@stakekit/widget 0.0.281 → 0.0.282
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/{website/assets/build-C1Hp5nre.js → bundle/build-BjTGUKBb.js} +1 -1
- package/dist/bundle/{build-DXRLzwHe.js → build-DaXa2hFa.js} +1 -1
- package/dist/bundle/{cardano-connector-ebl32zUD.js → cardano-connector-Bxl4EuKG.js} +1 -1
- package/dist/bundle/dist-C6DxN7oQ.js +1 -0
- package/dist/bundle/index.bundle.js +2 -2
- package/dist/bundle/{ledger-connector-BN25ujqn.js → ledger-connector-BYlWQcC2.js} +1 -1
- package/dist/bundle/{ledger-live-connector-meta-DPFZoSjd.js → ledger-live-connector-meta-BSOi7ps6.js} +2 -2
- package/dist/bundle/{misc-C7prhhSc.js → misc-B58_8Z_Y.js} +1 -1
- package/dist/bundle/name-service-WTCg35Ui.js +1 -0
- package/dist/bundle/networks-DcV8Uo1h.js +1 -0
- package/dist/bundle/{solana-connector-G7AHadyF.js → solana-connector-C4fvrXDL.js} +1 -1
- package/dist/bundle/{substrate-connector-C1B1qvJ7.js → substrate-connector-DjL2B0YP.js} +1 -1
- package/dist/bundle/{ton-connector-GT3crFFI.js → ton-connector-CFA850-u.js} +1 -1
- package/dist/bundle/{tron-connector-gqA-Dier.js → tron-connector-Bi9vQYaJ.js} +1 -1
- package/dist/bundle/tx-DTVo9zYr.js +1 -0
- package/dist/bundle/{utils-D25hFEIj.js → utils-UHcv2aK_.js} +1 -1
- package/dist/bundle/{wallet-manager-l_QoGIj_.js → wallet-manager-st5o-xIp.js} +3 -3
- package/dist/package/{build-BdpEvliU.js → build-19T6Y-f2.js} +1 -1
- package/dist/package/{build-vbzY6oYn.js → build-BrztUmTv.js} +2 -2
- package/dist/package/{cardano-connector-BZZm7XoD.js → cardano-connector-CKtTdyDA.js} +2 -2
- package/dist/package/dist-CDUoHqPz.js +3 -0
- package/dist/package/index.package.js +73 -11
- package/dist/package/{ledger-connector-C4iWqKKK.js → ledger-connector-Cs_sRWr9.js} +2 -2
- package/dist/package/{ledger-live-connector-meta-DaQZkCPN.js → ledger-live-connector-meta-BhqB5kyr.js} +24 -3
- package/dist/package/{misc-D2AZp5-W.js → misc-sZYZi3H7.js} +1 -1
- package/dist/package/name-service-CKkyMnnB.js +3 -0
- package/dist/package/{networks-CdsbwZ0i.js → networks-3BCZBoc0.js} +2 -1
- package/dist/package/{solana-connector-YHtJzNsy.js → solana-connector-BBT9LAWs.js} +2 -2
- package/dist/package/{substrate-connector-BfDsxLU7.js → substrate-connector-DfK3K0B4.js} +1 -1
- package/dist/package/{ton-connector-CJQSQVZ4.js → ton-connector-CRoAd0ZH.js} +2 -2
- package/dist/package/{tron-connector-CMwQ3mXk.js → tron-connector-DQfLwaZm.js} +2 -2
- package/dist/package/tx-DgblqE_C.js +3 -0
- package/dist/package/{utils-pXuPoWum.js → utils-CHNRVjvx.js} +1 -1
- package/dist/package/{wallet-manager-kCjbi0Rb.js → wallet-manager-DvGKqMe3.js} +17 -17
- package/dist/types/common/get-enabled-networks.d.ts +1 -1
- package/dist/types/domain/types/chains/evm.d.ts +4 -3
- package/dist/types/domain/types/chains/networks.d.ts +2 -0
- package/dist/types/domain/types/yields.d.ts +2 -2
- package/dist/types/generated/api/legacy.d.ts +244 -74
- package/dist/types/generated/api/yield.d.ts +120 -30
- package/dist/types/hooks/api/use-activity-actions.d.ts +1 -1
- package/dist/types/hooks/use-init-query-params.d.ts +2 -2
- package/dist/types/hooks/use-reward-token-details/index.d.ts +1 -1
- package/dist/types/pages/details/earn-page/state/use-get-token-balances-map.d.ts +1 -1
- package/dist/types/pages/details/earn-page/state/use-token-balances-map.d.ts +1 -1
- package/dist/types/pages/details/positions-page/hooks/use-position-list-item.d.ts +2 -2
- package/dist/types/pages/review/hooks/use-pending-review.hook.d.ts +1 -1
- package/dist/types/pages/review/hooks/use-stake-review.hook.d.ts +1 -1
- package/dist/types/pages/review/hooks/use-unstake-review.hook.d.ts +1 -1
- package/dist/website/assets/{AccountController-NpYHQOpg.js → AccountController-CZ3AskK0.js} +1 -1
- package/dist/website/assets/{ConnectorUtil-BFaNOi-N.js → ConnectorUtil-DhfSckTl.js} +1 -1
- package/dist/website/assets/{ConnectorUtil-OL3Xg5c8.js → ConnectorUtil-Dr-Sj5Xi.js} +1 -1
- package/dist/website/assets/{ConstantsUtil-BEN_xAuy.js → ConstantsUtil-KBrAwQeh.js} +1 -1
- package/dist/website/assets/{ConstantsUtil-BFUTsHll.js → ConstantsUtil-cWzo_bL6.js} +1 -1
- package/dist/website/assets/{EnsController-BWmWxEOw.js → EnsController-DCvEdmLX.js} +1 -1
- package/dist/website/assets/{ErrorUtil-CkCFNMzW.js → ErrorUtil-CqiPmwUQ.js} +1 -1
- package/dist/website/assets/{HelpersUtil-CHmLX1Ya.js → HelpersUtil-5BtTobdy.js} +1 -1
- package/dist/website/assets/{OnRampController-dyl9vPyu.js → OnRampController-Bja8dlwC.js} +1 -1
- package/dist/website/assets/{ProviderUtil-Db7wZp7G.js → ProviderUtil-B7GUQMp6.js} +1 -1
- package/dist/website/assets/{SIWXUtil-CHpRgtqH.js → SIWXUtil-WhCFYYeb.js} +1 -1
- package/dist/website/assets/{SIWXUtil-nVyZQJxB.js → SIWXUtil-cetRK2TM.js} +1 -1
- package/dist/website/assets/{SwapController-CeXfHNI5.js → SwapController-CM-1PbEv.js} +1 -1
- package/dist/website/assets/{W3mFrameHelpers-Bb2uLy-e.js → W3mFrameHelpers-B8kV5Q0n.js} +1 -1
- package/dist/website/assets/{W3mFrameProvider-DtXn_jtg.js → W3mFrameProvider-ohY0LTwE.js} +1 -1
- package/dist/website/assets/{add-B3PbXGMo.js → add-DM2nvQT-.js} +1 -1
- package/dist/website/assets/{all-wallets-D4AgkZTd.js → all-wallets-CbBymuk3.js} +1 -1
- package/dist/website/assets/{app-store-BbovquTu.js → app-store-DDxmj9Lx.js} +1 -1
- package/dist/website/assets/{apple-B1uUFNkm.js → apple-Dn7auf4q.js} +1 -1
- package/dist/website/assets/{arrow-bottom-C7uqaukG.js → arrow-bottom-Bb9Or_Vr.js} +1 -1
- package/dist/website/assets/{arrow-bottom-circle-B7KV_kzD.js → arrow-bottom-circle-Dtsu395i.js} +1 -1
- package/dist/website/assets/{arrow-left-tHERrXnS.js → arrow-left-urUveqA6.js} +1 -1
- package/dist/website/assets/{arrow-right-BAWas67F.js → arrow-right-Cy0Ygemc.js} +1 -1
- package/dist/website/assets/{arrow-top-BMWS-W5Y.js → arrow-top-CMkFVUPL.js} +1 -1
- package/dist/website/assets/{bank-DWoJkaOO.js → bank-BfpbjcJU.js} +1 -1
- package/dist/website/assets/{basic-DVJYfN0n.js → basic-BOLR86Me.js} +1 -1
- package/dist/website/assets/{basic-C59p6Im0.js → basic-CelNIwvX.js} +1 -1
- package/dist/website/assets/{browser-CiYp-WP5.js → browser-DjOYXDTm.js} +1 -1
- package/dist/website/assets/{browser-DzHQAgb4.js → browser-MeMHJ-8U.js} +1 -1
- package/dist/website/assets/{build--8alOb1B.js → build-CWk0QocV.js} +1 -1
- package/dist/{bundle/build-Z489QYQJ.js → website/assets/build-CpWkW2tw.js} +1 -1
- package/dist/website/assets/{card-CFJ_BBYV.js → card-BGKYxgPZ.js} +1 -1
- package/dist/website/assets/{cardano-connector-D-fikOUn.js → cardano-connector-BYu3bSHH.js} +1 -1
- package/dist/website/assets/{ccip-TpjURkX-.js → ccip-DQel3KVV.js} +1 -1
- package/dist/website/assets/{ccip-Tbj4Wwc2.js → ccip-DfRE0PKO.js} +1 -1
- package/dist/website/assets/{checkmark-R8bE4-mw.js → checkmark-B54WvXLf.js} +1 -1
- package/dist/website/assets/{checkmark-bold-CNF4JcNT.js → checkmark-bold-CCJMCK3Y.js} +1 -1
- package/dist/website/assets/{chevron-bottom-C5NCdSjZ.js → chevron-bottom-hwdmvWLF.js} +1 -1
- package/dist/website/assets/{chevron-left-ruW-Itk4.js → chevron-left-CN6NEo1b.js} +1 -1
- package/dist/website/assets/{chevron-right-BOmCXhmd.js → chevron-right-CWf6ew-m.js} +1 -1
- package/dist/website/assets/{chevron-top-DkMyAQ07.js → chevron-top-BfSjLB5_.js} +1 -1
- package/dist/website/assets/{chrome-store-ByoANBRO.js → chrome-store-ClZGfzcx.js} +1 -1
- package/dist/website/assets/{clock-wzmlRjlx.js → clock-DSZaUPCM.js} +1 -1
- package/dist/website/assets/{close-F0MwVD-N.js → close-o8u0_8yN.js} +1 -1
- package/dist/website/assets/{coinPlaceholder-CPIsfULr.js → coinPlaceholder-XznZsK4p.js} +1 -1
- package/dist/website/assets/{compass-C3xYKfjB.js → compass-YEYH0wOn.js} +1 -1
- package/dist/website/assets/{copy-0-ETR78R.js → copy-pInvOcim.js} +1 -1
- package/dist/website/assets/{core-CMghWqi3.js → core-CfyKWiQv.js} +2 -2
- package/dist/website/assets/cursor-BkSthN9t.js +3 -0
- package/dist/website/assets/{cursor-transparent-bPhMqDAT.js → cursor-transparent-D3AJK0My.js} +1 -1
- package/dist/website/assets/{data-capture-C-t-Szcz.js → data-capture-DU463HBK.js} +1 -1
- package/dist/website/assets/{decode-C9RnV0z9.js → decode-DmPUixTK.js} +3 -3
- package/dist/website/assets/{desktop-ConegieV.js → desktop-D9coRt6t.js} +1 -1
- package/dist/website/assets/{disconnect-BtHoDX3P.js → disconnect-BP3wbEyx.js} +1 -1
- package/dist/website/assets/{discord-D7sM_hL2.js → discord-Bue5RU-6.js} +1 -1
- package/dist/website/assets/dist-C582ZtDs.js +1 -0
- package/dist/website/assets/{dist-4qCfMWnV.js → dist-DZQMP5L_.js} +2 -2
- package/dist/website/assets/{email-Dr7Nxe-l.js → email-BYn06MIp.js} +1 -1
- package/dist/website/assets/{embedded-wallet-DVEI4Qes.js → embedded-wallet-DHUvMYek.js} +1 -1
- package/dist/website/assets/en_US-IFPOGBSL-BK5IEFRX.js +1 -0
- package/dist/website/assets/{esm-cAYSG3Wi.js → esm-ONCreVwv.js} +1 -1
- package/dist/website/assets/{etherscan-Cunv9YUG.js → etherscan-DQBoFKLv.js} +1 -1
- package/dist/website/assets/{exclamation-triangle-Du1Q90rv.js → exclamation-triangle-kDYUulbA.js} +1 -1
- package/dist/website/assets/{exports-CJIQZSyw.js → exports-BvOrlL9b.js} +1 -1
- package/dist/website/assets/{exports-eBov3G1-.js → exports-CzRzpkCO.js} +1 -1
- package/dist/website/assets/{exports-Ce6Q2-Fc.js → exports-DFrhs9-4.js} +1 -1
- package/dist/website/assets/{extension-ygjPSk3Z.js → extension-7ZdOFRsz.js} +1 -1
- package/dist/website/assets/{external-link-WHeTbJh5.js → external-link-tgLj5Ewp.js} +1 -1
- package/dist/website/assets/{facebook-Cse6icRO.js → facebook-l5ej5aLA.js} +1 -1
- package/dist/website/assets/{farcaster-B7Pgeu1S.js → farcaster-B4by4dn_.js} +1 -1
- package/dist/website/assets/{features-BA7Koivc.js → features-DQXem-4z.js} +1 -1
- package/dist/website/assets/{filters-Cy-Kst6a.js → filters-DcZXEY3g.js} +1 -1
- package/dist/website/assets/{github-Bbh48Pya.js → github-BDsHglT5.js} +1 -1
- package/dist/website/assets/{google-7jWc1CSH.js → google-Jkx1oZdL.js} +1 -1
- package/dist/website/assets/{help-circle-D1hLtiEY.js → help-circle-CFwJ8FAj.js} +1 -1
- package/dist/website/assets/{id-CUGUCSHj.js → id-XqBLPO2G.js} +1 -1
- package/dist/website/assets/{image-B6j8-pwz.js → image-lo_miGZb.js} +1 -1
- package/dist/website/assets/{index-S7C5SOGh.js → index--r1G5ij4.js} +7 -7
- package/dist/website/assets/{index.es-wBv_4tYT.js → index.es-B5D3HtzA.js} +1 -1
- package/dist/website/assets/{index.es-DUp5dplG.js → index.es-CoCSILjf.js} +2 -2
- package/dist/website/assets/{info-circle-DcUHDdFU.js → info-circle-DmYANINU.js} +1 -1
- package/dist/website/assets/{info-BKY-r3IE.js → info-eVFjXpEa.js} +1 -1
- package/dist/website/assets/{ledger-connector-DIr8MrjV.js → ledger-connector-BD7bNK8U.js} +1 -1
- package/dist/website/assets/{lightbulb-ByMlYp-I.js → lightbulb-CNNrGCtj.js} +1 -1
- package/dist/website/assets/{localBatchGatewayRequest-DkKLHvTF.js → localBatchGatewayRequest-gb19_uU1.js} +3 -3
- package/dist/website/assets/{mail-DS6MVBhq.js → mail-CtNG1vZT.js} +1 -1
- package/dist/website/assets/{mobile-ChQ3F2Ky.js → mobile-AWJ5nLmy.js} +1 -1
- package/dist/website/assets/{more-BsfZKeWb.js → more-DfEQIkwx.js} +1 -1
- package/dist/website/assets/name-service-tewBv0Xj.js +1 -0
- package/dist/website/assets/{network-placeholder-BDF57UfV.js → network-placeholder-NmjG-bQA.js} +1 -1
- package/dist/website/assets/{nftPlaceholder-Bo-l1JOd.js → nftPlaceholder-5eI3PZnu.js} +1 -1
- package/dist/website/assets/{off-BV8TBjy0.js → off-B-dZyTnf.js} +1 -1
- package/dist/website/assets/{onramp-ChKG5Hkz.js → onramp-BqLRcbU9.js} +1 -1
- package/dist/website/assets/{p256-7leWdc5z.js → p256-CAvUfeCP.js} +1 -1
- package/dist/website/assets/{pay-with-exchange-B7x1B3ok.js → pay-with-exchange-BB04DYim.js} +1 -1
- package/dist/website/assets/{play-store-ApXFB8hp.js → play-store-BUU7RrlP.js} +1 -1
- package/dist/website/assets/{plus-DxlqMf8j.js → plus-Bs4s1rv1.js} +1 -1
- package/dist/website/assets/{qr-code-DfbLAoQG.js → qr-code-bQtPB-Gz.js} +1 -1
- package/dist/website/assets/{receive-8eT-25xA.js → receive-Czcadidc.js} +1 -1
- package/dist/website/assets/{recycle-horizontal-BOlfTjYo.js → recycle-horizontal-Cx8_xLt7.js} +1 -1
- package/dist/website/assets/{refresh-DqO9y0bM.js → refresh-DZ2CzY4A.js} +1 -1
- package/dist/website/assets/{registry-dDg28sJ6.js → registry-CCoDEOty.js} +1 -1
- package/dist/website/assets/{reown-logo-C1-wIDb_.js → reown-logo-Bc69tk_B.js} +1 -1
- package/dist/website/assets/{safe-connector-FR2ihsAe.js → safe-connector-ChHN6PFH.js} +1 -1
- package/dist/website/assets/{search-DyKz3H5F.js → search-BMdCijEz.js} +1 -1
- package/dist/website/assets/{send-DyjQRYrk.js → send-Cml8YGtH.js} +1 -1
- package/dist/website/assets/{send-CEkH3Aex.js → send-welRl4pB.js} +1 -1
- package/dist/website/assets/{socials-CBT-IFwY.js → socials-lvk_JwAC.js} +1 -1
- package/dist/website/assets/{solana-connector-8Ip4bFoN.js → solana-connector-C-tqKpo-.js} +1 -1
- package/dist/website/assets/{substrate-connector-D0ow4PYz.js → substrate-connector-C0UxydKR.js} +2 -2
- package/dist/website/assets/{swapHorizontal-kwOihdBF.js → swapHorizontal-XLOsaD8E.js} +1 -1
- package/dist/website/assets/{swapHorizontalBold-CzomJEqp.js → swapHorizontalBold-rltpBI6G.js} +1 -1
- package/dist/website/assets/{swapHorizontalMedium-B48dDzc8.js → swapHorizontalMedium-B66Ecuau.js} +1 -1
- package/dist/website/assets/{swapHorizontalRoundedBold-D24AErbC.js → swapHorizontalRoundedBold-D-nAnu47.js} +1 -1
- package/dist/website/assets/{swapVertical-DaWBbck0.js → swapVertical-DXYw64Gv.js} +1 -1
- package/dist/website/assets/{swaps-Bd3nmzzA.js → swaps-DcF_cAL3.js} +1 -1
- package/dist/website/assets/{telegram-Cr8mioCq.js → telegram-D6f1t_w1.js} +1 -1
- package/dist/website/assets/{three-dots-Cu7kOm3Q.js → three-dots-Ct4Bt9fa.js} +1 -1
- package/dist/website/assets/{ton-connector-CFunHvil.js → ton-connector-DX6PEEu6.js} +1 -1
- package/dist/website/assets/{transactions-w9TV8a2T.js → transactions-NlQoRKDN.js} +1 -1
- package/dist/website/assets/{tron-connector-D6LmJW_Z.js → tron-connector-DnNZm1ad.js} +3 -3
- package/dist/website/assets/{twitch-BDA7hbvo.js → twitch-D6l2ucO_.js} +1 -1
- package/dist/website/assets/{twitterIcon-DCyAC_Fs.js → twitterIcon-B_BwiCHt.js} +1 -1
- package/dist/website/assets/tx-M8zFD10L.js +1 -0
- package/dist/website/assets/{utils-BZw-E_uE.js → utils-yNiv3ygK.js} +1 -1
- package/dist/website/assets/{verify-CmDy0sEt.js → verify-Dqnc4oTE.js} +1 -1
- package/dist/website/assets/{verify-filled-BT0uHzaT.js → verify-filled-CMUc8_Tu.js} +1 -1
- package/dist/website/assets/{w3m-activity-list-vWhfwwVY.js → w3m-activity-list-OGYrJa_i.js} +1 -1
- package/dist/website/assets/{w3m-email-otp-widget-xSRLym6j.js → w3m-email-otp-widget-CQKNfGsf.js} +1 -1
- package/dist/website/assets/{w3m-legal-footer-Cn1GoTQ4.js → w3m-legal-footer-QkjY632O.js} +1 -1
- package/dist/website/assets/{w3m-modal-Df63Ku_a.js → w3m-modal-K5qblTEQ.js} +1 -1
- package/dist/website/assets/{w3m-modal-CuQnvS93.js → w3m-modal-VMveiR8F.js} +1 -1
- package/dist/website/assets/{w3m-modal-bd1jNEdI.js → w3m-modal-XAHgBJGP.js} +1 -1
- package/dist/website/assets/{w3m-router-CFN3PESa.js → w3m-router-o5zv6Iwe.js} +1 -1
- package/dist/website/assets/{w3m-tooltip-D12jKTvb.js → w3m-tooltip-Cf2MoT2S.js} +1 -1
- package/dist/website/assets/{w3m-tooltip-trigger-CcQYTUtJ.js → w3m-tooltip-trigger-DANArbtb.js} +1 -1
- package/dist/website/assets/{wallet-CyphpkcQ.js → wallet-CwzDEuji.js} +1 -1
- package/dist/website/assets/{wallet-manager-Ht6aNi4c.js → wallet-manager-DlDW8sTG.js} +4 -4
- package/dist/website/assets/{wallet-placeholder-B0I_Sy7W.js → wallet-placeholder-lvbGOM19.js} +1 -1
- package/dist/website/assets/{walletconnect-BA4wWZDP.js → walletconnect-1RONYn1c.js} +1 -1
- package/dist/website/assets/{warning-circle-DnsLpMEN.js → warning-circle-rLUGv8BB.js} +1 -1
- package/dist/website/assets/{wui-button-CuzkVQVh.js → wui-button-RbojCS_V.js} +1 -1
- package/dist/website/assets/{wui-chip-button-3gR3n1pR.js → wui-chip-button-DJqoVDqs.js} +1 -1
- package/dist/website/assets/{wui-email-input-Bot-XOIH.js → wui-email-input-BDTuv7qX.js} +1 -1
- package/dist/website/assets/wui-icon-CX2U1cQN.js +1 -0
- package/dist/website/assets/{wui-icon-B2gtpNVr.js → wui-icon-DGvilNiQ.js} +1 -1
- package/dist/website/assets/wui-icon-box-DVQU4OBo.js +1 -0
- package/dist/website/assets/{wui-icon-box-z9zHcFIW.js → wui-icon-box-DcWR69zt.js} +1 -1
- package/dist/website/assets/{wui-icon-link-B7DclHuW.js → wui-icon-link-DHSEK3F6.js} +1 -1
- package/dist/website/assets/{wui-image-CD8c1Em8.js → wui-image-C7Cs2dFG.js} +1 -1
- package/dist/website/assets/wui-image-Z7-7hOwu.js +1 -0
- package/dist/website/assets/wui-input-text-D3nDS5vo.js +1 -0
- package/dist/website/assets/{wui-input-text-C7AgrQVk.js → wui-input-text-DNXtkc3b.js} +1 -1
- package/dist/website/assets/{wui-link-B9LUHbsw.js → wui-link-B3ACN9m1.js} +1 -1
- package/dist/website/assets/{wui-list-item-D0ToZsiR.js → wui-list-item-IkfIdqB_.js} +1 -1
- package/dist/website/assets/{wui-list-social-CxYNltn4.js → wui-list-social-1TJN_kN9.js} +1 -1
- package/dist/website/assets/{wui-list-token-KAu1tv89.js → wui-list-token-BEOVjAxO.js} +1 -1
- package/dist/website/assets/wui-loading-spinner-DYStep66.js +1 -0
- package/dist/website/assets/{wui-loading-spinner-SQ4fTuhF.js → wui-loading-spinner-Dit3fDIZ.js} +1 -1
- package/dist/website/assets/{wui-loading-thumbnail-Dx43aafO.js → wui-loading-thumbnail-CgsJwZcw.js} +1 -1
- package/dist/website/assets/{wui-qr-code-4EceSqLA.js → wui-qr-code-aMc5Qnn_.js} +1 -1
- package/dist/website/assets/{wui-separator-BvILvAhc.js → wui-separator-tSBrE8qX.js} +1 -1
- package/dist/website/assets/wui-shimmer-BJS_0nwN.js +1 -0
- package/dist/website/assets/{wui-shimmer-DD0I5ZME.js → wui-shimmer-Bdko9qLE.js} +1 -1
- package/dist/website/assets/{wui-tag-ceBfWX4J.js → wui-tag-2uJXk-g0.js} +1 -1
- package/dist/website/assets/{wui-text-owWs1Glq.js → wui-text-CwFmUhFG.js} +1 -1
- package/dist/website/assets/{wui-text-K8E1Z6zf.js → wui-text-DkRtRoYA.js} +1 -1
- package/dist/website/assets/{wui-text-5C4yPTyu.js → wui-text-NSwyfOcr.js} +3 -3
- package/dist/website/assets/{wui-token-button-D27_1cei.js → wui-token-button-Fd4nqF_T.js} +1 -1
- package/dist/website/assets/{wui-visual-CHXBBr3F.js → wui-visual-Dqd3OHrH.js} +1 -1
- package/dist/website/assets/{wui-wallet-image-CNOTUTVB.js → wui-wallet-image-BbrxI49C.js} +1 -1
- package/dist/website/assets/{x-B_XqN7Oa.js → x-B927Ooe7.js} +1 -1
- package/dist/website/index.html +1 -1
- package/package.json +1 -1
- package/dist/bundle/dist-Dg6gWrxW.js +0 -1
- package/dist/bundle/name-service-C5U_6bCa.js +0 -1
- package/dist/bundle/networks-DkZQuO0f.js +0 -1
- package/dist/bundle/tx-J4VM1ks9.js +0 -1
- package/dist/package/dist-Ird-eHMD.js +0 -3
- package/dist/package/name-service-DZL_wu3E.js +0 -3
- package/dist/package/tx-BMW2v_GY.js +0 -3
- package/dist/website/assets/cursor-BUW4dSFt.js +0 -3
- package/dist/website/assets/dist-C0K_070R.js +0 -1
- package/dist/website/assets/en_US-IFPOGBSL-zV65Fyd5.js +0 -1
- package/dist/website/assets/name-service-DcUMyI0A.js +0 -1
- package/dist/website/assets/tx-DhHYzooK.js +0 -1
- package/dist/website/assets/wui-icon-DMXbZsiJ.js +0 -1
- package/dist/website/assets/wui-icon-box-BUnDiST6.js +0 -1
- package/dist/website/assets/wui-image-CIShfRJN.js +0 -1
- package/dist/website/assets/wui-input-text-DgPoND5q.js +0 -1
- package/dist/website/assets/wui-loading-spinner-9KY2xyW3.js +0 -1
- package/dist/website/assets/wui-shimmer-DI0RVmTL.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/build-
|
|
2
|
-
import{a as e,n as t,o as n,r,s as i,t as a}from"./chunk-CJJwijRH.js";import{n as o,t as s}from"./dist-CeXM7Kux.js";import{E as c,K as l,V as u,n as d,t as f,y as p}from"./createConnector-BkcvlarK.js";import{n as m,t as h}from"./dist-BalQtXKe.js";import{t as g}from"./preload-helper-zJ_50EbN.js";import{r as _,t as v}from"./dist-BQMAk709.js";import{a as y,b,c as x,g as S,i as C,m as w}from"./utils-GIC7NcXf.js";import{i as T,n as E,r as D,s as O,t as k}from"./hmac-BliMQdXS.js";import{n as A,t as j}from"./bn-DuEpkJdN.js";import{a as M,c as N,i as P,n as F,o as I,r as L,t as R}from"./crypto-browserify-DjHA5ups.js";import{t as ee}from"./events-H7eok89L.js";import{a as te,c as ne,i as re,l as ie,o as ae,r as oe,s as se,t as ce,u as le}from"./index.es-CD1QZ58d.js";import{_ as ue,a as de,d as fe,f as pe,g as me,h as he,i as ge,l as _e,n as ve,o as ye,p as z,r as be,s as xe,t as Se,u as Ce,v as we}from"./browser-ponyfill-Um6_QYhg.js";import{n as Te,t as Ee}from"./esm-DovyE5S1.js";import{t as De}from"./blake2-DFE8rJki.js";import{n as Oe,t as ke}from"./esm-DZjVTWAH.js";import{$ as Ae,Ft as je,Ot as Me,Pt as Ne,at as Pe,ct as Fe,dn as Ie,et as Le,gn as Re,hn as ze,it as Be,ln as Ve,nn as He,tn as Ue,tt as We,un as Ge}from"./index-S7C5SOGh.js";import{t as Ke}from"./p256-7leWdc5z.js";import{a as qe,o as Je,t as Ye}from"./build-BIWX__lt.js";import{n as Xe,t as Ze}from"./src-CQGv6J_e.js";import{n as Qe}from"./bignumber-BGaAhqFj.js";import{n as $e,r as et,t as tt}from"./src-BNPFDZz3.js";import{t as nt}from"./blakejs-C2IeO1K2.js";import{cosmosAssets as rt,registryIdsToSKCosmosNetworks as it}from"./chain-registry-Dby2f2S0.js";import{t as at}from"./cjs-CfJ7LJmy.js";s(),m(),_(),w(),Ue(),D();var ot=i(ee()),st=I(),B=le(),ct=re(),lt=oe(),ut=i(Se());function dt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function ft(e){if(typeof e!=`boolean`)throw Error(`boolean expected, not ${e}`)}function pt(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function mt(e,...t){if(!dt(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ht(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function gt(e,t){mt(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function _t(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function vt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function yt(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var bt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function xt(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function St(e){if(typeof e==`string`)e=xt(e);else if(dt(e))e=At(e);else throw Error(`Uint8Array expected, got `+typeof e);return e}function Ct(e,t){if(typeof t!=`object`||!t)throw Error(`options must be defined`);return Object.assign(e,t)}function wt(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}var Tt=(e,t)=>{function n(n,...r){if(mt(n),!bt)throw Error(`Non little-endian hardware is not yet supported`);if(e.nonceLength!==void 0){let t=r[0];if(!t)throw Error(`nonce / iv required`);e.varSizeNonce?mt(t):mt(t,e.nonceLength)}let i=e.tagLength;i&&r[1]!==void 0&&mt(r[1]);let a=t(n,...r),o=(e,t)=>{if(t!==void 0){if(e!==2)throw Error(`cipher output not supported`);mt(t)}},s=!1;return{encrypt(e,t){if(s)throw Error(`cannot encrypt() twice with same key + nonce`);return s=!0,mt(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(mt(e),i&&e.length<i)throw Error(`invalid ciphertext length: smaller than tagLength=`+i);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n};function Et(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw Error(`invalid output length, expected `+e+`, got: `+t.length);if(n&&!kt(t))throw Error(`invalid output, must be aligned`);return t}function Dt(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Ot(e,t,n){ft(n);let r=new Uint8Array(16),i=yt(r);return Dt(i,0,BigInt(t),n),Dt(i,8,BigInt(e),n),r}function kt(e){return e.byteOffset%4==0}function At(e){return Uint8Array.from(e)}var jt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.utf8Write=e.utf8Read=e.utf8Length=void 0;function t(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t}e.utf8Length=t;function n(e,t,n){if(n-t<1)return``;let r=[],i=[],a=0,o;for(;t<n;)o=e[t++],o<128?r[a++]=o:o>191&&o<224?r[a++]=(o&31)<<6|e[t++]&63:o>239&&o<365?(o=((o&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r[a++]=55296+(o>>10),r[a++]=56320+(o&1023)):r[a++]=(o&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||=[]).push(String.fromCharCode(...r)),a=0);return i?(a&&i.push(String.fromCharCode(...r.slice(0,a))),i.join(``)):String.fromCharCode(...r.slice(0,a))}e.utf8Read=n;function r(e,t,n){let r=n,i,a;for(let r=0;r<e.length;++r)i=e.charCodeAt(r),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(r+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++r,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}e.utf8Write=r})),Mt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.writeByte=e.writeFixed32=e.int64Length=e.writeVarint64=e.writeVarint32=e.readInt32=e.readUInt32=e.zzDecode=e.zzEncode=e.varint32read=e.varint32write=e.uInt64ToString=e.int64ToString=e.int64FromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}e.varint64read=t;function n(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;var r=4294967296;function i(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?l(i,a):c(i,a)}e.int64FromString=i;function a(e,t){let n=c(e,t),r=n.hi&2147483648;r&&(n=l(n.lo,n.hi));let i=o(n.lo,n.hi);return r?`-`+i:i}e.int64ToString=a;function o(e,t){if({lo:e,hi:t}=s(e,t),t<=2097151)return String(r*t+e);let n=e&16777215,i=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,c=i+a*8147497,l=a*2,d=1e7;return o>=d&&(c+=Math.floor(o/d),o%=d),c>=d&&(l+=Math.floor(c/d),c%=d),l.toString()+u(c)+u(o)}e.uInt64ToString=o;function s(e,t){return{lo:e>>>0,hi:t>>>0}}function c(e,t){return{lo:e|0,hi:t|0}}function l(e,t){return t=~t,e?e=~e+1:t+=1,c(e,t)}var u=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=d;function f(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=f;function p(e,t){let n=t>>31;return t=((t<<1|e>>>31)^n)>>>0,e=(e<<1^n)>>>0,[e,t]}e.zzEncode=p;function m(e,t){let n=-(e&1);return e=((e>>>1|t<<31)^n)>>>0,t=(t>>>1^n)>>>0,[e,t]}e.zzDecode=m;function h(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}e.readUInt32=h;function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}e.readInt32=g;function _(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}e.writeVarint32=_;function v(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}e.writeVarint64=v;function y(e,t){let n=e,r=(e>>>28|t<<4)>>>0,i=t>>>24;return i===0?r===0?n<16384?n<128?1:2:n<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10}e.int64Length=y;function b(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}e.writeFixed32=b;function x(e,t,n){t[n]=e&255}e.writeByte=x})),Nt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryWriter=e.BinaryReader=e.WireType=void 0;var t=jt(),n=Mt(),r;(function(e){e[e.Varint=0]=`Varint`,e[e.Fixed64=1]=`Fixed64`,e[e.Bytes=2]=`Bytes`,e[e.Fixed32=5]=`Fixed32`})(r||(e.WireType=r={})),e.BinaryReader=class{assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}constructor(e){this.buf=e?new Uint8Array(e):new Uint8Array,this.pos=0,this.type=0,this.len=this.buf.length}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n,e]}skip(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case r.Varint:this.skip();break;case r.Fixed64:this.skip(8);break;case r.Bytes:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case r.Fixed32:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this}uint32(){return n.varint32read.bind(this)()}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e%2==1?(e+1)/-2:e/2}fixed32(){let e=(0,n.readUInt32)(this.buf,this.pos);return this.pos+=4,e}sfixed32(){let e=(0,n.readInt32)(this.buf,this.pos);return this.pos+=4,e}int64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.int64ToString)(e,t))}uint64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.uInt64ToString)(e,t))}sint64(){let[e,t]=n.varint64read.bind(this)();return[e,t]=(0,n.zzDecode)(e,t),BigInt((0,n.int64ToString)(e,t))}fixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.uInt64ToString)(e,t))}sfixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.int64ToString)(e,t))}float(){throw Error(`float not supported`)}double(){throw Error(`double not supported`)}bool(){let[e,t]=n.varint64read.bind(this)();return e!==0||t!==0}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){let e=this.bytes();return(0,t.utf8Read)(e,0,e.length)}};var i=class{constructor(e,t,n){this.fn=e,this.len=t,this.val=n}proceed(e,t){this.fn&&this.fn(this.val,e,t)}},a=class{constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}};e.BinaryWriter=class e{constructor(){this.len=0,this.uint64=e.prototype.int64,this.sfixed64=e.prototype.fixed64,this.sfixed32=e.prototype.fixed32,this.head=new i(null,0,0),this.tail=this.head,this.states=null}static create(){return new e}static alloc(e){return typeof Uint8Array<`u`?s(e=>new Uint8Array(e),Uint8Array.prototype.subarray)(e):Array(e)}_push(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this}finish(){let t=this.head.next,n=0,r=e.alloc(this.len);for(;t;)t.proceed(r,n),n+=t.len,t=t.next;return r}fork(){return this.states=new a(this),this.head=this.tail=new i(null,0,0),this.len=0,this}reset(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(null,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}tag(e,t){return this.uint32((e<<3|t)>>>0)}uint32(e){return this.len+=(this.tail=this.tail.next=new i(n.writeVarint32,(e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(n.writeVarint64,10,(0,n.int64FromString)(e.toString())):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}int64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}sint64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return[t,r]=(0,n.zzEncode)(t,r),this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}fixed64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeFixed32,4,t)._push(n.writeFixed32,4,r)}bool(e){return this._push(n.writeByte,1,+!!e)}fixed32(e){return this._push(n.writeFixed32,4,e>>>0)}float(e){throw Error(`float not supported`+e)}double(e){throw Error(`double not supported`+e)}bytes(e){let t=e.length>>>0;return t?this.uint32(t)._push(o,t,e):this._push(n.writeByte,1,0)}string(e){let r=(0,t.utf8Length)(e);return r?this.uint32(r)._push(t.utf8Write,r,e):this._push(n.writeByte,1,0)}};function o(e,t,n){if(typeof Uint8Array<`u`)t.set(e,n);else for(let r=0;r<e.length;++r)t[n+r]=e[r]}function s(e,t,n){let r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);let s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}})),Pt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromJsonTimestamp=e.fromTimestamp=e.toTimestamp=e.isRpc=e.setPaginationParams=e.isObject=e.isSet=e.fromDuration=e.toDuration=e.omitDefault=e.base64FromBytes=e.bytesFromBase64=void 0;var t=(()=>{if(t!==void 0)return t;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),n=t.atob||(e=>t.Buffer.from(e,`base64`).toString(`binary`));function r(e){let t=n(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}e.bytesFromBase64=r;var i=t.btoa||(e=>t.Buffer.from(e,`binary`).toString(`base64`));function a(e){let t=[];return e.forEach(e=>{t.push(String.fromCharCode(e))}),i(t.join(``))}e.base64FromBytes=a;function o(e){if(typeof e==`string`)return e===``?void 0:e;if(typeof e==`number`)return e===0?void 0:e;if(typeof e==`boolean`)return e===!1?void 0:e;if(typeof e==`bigint`)return e===BigInt(0)?void 0:e;throw Error(`Got unsupported type ${typeof e}`)}e.omitDefault=o;function s(e){return{seconds:BigInt(Math.floor(parseInt(e)/1e9)),nanos:parseInt(e)%1e9}}e.toDuration=s;function c(e){return(parseInt(e.seconds.toString())*1e9+e.nanos).toString()}e.fromDuration=c;function l(e){return e!=null}e.isSet=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u,e.setPaginationParams=(e,t)=>t?(t?.countTotal!==void 0&&(e.params[`pagination.count_total`]=t.countTotal),t?.key!==void 0&&(e.params[`pagination.key`]=v.from(t.key).toString(`base64`)),t?.limit!==void 0&&(e.params[`pagination.limit`]=t.limit.toString()),t?.offset!==void 0&&(e.params[`pagination.offset`]=t.offset.toString()),t?.reverse!==void 0&&(e.params[`pagination.reverse`]=t.reverse),e):e;function d(e){return e!=null&&typeof e.request==`function`}e.isRpc=d;function f(e){return{seconds:_(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6}}e.toTimestamp=f;function p(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}e.fromTimestamp=p;var m=e=>({seconds:l(e.seconds)?BigInt(e.seconds.toString()):BigInt(0),nanos:l(e.nanos)?Number(e.nanos):0});function g(e){return e instanceof Date?f(e):typeof e==`string`?f(new Date(e)):m(e)}e.fromJsonTimestamp=g;function _(e){return BigInt(Math.trunc(e))}})),Ft=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Any=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`google.protobuf`;function r(){return{typeUrl:``,value:new Uint8Array}}e.Any={typeUrl:`/google.protobuf.Any`,encode(e,n=t.BinaryWriter.create()){return e.typeUrl!==``&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.typeUrl=i.string();break;case 2:o.value=i.bytes();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.typeUrl)&&(t.typeUrl=String(e.typeUrl)),(0,n.isSet)(e.value)&&(t.value=(0,n.bytesFromBase64)(e.value)),t},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=(0,n.base64FromBytes)(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=r();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}}})),It=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function r(){return{signatures:[]}}e.MultiSignature={typeUrl:`/cosmos.crypto.multisig.v1beta1.MultiSignature`,encode(e,n=t.BinaryWriter.create()){for(let t of e.signatures)n.uint32(10).bytes(t);return n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.signatures.push(i.bytes());break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,n.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>(0,n.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=r();return t.signatures=e.signatures?.map(e=>e)||[],t}};function i(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={typeUrl:`/cosmos.crypto.multisig.v1beta1.CompactBitArray`,encode(e,n=t.BinaryWriter.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.extraBitsStored=r.uint32();break;case 2:o.elems=r.bytes();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.extraBitsStored)&&(t.extraBitsStored=Number(e.extraBitsStored)),(0,n.isSet)(e.elems)&&(t.elems=(0,n.bytesFromBase64)(e.elems)),t},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=(0,n.base64FromBytes)(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=i();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}}})),Lt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var t=It(),n=Ft(),r=Nt(),i=Pt();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var a;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_DIRECT_AUX=3]=`SIGN_MODE_DIRECT_AUX`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.SIGN_MODE_EIP_191=191]=`SIGN_MODE_EIP_191`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a||(e.SignMode=a={}));function o(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return a.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return a.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return a.SIGN_MODE_TEXTUAL;case 3:case`SIGN_MODE_DIRECT_AUX`:return a.SIGN_MODE_DIRECT_AUX;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return a.SIGN_MODE_LEGACY_AMINO_JSON;case 191:case`SIGN_MODE_EIP_191`:return a.SIGN_MODE_EIP_191;default:return a.UNRECOGNIZED}}e.signModeFromJSON=o;function s(e){switch(e){case a.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case a.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case a.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case a.SIGN_MODE_DIRECT_AUX:return`SIGN_MODE_DIRECT_AUX`;case a.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;case a.SIGN_MODE_EIP_191:return`SIGN_MODE_EIP_191`;case a.UNRECOGNIZED:default:return`UNRECOGNIZED`}}e.signModeToJSON=s;function c(){return{signatures:[]}}e.SignatureDescriptors={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptors`,encode(t,n=r.BinaryWriter.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=c();return Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t))),n},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=c();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function l(){return{publicKey:void 0,data:void 0,sequence:BigInt(0)}}e.SignatureDescriptor={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptor`,encode(t,i=r.BinaryWriter.create()){return t.publicKey!==void 0&&n.Any.encode(t.publicKey,i.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,i.uint32(18).fork()).ldelim(),t.sequence!==BigInt(0)&&i.uint32(24).uint64(t.sequence),i},decode(t,i){let a=t instanceof r.BinaryReader?t:new r.BinaryReader(t),o=i===void 0?a.len:a.pos+i,s=l();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=n.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=a.uint64();break;default:a.skipType(t&7);break}}return s},fromJSON(t){let r=l();return(0,i.isSet)(t.publicKey)&&(r.publicKey=n.Any.fromJSON(t.publicKey)),(0,i.isSet)(t.data)&&(r.data=e.SignatureDescriptor_Data.fromJSON(t.data)),(0,i.isSet)(t.sequence)&&(r.sequence=BigInt(t.sequence.toString())),r},toJSON(t){let r={};return t.publicKey!==void 0&&(r.publicKey=t.publicKey?n.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(r.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(r.sequence=(t.sequence||BigInt(0)).toString()),r},fromPartial(t){let r=l();return t.publicKey!==void 0&&t.publicKey!==null&&(r.publicKey=n.Any.fromPartial(t.publicKey)),t.data!==void 0&&t.data!==null&&(r.data=e.SignatureDescriptor_Data.fromPartial(t.data)),t.sequence!==void 0&&t.sequence!==null&&(r.sequence=BigInt(t.sequence.toString())),r}};function u(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={typeUrl:`/cosmos.tx.signing.v1beta1.Data`,encode(t,n=r.BinaryWriter.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=u();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=u();return(0,i.isSet)(t.single)&&(n.single=e.SignatureDescriptor_Data_Single.fromJSON(t.single)),(0,i.isSet)(t.multi)&&(n.multi=e.SignatureDescriptor_Data_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=u();return t.single!==void 0&&t.single!==null&&(n.single=e.SignatureDescriptor_Data_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.SignatureDescriptor_Data_Multi.fromPartial(t.multi)),n}};function d(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={typeUrl:`/cosmos.tx.signing.v1beta1.Single`,encode(e,t=r.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.BinaryReader?e:new r.BinaryReader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){let t=d();return(0,i.isSet)(e.mode)&&(t.mode=o(e.mode)),(0,i.isSet)(e.signature)&&(t.signature=(0,i.bytesFromBase64)(e.signature)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=s(e.mode)),e.signature!==void 0&&(t.signature=(0,i.base64FromBytes)(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=d();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function f(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={typeUrl:`/cosmos.tx.signing.v1beta1.Multi`,encode(n,i=r.BinaryWriter.create()){n.bitarray!==void 0&&t.CompactBitArray.encode(n.bitarray,i.uint32(10).fork()).ldelim();for(let t of n.signatures)e.SignatureDescriptor_Data.encode(t,i.uint32(18).fork()).ldelim();return i},decode(n,i){let a=n instanceof r.BinaryReader?n:new r.BinaryReader(n),o=i===void 0?a.len:a.pos+i,s=f();for(;a.pos<o;){let n=a.uint32();switch(n>>>3){case 1:s.bitarray=t.CompactBitArray.decode(a,a.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(a,a.uint32()));break;default:a.skipType(n&7);break}}return s},fromJSON(n){let r=f();return(0,i.isSet)(n.bitarray)&&(r.bitarray=t.CompactBitArray.fromJSON(n.bitarray)),Array.isArray(n?.signatures)&&(r.signatures=n.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t))),r},toJSON(n){let r={};return n.bitarray!==void 0&&(r.bitarray=n.bitarray?t.CompactBitArray.toJSON(n.bitarray):void 0),n.signatures?r.signatures=n.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):r.signatures=[],r},fromPartial(n){let r=f();return n.bitarray!==void 0&&n.bitarray!==null&&(r.bitarray=t.CompactBitArray.fromPartial(n.bitarray)),r.signatures=n.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],r}}})),Rt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`cosmos.base.v1beta1`;function r(){return{denom:``,amount:``}}e.Coin={typeUrl:`/cosmos.base.v1beta1.Coin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.denom=i.string();break;case 2:o.amount=i.string();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=r();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function i(){return{denom:``,amount:``}}e.DecCoin={typeUrl:`/cosmos.base.v1beta1.DecCoin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.denom=r.string();break;case 2:o.amount=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{int:``}}e.IntProto={typeUrl:`/cosmos.base.v1beta1.IntProto`,encode(e,n=t.BinaryWriter.create()){return e.int!==``&&n.uint32(10).string(e.int),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=a();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.int=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=a();return(0,n.isSet)(e.int)&&(t.int=String(e.int)),t},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=a();return t.int=e.int??``,t}};function o(){return{dec:``}}e.DecProto={typeUrl:`/cosmos.base.v1beta1.DecProto`,encode(e,n=t.BinaryWriter.create()){return e.dec!==``&&n.uint32(10).string(e.dec),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,a=o();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:a.dec=r.string();break;default:r.skipType(e&7);break}}return a},fromJSON(e){let t=o();return(0,n.isSet)(e.dec)&&(t.dec=String(e.dec)),t},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=o();return t.dec=e.dec??``,t}}})),zt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AuxSignerData=e.Tip=e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDocDirectAux=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var t=Ft(),n=Lt(),r=It(),i=Rt(),a=Nt(),o=Pt();e.protobufPackage=`cosmos.tx.v1beta1`;function s(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={typeUrl:`/cosmos.tx.v1beta1.Tx`,encode(t,n=a.BinaryWriter.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=s();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(r,r.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(r,r.uint32());break;case 3:o.signatures.push(r.bytes());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=s();return(0,o.isSet)(t.body)&&(n.body=e.TxBody.fromJSON(t.body)),(0,o.isSet)(t.authInfo)&&(n.authInfo=e.AuthInfo.fromJSON(t.authInfo)),Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(e=>(0,o.bytesFromBase64)(e))),n},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=s();return t.body!==void 0&&t.body!==null&&(n.body=e.TxBody.fromPartial(t.body)),t.authInfo!==void 0&&t.authInfo!==null&&(n.authInfo=e.AuthInfo.fromPartial(t.authInfo)),n.signatures=t.signatures?.map(e=>e)||[],n}};function c(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={typeUrl:`/cosmos.tx.v1beta1.TxRaw`,encode(e,t=a.BinaryWriter.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=c();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=c();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,o.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=c();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:BigInt(0)}}e.SignDoc={typeUrl:`/cosmos.tx.v1beta1.SignDoc`,encode(e,t=a.BinaryWriter.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==BigInt(0)&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=l();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.chainId=n.string();break;case 4:i.accountNumber=n.uint64();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=l();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),(0,o.isSet)(e.chainId)&&(t.chainId=String(e.chainId)),(0,o.isSet)(e.accountNumber)&&(t.accountNumber=BigInt(e.accountNumber.toString())),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=(e.accountNumber||BigInt(0)).toString()),t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,e.accountNumber!==void 0&&e.accountNumber!==null&&(t.accountNumber=BigInt(e.accountNumber.toString())),t}};function u(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:``,accountNumber:BigInt(0),sequence:BigInt(0),tip:void 0}}e.SignDocDirectAux={typeUrl:`/cosmos.tx.v1beta1.SignDocDirectAux`,encode(n,r=a.BinaryWriter.create()){return n.bodyBytes.length!==0&&r.uint32(10).bytes(n.bodyBytes),n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(18).fork()).ldelim(),n.chainId!==``&&r.uint32(26).string(n.chainId),n.accountNumber!==BigInt(0)&&r.uint32(32).uint64(n.accountNumber),n.sequence!==BigInt(0)&&r.uint32(40).uint64(n.sequence),n.tip!==void 0&&e.Tip.encode(n.tip,r.uint32(50).fork()).ldelim(),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=u();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.bodyBytes=i.bytes();break;case 2:s.publicKey=t.Any.decode(i,i.uint32());break;case 3:s.chainId=i.string();break;case 4:s.accountNumber=i.uint64();break;case 5:s.sequence=i.uint64();break;case 6:s.tip=e.Tip.decode(i,i.uint32());break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=u();return(0,o.isSet)(n.bodyBytes)&&(r.bodyBytes=(0,o.bytesFromBase64)(n.bodyBytes)),(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.chainId)&&(r.chainId=String(n.chainId)),(0,o.isSet)(n.accountNumber)&&(r.accountNumber=BigInt(n.accountNumber.toString())),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),(0,o.isSet)(n.tip)&&(r.tip=e.Tip.fromJSON(n.tip)),r},toJSON(n){let r={};return n.bodyBytes!==void 0&&(r.bodyBytes=(0,o.base64FromBytes)(n.bodyBytes===void 0?new Uint8Array:n.bodyBytes)),n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.chainId!==void 0&&(r.chainId=n.chainId),n.accountNumber!==void 0&&(r.accountNumber=(n.accountNumber||BigInt(0)).toString()),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),n.tip!==void 0&&(r.tip=n.tip?e.Tip.toJSON(n.tip):void 0),r},fromPartial(n){let r=u();return r.bodyBytes=n.bodyBytes??new Uint8Array,n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),r.chainId=n.chainId??``,n.accountNumber!==void 0&&n.accountNumber!==null&&(r.accountNumber=BigInt(n.accountNumber.toString())),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),n.tip!==void 0&&n.tip!==null&&(r.tip=e.Tip.fromPartial(n.tip)),r}};function d(){return{messages:[],memo:``,timeoutHeight:BigInt(0),extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={typeUrl:`/cosmos.tx.v1beta1.TxBody`,encode(e,n=a.BinaryWriter.create()){for(let r of e.messages)t.Any.encode(r,n.uint32(10).fork()).ldelim();e.memo!==``&&n.uint32(18).string(e.memo),e.timeoutHeight!==BigInt(0)&&n.uint32(24).uint64(e.timeoutHeight);for(let r of e.extensionOptions)t.Any.encode(r,n.uint32(8186).fork()).ldelim();for(let r of e.nonCriticalExtensionOptions)t.Any.encode(r,n.uint32(16378).fork()).ldelim();return n},decode(e,n){let r=e instanceof a.BinaryReader?e:new a.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=d();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.messages.push(t.Any.decode(r,r.uint32()));break;case 2:o.memo=r.string();break;case 3:o.timeoutHeight=r.uint64();break;case 1023:o.extensionOptions.push(t.Any.decode(r,r.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(t.Any.decode(r,r.uint32()));break;default:r.skipType(e&7);break}}return o},fromJSON(e){let n=d();return Array.isArray(e?.messages)&&(n.messages=e.messages.map(e=>t.Any.fromJSON(e))),(0,o.isSet)(e.memo)&&(n.memo=String(e.memo)),(0,o.isSet)(e.timeoutHeight)&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),Array.isArray(e?.extensionOptions)&&(n.extensionOptions=e.extensionOptions.map(e=>t.Any.fromJSON(e))),Array.isArray(e?.nonCriticalExtensionOptions)&&(n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>t.Any.fromJSON(e))),n},toJSON(e){let n={};return e.messages?n.messages=e.messages.map(e=>e?t.Any.toJSON(e):void 0):n.messages=[],e.memo!==void 0&&(n.memo=e.memo),e.timeoutHeight!==void 0&&(n.timeoutHeight=(e.timeoutHeight||BigInt(0)).toString()),e.extensionOptions?n.extensionOptions=e.extensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.extensionOptions=[],e.nonCriticalExtensionOptions?n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.nonCriticalExtensionOptions=[],n},fromPartial(e){let n=d();return n.messages=e.messages?.map(e=>t.Any.fromPartial(e))||[],n.memo=e.memo??``,e.timeoutHeight!==void 0&&e.timeoutHeight!==null&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),n.extensionOptions=e.extensionOptions?.map(e=>t.Any.fromPartial(e))||[],n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>t.Any.fromPartial(e))||[],n}};function f(){return{signerInfos:[],fee:void 0,tip:void 0}}e.AuthInfo={typeUrl:`/cosmos.tx.v1beta1.AuthInfo`,encode(t,n=a.BinaryWriter.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),t.tip!==void 0&&e.Tip.encode(t.tip,n.uint32(26).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=f();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(r,r.uint32()));break;case 2:o.fee=e.Fee.decode(r,r.uint32());break;case 3:o.tip=e.Tip.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=f();return Array.isArray(t?.signerInfos)&&(n.signerInfos=t.signerInfos.map(t=>e.SignerInfo.fromJSON(t))),(0,o.isSet)(t.fee)&&(n.fee=e.Fee.fromJSON(t.fee)),(0,o.isSet)(t.tip)&&(n.tip=e.Tip.fromJSON(t.tip)),n},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),t.tip!==void 0&&(n.tip=t.tip?e.Tip.toJSON(t.tip):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],t.fee!==void 0&&t.fee!==null&&(n.fee=e.Fee.fromPartial(t.fee)),t.tip!==void 0&&t.tip!==null&&(n.tip=e.Tip.fromPartial(t.tip)),n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:BigInt(0)}}e.SignerInfo={typeUrl:`/cosmos.tx.v1beta1.SignerInfo`,encode(n,r=a.BinaryWriter.create()){return n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(10).fork()).ldelim(),n.modeInfo!==void 0&&e.ModeInfo.encode(n.modeInfo,r.uint32(18).fork()).ldelim(),n.sequence!==BigInt(0)&&r.uint32(24).uint64(n.sequence),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=p();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.publicKey=t.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=i.uint64();break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=p();return(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.modeInfo)&&(r.modeInfo=e.ModeInfo.fromJSON(n.modeInfo)),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),r},toJSON(n){let r={};return n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.modeInfo!==void 0&&(r.modeInfo=n.modeInfo?e.ModeInfo.toJSON(n.modeInfo):void 0),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),r},fromPartial(n){let r=p();return n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),n.modeInfo!==void 0&&n.modeInfo!==null&&(r.modeInfo=e.ModeInfo.fromPartial(n.modeInfo)),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),r}};function m(){return{single:void 0,multi:void 0}}e.ModeInfo={typeUrl:`/cosmos.tx.v1beta1.ModeInfo`,encode(t,n=a.BinaryWriter.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=m();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(r,r.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=m();return(0,o.isSet)(t.single)&&(n.single=e.ModeInfo_Single.fromJSON(t.single)),(0,o.isSet)(t.multi)&&(n.multi=e.ModeInfo_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=m();return t.single!==void 0&&t.single!==null&&(n.single=e.ModeInfo_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.ModeInfo_Multi.fromPartial(t.multi)),n}};function h(){return{mode:0}}e.ModeInfo_Single={typeUrl:`/cosmos.tx.v1beta1.Single`,encode(e,t=a.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=h();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.mode=n.int32();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=h();return(0,o.isSet)(e.mode)&&(t.mode=(0,n.signModeFromJSON)(e.mode)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,n.signModeToJSON)(e.mode)),t},fromPartial(e){let t=h();return t.mode=e.mode??0,t}};function g(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={typeUrl:`/cosmos.tx.v1beta1.Multi`,encode(t,n=a.BinaryWriter.create()){t.bitarray!==void 0&&r.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof a.BinaryReader?t:new a.BinaryReader(t),o=n===void 0?i.len:i.pos+n,s=g();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=r.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){let n=g();return(0,o.isSet)(t.bitarray)&&(n.bitarray=r.CompactBitArray.fromJSON(t.bitarray)),Array.isArray(t?.modeInfos)&&(n.modeInfos=t.modeInfos.map(t=>e.ModeInfo.fromJSON(t))),n},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?r.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=g();return t.bitarray!==void 0&&t.bitarray!==null&&(n.bitarray=r.CompactBitArray.fromPartial(t.bitarray)),n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function _(){return{amount:[],gasLimit:BigInt(0),payer:``,granter:``}}e.Fee={typeUrl:`/cosmos.tx.v1beta1.Fee`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==BigInt(0)&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.gasLimit=n.uint64();break;case 3:o.payer=n.string();break;case 4:o.granter=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=_();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.gasLimit)&&(t.gasLimit=BigInt(e.gasLimit.toString())),(0,o.isSet)(e.payer)&&(t.payer=String(e.payer)),(0,o.isSet)(e.granter)&&(t.granter=String(e.granter)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=(e.gasLimit||BigInt(0)).toString()),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=_();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],e.gasLimit!==void 0&&e.gasLimit!==null&&(t.gasLimit=BigInt(e.gasLimit.toString())),t.payer=e.payer??``,t.granter=e.granter??``,t}};function v(){return{amount:[],tipper:``}}e.Tip={typeUrl:`/cosmos.tx.v1beta1.Tip`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==``&&t.uint32(18).string(e.tipper),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.tipper=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=v();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.tipper)&&(t.tipper=String(e.tipper)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){let t=v();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.tipper=e.tipper??``,t}};function y(){return{address:``,signDoc:void 0,mode:0,sig:new Uint8Array}}e.AuxSignerData={typeUrl:`/cosmos.tx.v1beta1.AuxSignerData`,encode(t,n=a.BinaryWriter.create()){return t.address!==``&&n.uint32(10).string(t.address),t.signDoc!==void 0&&e.SignDocDirectAux.encode(t.signDoc,n.uint32(18).fork()).ldelim(),t.mode!==0&&n.uint32(24).int32(t.mode),t.sig.length!==0&&n.uint32(34).bytes(t.sig),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=y();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.address=r.string();break;case 2:o.signDoc=e.SignDocDirectAux.decode(r,r.uint32());break;case 3:o.mode=r.int32();break;case 4:o.sig=r.bytes();break;default:r.skipType(t&7);break}}return o},fromJSON(t){let r=y();return(0,o.isSet)(t.address)&&(r.address=String(t.address)),(0,o.isSet)(t.signDoc)&&(r.signDoc=e.SignDocDirectAux.fromJSON(t.signDoc)),(0,o.isSet)(t.mode)&&(r.mode=(0,n.signModeFromJSON)(t.mode)),(0,o.isSet)(t.sig)&&(r.sig=(0,o.bytesFromBase64)(t.sig)),r},toJSON(t){let r={};return t.address!==void 0&&(r.address=t.address),t.signDoc!==void 0&&(r.signDoc=t.signDoc?e.SignDocDirectAux.toJSON(t.signDoc):void 0),t.mode!==void 0&&(r.mode=(0,n.signModeToJSON)(t.mode)),t.sig!==void 0&&(r.sig=(0,o.base64FromBytes)(t.sig===void 0?new Uint8Array:t.sig)),r},fromPartial(t){let n=y();return n.address=t.address??``,t.signDoc!==void 0&&t.signDoc!==null&&(n.signDoc=e.SignDocDirectAux.fromPartial(t.signDoc)),n.mode=t.mode??0,n.sig=t.sig??new Uint8Array,n}}})),Bt=class{client;registry;constructor(e,t){this.client=e,this.registry=t}async resolveName(e){try{let{contract:t,getQueryMsg:n}=this.registry;return await this.client.queryContractSmart(t,n(e))}catch(e){console?.error(e);return}}};function Vt(e,t){return function(){return e.apply(t,arguments)}}m();var{toString:Ht}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:Wt,toStringTag:Gt}=Symbol,Kt=(e=>t=>{let n=Ht.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qt=e=>(e=e.toLowerCase(),t=>Kt(t)===e),Jt=e=>t=>typeof t===e,{isArray:Yt}=Array,Xt=Jt(`undefined`);function Zt(e){return e!==null&&!Xt(e)&&e.constructor!==null&&!Xt(e.constructor)&&tn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Qt=qt(`ArrayBuffer`);function $t(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qt(e.buffer),t}var en=Jt(`string`),tn=Jt(`function`),nn=Jt(`number`),rn=e=>typeof e==`object`&&!!e,an=e=>e===!0||e===!1,on=e=>{if(Kt(e)!==`object`)return!1;let t=Ut(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Gt in e)&&!(Wt in e)},sn=e=>{if(!rn(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},cn=qt(`Date`),ln=qt(`File`),un=e=>!!(e&&e.uri!==void 0),dn=e=>e&&e.getParts!==void 0,fn=qt(`Blob`),pn=qt(`FileList`),mn=e=>rn(e)&&tn(e.pipe);function hn(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:h===void 0?{}:h}var gn=hn(),_n=gn.FormData===void 0?void 0:gn.FormData,vn=e=>{if(!e)return!1;if(_n&&e instanceof _n)return!0;let t=Ut(e);if(!t||t===Object.prototype||!tn(e.append))return!1;let n=Kt(e);return n===`formdata`||n===`object`&&tn(e.toString)&&e.toString()===`[object FormData]`},yn=qt(`URLSearchParams`),[bn,xn,Sn,Cn]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(qt),wn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Tn(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),Yt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Zt(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function En(e,t){if(Zt(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Dn=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:h,On=e=>!Xt(e)&&e!==Dn;function kn(...e){let{caseless:t,skipUndefined:n}=On(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&En(r,i)||i,o=Vn(r,a)?r[a]:void 0;on(o)&&on(e)?r[a]=kn(o,e):on(e)?r[a]=kn({},e):Yt(e)?r[a]=e.slice():(!n||!Xt(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++)e[t]&&Tn(e[t],i);return r}var An=(e,t,n,{allOwnKeys:r}={})=>(Tn(t,(t,r)=>{n&&tn(t)?Object.defineProperty(e,r,{__proto__:null,value:Vt(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),jn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Nn=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Ut(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Pn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Fn=e=>{if(!e)return null;if(Yt(e))return e;let t=e.length;if(!nn(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},In=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Ut(Uint8Array)),Ln=(e,t)=>{let n=(e&&e[Wt]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Rn=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zn=qt(`HTMLFormElement`),Bn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Vn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Hn=qt(`RegExp`),Un=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Tn(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Wn=e=>{Un(e,(t,n)=>{if(tn(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(tn(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Gn=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Yt(e)?r(e):r(String(e).split(t)),n},Kn=()=>{},qn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Jn(e){return!!(e&&tn(e.append)&&e[Gt]===`FormData`&&e[Wt])}var Yn=e=>{let t=Array(10),n=(e,r)=>{if(rn(e)){if(t.indexOf(e)>=0)return;if(Zt(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=Yt(e)?[]:{};return Tn(e,(e,t)=>{let a=n(e,r+1);!Xt(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Xn=qt(`AsyncFunction`),Zn=e=>e&&(rn(e)||tn(e))&&tn(e.then)&&tn(e.catch),Qn=((e,t)=>e?setImmediate:t?((e,t)=>(Dn.addEventListener(`message`,({source:n,data:r})=>{n===Dn&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Dn.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,tn(Dn.postMessage)),V={isArray:Yt,isArrayBuffer:Qt,isBuffer:Zt,isFormData:vn,isArrayBufferView:$t,isString:en,isNumber:nn,isBoolean:an,isObject:rn,isPlainObject:on,isEmptyObject:sn,isReadableStream:bn,isRequest:xn,isResponse:Sn,isHeaders:Cn,isUndefined:Xt,isDate:cn,isFile:ln,isReactNativeBlob:un,isReactNative:dn,isBlob:fn,isRegExp:Hn,isFunction:tn,isStream:mn,isURLSearchParams:yn,isTypedArray:In,isFileList:pn,forEach:Tn,merge:kn,extend:An,trim:wn,stripBOM:jn,inherits:Mn,toFlatObject:Nn,kindOf:Kt,kindOfTest:qt,endsWith:Pn,toArray:Fn,forEachEntry:Ln,matchAll:Rn,isHTMLForm:zn,hasOwnProperty:Vn,hasOwnProp:Vn,reduceDescriptors:Un,freezeMethods:Wn,toObjectSet:Gn,toCamelCase:Bn,noop:Kn,toFiniteNumber:qn,findKey:En,global:Dn,isContextDefined:On,isSpecCompliantForm:Jn,toJSONObject:Yn,isAsyncFn:Xn,isThenable:Zn,setImmediate:Qn,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Dn):o!==void 0&&o.nextTick||Qn,isIterable:e=>e!=null&&tn(e[Wt])},$n=V.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),er=e=>{let t={},n,r,i;return e&&e.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/build-CpWkW2tw.js","assets/chunk-CJJwijRH.js","assets/build-BIWX__lt.js","assets/sha256-C0vxEvCe.js","assets/legacy-xs8KgUGb.js","assets/src-CQGv6J_e.js","assets/dist-BQMAk709.js","assets/dist-BalQtXKe.js","assets/has-property-descriptors-C-vuneCL.js","assets/dist-CeXM7Kux.js","assets/build-CWk0QocV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,n as t,o as n,r,s as i,t as a}from"./chunk-CJJwijRH.js";import{n as o,t as s}from"./dist-CeXM7Kux.js";import{E as c,K as l,V as u,n as d,t as f,y as p}from"./createConnector-BkcvlarK.js";import{n as m,t as h}from"./dist-BalQtXKe.js";import{t as g}from"./preload-helper-zJ_50EbN.js";import{r as _,t as v}from"./dist-BQMAk709.js";import{a as y,b,c as x,g as S,i as C,m as w}from"./utils-GIC7NcXf.js";import{i as T,n as E,r as D,s as O,t as k}from"./hmac-BliMQdXS.js";import{n as A,t as j}from"./bn-DuEpkJdN.js";import{a as M,c as N,i as P,n as F,o as I,r as L,t as R}from"./crypto-browserify-DjHA5ups.js";import{t as ee}from"./events-H7eok89L.js";import{a as te,c as ne,i as re,l as ie,o as ae,r as oe,s as se,t as ce,u as le}from"./index.es-CD1QZ58d.js";import{_ as ue,a as de,d as fe,f as pe,g as me,h as he,i as ge,l as _e,n as ve,o as ye,p as z,r as be,s as xe,t as Se,u as Ce,v as we}from"./browser-ponyfill-Um6_QYhg.js";import{n as Te,t as Ee}from"./esm-DovyE5S1.js";import{t as De}from"./blake2-DFE8rJki.js";import{n as Oe,t as ke}from"./esm-DZjVTWAH.js";import{$ as Ae,Ft as je,Ot as Me,Pt as Ne,at as Pe,ct as Fe,dn as Ie,et as Le,gn as Re,hn as ze,it as Be,ln as Ve,nn as He,tn as Ue,tt as We,un as Ge}from"./index--r1G5ij4.js";import{t as Ke}from"./p256-CAvUfeCP.js";import{a as qe,o as Je,t as Ye}from"./build-BIWX__lt.js";import{n as Xe,t as Ze}from"./src-CQGv6J_e.js";import{n as Qe}from"./bignumber-BGaAhqFj.js";import{n as $e,r as et,t as tt}from"./src-BNPFDZz3.js";import{t as nt}from"./blakejs-C2IeO1K2.js";import{cosmosAssets as rt,registryIdsToSKCosmosNetworks as it}from"./chain-registry-Dby2f2S0.js";import{t as at}from"./cjs-CfJ7LJmy.js";s(),m(),_(),w(),Ue(),D();var ot=i(ee()),st=I(),B=le(),ct=re(),lt=oe(),ut=i(Se());function dt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function ft(e){if(typeof e!=`boolean`)throw Error(`boolean expected, not ${e}`)}function pt(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function mt(e,...t){if(!dt(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ht(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function gt(e,t){mt(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function _t(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function vt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function yt(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var bt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function xt(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function St(e){if(typeof e==`string`)e=xt(e);else if(dt(e))e=At(e);else throw Error(`Uint8Array expected, got `+typeof e);return e}function Ct(e,t){if(typeof t!=`object`||!t)throw Error(`options must be defined`);return Object.assign(e,t)}function wt(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}var Tt=(e,t)=>{function n(n,...r){if(mt(n),!bt)throw Error(`Non little-endian hardware is not yet supported`);if(e.nonceLength!==void 0){let t=r[0];if(!t)throw Error(`nonce / iv required`);e.varSizeNonce?mt(t):mt(t,e.nonceLength)}let i=e.tagLength;i&&r[1]!==void 0&&mt(r[1]);let a=t(n,...r),o=(e,t)=>{if(t!==void 0){if(e!==2)throw Error(`cipher output not supported`);mt(t)}},s=!1;return{encrypt(e,t){if(s)throw Error(`cannot encrypt() twice with same key + nonce`);return s=!0,mt(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(mt(e),i&&e.length<i)throw Error(`invalid ciphertext length: smaller than tagLength=`+i);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n};function Et(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw Error(`invalid output length, expected `+e+`, got: `+t.length);if(n&&!kt(t))throw Error(`invalid output, must be aligned`);return t}function Dt(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Ot(e,t,n){ft(n);let r=new Uint8Array(16),i=yt(r);return Dt(i,0,BigInt(t),n),Dt(i,8,BigInt(e),n),r}function kt(e){return e.byteOffset%4==0}function At(e){return Uint8Array.from(e)}var jt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.utf8Write=e.utf8Read=e.utf8Length=void 0;function t(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t}e.utf8Length=t;function n(e,t,n){if(n-t<1)return``;let r=[],i=[],a=0,o;for(;t<n;)o=e[t++],o<128?r[a++]=o:o>191&&o<224?r[a++]=(o&31)<<6|e[t++]&63:o>239&&o<365?(o=((o&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r[a++]=55296+(o>>10),r[a++]=56320+(o&1023)):r[a++]=(o&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||=[]).push(String.fromCharCode(...r)),a=0);return i?(a&&i.push(String.fromCharCode(...r.slice(0,a))),i.join(``)):String.fromCharCode(...r.slice(0,a))}e.utf8Read=n;function r(e,t,n){let r=n,i,a;for(let r=0;r<e.length;++r)i=e.charCodeAt(r),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(r+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++r,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}e.utf8Write=r})),Mt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.writeByte=e.writeFixed32=e.int64Length=e.writeVarint64=e.writeVarint32=e.readInt32=e.readUInt32=e.zzDecode=e.zzEncode=e.varint32read=e.varint32write=e.uInt64ToString=e.int64ToString=e.int64FromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}e.varint64read=t;function n(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;var r=4294967296;function i(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?l(i,a):c(i,a)}e.int64FromString=i;function a(e,t){let n=c(e,t),r=n.hi&2147483648;r&&(n=l(n.lo,n.hi));let i=o(n.lo,n.hi);return r?`-`+i:i}e.int64ToString=a;function o(e,t){if({lo:e,hi:t}=s(e,t),t<=2097151)return String(r*t+e);let n=e&16777215,i=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,c=i+a*8147497,l=a*2,d=1e7;return o>=d&&(c+=Math.floor(o/d),o%=d),c>=d&&(l+=Math.floor(c/d),c%=d),l.toString()+u(c)+u(o)}e.uInt64ToString=o;function s(e,t){return{lo:e>>>0,hi:t>>>0}}function c(e,t){return{lo:e|0,hi:t|0}}function l(e,t){return t=~t,e?e=~e+1:t+=1,c(e,t)}var u=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=d;function f(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=f;function p(e,t){let n=t>>31;return t=((t<<1|e>>>31)^n)>>>0,e=(e<<1^n)>>>0,[e,t]}e.zzEncode=p;function m(e,t){let n=-(e&1);return e=((e>>>1|t<<31)^n)>>>0,t=(t>>>1^n)>>>0,[e,t]}e.zzDecode=m;function h(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}e.readUInt32=h;function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}e.readInt32=g;function _(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}e.writeVarint32=_;function v(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}e.writeVarint64=v;function y(e,t){let n=e,r=(e>>>28|t<<4)>>>0,i=t>>>24;return i===0?r===0?n<16384?n<128?1:2:n<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10}e.int64Length=y;function b(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}e.writeFixed32=b;function x(e,t,n){t[n]=e&255}e.writeByte=x})),Nt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryWriter=e.BinaryReader=e.WireType=void 0;var t=jt(),n=Mt(),r;(function(e){e[e.Varint=0]=`Varint`,e[e.Fixed64=1]=`Fixed64`,e[e.Bytes=2]=`Bytes`,e[e.Fixed32=5]=`Fixed32`})(r||(e.WireType=r={})),e.BinaryReader=class{assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}constructor(e){this.buf=e?new Uint8Array(e):new Uint8Array,this.pos=0,this.type=0,this.len=this.buf.length}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n,e]}skip(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case r.Varint:this.skip();break;case r.Fixed64:this.skip(8);break;case r.Bytes:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case r.Fixed32:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this}uint32(){return n.varint32read.bind(this)()}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e%2==1?(e+1)/-2:e/2}fixed32(){let e=(0,n.readUInt32)(this.buf,this.pos);return this.pos+=4,e}sfixed32(){let e=(0,n.readInt32)(this.buf,this.pos);return this.pos+=4,e}int64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.int64ToString)(e,t))}uint64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.uInt64ToString)(e,t))}sint64(){let[e,t]=n.varint64read.bind(this)();return[e,t]=(0,n.zzDecode)(e,t),BigInt((0,n.int64ToString)(e,t))}fixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.uInt64ToString)(e,t))}sfixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.int64ToString)(e,t))}float(){throw Error(`float not supported`)}double(){throw Error(`double not supported`)}bool(){let[e,t]=n.varint64read.bind(this)();return e!==0||t!==0}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){let e=this.bytes();return(0,t.utf8Read)(e,0,e.length)}};var i=class{constructor(e,t,n){this.fn=e,this.len=t,this.val=n}proceed(e,t){this.fn&&this.fn(this.val,e,t)}},a=class{constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}};e.BinaryWriter=class e{constructor(){this.len=0,this.uint64=e.prototype.int64,this.sfixed64=e.prototype.fixed64,this.sfixed32=e.prototype.fixed32,this.head=new i(null,0,0),this.tail=this.head,this.states=null}static create(){return new e}static alloc(e){return typeof Uint8Array<`u`?s(e=>new Uint8Array(e),Uint8Array.prototype.subarray)(e):Array(e)}_push(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this}finish(){let t=this.head.next,n=0,r=e.alloc(this.len);for(;t;)t.proceed(r,n),n+=t.len,t=t.next;return r}fork(){return this.states=new a(this),this.head=this.tail=new i(null,0,0),this.len=0,this}reset(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(null,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}tag(e,t){return this.uint32((e<<3|t)>>>0)}uint32(e){return this.len+=(this.tail=this.tail.next=new i(n.writeVarint32,(e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(n.writeVarint64,10,(0,n.int64FromString)(e.toString())):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}int64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}sint64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return[t,r]=(0,n.zzEncode)(t,r),this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}fixed64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeFixed32,4,t)._push(n.writeFixed32,4,r)}bool(e){return this._push(n.writeByte,1,+!!e)}fixed32(e){return this._push(n.writeFixed32,4,e>>>0)}float(e){throw Error(`float not supported`+e)}double(e){throw Error(`double not supported`+e)}bytes(e){let t=e.length>>>0;return t?this.uint32(t)._push(o,t,e):this._push(n.writeByte,1,0)}string(e){let r=(0,t.utf8Length)(e);return r?this.uint32(r)._push(t.utf8Write,r,e):this._push(n.writeByte,1,0)}};function o(e,t,n){if(typeof Uint8Array<`u`)t.set(e,n);else for(let r=0;r<e.length;++r)t[n+r]=e[r]}function s(e,t,n){let r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);let s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}})),Pt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromJsonTimestamp=e.fromTimestamp=e.toTimestamp=e.isRpc=e.setPaginationParams=e.isObject=e.isSet=e.fromDuration=e.toDuration=e.omitDefault=e.base64FromBytes=e.bytesFromBase64=void 0;var t=(()=>{if(t!==void 0)return t;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),n=t.atob||(e=>t.Buffer.from(e,`base64`).toString(`binary`));function r(e){let t=n(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}e.bytesFromBase64=r;var i=t.btoa||(e=>t.Buffer.from(e,`binary`).toString(`base64`));function a(e){let t=[];return e.forEach(e=>{t.push(String.fromCharCode(e))}),i(t.join(``))}e.base64FromBytes=a;function o(e){if(typeof e==`string`)return e===``?void 0:e;if(typeof e==`number`)return e===0?void 0:e;if(typeof e==`boolean`)return e===!1?void 0:e;if(typeof e==`bigint`)return e===BigInt(0)?void 0:e;throw Error(`Got unsupported type ${typeof e}`)}e.omitDefault=o;function s(e){return{seconds:BigInt(Math.floor(parseInt(e)/1e9)),nanos:parseInt(e)%1e9}}e.toDuration=s;function c(e){return(parseInt(e.seconds.toString())*1e9+e.nanos).toString()}e.fromDuration=c;function l(e){return e!=null}e.isSet=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u,e.setPaginationParams=(e,t)=>t?(t?.countTotal!==void 0&&(e.params[`pagination.count_total`]=t.countTotal),t?.key!==void 0&&(e.params[`pagination.key`]=v.from(t.key).toString(`base64`)),t?.limit!==void 0&&(e.params[`pagination.limit`]=t.limit.toString()),t?.offset!==void 0&&(e.params[`pagination.offset`]=t.offset.toString()),t?.reverse!==void 0&&(e.params[`pagination.reverse`]=t.reverse),e):e;function d(e){return e!=null&&typeof e.request==`function`}e.isRpc=d;function f(e){return{seconds:_(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6}}e.toTimestamp=f;function p(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}e.fromTimestamp=p;var m=e=>({seconds:l(e.seconds)?BigInt(e.seconds.toString()):BigInt(0),nanos:l(e.nanos)?Number(e.nanos):0});function g(e){return e instanceof Date?f(e):typeof e==`string`?f(new Date(e)):m(e)}e.fromJsonTimestamp=g;function _(e){return BigInt(Math.trunc(e))}})),Ft=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Any=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`google.protobuf`;function r(){return{typeUrl:``,value:new Uint8Array}}e.Any={typeUrl:`/google.protobuf.Any`,encode(e,n=t.BinaryWriter.create()){return e.typeUrl!==``&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.typeUrl=i.string();break;case 2:o.value=i.bytes();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.typeUrl)&&(t.typeUrl=String(e.typeUrl)),(0,n.isSet)(e.value)&&(t.value=(0,n.bytesFromBase64)(e.value)),t},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=(0,n.base64FromBytes)(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=r();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}}})),It=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function r(){return{signatures:[]}}e.MultiSignature={typeUrl:`/cosmos.crypto.multisig.v1beta1.MultiSignature`,encode(e,n=t.BinaryWriter.create()){for(let t of e.signatures)n.uint32(10).bytes(t);return n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.signatures.push(i.bytes());break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,n.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>(0,n.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=r();return t.signatures=e.signatures?.map(e=>e)||[],t}};function i(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={typeUrl:`/cosmos.crypto.multisig.v1beta1.CompactBitArray`,encode(e,n=t.BinaryWriter.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.extraBitsStored=r.uint32();break;case 2:o.elems=r.bytes();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.extraBitsStored)&&(t.extraBitsStored=Number(e.extraBitsStored)),(0,n.isSet)(e.elems)&&(t.elems=(0,n.bytesFromBase64)(e.elems)),t},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=(0,n.base64FromBytes)(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=i();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}}})),Lt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var t=It(),n=Ft(),r=Nt(),i=Pt();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var a;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_DIRECT_AUX=3]=`SIGN_MODE_DIRECT_AUX`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.SIGN_MODE_EIP_191=191]=`SIGN_MODE_EIP_191`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a||(e.SignMode=a={}));function o(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return a.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return a.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return a.SIGN_MODE_TEXTUAL;case 3:case`SIGN_MODE_DIRECT_AUX`:return a.SIGN_MODE_DIRECT_AUX;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return a.SIGN_MODE_LEGACY_AMINO_JSON;case 191:case`SIGN_MODE_EIP_191`:return a.SIGN_MODE_EIP_191;default:return a.UNRECOGNIZED}}e.signModeFromJSON=o;function s(e){switch(e){case a.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case a.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case a.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case a.SIGN_MODE_DIRECT_AUX:return`SIGN_MODE_DIRECT_AUX`;case a.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;case a.SIGN_MODE_EIP_191:return`SIGN_MODE_EIP_191`;case a.UNRECOGNIZED:default:return`UNRECOGNIZED`}}e.signModeToJSON=s;function c(){return{signatures:[]}}e.SignatureDescriptors={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptors`,encode(t,n=r.BinaryWriter.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=c();return Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t))),n},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=c();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function l(){return{publicKey:void 0,data:void 0,sequence:BigInt(0)}}e.SignatureDescriptor={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptor`,encode(t,i=r.BinaryWriter.create()){return t.publicKey!==void 0&&n.Any.encode(t.publicKey,i.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,i.uint32(18).fork()).ldelim(),t.sequence!==BigInt(0)&&i.uint32(24).uint64(t.sequence),i},decode(t,i){let a=t instanceof r.BinaryReader?t:new r.BinaryReader(t),o=i===void 0?a.len:a.pos+i,s=l();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=n.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=a.uint64();break;default:a.skipType(t&7);break}}return s},fromJSON(t){let r=l();return(0,i.isSet)(t.publicKey)&&(r.publicKey=n.Any.fromJSON(t.publicKey)),(0,i.isSet)(t.data)&&(r.data=e.SignatureDescriptor_Data.fromJSON(t.data)),(0,i.isSet)(t.sequence)&&(r.sequence=BigInt(t.sequence.toString())),r},toJSON(t){let r={};return t.publicKey!==void 0&&(r.publicKey=t.publicKey?n.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(r.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(r.sequence=(t.sequence||BigInt(0)).toString()),r},fromPartial(t){let r=l();return t.publicKey!==void 0&&t.publicKey!==null&&(r.publicKey=n.Any.fromPartial(t.publicKey)),t.data!==void 0&&t.data!==null&&(r.data=e.SignatureDescriptor_Data.fromPartial(t.data)),t.sequence!==void 0&&t.sequence!==null&&(r.sequence=BigInt(t.sequence.toString())),r}};function u(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={typeUrl:`/cosmos.tx.signing.v1beta1.Data`,encode(t,n=r.BinaryWriter.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=u();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=u();return(0,i.isSet)(t.single)&&(n.single=e.SignatureDescriptor_Data_Single.fromJSON(t.single)),(0,i.isSet)(t.multi)&&(n.multi=e.SignatureDescriptor_Data_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=u();return t.single!==void 0&&t.single!==null&&(n.single=e.SignatureDescriptor_Data_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.SignatureDescriptor_Data_Multi.fromPartial(t.multi)),n}};function d(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={typeUrl:`/cosmos.tx.signing.v1beta1.Single`,encode(e,t=r.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.BinaryReader?e:new r.BinaryReader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){let t=d();return(0,i.isSet)(e.mode)&&(t.mode=o(e.mode)),(0,i.isSet)(e.signature)&&(t.signature=(0,i.bytesFromBase64)(e.signature)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=s(e.mode)),e.signature!==void 0&&(t.signature=(0,i.base64FromBytes)(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=d();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function f(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={typeUrl:`/cosmos.tx.signing.v1beta1.Multi`,encode(n,i=r.BinaryWriter.create()){n.bitarray!==void 0&&t.CompactBitArray.encode(n.bitarray,i.uint32(10).fork()).ldelim();for(let t of n.signatures)e.SignatureDescriptor_Data.encode(t,i.uint32(18).fork()).ldelim();return i},decode(n,i){let a=n instanceof r.BinaryReader?n:new r.BinaryReader(n),o=i===void 0?a.len:a.pos+i,s=f();for(;a.pos<o;){let n=a.uint32();switch(n>>>3){case 1:s.bitarray=t.CompactBitArray.decode(a,a.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(a,a.uint32()));break;default:a.skipType(n&7);break}}return s},fromJSON(n){let r=f();return(0,i.isSet)(n.bitarray)&&(r.bitarray=t.CompactBitArray.fromJSON(n.bitarray)),Array.isArray(n?.signatures)&&(r.signatures=n.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t))),r},toJSON(n){let r={};return n.bitarray!==void 0&&(r.bitarray=n.bitarray?t.CompactBitArray.toJSON(n.bitarray):void 0),n.signatures?r.signatures=n.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):r.signatures=[],r},fromPartial(n){let r=f();return n.bitarray!==void 0&&n.bitarray!==null&&(r.bitarray=t.CompactBitArray.fromPartial(n.bitarray)),r.signatures=n.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],r}}})),Rt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var t=Nt(),n=Pt();e.protobufPackage=`cosmos.base.v1beta1`;function r(){return{denom:``,amount:``}}e.Coin={typeUrl:`/cosmos.base.v1beta1.Coin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.denom=i.string();break;case 2:o.amount=i.string();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=r();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function i(){return{denom:``,amount:``}}e.DecCoin={typeUrl:`/cosmos.base.v1beta1.DecCoin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.denom=r.string();break;case 2:o.amount=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{int:``}}e.IntProto={typeUrl:`/cosmos.base.v1beta1.IntProto`,encode(e,n=t.BinaryWriter.create()){return e.int!==``&&n.uint32(10).string(e.int),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=a();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.int=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=a();return(0,n.isSet)(e.int)&&(t.int=String(e.int)),t},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=a();return t.int=e.int??``,t}};function o(){return{dec:``}}e.DecProto={typeUrl:`/cosmos.base.v1beta1.DecProto`,encode(e,n=t.BinaryWriter.create()){return e.dec!==``&&n.uint32(10).string(e.dec),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,a=o();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:a.dec=r.string();break;default:r.skipType(e&7);break}}return a},fromJSON(e){let t=o();return(0,n.isSet)(e.dec)&&(t.dec=String(e.dec)),t},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=o();return t.dec=e.dec??``,t}}})),zt=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AuxSignerData=e.Tip=e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDocDirectAux=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var t=Ft(),n=Lt(),r=It(),i=Rt(),a=Nt(),o=Pt();e.protobufPackage=`cosmos.tx.v1beta1`;function s(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={typeUrl:`/cosmos.tx.v1beta1.Tx`,encode(t,n=a.BinaryWriter.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=s();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(r,r.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(r,r.uint32());break;case 3:o.signatures.push(r.bytes());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=s();return(0,o.isSet)(t.body)&&(n.body=e.TxBody.fromJSON(t.body)),(0,o.isSet)(t.authInfo)&&(n.authInfo=e.AuthInfo.fromJSON(t.authInfo)),Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(e=>(0,o.bytesFromBase64)(e))),n},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=s();return t.body!==void 0&&t.body!==null&&(n.body=e.TxBody.fromPartial(t.body)),t.authInfo!==void 0&&t.authInfo!==null&&(n.authInfo=e.AuthInfo.fromPartial(t.authInfo)),n.signatures=t.signatures?.map(e=>e)||[],n}};function c(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={typeUrl:`/cosmos.tx.v1beta1.TxRaw`,encode(e,t=a.BinaryWriter.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=c();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=c();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,o.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=c();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:BigInt(0)}}e.SignDoc={typeUrl:`/cosmos.tx.v1beta1.SignDoc`,encode(e,t=a.BinaryWriter.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==BigInt(0)&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=l();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.chainId=n.string();break;case 4:i.accountNumber=n.uint64();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=l();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),(0,o.isSet)(e.chainId)&&(t.chainId=String(e.chainId)),(0,o.isSet)(e.accountNumber)&&(t.accountNumber=BigInt(e.accountNumber.toString())),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=(e.accountNumber||BigInt(0)).toString()),t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,e.accountNumber!==void 0&&e.accountNumber!==null&&(t.accountNumber=BigInt(e.accountNumber.toString())),t}};function u(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:``,accountNumber:BigInt(0),sequence:BigInt(0),tip:void 0}}e.SignDocDirectAux={typeUrl:`/cosmos.tx.v1beta1.SignDocDirectAux`,encode(n,r=a.BinaryWriter.create()){return n.bodyBytes.length!==0&&r.uint32(10).bytes(n.bodyBytes),n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(18).fork()).ldelim(),n.chainId!==``&&r.uint32(26).string(n.chainId),n.accountNumber!==BigInt(0)&&r.uint32(32).uint64(n.accountNumber),n.sequence!==BigInt(0)&&r.uint32(40).uint64(n.sequence),n.tip!==void 0&&e.Tip.encode(n.tip,r.uint32(50).fork()).ldelim(),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=u();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.bodyBytes=i.bytes();break;case 2:s.publicKey=t.Any.decode(i,i.uint32());break;case 3:s.chainId=i.string();break;case 4:s.accountNumber=i.uint64();break;case 5:s.sequence=i.uint64();break;case 6:s.tip=e.Tip.decode(i,i.uint32());break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=u();return(0,o.isSet)(n.bodyBytes)&&(r.bodyBytes=(0,o.bytesFromBase64)(n.bodyBytes)),(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.chainId)&&(r.chainId=String(n.chainId)),(0,o.isSet)(n.accountNumber)&&(r.accountNumber=BigInt(n.accountNumber.toString())),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),(0,o.isSet)(n.tip)&&(r.tip=e.Tip.fromJSON(n.tip)),r},toJSON(n){let r={};return n.bodyBytes!==void 0&&(r.bodyBytes=(0,o.base64FromBytes)(n.bodyBytes===void 0?new Uint8Array:n.bodyBytes)),n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.chainId!==void 0&&(r.chainId=n.chainId),n.accountNumber!==void 0&&(r.accountNumber=(n.accountNumber||BigInt(0)).toString()),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),n.tip!==void 0&&(r.tip=n.tip?e.Tip.toJSON(n.tip):void 0),r},fromPartial(n){let r=u();return r.bodyBytes=n.bodyBytes??new Uint8Array,n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),r.chainId=n.chainId??``,n.accountNumber!==void 0&&n.accountNumber!==null&&(r.accountNumber=BigInt(n.accountNumber.toString())),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),n.tip!==void 0&&n.tip!==null&&(r.tip=e.Tip.fromPartial(n.tip)),r}};function d(){return{messages:[],memo:``,timeoutHeight:BigInt(0),extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={typeUrl:`/cosmos.tx.v1beta1.TxBody`,encode(e,n=a.BinaryWriter.create()){for(let r of e.messages)t.Any.encode(r,n.uint32(10).fork()).ldelim();e.memo!==``&&n.uint32(18).string(e.memo),e.timeoutHeight!==BigInt(0)&&n.uint32(24).uint64(e.timeoutHeight);for(let r of e.extensionOptions)t.Any.encode(r,n.uint32(8186).fork()).ldelim();for(let r of e.nonCriticalExtensionOptions)t.Any.encode(r,n.uint32(16378).fork()).ldelim();return n},decode(e,n){let r=e instanceof a.BinaryReader?e:new a.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=d();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.messages.push(t.Any.decode(r,r.uint32()));break;case 2:o.memo=r.string();break;case 3:o.timeoutHeight=r.uint64();break;case 1023:o.extensionOptions.push(t.Any.decode(r,r.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(t.Any.decode(r,r.uint32()));break;default:r.skipType(e&7);break}}return o},fromJSON(e){let n=d();return Array.isArray(e?.messages)&&(n.messages=e.messages.map(e=>t.Any.fromJSON(e))),(0,o.isSet)(e.memo)&&(n.memo=String(e.memo)),(0,o.isSet)(e.timeoutHeight)&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),Array.isArray(e?.extensionOptions)&&(n.extensionOptions=e.extensionOptions.map(e=>t.Any.fromJSON(e))),Array.isArray(e?.nonCriticalExtensionOptions)&&(n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>t.Any.fromJSON(e))),n},toJSON(e){let n={};return e.messages?n.messages=e.messages.map(e=>e?t.Any.toJSON(e):void 0):n.messages=[],e.memo!==void 0&&(n.memo=e.memo),e.timeoutHeight!==void 0&&(n.timeoutHeight=(e.timeoutHeight||BigInt(0)).toString()),e.extensionOptions?n.extensionOptions=e.extensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.extensionOptions=[],e.nonCriticalExtensionOptions?n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.nonCriticalExtensionOptions=[],n},fromPartial(e){let n=d();return n.messages=e.messages?.map(e=>t.Any.fromPartial(e))||[],n.memo=e.memo??``,e.timeoutHeight!==void 0&&e.timeoutHeight!==null&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),n.extensionOptions=e.extensionOptions?.map(e=>t.Any.fromPartial(e))||[],n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>t.Any.fromPartial(e))||[],n}};function f(){return{signerInfos:[],fee:void 0,tip:void 0}}e.AuthInfo={typeUrl:`/cosmos.tx.v1beta1.AuthInfo`,encode(t,n=a.BinaryWriter.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),t.tip!==void 0&&e.Tip.encode(t.tip,n.uint32(26).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=f();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(r,r.uint32()));break;case 2:o.fee=e.Fee.decode(r,r.uint32());break;case 3:o.tip=e.Tip.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=f();return Array.isArray(t?.signerInfos)&&(n.signerInfos=t.signerInfos.map(t=>e.SignerInfo.fromJSON(t))),(0,o.isSet)(t.fee)&&(n.fee=e.Fee.fromJSON(t.fee)),(0,o.isSet)(t.tip)&&(n.tip=e.Tip.fromJSON(t.tip)),n},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),t.tip!==void 0&&(n.tip=t.tip?e.Tip.toJSON(t.tip):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],t.fee!==void 0&&t.fee!==null&&(n.fee=e.Fee.fromPartial(t.fee)),t.tip!==void 0&&t.tip!==null&&(n.tip=e.Tip.fromPartial(t.tip)),n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:BigInt(0)}}e.SignerInfo={typeUrl:`/cosmos.tx.v1beta1.SignerInfo`,encode(n,r=a.BinaryWriter.create()){return n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(10).fork()).ldelim(),n.modeInfo!==void 0&&e.ModeInfo.encode(n.modeInfo,r.uint32(18).fork()).ldelim(),n.sequence!==BigInt(0)&&r.uint32(24).uint64(n.sequence),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=p();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.publicKey=t.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=i.uint64();break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=p();return(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.modeInfo)&&(r.modeInfo=e.ModeInfo.fromJSON(n.modeInfo)),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),r},toJSON(n){let r={};return n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.modeInfo!==void 0&&(r.modeInfo=n.modeInfo?e.ModeInfo.toJSON(n.modeInfo):void 0),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),r},fromPartial(n){let r=p();return n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),n.modeInfo!==void 0&&n.modeInfo!==null&&(r.modeInfo=e.ModeInfo.fromPartial(n.modeInfo)),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),r}};function m(){return{single:void 0,multi:void 0}}e.ModeInfo={typeUrl:`/cosmos.tx.v1beta1.ModeInfo`,encode(t,n=a.BinaryWriter.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=m();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(r,r.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=m();return(0,o.isSet)(t.single)&&(n.single=e.ModeInfo_Single.fromJSON(t.single)),(0,o.isSet)(t.multi)&&(n.multi=e.ModeInfo_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=m();return t.single!==void 0&&t.single!==null&&(n.single=e.ModeInfo_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.ModeInfo_Multi.fromPartial(t.multi)),n}};function h(){return{mode:0}}e.ModeInfo_Single={typeUrl:`/cosmos.tx.v1beta1.Single`,encode(e,t=a.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=h();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.mode=n.int32();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=h();return(0,o.isSet)(e.mode)&&(t.mode=(0,n.signModeFromJSON)(e.mode)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,n.signModeToJSON)(e.mode)),t},fromPartial(e){let t=h();return t.mode=e.mode??0,t}};function g(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={typeUrl:`/cosmos.tx.v1beta1.Multi`,encode(t,n=a.BinaryWriter.create()){t.bitarray!==void 0&&r.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof a.BinaryReader?t:new a.BinaryReader(t),o=n===void 0?i.len:i.pos+n,s=g();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=r.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){let n=g();return(0,o.isSet)(t.bitarray)&&(n.bitarray=r.CompactBitArray.fromJSON(t.bitarray)),Array.isArray(t?.modeInfos)&&(n.modeInfos=t.modeInfos.map(t=>e.ModeInfo.fromJSON(t))),n},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?r.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=g();return t.bitarray!==void 0&&t.bitarray!==null&&(n.bitarray=r.CompactBitArray.fromPartial(t.bitarray)),n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function _(){return{amount:[],gasLimit:BigInt(0),payer:``,granter:``}}e.Fee={typeUrl:`/cosmos.tx.v1beta1.Fee`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==BigInt(0)&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.gasLimit=n.uint64();break;case 3:o.payer=n.string();break;case 4:o.granter=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=_();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.gasLimit)&&(t.gasLimit=BigInt(e.gasLimit.toString())),(0,o.isSet)(e.payer)&&(t.payer=String(e.payer)),(0,o.isSet)(e.granter)&&(t.granter=String(e.granter)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=(e.gasLimit||BigInt(0)).toString()),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=_();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],e.gasLimit!==void 0&&e.gasLimit!==null&&(t.gasLimit=BigInt(e.gasLimit.toString())),t.payer=e.payer??``,t.granter=e.granter??``,t}};function v(){return{amount:[],tipper:``}}e.Tip={typeUrl:`/cosmos.tx.v1beta1.Tip`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==``&&t.uint32(18).string(e.tipper),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.tipper=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=v();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.tipper)&&(t.tipper=String(e.tipper)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){let t=v();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.tipper=e.tipper??``,t}};function y(){return{address:``,signDoc:void 0,mode:0,sig:new Uint8Array}}e.AuxSignerData={typeUrl:`/cosmos.tx.v1beta1.AuxSignerData`,encode(t,n=a.BinaryWriter.create()){return t.address!==``&&n.uint32(10).string(t.address),t.signDoc!==void 0&&e.SignDocDirectAux.encode(t.signDoc,n.uint32(18).fork()).ldelim(),t.mode!==0&&n.uint32(24).int32(t.mode),t.sig.length!==0&&n.uint32(34).bytes(t.sig),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=y();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.address=r.string();break;case 2:o.signDoc=e.SignDocDirectAux.decode(r,r.uint32());break;case 3:o.mode=r.int32();break;case 4:o.sig=r.bytes();break;default:r.skipType(t&7);break}}return o},fromJSON(t){let r=y();return(0,o.isSet)(t.address)&&(r.address=String(t.address)),(0,o.isSet)(t.signDoc)&&(r.signDoc=e.SignDocDirectAux.fromJSON(t.signDoc)),(0,o.isSet)(t.mode)&&(r.mode=(0,n.signModeFromJSON)(t.mode)),(0,o.isSet)(t.sig)&&(r.sig=(0,o.bytesFromBase64)(t.sig)),r},toJSON(t){let r={};return t.address!==void 0&&(r.address=t.address),t.signDoc!==void 0&&(r.signDoc=t.signDoc?e.SignDocDirectAux.toJSON(t.signDoc):void 0),t.mode!==void 0&&(r.mode=(0,n.signModeToJSON)(t.mode)),t.sig!==void 0&&(r.sig=(0,o.base64FromBytes)(t.sig===void 0?new Uint8Array:t.sig)),r},fromPartial(t){let n=y();return n.address=t.address??``,t.signDoc!==void 0&&t.signDoc!==null&&(n.signDoc=e.SignDocDirectAux.fromPartial(t.signDoc)),n.mode=t.mode??0,n.sig=t.sig??new Uint8Array,n}}})),Bt=class{client;registry;constructor(e,t){this.client=e,this.registry=t}async resolveName(e){try{let{contract:t,getQueryMsg:n}=this.registry;return await this.client.queryContractSmart(t,n(e))}catch(e){console?.error(e);return}}};function Vt(e,t){return function(){return e.apply(t,arguments)}}m();var{toString:Ht}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:Wt,toStringTag:Gt}=Symbol,Kt=(e=>t=>{let n=Ht.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qt=e=>(e=e.toLowerCase(),t=>Kt(t)===e),Jt=e=>t=>typeof t===e,{isArray:Yt}=Array,Xt=Jt(`undefined`);function Zt(e){return e!==null&&!Xt(e)&&e.constructor!==null&&!Xt(e.constructor)&&tn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Qt=qt(`ArrayBuffer`);function $t(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qt(e.buffer),t}var en=Jt(`string`),tn=Jt(`function`),nn=Jt(`number`),rn=e=>typeof e==`object`&&!!e,an=e=>e===!0||e===!1,on=e=>{if(Kt(e)!==`object`)return!1;let t=Ut(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Gt in e)&&!(Wt in e)},sn=e=>{if(!rn(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},cn=qt(`Date`),ln=qt(`File`),un=e=>!!(e&&e.uri!==void 0),dn=e=>e&&e.getParts!==void 0,fn=qt(`Blob`),pn=qt(`FileList`),mn=e=>rn(e)&&tn(e.pipe);function hn(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:h===void 0?{}:h}var gn=hn(),_n=gn.FormData===void 0?void 0:gn.FormData,vn=e=>{if(!e)return!1;if(_n&&e instanceof _n)return!0;let t=Ut(e);if(!t||t===Object.prototype||!tn(e.append))return!1;let n=Kt(e);return n===`formdata`||n===`object`&&tn(e.toString)&&e.toString()===`[object FormData]`},yn=qt(`URLSearchParams`),[bn,xn,Sn,Cn]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(qt),wn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Tn(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),Yt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Zt(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function En(e,t){if(Zt(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Dn=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:h,On=e=>!Xt(e)&&e!==Dn;function kn(...e){let{caseless:t,skipUndefined:n}=On(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&En(r,i)||i,o=Vn(r,a)?r[a]:void 0;on(o)&&on(e)?r[a]=kn(o,e):on(e)?r[a]=kn({},e):Yt(e)?r[a]=e.slice():(!n||!Xt(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++)e[t]&&Tn(e[t],i);return r}var An=(e,t,n,{allOwnKeys:r}={})=>(Tn(t,(t,r)=>{n&&tn(t)?Object.defineProperty(e,r,{__proto__:null,value:Vt(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),jn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Nn=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Ut(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Pn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Fn=e=>{if(!e)return null;if(Yt(e))return e;let t=e.length;if(!nn(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},In=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Ut(Uint8Array)),Ln=(e,t)=>{let n=(e&&e[Wt]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Rn=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zn=qt(`HTMLFormElement`),Bn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Vn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Hn=qt(`RegExp`),Un=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Tn(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Wn=e=>{Un(e,(t,n)=>{if(tn(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(tn(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Gn=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Yt(e)?r(e):r(String(e).split(t)),n},Kn=()=>{},qn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Jn(e){return!!(e&&tn(e.append)&&e[Gt]===`FormData`&&e[Wt])}var Yn=e=>{let t=Array(10),n=(e,r)=>{if(rn(e)){if(t.indexOf(e)>=0)return;if(Zt(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=Yt(e)?[]:{};return Tn(e,(e,t)=>{let a=n(e,r+1);!Xt(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Xn=qt(`AsyncFunction`),Zn=e=>e&&(rn(e)||tn(e))&&tn(e.then)&&tn(e.catch),Qn=((e,t)=>e?setImmediate:t?((e,t)=>(Dn.addEventListener(`message`,({source:n,data:r})=>{n===Dn&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Dn.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,tn(Dn.postMessage)),V={isArray:Yt,isArrayBuffer:Qt,isBuffer:Zt,isFormData:vn,isArrayBufferView:$t,isString:en,isNumber:nn,isBoolean:an,isObject:rn,isPlainObject:on,isEmptyObject:sn,isReadableStream:bn,isRequest:xn,isResponse:Sn,isHeaders:Cn,isUndefined:Xt,isDate:cn,isFile:ln,isReactNativeBlob:un,isReactNative:dn,isBlob:fn,isRegExp:Hn,isFunction:tn,isStream:mn,isURLSearchParams:yn,isTypedArray:In,isFileList:pn,forEach:Tn,merge:kn,extend:An,trim:wn,stripBOM:jn,inherits:Mn,toFlatObject:Nn,kindOf:Kt,kindOfTest:qt,endsWith:Pn,toArray:Fn,forEachEntry:Ln,matchAll:Rn,isHTMLForm:zn,hasOwnProperty:Vn,hasOwnProp:Vn,reduceDescriptors:Un,freezeMethods:Wn,toObjectSet:Gn,toCamelCase:Bn,noop:Kn,toFiniteNumber:qn,findKey:En,global:Dn,isContextDefined:On,isSpecCompliantForm:Jn,toJSONObject:Yn,isAsyncFn:Xn,isThenable:Zn,setImmediate:Qn,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Dn):o!==void 0&&o.nextTick||Qn,isIterable:e=>e!=null&&tn(e[Wt])},$n=V.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),er=e=>{let t={},n,r,i;return e&&e.split(`
|
|
3
3
|
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&$n[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},tr=Symbol(`internals`),nr=/[^\x09\x20-\x7E\x80-\xFF]/g;function rr(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function ir(e){return e&&String(e).trim().toLowerCase()}function ar(e){return rr(e.replace(nr,``))}function or(e){return e===!1||e==null?e:V.isArray(e)?e.map(or):ar(String(e))}function sr(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var cr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lr(e,t,n,r,i){if(V.isFunction(r))return r.call(this,t,n);if(i&&(t=n),V.isString(t)){if(V.isString(r))return t.indexOf(r)!==-1;if(V.isRegExp(r))return r.test(t)}}function ur(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function dr(e,t){let n=V.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var fr=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=ir(t);if(!i)throw Error(`header name must be a non-empty string`);let a=V.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=or(e))}let a=(e,t)=>V.forEach(e,(e,n)=>i(e,n,t));if(V.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(V.isString(e)&&(e=e.trim())&&!cr(e))a(er(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n={},r,i;for(let t of e){if(!V.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?V.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=ir(e),e){let n=V.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return sr(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=ir(e),e){let n=V.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||lr(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=ir(e),e){let i=V.findKey(n,e);i&&(!t||lr(n,n[i],i,t))&&(delete n[i],r=!0)}}return V.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||lr(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return V.forEach(this,(r,i)=>{let a=V.findKey(n,i);if(a){t[a]=or(r),delete t[i];return}let o=e?ur(i):String(i).trim();o!==i&&delete t[i],t[o]=or(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return V.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&V.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
4
4
|
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[tr]=this[tr]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=ir(e);t[r]||(dr(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}};fr.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),V.reduceDescriptors(fr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),V.freezeMethods(fr);var pr=`[REDACTED ****]`;function mr(e){if(V.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(V.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function hr(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||V.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof fr&&(e=e.toJSON()),r.push(e);let t;if(V.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);V.isUndefined(r)||(t[n]=r)});else{if(!V.isPlainObject(e)&&mr(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?pr:i(a);V.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var H=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&V.hasOwnProp(e,`redact`)?e.redact:void 0,n=V.isArray(t)&&t.length>0?hr(e,t):V.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};H.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,H.ERR_BAD_OPTION=`ERR_BAD_OPTION`,H.ECONNABORTED=`ECONNABORTED`,H.ETIMEDOUT=`ETIMEDOUT`,H.ECONNREFUSED=`ECONNREFUSED`,H.ERR_NETWORK=`ERR_NETWORK`,H.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,H.ERR_DEPRECATED=`ERR_DEPRECATED`,H.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,H.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,H.ERR_CANCELED=`ERR_CANCELED`,H.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,H.ERR_INVALID_URL=`ERR_INVALID_URL`,H.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`,_();function gr(e){return V.isPlainObject(e)||V.isArray(e)}function _r(e){return V.endsWith(e,`[]`)?e.slice(0,-2):e}function vr(e,t,n){return e?e.concat(t).map(function(e,t){return e=_r(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function yr(e){return V.isArray(e)&&!e.some(gr)}var br=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function xr(e,t,n){if(!V.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!V.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&V.isSpecCompliantForm(t);if(!V.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!l&&V.isBlob(e))throw new H(`Blob is not supported. Use a Buffer instead.`);return V.isArrayBuffer(e)||V.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):v.from(e):e}function d(e,n,i){let s=e;if(V.isReactNative(t)&&V.isReactNativeBlob(e))return t.append(vr(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(V.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&yr(e)||(V.isFileList(e)||V.endsWith(n,`[]`))&&(s=V.toArray(e)))return n=_r(n),s.forEach(function(e,r){!(V.isUndefined(e)||e===null)&&t.append(o===!0?vr([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return gr(e)?!0:(t.append(vr(i,n,a),u(e)),!1)}let f=[],p=Object.assign(br,{defaultVisitor:d,convertValue:u,isVisitable:gr});function m(e,n,r=0){if(!V.isUndefined(e)){if(r>c)throw new H(`Object is too deeply nested (`+r+` levels). Max depth: `+c,H.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),V.forEach(e,function(e,a){(!(V.isUndefined(e)||e===null)&&i.call(t,e,V.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!V.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function Sr(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Cr(e,t){this._pairs=[],e&&xr(e,this,t)}var wr=Cr.prototype;wr.append=function(e,t){this._pairs.push([e,t])},wr.toString=function(e){let t=e?function(t){return e.call(this,t,Sr)}:Sr;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Tr(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Er(e,t,n){if(!t)return e;let r=n&&n.encode||Tr,i=V.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):V.isURLSearchParams(t)?t.toString():new Cr(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Dr=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){V.forEach(this.handlers,function(t){t!==null&&e(t)})}},Or={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},kr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Cr,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Ar=r({hasBrowserEnv:()=>jr,hasStandardBrowserEnv:()=>Nr,hasStandardBrowserWebWorkerEnv:()=>Pr,navigator:()=>Mr,origin:()=>Fr}),jr=typeof window<`u`&&typeof document<`u`,Mr=typeof navigator==`object`&&navigator||void 0,Nr=jr&&(!Mr||[`ReactNative`,`NativeScript`,`NS`].indexOf(Mr.product)<0),Pr=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Fr=jr&&window.location.href||`http://localhost`,Ir={...Ar,...kr};function Lr(e,t){return xr(e,new Ir.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ir.isNode&&V.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Rr(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function zr(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Br(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&V.isArray(r)?r.length:a,s?(V.hasOwnProp(r,a)?r[a]=V.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!r[a]||!V.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&V.isArray(r[a])&&(r[a]=zr(r[a])),!o)}if(V.isFormData(e)&&V.isFunction(e.entries)){let n={};return V.forEachEntry(e,(e,r)=>{t(Rr(e),r,n,0)}),n}return null}var Vr=(e,t)=>e!=null&&V.hasOwnProp(e,t)?e[t]:void 0;function Hr(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Ur={transitional:Or,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=V.isObject(e);if(i&&V.isHTMLForm(e)&&(e=new FormData(e)),V.isFormData(e))return r?JSON.stringify(Br(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Vr(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Lr(e,t).toString();if((a=V.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Vr(this,`env`),r=n&&n.FormData;return xr(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Hr(e)):e}],transformResponse:[function(e){let t=Vr(this,`transitional`)||Ur.transitional,n=t&&t.forcedJSONParsing,r=Vr(this,`responseType`),i=r===`json`;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Vr(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?H.from(e,H.ERR_BAD_RESPONSE,this,null,Vr(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ir.classes.FormData,Blob:Ir.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};V.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{Ur.headers[e]={}});function Wr(e,t){let n=this||Ur,r=t||n,i=fr.from(r.headers),a=r.data;return V.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Gr(e){return!!(e&&e.__CANCEL__)}var Kr=class extends H{constructor(e,t,n){super(e??`canceled`,H.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function qr(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new H(`Request failed with status code `+n.status,n.status>=400&&n.status<500?H.ERR_BAD_REQUEST:H.ERR_BAD_RESPONSE,n.config,n.request,n))}function Jr(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function Yr(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Xr(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Zr=(e,t,n=3)=>{let r=0,i=Yr(50,250);return Xr(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Qr=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},$r=e=>(...t)=>V.asap(()=>e(...t)),ei=Ir.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ir.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ir.origin),Ir.navigator&&/(msie|trident)/i.test(Ir.navigator.userAgent)):()=>!0,ti=Ir.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];V.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),V.isString(r)&&s.push(`path=${r}`),V.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),V.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)return decodeURIComponent(r.slice(i+1))}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function ni(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function ri(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function ii(e,t,n){let r=!ni(t);return e&&(r||n===!1)?ri(e,t):t}var ai=e=>e instanceof fr?{...e}:e;function oi(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function i(e,t,n,i){if(!V.isUndefined(t))return r(e,t,n,i);if(!V.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!V.isUndefined(t))return r(void 0,t)}function o(e,t){if(!V.isUndefined(t))return r(void 0,t);if(!V.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(V.hasOwnProp(t,a))return r(n,i);if(V.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(ai(e),ai(t),n,!0)};return V.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=V.hasOwnProp(c,r)?c[r]:i,o=a(V.hasOwnProp(e,r)?e[r]:void 0,V.hasOwnProp(t,r)?t[r]:void 0,r);V.isUndefined(o)&&a!==s||(n[r]=o)}),n}var si=[`content-type`,`content-length`];function ci(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{si.includes(t.toLowerCase())&&e.set(t,n)})}var li=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),ui=e=>{let t=oi({},e),n=e=>V.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=fr.from(s),t.url=Er(ii(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?li(c.password):``))),V.isFormData(r)&&(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):V.isFunction(r.getHeaders)&&ci(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Ir.hasStandardBrowserEnv&&(V.isFunction(i)&&(i=i(t)),i===!0||i==null&&ei(t.url))){let e=a&&o&&ti.read(o);e&&s.set(a,e)}return t},di=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=ui(e),i=r.data,a=fr.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=fr.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());qr(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new H(`Request aborted`,H.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new H(t&&t.message?t.message:`Network Error`,H.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Or;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new H(t,i.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&V.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),V.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Zr(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Zr(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Kr(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Jr(r.url);if(_&&!Ir.protocols.includes(_)){n(new H(`Unsupported protocol `+_+`:`,H.ERR_BAD_REQUEST,e));return}h.send(i||null)})},fi=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof H?t:new Kr(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new H(`timeout of ${t}ms exceeded`,H.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>V.asap(o),s}},pi=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},mi=async function*(e,t){for await(let n of hi(e))yield*pi(n,t)},hi=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},gi=(e,t,n,r)=>{let i=mi(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};_();function _i(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n<t;n++)if(r.charCodeAt(n)===37&&n+2<t){let t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(v!==void 0&&typeof v.byteLength==`function`)return v.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var vi=`1.16.0`,yi=64*1024,{isFunction:bi}=V,xi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Si=e=>{let t=V.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=V.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?bi(i):typeof fetch==`function`,c=bi(a),l=bi(o);if(!s)return!1;let u=s&&bi(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&xi(()=>{let e=!1,t=new a(Ir.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&xi(()=>V.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new H(`Response type '${e}' is not supported`,H.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e))return(await new a(Ir.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(V.isArrayBufferView(e)||V.isArrayBuffer(e))return e.byteLength;if(V.isURLSearchParams(e)&&(e+=``),V.isString(e))return(await d(e)).byteLength},g=async(e,t)=>V.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=ui(e),w=V.isNumber(S)&&S>-1,T=V.isNumber(C)&&C>-1,E=i||fetch;v=v?(v+``).toLowerCase():`text`;let D=fi([l,u&&u.toAbortSignal()],d),O=null,k=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),A;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&_i(t)>S)throw new H(`maxContentLength size of `+S+` exceeded`,H.ERR_BAD_RESPONSE,e,O);if(T&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new H(`Request body larger than maxBodyLength limit`,H.ERR_BAD_REQUEST,e,O)}if(_&&f&&n!==`get`&&n!==`head`&&(A=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(V.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=Qr(A,Zr($r(_)));s=gi(e.body,yi,t,n)}}V.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;if(V.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+vi,!1);let l={...x,signal:D,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:`half`,credentials:i?b:void 0};O=c&&new a(t,l);let u=await(c?E(O,x):E(t,l));if(w){let t=V.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new H(`maxContentLength size of `+S+` exceeded`,H.ERR_BAD_RESPONSE,e,O)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&k)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=V.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&Qr(n,Zr($r(h),!0))||[],a=0;u=new o(gi(u.body,yi,t=>{if(w&&(a=t,a>S))throw new H(`maxContentLength size of `+S+` exceeded`,H.ERR_BAD_RESPONSE,e,O);r&&r(t)},()=>{i&&i(),k&&k()}),t)}v||=`text`;let j=await m[V.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(j!=null&&(typeof j.byteLength==`number`?t=j.byteLength:typeof j.size==`number`?t=j.size:typeof j==`string`&&(t=typeof r==`function`?new r().encode(j).byteLength:j.length)),typeof t==`number`&&t>S)throw new H(`maxContentLength size of `+S+` exceeded`,H.ERR_BAD_RESPONSE,e,O)}return!d&&k&&k(),await new Promise((t,n)=>{qr(t,n,{data:j,headers:fr.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(k&&k(),D&&D.aborted&&D.reason instanceof H){let n=D.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new H(`Network Error`,H.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t}):H.from(t,t&&t.code,e,O,t&&t.response)}}},Ci=new Map,wi=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Ci;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Si(t)),l=c;return c};wi();var Ti={http:null,xhr:di,fetch:{get:wi}};V.forEach(Ti,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Ei=e=>`- ${e}`,Di=e=>V.isFunction(e)||e===null||e===!1;function Oi(e,t){e=V.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Di(r)&&(i=Ti[(n=String(r)).toLowerCase()],i===void 0))throw new H(`Unknown adapter '${n}'`);if(i&&(V.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new H(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
5
5
|
`+e.map(Ei).join(`
|
|
@@ -17,10 +17,10 @@ ${e.length}`;return`0x`+tt(He(new TextEncoder().encode(t+e)),`base16`)}async fun
|
|
|
17
17
|
Required: ${o.toString()}
|
|
18
18
|
Approved: ${s.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(`:`)||r)return;let i=Af(t[e].accounts);i.includes(e)||(r=K(`NON_CONFORMING_NAMESPACES`,`${n} namespaces accounts don't satisfy namespace accounts for ${e}
|
|
19
19
|
Required: ${e}
|
|
20
|
-
Approved: ${i.toString()}`))}),o.forEach(e=>{r||(Pu(i[e].methods,a[e].methods)?Pu(i[e].events,a[e].events)||(r=K(`NON_CONFORMING_NAMESPACES`,`${n} namespaces events don't satisfy namespace events for ${e}`)):r=K(`NON_CONFORMING_NAMESPACES`,`${n} namespaces methods don't satisfy namespace methods for ${e}`))}),r}function xp(e){let t={};return Object.keys(e).forEach(n=>{n.includes(`:`)?t[n]=e[n]:e[n].chains?.forEach(r=>{t[r]={methods:e[n].methods,events:e[n].events}})}),t}function Sp(e){return[...new Set(e.map(e=>e.includes(`:`)?e.split(`:`)[0]:e))]}function Cp(e){let t={};return Object.keys(e).forEach(n=>{n.includes(`:`)?t[n]=e[n]:Af(e[n].accounts)?.forEach(r=>{t[r]={accounts:e[n].accounts.filter(e=>e.includes(`${r}:`)),methods:e[n].methods,events:e[n].events}})}),t}function wp(e,t){return Kf(e,!1)&&e<=t.max&&e>=t.min}function Tp(){let e=Tu();return new Promise(t=>{switch(e){case yu.browser:t(Ep());break;case yu.reactNative:t(Dp());break;case yu.node:t(Op());break;default:t(!0)}})}function Ep(){return wu()&&navigator?.onLine}async function Dp(){return xu()&&typeof h<`u`&&h?.NetInfo?(await h?.NetInfo.fetch())?.isConnected:!0}function Op(){return!0}function kp(e){switch(Tu()){case yu.browser:Ap(e);break;case yu.reactNative:jp(e);break;case yu.node:break}}function Ap(e){!xu()&&wu()&&(window.addEventListener(`online`,()=>e(!0)),window.addEventListener(`offline`,()=>e(!1)))}function jp(e){xu()&&typeof h<`u`&&h?.NetInfo&&h?.NetInfo.addEventListener(t=>e(t?.isConnected))}function Mp(){return wu()&&(0,ct.getDocument)()?(0,ct.getDocument)()?.visibilityState===`visible`:!0}var Np={},Pp=class{static get(e){return Np[e]}static set(e,t){Np[e]=t}static delete(e){delete Np[e]}};function Fp(e){let t=Oe.decode(e);if(t.length<33)throw Error(`Too short to contain a public key`);return t.slice(1,33)}function Ip({publicKey:e,signature:t,payload:n}){let r=Rp(n.method),i=128|parseInt(n.version?.toString()||`4`),a=Bp(n.address),o=n.era===`00`?new Uint8Array([0]):Rp(n.era);if(o.length!==1&&o.length!==2)throw Error(`Invalid era length`);let s=parseInt(n.nonce,16),c=new Uint8Array([s&255,s>>8&255]),l=Hp(BigInt(`0x${zp(n.tip)}`)),u=new Uint8Array([0,...e,a,...t,...o,...c,...l,...r]),d=Vp(u.length+1);return new Uint8Array([...d,i,...u])}function Lp(e){return`0x`+tt((0,du.blake2b)(Rp(e),void 0,32),`base16`)}function Rp(e){return new Uint8Array(e.replace(/^0x/,``).match(/.{1,2}/g).map(e=>parseInt(e,16)))}function zp(e){return e.startsWith(`0x`)?e.slice(2):e}function Bp(e){let t=Oe.decode(e)[0];return t===42?0:t===60?2:1}function Vp(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([t&255,t>>8&255])}else if(e<1<<30){let t=e<<2|2;return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}else throw Error(`Compact encoding > 2^30 not supported`)}function Hp(e){if(e<1n<<6n)return new Uint8Array([Number(e<<2n)]);if(e<1n<<14n){let t=e<<2n|1n;return new Uint8Array([Number(t&255n),Number(t>>8n&255n)])}else if(e<1n<<30n){let t=e<<2n|2n;return new Uint8Array([Number(t&255n),Number(t>>8n&255n),Number(t>>16n&255n),Number(t>>24n&255n)])}else throw Error(`BigInt compact encoding not supported > 2^30`)}function Up(e){let t=Rp(e.signature);return Lp(tt(Ip({publicKey:Fp(e.transaction.address),signature:t,payload:e.transaction}),`base16`))}function Wp({logger:e,name:t}){let n=typeof e==`string`?uu({opts:{level:e,name:t}}).logger:e;return n.level=typeof e==`string`?e:e.level,n}var Gp=`cosmiframe`,Kp=`cosmiframe_keystorechange`,qp=class{_mutable;actions;_env;logger;constructor(){this._mutable={state:U.Init}}get env(){return this._env}setEnv(e){this._env=e}setActions=e=>{this.actions=e};get isMobile(){return this.env?.device===`mobile`}get mutable(){return this._mutable}get state(){return this.mutable.state}get isInit(){return this.state===`Init`}get isDone(){return this.state===`Done`}get isError(){return this.state===`Error`}get isPending(){return this.state===`Pending`}get data(){return this.mutable.data}get message(){return this.mutable.message}setState(e){this.logger?.debug(`[State Change] ${this.state} (${this.walletStatus}) -> ${e} (${this.chainName}/${this.walletName})`),this._mutable.state=e,this.actions?.state?.(e)}setData(e){this._mutable.data=e,this.actions?.data?.(e)}setMessage(e){this.logger?.debug(`[Message Set] ${e} (${this.chainName}/${this.walletName})`),this._mutable.message=e,this.actions?.message?.(e)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init)}get walletStatus(){return na(this.state,this.message)}get isWalletOnceConnect(){return this.isWalletConnected||this.isWalletError}get isWalletConnecting(){return this.walletStatus===`Connecting`}get isWalletConnected(){return this.walletStatus===`Connected`}get isWalletDisconnected(){return this.walletStatus===`Disconnected`}get isWalletRejected(){return this.walletStatus===`Rejected`}get isWalletNotExist(){return this.walletStatus===`NotExist`}get isWalletError(){return this.walletStatus===`Error`}},Jp=class extends qp{clientMutable={state:U.Init};emitter;_walletInfo;callbacks;session;walletConnectOptions;isActive=!1;throwErrors=!1;constructor(e){super(),this._walletInfo=e}get appUrl(){return this.client?.appUrl}get qrUrl(){return this.client?.qrUrl}activate(){this.isActive=!0}inactivate(){this.isActive=!1}get client(){return this.clientMutable?.data}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0}initClientError(e){this.logger?.error(`${this.walletPrettyName} initClientError: ${e?.message}`),this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.isModeExtension?this.setClientNotExist():this.setError(`InitClientError: ${e.message}`)}get walletInfo(){return this._walletInfo}get isModeExtension(){return this.walletInfo.mode===`extension`}get isModeWalletConnect(){return this.walletInfo.mode===`wallet-connect`}get downloadInfo(){let e=this.walletInfo.downloads||[];return e=e.filter(e=>e.device===this.env?.device||!e.device),e.length===1||(e=e.filter(e=>e.os===this.env?.os||!e.os),e.length===1)||(e=e.filter(e=>e.browser===this.env?.browser||!e.browser)),e[0]}get walletName(){return this.walletInfo.name}get walletPrettyName(){return this.walletInfo.prettyName}get rejectMessageSource(){return typeof this.walletInfo.rejectMessage==`string`?this.walletInfo.rejectMessage:this.walletInfo.rejectMessage?.source}get rejectMessageTarget(){if(typeof this.walletInfo.rejectMessage!=`string`)return this.walletInfo.rejectMessage?.target}get rejectCode(){return this.walletInfo.rejectCode}rejectMatched(e){return this.rejectMessageSource&&e.message===this.rejectMessageSource||this.rejectCode&&e.code===this.rejectCode}updateCallbacks(e){this.callbacks={...this.callbacks,...e}}_disconnect=async(e,t)=>{await this.callbacks?.beforeDisconnect?.(),await this.client?.disconnect?.(t),this.clientMutable.state!==U.Error&&this.reset(),this.walletName!==`cosmiframe`&&window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`),e&&(this.emitter?.emit(`sync_disconnect`,this.chainName),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")),await this.callbacks?.afterDisconnect?.()};disconnect=async(e,t)=>{await this._disconnect(e,t)};setClientNotExist(e){let t=e===void 0?Error():e;t.message=Yi.message,this.setError(t)}setRejected(e){let t=e===void 0?Error():e;t.message=Xi.message,this.setError(t)}setError(e){let t=typeof e==`string`||e===void 0?Error(e):e;if(this.setState(U.Error),this.setMessage(t.message),this.throwErrors===!0||this.throwErrors===`connect_only`&&t.name===`ConnectError`)throw t}connect=async e=>{await this.callbacks?.beforeConnect?.();let t=typeof this.walletInfo.mobileDisabled==`boolean`?this.walletInfo.mobileDisabled:this.walletInfo.mobileDisabled();if(this.isMobile&&t){this.setError(new $i(`This wallet is not supported on mobile, please use desktop browsers.`));return}e&&(this.emitter?.emit(`sync_connect`,this.chainName),this.logger?.debug(`[Event Emit] \`sync_connect\` (${this.chainName}/${this.walletName})`));try{if(!this.client&&(this.setState(U.Pending),this.setMessage(`InitClient`),await this.initClient(this.walletInfo.mode===`wallet-connect`?this.walletConnectOptions:void 0),this.emitter?.emit(`broadcast_client`,this.client),this.logger?.debug("[WALLET EVENT] Emit `broadcast_client`"),!this.client)){this.setClientNotExist(new $i);return}await this.update()}catch(e){this.setError(new $i(e.message))}await this.callbacks?.afterConnect?.()}},Yp=class extends Jp{mainWallet;chainRecord;_rpcEndpoint;_restEndpoint;connectChains;offlineSigner;namespace=`cosmos`;preferredSignType;constructor(e,t){super(e),this.chainRecord=t,this.preferredSignType=t.clientOptions?.preferredSignType||`amino`}get chain(){return this.chainRecord.chain}get assetList(){return this.chainRecord.assetList}get isTestNet(){return this.chainName.includes(`testnet`)}get preferredEndpoints(){return this.chainRecord.preferredEndpoints}get rpcEndpoints(){return this.preferredEndpoints?.rpc||[]}get restEndpoints(){return this.preferredEndpoints?.rest||[]}get isLazy(){return this.preferredEndpoints.isLazy}addEndpoints(e){this.chainRecord.preferredEndpoints={isLazy:e?.isLazy??this.preferredEndpoints?.isLazy,rpc:[...e?.rpc||[],...this.preferredEndpoints?.rpc||[]],rest:[...e?.rest||[],...this.preferredEndpoints?.rest||[]]}}get chainName(){return this.chainRecord.name}get chainLogoUrl(){return this.assetList?.assets[0]?.logo_URIs?.svg||this.assetList?.assets[0]?.logo_URIs?.png||void 0}get stargateOptions(){return this.chainRecord.clientOptions?.stargate}get signingStargateOptions(){return this.chainRecord.clientOptions?.signingStargate||this.chainRecord.clientOptions?.stargate}get signingCosmwasmOptions(){return this.chainRecord.clientOptions?.signingCosmwasm}get assets(){return this.assetList?.assets}get chainId(){return this.chain?.chain_id}get cosmwasmEnabled(){return this.chain?.codebase?.cosmwasm_enabled}get username(){return this.data?.username}get address(){return this.data?.address}setData(e){this.logger?.debug(`[Data Change] ${JSON.stringify(this.data)} -> ${JSON.stringify(e)} (${this.chainName}/${this.walletName})`),this._mutable.data=e,this.actions?.data?.(e);let t=window.localStorage.getItem(`cosmos-kit@2:core//accounts`),n=t?JSON.parse(t):[];e===void 0?n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace):(n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace),n.push(e)),window?.localStorage.setItem(`cosmos-kit@2:core//accounts`,JSON.stringify(n)),this.session?.update()}initClient(e){throw Error(`initClient not implemented`)}async update(e={connect:!0}){this.setState(U.Pending),this.setMessage(void 0);try{e.connect&&(this.connectChains?await this.connectChains():await this?.client?.connect?.(this.chainId));let t;try{this.logger?.debug(`Fetching ${this.walletName} ${this.chainId} account.`),t=await this?.client?.getSimpleAccount(this.chainId)}catch(e){if(this.rejectMatched(e)){this.logger?.debug(`Fetching rejected.`),this.setRejected(new $i);return}if(this.client&&this?.client?.addChain)this.logger?.debug(`Going to add chain ${this.chainId}`),await this.client.addChain(this.chainRecord),t=await this.client.getSimpleAccount(this.chainId);else throw e}this.setData(t),this.setState(U.Done),this.setMessage(void 0)}catch(e){e&&this.rejectMatched(e)?this.setRejected(new $i):this.setError(new $i(e.message))}!this.isWalletRejected&&this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}getRpcEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-BZw-E_uE.js`);return{getIsLazy:e}},[]),n=t(void 0,this.isLazy,this._rpcEndpoint?.isLazy,e,this.logger);if(n)return this._rpcEndpoint||this.rpcEndpoints[0]||Promise.reject(`No endpoint available.`);let{isValidEndpoint:r}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-BZw-E_uE.js`);return{isValidEndpoint:e}},[]);if(this._rpcEndpoint&&await r(this._rpcEndpoint,`rpc`,n,this.logger))return this._rpcEndpoint;let{getFastestEndpoint:i}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-BZw-E_uE.js`);return{getFastestEndpoint:e}},[]);return this._rpcEndpoint=await i(this.rpcEndpoints,`rpc`,this.logger),this._rpcEndpoint};getRestEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-BZw-E_uE.js`);return{getIsLazy:e}},[]),n=t(void 0,this.isLazy,this._restEndpoint?.isLazy,e,this.logger);if(n)return this._restEndpoint||this.restEndpoints[0]||Promise.reject(`No endpoint available.`);let r=`rest`,{isValidEndpoint:i}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-BZw-E_uE.js`);return{isValidEndpoint:e}},[]);if(this._restEndpoint&&await i(this._restEndpoint,r,n,this.logger))return this._restEndpoint;let{getFastestEndpoint:a}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-BZw-E_uE.js`);return{getFastestEndpoint:e}},[]);return this._restEndpoint=await a(this.restEndpoints,r,this.logger),this._restEndpoint};getStargateClient=async()=>{let e=await this.getRpcEndpoint(),{StargateClient:t}=await g(async()=>{let{StargateClient:e}=await import(`./build-C1Hp5nre.js`).then(e=>i(e.t()));return{StargateClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t.connect(e,this.stargateOptions)};getCosmWasmClient=async()=>{let e=await this.getRpcEndpoint(),{CosmWasmClient:t}=await g(async()=>{let{CosmWasmClient:e}=await import(`./build--8alOb1B.js`).then(e=>i(e.default));return{CosmWasmClient:e}},__vite__mapDeps([10,1,2,3,4,5,6,7,0,8,9]));return t.connect(e)};getNameService=async()=>{let e=await this.getCosmWasmClient(),{getNameServiceRegistryFromChainName:t}=await g(async()=>{let{getNameServiceRegistryFromChainName:e}=await import(`./utils-BZw-E_uE.js`);return{getNameServiceRegistryFromChainName:e}},[]),n=t(this.chainName),{NameService:r}=await g(async()=>{let{NameService:e}=await import(`./name-service-DcUMyI0A.js`);return{NameService:e}},[]);return new r(e,n)};async initOfflineSigner(e){if(this.client===void 0)throw Error(`WalletClient is not initialized`);e&&(this.preferredSignType=e),this.offlineSigner=await this.client.getOfflineSigner(this.chainId,this.preferredSignType)}getSigningStargateClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningStargateClient:t}=await g(async()=>{let{SigningStargateClient:e}=await import(`./build-C1Hp5nre.js`).then(e=>i(e.t()));return{SigningStargateClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t.connectWithSigner(e,this.offlineSigner,this.signingStargateOptions)};getSigningCosmWasmClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningCosmWasmClient:t}=await g(async()=>{let{SigningCosmWasmClient:e}=await import(`./build--8alOb1B.js`).then(e=>i(e.default));return{SigningCosmWasmClient:e}},__vite__mapDeps([10,1,2,3,4,5,6,7,0,8,9]));return t.connectWithSigner(e,this.offlineSigner,this.signingCosmwasmOptions)};getSigningClient=async e=>{switch(e){case`stargate`:return await this.getSigningStargateClient();case`cosmwasm`:return await this.getSigningCosmWasmClient();default:return this.getSigningStargateClient()}};estimateFee=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let a;switch(t){case`stargate`:a=this.signingStargateOptions?.gasPrice;break;case`cosmwasm`:a=this.signingCosmwasmOptions?.gasPrice;break;default:a=this.signingStargateOptions?.gasPrice;break}if(!a)throw Error(`Gas price must be set in the client options when auto gas is used.`);let o=await(await this.getSigningClient(t)).simulate(this.address,e,n),{calculateFee:s}=await g(async()=>{let{calculateFee:e}=await import(`./build-C1Hp5nre.js`).then(e=>i(e.t()));return{calculateFee:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return s(Math.round(o*(r||1.4)),a)};sign=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let i=await this.getSigningClient(r),a;return a=t===void 0||typeof t==`number`?await this.estimateFee(e,r,n,t):t,await i.sign(this.address,e,a,n||``)};broadcast=async(e,t)=>{let n=await this.getSigningClient(t),{TxRaw:r}=await g(async()=>{let{TxRaw:e}=await import(`./tx-DhHYzooK.js`).then(e=>i(e.default));return{TxRaw:e}},[]),a=r.encode(e).finish(),o,s;switch(t){case`stargate`:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break;case`cosmwasm`:o=this.signingCosmwasmOptions?.broadcastTimeoutMs,s=this.signingCosmwasmOptions?.broadcastPollIntervalMs;break;default:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break}return n.broadcastTx(a,o,s)};signAndBroadcast=async(e,t,n,r)=>{let i=await this.sign(e,t,n,r);return this.broadcast(i,r)}},Xp=class extends Jp{_chainWalletMap;preferredEndpoints;ChainWallet;constructor(e,t){super(e),this.ChainWallet=t,this.emitter=new ot.default,this.emitter.on(`broadcast_client`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_client\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}),this.emitter.on(`broadcast_env`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_env\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.setEnv(e)})}),this.emitter.on(`sync_connect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_connect\` (${this.walletName})`),await this.connectAll(!0,e),this.update()}),this.emitter.on(`sync_disconnect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_disconnect\` (${this.walletName})`),await this.disconnectAll(!0,e),this.reset()}),this.emitter.on(`reset`,e=>{this.logger?.debug(`[Event Fired] \`reset\` (${this.walletName})`),e.forEach(e=>Array.from(this.chainWalletMap.values()).find(t=>t.chainId===e)?.reset())})}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0,this.actions?.clientState?.(U.Pending),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(e=>{e.initingClient()})}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0,this.actions?.clientState?.(U.Done),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}initClientError(e){if(this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.actions?.clientState?.(U.Error),this.actions?.clientMessage?.(e?.message),this.chainWalletMap?.forEach(t=>{t.initClientError(e)}),this.throwErrors===!0)throw Error(this.clientMutable.message)}onSetChainsDone(){}makeFinalEndpoints(e){let t=e.name.includes(`testnet`);return{isLazy:e.preferredEndpoints?.isLazy,rpc:[...e.preferredEndpoints?.rpc||[],...this.preferredEndpoints?.[e.name]?.rpc||[],...e.chain?.apis?.rpc?.map(e=>e.address)||[],t?`https://rpc.testcosmos.directory/${e.name}`:`https://rpc.cosmos.directory/${e.name}`],rest:[...e.preferredEndpoints?.rest||[],...this.preferredEndpoints?.[e.name]?.rest||[],...e.chain?.apis?.rest?.map(e=>e.address)||[],t?`https://rest.testcosmos.directory/${e.name}`:`https://rest.cosmos.directory/${e.name}`]}}addEnpoints(e){this.getChainWalletList(!1).forEach(t=>{t.addEndpoints(e[t.chainName])})}setChains(e,t=!0){(t||!this._chainWalletMap)&&(this._chainWalletMap=new Map),e.forEach(e=>{let t=new this.ChainWallet(this.walletInfo,{...e,preferredEndpoints:this.makeFinalEndpoints(e)});t.mainWallet=this,t.emitter=this.emitter,t.logger=this.logger,t.throwErrors=this.throwErrors,t.session=this.session,t.walletConnectOptions=this.walletConnectOptions,t.initClient=this.initClient,this._chainWalletMap.set(e.name,t)}),this.onSetChainsDone()}get chainWalletMap(){return this._chainWalletMap}getChainWallet=e=>this.chainWalletMap?.get(e);getChainWalletList=(e=!0)=>{let t=Array.from(this.chainWalletMap.values());return e?t.filter(e=>e.isActive):t};getGlobalStatusAndMessage=(e=!0)=>{let t=this.getChainWalletList(e),n=t.find(e=>e.isWalletNotExist);return n?[n.walletStatus,n.message]:(n=t.find(e=>e.isWalletConnecting),n?[ta.Connecting,void 0]:(n=t.find(e=>e.isWalletDisconnected),n?[ta.Disconnected,`Exist disconnected wallets`]:(n=t.find(e=>e.isError||e.isWalletRejected),n?[n.walletStatus,n.message]:[ta.Connected,void 0])))};async update(){if(this.walletStatus===`NotExist`)return window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`);this.setData(void 0),this.setMessage(void 0),this.setState(U.Done),this.activate(),this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init),this.inactivate()}async connectAll(e=!0,t){let n=this.getChainWalletList(e);if(!(n.length>0&&n.every(e=>e.isModeWalletConnect&&e.connectChains)))for(let e of n)e.chainName!==t&&await e.connect()}async disconnectAll(e=!0,t,n){let r=this.getChainWalletList(e);for(let e of r)e.chainName!==t&&await e.disconnect(!1,n)}},Zp=class extends Yp{constructor(e,t){super(e,t)}},Qp=class{cosmiframe;constructor(e){this.cosmiframe=e}async getSimpleAccount(...e){return await this.cosmiframe.p.getSimpleAccount(...e)}async connect(...e){return await this.cosmiframe.p.connect(...e)}async enable(...e){await this.cosmiframe.p.enable(...e)}async suggestToken(...e){await this.cosmiframe.p.suggestToken(...e)}async addChain(...e){let t=e[0];t&&`clientOptions`in t&&(t={...t,clientOptions:{}},e[0]=t),await this.cosmiframe.p.addChain(...e)}async getAccount(...e){return await this.cosmiframe.p.getAccount(...e)}getOfflineSigner(e,t){return t===`direct`?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return this.cosmiframe.getOfflineSignerAmino(e)}getOfflineSignerDirect(e){return this.cosmiframe.getOfflineSignerDirect(e)}async sign(...e){return await this.cosmiframe.p.sign(...e)}async signAmino(...e){return await this.cosmiframe.p.signAmino(...e)}async signDirect(...e){return await this.cosmiframe.p.signDirect(...e)}async signArbitrary(...e){return await this.cosmiframe.p.signArbitrary(...e)}async getEnigmaPubKey(...e){return await this.cosmiframe.p.getEnigmaPubKey(...e)}async getEnigmaTxEncryptionKey(...e){return await this.cosmiframe.p.getEnigmaTxEncryptionKey(...e)}async enigmaEncrypt(...e){return await this.cosmiframe.p.enigmaEncrypt(...e)}async enigmaDecrypt(...e){return await this.cosmiframe.p.enigmaDecrypt(...e)}async sendTx(...e){return await this.cosmiframe.p.sendTx(...e)}},$p=Object.defineProperty,em=(e,t,n)=>t in e?$p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tm=(e,t)=>$p(e,`name`,{value:t,configurable:!0}),nm=(e,t,n)=>(em(e,typeof t==`symbol`?t:t+``,n),n),rm=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},im=(e,t,n)=>(rm(e,t,`read from private field`),n?n.call(e):t.get(e)),am=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},om=(e,t,n,r)=>(rm(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),sm=class extends Error{constructor(e){super(e),this.name=`CosmiframeTimeoutError`}};tm(sm,`CosmiframeTimeoutError`);var cm=sm,lm=tm((e,t,n)=>new Promise((r,i)=>{let a=null,o=_a(),s=tm(({origin:e,source:n,data:c})=>{!fm(t,e)||n!==window.parent||c.id!==o||(window.removeEventListener(`message`,s),a!==null&&clearTimeout(a),c.type===`success`?r({result:c.response,origin:e}):i(Error(c.error)))},`listener`);window.addEventListener(`message`,s);try{let t={...e,id:o};window.parent.postMessage(t,`*`)}catch(e){window.removeEventListener(`message`,s),i(e)}n&&(a=setTimeout(()=>{window.removeEventListener(`message`,s),i(new cm(`Timed out after ${n}ms waiting for parent to respond.`))},n))}),`callParentMethod`),um=tm(e=>{if(!e||e.type===`error`)return{type:`error`,error:e&&e.type===`error`&&e.error||`Handled by outer wallet.`};if(e.type===`success`)return{type:`success`,response:e.value}},`processOverrideHandler`),dm=tm(()=>typeof window<`u`&&window.self!==window.parent,`isInIframe`),fm=tm((e,t)=>e.some(e=>e===`*`||typeof e==`string`&&t===e||e instanceof RegExp&&e.test(t)),`isOriginAllowed`),pm,mm=class{constructor(e,t){nm(this,`chainId`),am(this,pm,void 0),this.chainId=e,om(this,pm,t)}async getAccounts(){return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},im(this,pm))).result}async signDirect(e,t){return(await lm({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},im(this,pm))).result}};pm=new WeakMap,tm(mm,`CosmiframeDirectSigner`);var hm=mm,gm,_m=class{constructor(e,t){nm(this,`chainId`),am(this,gm,void 0),this.chainId=e,om(this,gm,t)}async getAccounts(){return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},im(this,gm))).result}async signAmino(e,t){return(await lm({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},im(this,gm))).result}};gm=new WeakMap,tm(_m,`CosmiframeAminoSigner`);var vm=_m,ym,bm=class{constructor(e,t){nm(this,`chainId`),am(this,ym,void 0),this.chainId=e,om(this,ym,t)}async getAccounts(){try{return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},im(this,ym))).result}catch{return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},im(this,ym))).result}}async signDirect(e,t){return(await lm({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},im(this,ym))).result}async signAmino(e,t){return(await lm({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},im(this,ym))).result}};ym=new WeakMap,tm(bm,`CosmiframeEitherSigner`);var xm=bm,Sm;(function(e){e.IsCosmiframe=`isCosmiframe`,e.GetMetadata=`getMetadata`})(Sm||={});var Cm,wm=class{constructor(e){if(am(this,Cm,void 0),nm(this,`p`),!e.length)throw Error(`You must explicitly allow parent origins.`);if(e.includes(`*`))throw Error("It is very unsafe to allow all origins because a controlling app has the power to manipulate messages before they are signed. If you really want to do this, pass in `UNSAFE_ALLOW_ANY_ORIGIN`.");om(this,Cm,e.includes(`UNSAFE_ALLOW_ANY_ORIGIN`)?[`*`]:[...e]),this.p=new Proxy({getEnigmaUtils:e=>({getPubkey:()=>this.p.getEnigmaPubKey(e),decrypt:(...t)=>this.p.enigmaDecrypt(e,...t),encrypt:(...t)=>this.p.enigmaEncrypt(e,...t),getTxEncryptionKey:(...t)=>this.p.getEnigmaTxEncryptionKey(e,...t)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)})}callParentMethod(e,t){return lm(e,im(this,Cm),t)}async isReady(){if(!dm())return!1;try{let{origin:e,result:t}=await this.callParentMethod({internal:!0,method:Sm.IsCosmiframe,params:[]},500);return e||t}catch(e){if(e instanceof cm)return!1;throw e}}async getMetadata(){return(await this.callParentMethod({internal:!0,method:Sm.GetMetadata,params:[]},500)).result}getKeplrClient(){let e=new Proxy({version:`cosmiframe`,mode:`extension`,defaultOptions:{},getOfflineSigner:this.getOfflineSigner.bind(this),getOfflineSignerOnlyAmino:this.getOfflineSignerAmino.bind(this),getOfflineSignerAuto:e=>Promise.resolve(this.getOfflineSigner(e)),getEnigmaUtils:t=>({getPubkey:()=>e.getEnigmaPubKey(t),decrypt:(...n)=>e.enigmaDecrypt(t,...n),encrypt:(...n)=>e.enigmaEncrypt(t,...n),getTxEncryptionKey:(...n)=>e.getEnigmaTxEncryptionKey(t,...n)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)});return e}getOfflineSigner(e){return new xm(e,im(this,Cm))}getOfflineSignerAmino(e){return new vm(e,im(this,Cm))}getOfflineSignerDirect(e){return new hm(e,im(this,Cm))}static listen(e){let{iframe:t,target:n,getOfflineSignerDirect:r,getOfflineSignerAmino:i,nonSignerOverrides:a,signerOverrides:o,origins:s,metadata:c}=e,l=s?.length?s:[`*`],u={[Sm.IsCosmiframe]:()=>!0,[Sm.GetMetadata]:()=>c||null},d=tm(async({source:e,origin:s,data:c})=>{if(!t.contentWindow)throw Error(`Iframe contentWindow does not exist.`);if(e!==t.contentWindow||!fm(l,s)||!c||typeof c!=`object`||!(`id`in c)||!(`method`in c)||!(`params`in c))return;let{id:d,params:f,chainId:p,signType:m,internal:h}=c,{method:g,signerType:_}=c;_||=m,g=g.replace(/^signer:/,``);let v;try{if(h){if(typeof u[g]!=`function`)throw Error(`Unknown internal method: ${g}`);v={type:`success`,response:await u[g](...f)}}else if(_){if(!p)throw Error(`Missing chainId in signer message request`);let e=typeof o==`function`?await o(p):o;if(e&&g in e){let t=um(await e[g](...f));t&&(v=t)}if(!v){let e=_===`direct`?await r(p):await i(p);if(!(g in e)||typeof e[g]!=`function`)throw Error(`No ${_} signer method '${g}' for chain ID '${p}'.`);v={type:`success`,response:await e[g](...f)}}}else{let e=typeof a==`function`?await a():a;if(e&&g in e){let t=um(await e[g](...f));t&&(v=t)}if(!v){if(!(g in n)||typeof n[g]!=`function`)throw Error(`No method '${g}' on target.`);v={type:`success`,response:await n[g](...f)}}}}catch(e){v={type:`error`,error:e instanceof Error?e.message:`${e}`}}t.contentWindow?.postMessage({...v,id:d},s)},`listener`);return window.addEventListener(`message`,d),()=>window.removeEventListener(`message`,d)}};Cm=new WeakMap,tm(wm,`Cosmiframe`);var Tm=wm,Em=class extends Xp{constructor(e){super(e,Zp)}get walletInfo(){return this._walletInfo}async initClient(){this.initingClient();let e=new Tm(this.walletInfo.allowedParentOrigins);if(!await e.isReady()){this.initClientError(Error(`Failed to detect Cosmiframe parent of allowed origin wrapping this app in an iframe.`));return}let t=await e.getMetadata();t?.name&&typeof t.name==`string`&&(this.walletInfo.prettyName=t.name),t?.imageUrl&&typeof t.imageUrl==`string`&&(this.walletInfo.logo=t.imageUrl),this.initClientDone(new Qp(e))}},Dm={name:Gp,prettyName:`Cosmiframe`,logo:`data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGZpbGw9IiM5MzkzOTMiCiAgICBkPSJNOC4xNCAxMC45NmMtLjA5LjMzLS4xNC42OC0uMTQgMS4wNCAwIDEuMS40NSAyLjEgMS4xNyAyLjgzbC0xLjQyIDEuNDJDNi42NyAxNS4xNiA2IDEzLjY2IDYgMTJjMC0uOTMuMjEtMS44LjU4LTIuNTlMNS4xMSA3Ljk0QzQuNCA5LjEzIDQgMTAuNTIgNCAxMmMwIDIuMjEuOSA0LjIxIDIuMzUgNS42NWwtMS40MiAxLjQyQzMuMTIgMTcuMjYgMiAxNC43NiAyIDEyYzAtMi4wNC42MS0zLjkzIDEuNjYtNS41MUwxLjM5IDQuMjIgMi44IDIuODFsMTguMzggMTguMzgtMS40MSAxLjQxTDguMTQgMTAuOTZ6bTkuMjggMy42M2MuMzctLjc5LjU4LTEuNjYuNTgtMi41OSAwLTEuNjYtLjY3LTMuMTYtMS43Ni00LjI0bC0xLjQyIDEuNDJDMTUuNTUgOS45IDE2IDEwLjkgMTYgMTJjMCAuMzYtLjA1LjcxLS4xNCAxLjA0bDEuNTYgMS41NXpNMjAgMTJjMCAxLjQ4LS40IDIuODctMS4xMSA0LjA2bDEuNDUgMS40NUMyMS4zOSAxNS45MyAyMiAxNC4wNCAyMiAxMmMwLTIuNzYtMS4xMi01LjI2LTIuOTMtNy4wN2wtMS40MiAxLjQyQzE5LjEgNy43OSAyMCA5Ljc5IDIwIDEyeiI+PC9wYXRoPgo8L3N2Zz4=`,mode:`extension`,mobileDisabled:!1,rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[Kp],allowedParentOrigins:[]},Om=e=>new Em({...Dm,allowedParentOrigins:e}),km=i(a(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.bowser=r():n.bowser=r()})(e,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||``},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||``},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case`NT`:return`NT`;case`XP`:return`XP`;case`NT 5.0`:return`2000`;case`NT 5.1`:return`XP`;case`NT 5.2`:return`2003`;case`NT 6.0`:return`Vista`;case`NT 6.1`:return`7`;case`NT 6.2`:return`8`;case`NT 6.3`:return`8.1`;case`NT 10.0`:return`10`;default:return}},e.getMacOSVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),t[0]===10)switch(t[1]){case 5:return`Leopard`;case 6:return`Snow Leopard`;case 7:return`Lion`;case 8:return`Mountain Lion`;case 9:return`Mavericks`;case 10:return`Yosemite`;case 11:return`El Capitan`;case 12:return`Sierra`;case 13:return`High Sierra`;case 14:return`Mojave`;case 15:return`Catalina`;default:return}},e.getAndroidVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?`Cupcake`:t[0]===1&&t[1]>=6?`Donut`:t[0]===2&&t[1]<2?`Eclair`:t[0]===2&&t[1]===2?`Froyo`:t[0]===2&&t[1]>2?`Gingerbread`:t[0]===3?`Honeycomb`:t[0]===4&&t[1]<1?`Ice Cream Sandwich`:t[0]===4&&t[1]<4?`Jelly Bean`:t[0]===4&&t[1]>=4?`KitKat`:t[0]===5?`Lollipop`:t[0]===6?`Marshmallow`:t[0]===7?`Nougat`:t[0]===8?`Oreo`:t[0]===9?`Pie`:void 0},e.getVersionPrecision=function(e){return e.split(`.`).length},e.compareVersions=function(t,n,r){r===void 0&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+Array(n+1).join(`.0`);return e.map(r.split(`.`),(function(e){return Array(20-e.length).join(`0`)+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),--o;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;--o}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];typeof e==`object`&&e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||``},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":`amazon_silk`,"Android Browser":`android`,Bada:`bada`,BlackBerry:`blackberry`,Chrome:`chrome`,Chromium:`chromium`,Electron:`electron`,Epiphany:`epiphany`,Firefox:`firefox`,Focus:`focus`,Generic:`generic`,"Google Search":`google_search`,Googlebot:`googlebot`,"Internet Explorer":`ie`,"K-Meleon":`k_meleon`,Maxthon:`maxthon`,"Microsoft Edge":`edge`,"MZ Browser":`mz`,"NAVER Whale Browser":`naver`,Opera:`opera`,"Opera Coast":`opera_coast`,PhantomJS:`phantomjs`,Puffin:`puffin`,QupZilla:`qupzilla`,QQ:`qq`,QQLite:`qqlite`,Safari:`safari`,Sailfish:`sailfish`,"Samsung Internet for Android":`samsung_internet`,SeaMonkey:`seamonkey`,Sleipnir:`sleipnir`,Swing:`swing`,Tizen:`tizen`,"UC Browser":`uc`,Vivaldi:`vivaldi`,"WebOS Browser":`webos`,WeChat:`wechat`,"Yandex Browser":`yandex`,Roku:`roku`},t.BROWSER_MAP={amazon_silk:`Amazon Silk`,android:`Android Browser`,bada:`Bada`,blackberry:`BlackBerry`,chrome:`Chrome`,chromium:`Chromium`,electron:`Electron`,epiphany:`Epiphany`,firefox:`Firefox`,focus:`Focus`,generic:`Generic`,googlebot:`Googlebot`,google_search:`Google Search`,ie:`Internet Explorer`,k_meleon:`K-Meleon`,maxthon:`Maxthon`,edge:`Microsoft Edge`,mz:`MZ Browser`,naver:`NAVER Whale Browser`,opera:`Opera`,opera_coast:`Opera Coast`,phantomjs:`PhantomJS`,puffin:`Puffin`,qupzilla:`QupZilla`,qq:`QQ Browser`,qqlite:`QQ Browser Lite`,safari:`Safari`,sailfish:`Sailfish`,samsung_internet:`Samsung Internet for Android`,seamonkey:`SeaMonkey`,sleipnir:`Sleipnir`,swing:`Swing`,tizen:`Tizen`,uc:`UC Browser`,vivaldi:`Vivaldi`,webos:`WebOS Browser`,wechat:`WeChat`,yandex:`Yandex Browser`},t.PLATFORMS_MAP={tablet:`tablet`,mobile:`mobile`,desktop:`desktop`,tv:`tv`},t.OS_MAP={WindowsPhone:`Windows Phone`,Windows:`Windows`,MacOS:`macOS`,iOS:`iOS`,Android:`Android`,WebOS:`WebOS`,BlackBerry:`BlackBerry`,Bada:`Bada`,Tizen:`Tizen`,Linux:`Linux`,ChromeOS:`Chrome OS`,PlayStation4:`PlayStation 4`,Roku:`Roku`},t.ENGINE_MAP={EdgeHTML:`EdgeHTML`,Blink:`Blink`,Trident:`Trident`,Presto:`Presto`,Gecko:`Gecko`,WebKit:`WebKit`}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.default=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(t===void 0&&(t=!1),typeof e!=`string`)throw Error(`UserAgent should be a string`);return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:`BROWSER_MAP`,get:function(){return a.BROWSER_MAP}},{key:`ENGINE_MAP`,get:function(){return a.ENGINE_MAP}},{key:`OS_MAP`,get:function(){return a.OS_MAP}},{key:`PLATFORMS_MAP`,get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(t===void 0&&(t=!1),e==null||e===``)throw Error(`UserAgent parameter can't be empty`);this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||``:this.getBrowser().name||``},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||``:t||``},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){e===void 0&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||``:t||``},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||``:this.getEngine().name||``},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];typeof o==`string`?(i[t]=o,a+=1):typeof o==`object`&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(l!==void 0)return l}var u=s.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(d!==void 0)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(p!==void 0)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){t===void 0&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if(typeof i==`string`)return e[0]===`>`||e[0]===`<`?(n=e.substr(1),e[1]===`=`?(r=!0,n=e.substr(2)):t=[],e[0]===`>`?t.push(1):t.push(-1)):e[0]===`=`?n=e.substr(1):e[0]===`~`&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return t===void 0&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return e===void 0&&(e=[]),e.some((function(e){return t.is(e)}))},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:`Googlebot`},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:`Samsung Internet for Android`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:`NAVER Whale Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:`MZ Browser`},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:`Focus`},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:`Swing`},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:`Opera Coast`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:`Opera Touch`},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:`Yandex Browser`},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:`UC Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:`Maxthon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:`Epiphany`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:`Puffin`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:`Sleipnir`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:`K-Meleon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:`WeChat`},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?`QQ Browser Lite`:`QQ Browser`},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:`Internet Explorer`},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:`Vivaldi`},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:`SeaMonkey`},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:`Sailfish`},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:`Amazon Silk`},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:`PhantomJS`},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:`SlimerJS`},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:`BlackBerry`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:`WebOS Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:`Bada`},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:`Tizen`},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:`QupZilla`},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:`Firefox`},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:`Electron`},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:`Miui`},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:`Chromium`},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:`Chrome`},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:`Google Search`},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:`Android Browser`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:`PlayStation 4`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:`Safari`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=e.search(`\\(`)===-1?/^(.*)\/(.*) /:/^(.*)\/(.*)[ \t]\((.*)/;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,`.`),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,`.`);return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:`bot`,vendor:`Google`}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&`Nova`,n={type:a.PLATFORMS_MAP.mobile,vendor:`Huawei`};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Nexus`}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`,model:`Kindle Fire HD 7`}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:`Apple`,model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Nexus`}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName(!0)===`blackberry`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`BlackBerry`}}},{test:function(e){return e.getBrowserName(!0)===`bada`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName()===`windows phone`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Microsoft`}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(`.`)[0]);return e.getOSName(!0)===`android`&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return e.getOSName(!0)===`android`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getOSName(!0)===`macos`},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:`Apple`}}},{test:function(e){return e.getOSName(!0)===`windows`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`linux`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`playstation 4`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`roku`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:function(e){return e.getBrowserName(!0)===`microsoft edge`},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}})}))}))());_();var Am=(e,t)=>{let n=[];for(let t of e)n.push(`${t.port_id}/${t.channel_id}`);let r=`${n.join(`/`)}/${t}`;return`ibc/`+v.from(new Uint8Array(new st.sha256().update(v.from(r)).digest())).toString(`hex`).toUpperCase()},jm=(e,t,n)=>e.find(e=>e.chain_1.chain_name===n&&e.chain_2.chain_name===t),Mm=(e,t,n)=>jm(e,t,n)||jm(e,n,t),Nm=e=>e.channels.find(e=>e.chain_1.port_id===`transfer`&&e.chain_2.port_id===`transfer`),Pm=e=>e.channels.find(e=>e.chain_1.port_id.startsWith(`wasm.`)&&e.chain_2.port_id===`transfer`||e.chain_1.port_id===`transfer`&&e.chain_2.port_id.startsWith(`wasm`)),Fm=(e,t,n,r,i)=>{let a=Mm(e,t,n);if(!a)return[];let o=i.startsWith(`cw20:`)?Pm(a):Nm(a);if(!o)return[];let s;s=a.chain_1.chain_name===t?o.chain_1:o.chain_2;let c=[s],l=r.find(({chain_name:e})=>e===n);if(!l)return c;let u=l.assets.find(e=>e.base===i);if(!u)return c;let d=u.traces?.filter?.(e=>e.type===`ibc`||e.type===`ibc-cw20`)??[];if(!d.length)return c;d.length;let[f]=d;return[...c,...Fm(e,n,f.counterparty.chain_name,r,f.counterparty.base_denom)]},Im=(e,t,n,r,i)=>{let a=Mm(e,t,n);if(a){if(!(i.startsWith(`cw20:`)?Pm(a):Nm(a)))return;let o=Fm(e,t,n,r,i),s=r.find(({chain_name:e})=>e===n);if(!s)return Am(o,i);let c=s.assets.find(e=>e.base===i);return c?Am(o,(c.traces?.find?.(e=>e.type===`ibc`))?.counterparty?.base_denom??c.base):Am(o,i)}},Lm=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u={...l,assets:l.assets.filter(e=>!(l.chain_name===`carbon`&&e.base.startsWith(`ibc/`)))}.assets.filter(e=>!e.base.startsWith(`cw20:`)).map(r=>{let i=Im(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a}),d=Nm(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{e[t.chain.chain_name]=e[t.chain.chain_name]||[];let n=t.assets.map(e=>{try{return{...e,traces:[{type:`ibc`,counterparty:{channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),r={...t,assets:n};return e[t.chain.chain_name].push(r),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Rm=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u=l.assets.filter(e=>e.base.startsWith(`cw20:`)).map(r=>{let i=Im(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a});if(!u.length)return;let d=Pm(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{let n=t;e[n.chain.chain_name]=e[n.chain.chain_name]||[];let r=n.assets.map(e=>{try{return{...e,traces:[{type:`ibc-cw20`,counterparty:{port:t.counterparty.port_id,channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{port:t.chain.port_id,channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),i={...t,assets:r};return e[t.chain.chain_name].push(i),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},zm=(e,t,n)=>{let r=Lm(e,t,n),i=Rm(e,t,n);return r.reduce((e,t)=>{let n=t.chain_name,r=[...t.assets],a=i.find(e=>e.chain_name===n);return a&&[].push.apply(r,a.assets),[{chain_name:n,assets:r},...e]},[])},Bm=class{chainName;fetcher;_chain;_assetList;_assetLists;_ibcData=[];constructor(e){this.chainName=e.chainName,this.fetcher=e.fetcher,this.refresh()}refresh(){this._assetList=this.fetcher.getChainAssetList(this.chainName),this._ibcData=this.fetcher.getChainIbcData(this.chainName),this._chain=this.fetcher.getChain(this.chainName);let e=this._ibcData.reduce((e,t)=>(e.includes(t.chain_1.chain_name)||e.push(t.chain_1.chain_name),e.includes(t.chain_2.chain_name)||e.push(t.chain_2.chain_name),e),[]);this._assetLists=this.fetcher.assetLists.filter(t=>e.includes(t.chain_name))}get chain(){return this._chain}get nativeAssetList(){return this._assetList}get assetLists(){return zm(this.chainName,this._ibcData,this._assetLists)}};s();function Vm(e){e===``&&(e=`.`);var t=e.charAt(0)===`/`;e=Wm(e);for(var n=e.split(`/`),r=[],i=0;i<n.length;i++){var a=n[i];a!==`.`&&(a===`..`&&(t||!t&&r.length>0&&r[0]!==`..`)?r.pop():r.push(a))}if(!t&&r.length<2)switch(r.length){case 1:r[0]===``&&r.unshift(`.`);break;default:r.push(`.`)}return e=r.join(`/`),t&&e.charAt(0)!==`/`&&(e=`/`+e),e}function Hm(e,t=``){if(e===``)return e;e=Vm(e);var n=e.split(`/`),r=n[n.length-1];return r===``&&n.length>1?n[n.length-2]:t.length>0&&r.substr(r.length-t.length)===t?r.substr(0,r.length-t.length):r}var Um=RegExp(`//+`,`g`);function Wm(e){return e=e.replace(Um,`/`),e}var Gm=e=>(0,ut.default)(e).then(e=>{if(e.status>=400)throw Error(`Bad response`);return e.json()}),Km=class{urls=[];_assetLists=[];_chains=[];_ibcData=[];chainInfoList=[];constructor(e={}){e.chains&&(this._chains=e.chains),e.assetLists&&(this._assetLists=e.assetLists),e.ibcData&&(this._ibcData=e.ibcData),e.urls&&(this.urls=e.urls)}get chains(){return this._chains}get assetLists(){return this._assetLists}get ibcData(){return this._ibcData}getChain(e){return this._chains.find(t=>t.chain_name===e)}getChainAssetList(e){return this._assetLists.find(t=>t.chain_name===e)}getGeneratedAssetLists(e){return zm(e,this._ibcData,this._assetLists)}getChainIbcData(e){return this._ibcData.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e)}getChainInfo(e){let t=this.chainInfoList.find(t=>t.chainName===e);return t||(t=new Bm({chainName:e,fetcher:this}),this.chainInfoList.push(t)),t}upsertChain(e){if(!this._chains.find(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type)){this._chains.push(e);return}this._chains=this._chains.map(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type?e:t)}updateAssetList(e){if(!this._assetLists.find(t=>t.chain_name===e.chain_name)){this._assetLists.push(e);return}this._assetLists=this._assetLists.map(t=>t.chain_name===e.chain_name?e:t)}upsertIbcData(e){if(!this._ibcData.find(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name)){this._ibcData.push(e);return}this._ibcData=this._ibcData.map(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name?e:t)}update(e){if(!e.$schema)throw Error(`not a registered JSON schema type`);switch(Hm(e.$schema,`.schema.json`)){case`chain`:this.upsertChain(e);break;case`assetlist`:this.updateAssetList(e);break;case`ibc_data`:this.upsertIbcData(e);break;default:throw Error(`unknown schema type`)}this.chainInfoList.forEach(e=>{e.refresh()})}async fetch(e){let t=await Gm(e);this.update(t)}async fetchUrls(){return Promise.all(this.urls.map(e=>this.fetch(e)))}},qm=class extends qp{isActive=!1;chainRecord;_wallets;namespace=`cosmos`;session;repelWallet=!0;callbackOptions;fetchInfo=!1;constructor(e,t=[]){if(super(),this.chainRecord=e,this._wallets=t,this.repelWallet&&this.wallets.forEach(e=>{e.updateCallbacks({...e.callbacks,beforeConnect:async()=>{this.wallets.forEach(async t=>{!t.isWalletDisconnected&&t!==e&&await t.disconnect(!1,this.callbackOptions?.beforeConnect?.disconnect)})}})}),!this.chainRecord.chain){this.fetchInfo=!0;let t=new Km({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/chain.json`]});t.fetchUrls().then(()=>{this.chainRecord.chain=t.getChain(e.name),this.actions?.render?.(e=>e+1)}).catch(t=>{this.chainRecord.chain=null,this.logger?.warn(`Failed to fetch chain info for chain ${e.name}: [${t.name}] ${t.message}`)})}if(!this.chainRecord.assetList){this.fetchInfo=!0;let t=new Km({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/assetlist.json`]});t.fetchUrls().then(()=>{this.chainRecord.assetList=t.getChainAssetList(e.name)}).catch(t=>{this.chainRecord.assetList=null,this.logger?.warn(`Failed to fetch assetList info for chain ${e.name}: [${t.name}] ${t.message}`)})}this.fetchInfo&&this._wallets.forEach(e=>e.chainRecord=this.chainRecord)}setCallbackOptions(e){this.callbackOptions=e}setEnv(e){this._env=e,this.wallets.forEach(t=>t.setEnv(e))}activate(){this.isActive=!0,this.wallets.forEach(e=>e.activate())}get chainName(){return this.chainRecord.name}get chainLogo(){return this.chainRecord.assetList?.assets[0]?.logo_URIs?.svg||this.chainRecord.assetList?.assets[0]?.logo_URIs?.png||void 0}get wallets(){return this._wallets}get platformEnabledWallets(){return this.isMobile?this._wallets.filter(e=>typeof e.walletInfo.mobileDisabled==`boolean`?!e.walletInfo.mobileDisabled:!e.walletInfo.mobileDisabled()):this._wallets}get isSingleWallet(){return this.wallets.length===1}get current(){if(!this.repelWallet){this.logger.warn("when `repelWallet` is set false, `current` is always undefined.");return}return this.wallets.find(e=>!e.isWalletNotExist&&!e.isWalletDisconnected)}getWallet=e=>this.wallets.find(t=>t.walletName===e);openView=()=>{this.actions?.viewWalletRepo?.(this),this.actions?.viewOpen?.(!0)};closeView=()=>{this.actions?.viewOpen?.(!1)};connect=async(e,t=!0)=>{e?await this.getWallet(e)?.connect(t):this.openView()};disconnect=async(e,t=!0,n)=>{e?await this.getWallet(e)?.disconnect(t,n):await this.current.disconnect(t,n)};getRpcEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRpcEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid RPC endpoint for chain ${this.chainName}!`)};getRestEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRestEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid REST endpoint for chain ${this.chainName}!`)};getStargateClient=async()=>{for(let e of this.wallets)try{return await e.getStargateClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getCosmWasmClient=async()=>{for(let e of this.wallets)try{return await e.getCosmWasmClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getNameService=async()=>{for(let e of this.wallets)try{return await e.getNameService()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint or name service is not registered for chain ${this.chainName}.`)}},Jm=class extends qp{chainRecords=[];walletRepos=[];defaultNameService=`icns`;mainWallets=[];coreEmitter;walletConnectOptions;session;repelWallet=!0;isLazy;throwErrors;subscribeConnectEvents;cosmiframeEnabled;_reconnectMap={};constructor(e,t,n,r,i=!0,a=[/^https?:\/\/localhost(:\d+)?/,/^https:\/\/(.+\.)?osmosis\.zone/,/^https:\/\/(.+\.)?daodao\.zone/,/^https:\/\/.+-da0da0\.vercel\.app/,/^https:\/\/(.+\.)?abstract\.money/],o,s,c,l,u,d){super(),this.throwErrors=r,this.subscribeConnectEvents=i,this.coreEmitter=new ot.default,this.logger=n,s&&(this.defaultNameService=s),this.session=new ca({duration:18e5,callback:()=>{this.mainWallets.forEach(e=>e.disconnectAll(!1)),window?.localStorage.removeItem(`cosmos-kit@2:core//accounts`),window?.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`)},...d}),this.walletConnectOptions=c,this.cosmiframeEnabled=dm()&&!!a?.length,t=[...this.cosmiframeEnabled?[Om(a)]:[],...t],t.forEach(({walletName:e})=>this._reconnectMap[e]=()=>this._reconnect(e,!0)),this.init(e,o,t,c,l,u)}init(e,t,n,r,i,a){this.logger.info(`${e.length} chains and ${n.length} wallets are provided!`),this.isLazy=a?.isLazy,this.chainRecords=e.map(e=>{let n=typeof e==`string`?e:e.chain_name;return Ji(e,t,i,a?.endpoints?.[n],this.isLazy,this.logger)}),this.mainWallets=n.map(e=>(e.logger=this.logger,e.throwErrors=this.throwErrors,e.session=this.session,e.walletConnectOptions=this.walletConnectOptions,e?.setChains(this.chainRecords),e)),this.chainRecords.forEach((e,t)=>{let r=new qm(e,n.map(({getChainWallet:t})=>t(e.name)));r.logger=this.logger,r.repelWallet=this.repelWallet,r.session=this.session,this.walletRepos.push(r),r.fetchInfo&&(this.chainRecords[t]=r.chainRecord)}),this.checkEndpoints(a?.endpoints)}checkEndpoints(e){Object.keys(e||{}).map(e=>{this.chainRecords.findIndex(t=>t.name===e)===-1&&this.logger?.warn(`You are providing endpointOptions with unrecognized chain NAME ${e} (NOT found such chain in ChainProvider property "chains")`)})}setWalletRepel(e){this.repelWallet=e,this.walletRepos.forEach(t=>t.repelWallet=e),window?.localStorage.setItem(`cosmos-kit@2:core//repel-wallet`,e.toString())}addEndpoints=e=>{this.mainWallets.forEach(t=>{t.addEnpoints(e)})};addChains=(e,t,n,r)=>{let i=e.map(e=>{let i=typeof e==`string`?e:e.chain_name;return Ji(e,t,n,r?.[i],this.isLazy,this.logger)});i.forEach(e=>{let t=this.chainRecords.findIndex(t=>t.name===e.name);t==-1?this.chainRecords.push(e):this.chainRecords[t]=e}),this.checkEndpoints(r),this.mainWallets.forEach(e=>{e.setChains(i,!1)}),i.forEach((e,t)=>{let n=new qm(e,this.mainWallets.map(({getChainWallet:t})=>t(e.name)));n.setActions({viewOpen:this.actions?.viewOpen,viewWalletRepo:this.actions?.viewWalletRepo}),n.wallets.forEach(e=>{e.setActions({data:this.actions?.data,state:this.actions?.state,message:this.actions?.message})}),n.logger=this.logger,n.repelWallet=this.repelWallet,n.session=this.session,n.fetchInfo&&(this.chainRecords[t]=n.chainRecord);let r=this.walletRepos.findIndex(e=>e.chainName===n.chainName);r==-1?this.walletRepos.push(n):this.walletRepos[r]=n})};on=(e,t)=>{this.coreEmitter.on(e,t)};off=(e,t)=>{this.coreEmitter.off(e,t)};get activeRepos(){return this.walletRepos.filter(e=>e.isActive===!0)}getMainWallet=e=>{let t=this.mainWallets.find(t=>t.walletName===e);if(!t)throw new Qi(e);return t};getWalletRepo=e=>{let t=this.walletRepos.find(t=>t.chainName===e);if(!t)throw Error(`Chain ${e} is not provided.`);return t};getChainWallet=(e,t)=>{let n=this.getMainWallet(t).getChainWallet(e);if(!n)throw Error(`${e} is not provided!`);return n};getChainRecord=e=>{let t=this.chainRecords.find(t=>t.name===e);if(!t)throw Error(`${e} is not provided!`);return t};getChainLogo=e=>{let t=this.getChainRecord(e);return t?.assetList?.assets[0]?.logo_URIs?.svg||t?.assetList?.assets[0]?.logo_URIs?.png||void 0};getNameService=async e=>{let t;if(e)t=e;else{if(!this.defaultNameService)throw Error(`defaultNameService is undefined`);let{getNameServiceRegistryFromName:e}=await g(async()=>{let{getNameServiceRegistryFromName:e}=await import(`./utils-BZw-E_uE.js`);return{getNameServiceRegistryFromName:e}},[]),n=e(this.defaultNameService);if(!n)throw Error(`Unknown defaultNameService `+this.defaultNameService);t=n.chainName}return await this.getWalletRepo(t).getNameService()};_reconnect=async(e,t=!1,n)=>{t&&this.getMainWallet(e)?.isWalletDisconnected||(this.logger?.debug("[Event Emit] `refresh_connection` (manager)"),this.coreEmitter.emit(`refresh_connection`),await this.getMainWallet(e).connect(),await Promise.all(this.getMainWallet(e).getChainWalletList(!0).map((e,t)=>n?n.includes(e.chainName)?e.connect(!1):void 0:t===0?e.connect(!0):void 0)))};_restoreAccounts=async()=>{let e=this.cosmiframeEnabled?Gp:window.localStorage.getItem(`cosmos-kit@2:core//current-wallet`);if(e)try{let t=this.getMainWallet(e);t.activate();let n;if(t.clientMutable.state===U.Done){let e=window.localStorage.getItem(`cosmos-kit@2:core//accounts`);if(e&&e!==`[]`){let r=JSON.parse(e).flatMap(e=>{let n=t.getChainWalletList(!1).find(t=>t.chainRecord.chain?.chain_id===e.chainId&&t.namespace===e.namespace);return n?.activate(),t.walletInfo.mode===`wallet-connect`&&(n?.setData(e),n?.setState(U.Done)),n||[]});t.setState(U.Done);let i=r.flatMap(e=>{try{let t=this.getWalletRepo(e.chainName);return t.activate(),t.chainRecord}catch{return[]}}),a=async()=>{try{return await t.client?.enable?.(i.map(e=>e.chain.chain_id)),!0}catch(e){if(e instanceof Error&&t.rejectMatched(e))return this.logger?.error(`Failed to connect to stored chains: ${e.message}`),!1;throw e}};try{if(!await a())return}catch{for(let e of i)await t.client?.addChain?.(e);if(!await a())return}n=i.map(e=>e.name)}}t.walletInfo.mode!==`wallet-connect`&&await this._reconnect(e,void 0,n)}catch(e){if(e instanceof Qi)this.logger?.warn(e.message);else throw e}};_handleCosmiframeKeystoreChangeEvent=e=>{typeof e.data==`object`&&`event`in e.data&&e.data.event===`cosmiframe_keystorechange`&&(window.dispatchEvent(new Event(Kp)),this._reconnect(Gp))};onMounted=async()=>{if(typeof window>`u`)return;this.cosmiframeEnabled&&window.addEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent);let e=km.default.getParser(window.navigator.userAgent),t={browser:e.getBrowserName(!0),device:e.getPlatform().type||`desktop`,os:e.getOSName(!0)};this.setEnv(t),this.walletRepos.forEach(e=>e.setEnv(t)),await Promise.all(this.mainWallets.map(async e=>{e.setEnv(t),e.emitter?.emit(`broadcast_env`,t),this.subscribeConnectEvents&&(e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.addEventListener(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to window`)}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.on?.(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to wallet client ${e.walletPrettyName}`)})),e.walletInfo.mode===`wallet-connect`?await e.initClient(this.walletConnectOptions):await e.initClient()})),await this._restoreAccounts()};onUnmounted=()=>{typeof window>`u`||(this.cosmiframeEnabled&&window.removeEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent),this.mainWallets.forEach(e=>{e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.removeEventListener(t,this._reconnectMap[e.walletName])}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.off?.(t,this._reconnectMap[e.walletName])})}))}},Ym={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},Xm=class extends Yp{constructor(e,t){super(e,t)}},Zm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Qm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),$m=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),eh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),th=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EIP6963EventNames=void 0,(function(e){e.Announce=`eip6963:announceProvider`,e.Request=`eip6963:requestProvider`})(e.EIP6963EventNames||={})})),rh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ih=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ah=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAIN_TYPE_TO_GENESIS_HASH=e.GENESIS_HASH_TO_CHAIN_TYPE=e.NETWORK_TO_GENESIS_HASH=e.GENESIS_HASH_TO_NETWORK=e.ChainType=e.Network=e.GenesisHash=e.BitcoinSignMessageType=void 0,(function(e){e.ECDSA=`ecdsa`,e.BIP322_SIMPLE=`bip322-simple`})(e.BitcoinSignMessageType||={});var t;(function(e){e.MAINNET=`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`,e.TESTNET=`000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943`,e.SIGNET=`00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6`})(t=e.GenesisHash||={});var n;(function(e){e.MAINNET=`mainnet`,e.LIVENET=`livenet`,e.TESTNET=`testnet`,e.SIGNET=`signet`})(n=e.Network||={});var r;(function(e){e.BITCOIN_MAINNET=`BITCOIN_MAINNET`,e.BITCOIN_TESTNET=`BITCOIN_TESTNET`,e.BITCOIN_SIGNET=`BITCOIN_SIGNET`})(r=e.ChainType||={}),e.GENESIS_HASH_TO_NETWORK={[t.MAINNET]:n.MAINNET,[t.TESTNET]:n.TESTNET,[t.SIGNET]:n.SIGNET},e.NETWORK_TO_GENESIS_HASH={[n.MAINNET]:t.MAINNET,[n.LIVENET]:t.MAINNET,[n.TESTNET]:t.TESTNET,[n.SIGNET]:t.SIGNET},e.GENESIS_HASH_TO_CHAIN_TYPE={[t.MAINNET]:r.BITCOIN_MAINNET,[t.TESTNET]:r.BITCOIN_TESTNET,[t.SIGNET]:r.BITCOIN_SIGNET},e.CHAIN_TYPE_TO_GENESIS_HASH={[r.BITCOIN_MAINNET]:t.MAINNET,[r.BITCOIN_TESTNET]:t.TESTNET,[r.BITCOIN_SIGNET]:t.SIGNET}})),oh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(th(),e),n(nh(),e),n(rh(),e),n(ih(),e),n(ah(),e)})),sh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ch=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthTxStatus=e.EthSignType=void 0,(function(e){e.MESSAGE=`message`,e.TRANSACTION=`transaction`,e.EIP712=`eip-712`})(e.EthSignType||={}),(function(e){e.Success=`0x1`,e.Failure=`0x0`})(e.EthTxStatus||={})})),lh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),uh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),dh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),fh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ph=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Zm(),e),n(Qm(),e),n($m(),e),n(eh(),e),n(oh(),e),n(sh(),e),n(ch(),e),n(lh(),e),n(uh(),e),n(dh(),e),n(fh(),e)})),mh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),hh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSONUint8Array=void 0;var t=mh();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),J=a(((e,t)=>{t.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function i(e){return(e&&e.__isLong__)===!0}r.isLong=i;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,(e|0)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}r.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}r.fromNumber=c;function l(e,t,n){return new r(e,t,n)}r.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return y;if(typeof t==`number`?(n=t,t=!1):t=!!t,n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}r.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}r.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);r.ZERO=y;var b=s(0,!0);r.UZERO=b;var x=s(1);r.ONE=x;var S=s(1,!0);r.UONE=S;var C=s(-1);r.NEG_ONE=C;var w=l(-1,2147483647,!1);r.MAX_VALUE=w;var T=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);r.MIN_VALUE=E;var D=r.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return i(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=r+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=f(e)),n)return l(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=r*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=t*p+r*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(n)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var t,r,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(t=this.shr(1).div(e).shl(1),t.eq(y)?e.isNegative()?x:C:(r=this.sub(e.mul(t)),a=t.add(r.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(t),p=d.mul(e);p.isNegative()||p.gt(r);)t-=s,d=c(t,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),r=r.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return i(e)||(e=f(e)),n?l((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.and=function(e){return i(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return i(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return i(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var n=this.low;return l(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return l(t,0,this.unsigned);else return l(t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}})),gh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),_h=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),vh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BUILD_VERSION=void 0,e.BUILD_VERSION=`0.12.313`})),yh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.metaId=e.KeplrLogoBase64=void 0,e.KeplrLogoBase64=`iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACPfSURBVHgBzV0L0B9VdT9nvy/vB6nVOg4GEx/VER3A1iqo9aMzFgWtoOhgsYaHYNV2lNEqxAdfmKHTakuDTge1FJK2tqOtGqoWFWti8TFSxGDriFSbIK+qgB95h+Tb09397+49r3t3/99/LT0zm//e9917fud3zr27SRB+EbKd1gAcOhFg/kSYmjoBiJ4JhMsB6LHFJetS+wfoAowOQOKnumGVUfSX+23Ba0uRfFaGsh6pNKDqP2PzQN5TbNxqjAeqi2CuWLuvAuU74eT1O+AXIAhDSaX0g+fBFL6ymHShfFhT5RvdknNLzsTIb+cChmzb2OJqJY8aQG9gaAUXaXLbOH0gL4mXmXHC/HYUv1thEWyDk9bPwQAyOQC2H1wHGb29uNtQdLcmFJBv2AsFAPVQJDQPlFBYFACpso7+kFm17g/9sUgr3QFWNI3VtQWO0KaCGXbDBLJwAFSKz2cLjtvglhNFGmr6NomgxEQdT1kYK8N0uzBwH3bosHJo3EKkD1ZG0X6ctAFEW6cAAiwYCAsDwM2HL4e8tHpa45a7NN2UUaxBmFAPmpdt+rGDq0zdrpP2I6yRig06ANHNHuAwjxlzFp67fhOMKeMBoLT6Kby+GHMGmklySVosJAO+ajK9LX6Uxl51eyqZp/tYvVcPbRklynQ7au913aaeBwLRz+6CDU4dhw2yvhVh++EzIcPvBOXXc+SXJz3LMVYeEblOYxKZMx/kF4V70aZPv+q+7ceUmaivHTu0hDSWqzwRWa4rAsTtcOuuM6Gn9APAzYfeVszsM8UAazoVCgDj1DELneqrBgrq/ilyKUFwFE2R8cX8UABD1OmaOx87pkw137gxoP9ssq91xfUZ+Pddl0MP6QbAVwt/Pw+boY+MCQzsquNY6VhCHUoGNeY4fUKjVLR9JdIC8IkxkTrqkerVPsNsHxCk17RUPtFstJw6tE2RfNAPl35Cs7XrSHcGhWPHADBWIJj25XJ8ipbJcUmlZR01Fs+bh0vg+eujBhwHQOnzoaD9pFAi25ZhD2XzPKmHNAAQyC/zHbCelFNGicBPpxP8jZFA0El37xyaHA8oqm8uBGfB89Zv84p8AJTRPuD24m4dpKSLAdhPPGKv8wx4+1l8dO/vtVWL1PvQKMIIxOtFo3VKKy9y4JNmkboflef2N5K5gglO8nYHfgxAhfJHwQQkL9EmXgfHqNcnLkBSwWAPEUFfrG3Xs6k8b+dg66N6RpS7DNMvAp+vwTXrB2Lt7dqugWm4HhyxANhe+P2U5fcBQy0mYh+nntOmL0BcoMREK8vNr8uiCgnKkAEixIO5Zo41IOKKrgPNWFvw1liuVDWHvNi+f/NHs6BErmdJ/Tnugt5Clhl5mVPdUnCkLnMhfVwC8hUz5c69qifm4vYBLrWT285Jq7aUdAOM4ut02ycAkLECilgGb1+1naNcugLJAPPF1iFlid7FxmjH6VO3R99d2zdOwa2k+gNpNVGGcObc5vPRExZvKFwxjahLil1olGf7qd0DgWIXjM+5Hbusg2syxMvVU9RSWv/R/tbvWyUflMZoQ9YwE6vfhxHK1ensy3HC6FlypG56ixZnBDJ1bf/2OwPeU8Qyeh6n5kDrGxZoGSA7CrMiqPEubjFdF5tTnzbGkrkoy+L5HgslGSbyPG4QR85YTp7PABi10sbqTTBIym8T2jnpvsV8EEwQ6EhG8Ha+ZtXHHHjk8M+hr1D7R1TQK1ftumIAtI1Nuo+Vpw+GAHod8rR5qXSqX5mOWzixcpanrIM8RhL9yP6UzM0fLljg1PVzIwY4cujMTovuQBVQD2tnc+zy2ynG6NoGdjJBbO5QWxdoa4aoj9fHwl46jIMBX6Tqt8+j/DwEixcswNsTJNYSwxVkzaIlcF55UwEAc9wwFgA8ZUQnYOt2AcN1b4mybvCh7IN6UH8zLx2ggVcnnY66BqpnxdcILDCaZ3Dn3/RK/nNJAGN7EUy9slkTwBsPeXZhJE3JuoicNn47jJhllwvoVe5RuaJ5Mz7avgCHTZutnBqzy0U0eXblKGIlRuaOHMnXT8ONB2d6Bo+9JeaeTJ2By9pyXslbQ8RRAUU6oI68sdOlpkikkSQIRxoPL4dadmgUSqHzURH5ukaOiqQS1kxPw4nTWfkFL/WDTEr6xR5xBY6v9NGqoFeJEu08BdcrHoDLFr7KQ9np2Glv/EKRSAYoCJQED0GDX2Q5wOYKajAuoW55N5UXAKA8m1mI+jvbUL+6CwGEKFdKQlHDmYRrNWBAgYMzAbZWG5IIZIASGpGTZ+eFdXEPGsf6yZs1wEUnTBeJYzrbmZyOwWgMBRZy7YlL4A1rp2Eh8m8PzsNp39yfrOMqE5i76FK0l1d0+tHjV8Hrj10KQ8h39x2Bk2/5WRisZCQ2HrXKU7GCmKDM6SpCmC9cQA7rus25n3TFEgMNY8U8mErEXIK2UOZvEdK0vvEpKwZT/l2H5uGc2x8S7KDHQzFPaDOC21LlvDCqF1xTmt06sX1JAMk0h8nqDAaICOOgp2BWiB20GZvfZU9bARufuhyGkFL5p9/6INx9KHdezTb7EwfhdQxAKV9LXqaQddOdf3Uu0ndKMIEet58eYIsKBeuIWT7P8sow0UazxGW/unw45R8slP/tB+HHxW87mAoMUbOBmZ4T/Y4h0ykAjSPj+Pxx23aOrQOvUmKgAMdVeaxXBwicJc5duwQ2Pm0Y5T98lODlheXfUyi/sXxyqF9s/2KULgJhgLRPlDKNOSxIJqJ/VGUTMIDxgaQsGsaZq7Q03u7Zx0zDNSesgiGkVP4ZtxSWfyAHHnsYP68WBhNl4NQEVZMzc3M3PZSv71O3nYAecxIXULdHM5Zfry1DVpHS8z5u+RR8/uTOzVJvOffbP4fv7Tka37K2WU5+m9Of+jFxNz3pKeBCqX9S2hd9eXSfGqu1NpTbKrS3xy2fhs+dshqOWTTMjN/63T3w9QcfsSwIvrI9RWOPOn3FBoEdgj0QM57SaTIwELjbz9Y1CDfgLzKKotFN2efaFVPwuResLkDQ/2/QpWTj9/bCP9x9UG4x7UwgrsT+9E88Va0DgbfJmx4jXpAt3WETZThem7HEYYCkwgnc7TLPO2YxwudeOJzy//TO/fDRXQeqIcLcmoHNDE0ZueWx9s7alm8BHYabyAXELDpeFmk3qRsa0wWkqLdRzmdfdMxgyv/AD/bDBwsA8LDDzmYhjFDXEeBN1FUgL2V6nMVfqL+vymI0HWPDvlK6gJx3qG4JBPLdOSj5y+euLKL+KRhCKuXfsb+eQ+phVZlQFgoqT0vsYcnNMjFAWslxIupL8UNbP+/DuoDE+CY+GMm7j18Gr3vSYhhCPvajg/Bn39+/YIvXRI9Obuvr2fOknILGz1guIAkOitdDb2ToZpQ+gqxrFJEPq2OsyVJ++QDvKpT/rmcugyHkE3cdgvfdvq+w/BBUsgFHWzyMW7ws8IHbMoMoGy+oFgzQ2/r1AkdamMlBhDUmdQEx9xJJe2UXP31pBYAh5BsPHIG33bqX+fwI9VcgAIguQKVQC4aktH0mK7V3CwsCo0EXQ2sPl4A0iebNsGYMce9F/rWc8+QlcOVJwxzxfm9uHs7/+sMOKBNb0Ja71cKaJrVyqWMr1rms4el7BoHUL6p3wJqyxDZvoF2ATuvAS4OgzH72L0/Blc8ZxvLv3p/Dq3fMwd4jsfUKGvLjIzU5cpuCH9WS2vz3k+4gMNKZmx1jBow9sGy3YMnB3eM2/jIGwrUrM9j6opWweoBTvlL5Z29/GPYeptbvV2M5oAuTJVtu6tQZ3ikOF17f61MUBul2AWQjUlccJccUjBEqXpDUMYAOsqIgqBf3uJUIn3nJquK0b/K9fqn813zlYbh3/zx7nsaeO/bwVRWKzlvWg3jMYILM2GgouhrvbWDKr8diRHTyqudldDEBA3Dl60+/YiA4rrD8T79k5WDKf+2/KuXrSL2OzsEtr6HClIuReiEvZjYUtf5Yi44YgEwSI/Vic9KBHjpbtElZoF1bh/Kb8Zo6q4sj3utnVlT0P6nsKXz9a7/8MNyzb/RaF1Nb3fYolsRcRb0u6mfZsnM1mhc7RCTxMigR+EWsWhUn66EpmEB4n6RcDFusMvtDL1wOz3rM5Kd8lfJvKix/b171G+iVfV6uwc7+hORxjZ/y2k26hNYFJIIC36ezQxVj3Y5FMCsQljuBYP1dBbbjgutTr3j+MnjpcYtgCLlo+174/oPz7nd8Md9vlOvRvicC1F3BHiWTuotpo8y+lBz17baOuCWHIYaIATzLZ+l3PGcpXHT8EhhC3vn1/fCt+4+MLF8xdgAitidzdcpnBU37VP+BDnNG1lNm9tAea1MwQI/V96iM2j9kFTYzTET/VXpCy9f9mMOeOv8dv7a0AsAQcsUtB+BT/3UYmtM9d0wBCt/3G8OJWQ7PoQ7r9PrukM6DID53t8wJUPSzSLTKv7SZ6r+XlG35OQDJeV307MUVAIaQq79zELb85yFBx9jhkxF4XT5pv36b79I7hngnsRGId2wXeox3AayOg2jZ3qe9NOoXLsiBxeZ52vpFsOmUYU75rr7tYAWACtA84FV/d6/ZiiaftfmXP7hleOuRUmaXtWtdu9ba4xzAt/IIgiMTEqDRwdoA4sUAzyqOeDfPDKf8D912cOTzXcrn/5SL3RLz8wkNDLHArnVTXNkOQHoDopZ+L4NUoOi5q0AK4UmNFXj5zQNOIDoGWLsqg2tftgJWL5mcYq7/j8Pw4VsPyrknAk7sEfwhv0kCo+4PIK3sCbbWvT8KxWYkPQEFDr5Ioh6SzUfmRhYq5ZB5mFep/E+eWZzyrZpc+Z/6wSNw5TcOmICPK5UrQdO8LjfH5R7tq/VzrR57Wjp248EFAEZHBp+2sQuNZA5kmroY67OntBZZXE88plD+WYXyV0+u/HKPf+lX9tf/hg60IBBKM0qH5FYU2bt6Ga+Q7ENXaOqxcUU+RMSNA6TEXYBAIEVHCdbAKK8pY/my7uhmcjXV/RYgXr0U4dozVgym/Ndv2xuOqVvF1kzAx3Zjgjgz+FtVBxie23DcgJOMZzq69oNAdFpRpLhRpqH80BxVQ5zAZxmprf+q314Gxz9u8vP98mj39z69F/YVr3UzV3HsX/5Cct2BOYl0QCHSAO62D2MKj+QDqDFNphX/HIBsD+gkRgMpCxeKl44sgITES5pJdwOXzyyF054y+RHvvXtq5R+i4JoSikT2Sdc4ls/7AkgDw+tL5IsOrIi+HVExgKVx25NUZJXWflDeKP9PJg8mAMDJa6eqa1Iplf+GT+2F+/bkYlGxy7qhiQ9AKCpm+e5a6TYAFgiNLaWAwCcVEV083ee7PI9SxL+pKw291a4J/PjHJej3+2hIpfx/rJWP2u+Dq1hUAPHKYuWectHz95ohmnyAxOt3nQFJSW4DvUFa6zZ5jdhPoMVJnWEFGuxAaCGyp/D1Gz7JLF9t9bjiW4tnrBVYQIqXj2OUJ9Ns/FT9UC+OgvRBkLZstRuwL3sUMJyI37iDR1v5nyiUP1e/0/don8Ac77b1HIYw7Vm5Trf16zw3Jqg7cllAVJaCrJ5fOJL4OUCkN49iWlZwJsb/QUSJ9kS88X8k77nxAPzgJ/PGvyOApG6eX2Y0ZcyHx2IFnQaQykHzKhj6uwMAP45ICgpg9NoGJg9/qP3D+RKHVD0Ir0b5xB8FFii/3r3jf45WZwiefxfWD5D09a2ylQFYJkD/lbhj+bFX596HIcbae4Oh/MeiSwCoC+ehOl4dXaq83raN8qm6qkWkum19VS9F2nqhHa/flj8KAFhVvCfY8rpVcOzqrJpDVs8nq+fE58fvm3q6LMtZ+ypd/8PMObtYm0zUleNnTV7RJiN5NX1lug/TNugCKX6FD0I0XLR/Nwl1IoaqTPh6aJnC97OPAgIKObY4Ov7wq1bCBX8/2vsLyua/nrU7ZdzCOXUbt8AeV7AF4Ni7gSrfNXXGEInlzaqOaut1Lb2x3PaqmYFknbYNYw3OAMgYAdu6MGIEePTk6Y+fgut+d1X15jBlKfwKLIDqitfNTFsYWXRj2YRifQwLGUu2rICCLSRDGJZoruiDardQKT0ovqH7AJYRMCTdw0jBRKG+6P/R3QI2UoLg2nNXVZ+Me/Ru6D8HV+GZqhdLY94oXbqczOmrAUqj6Ky9wKX+Biyesl2AejGAVToJpQsrdhTfx+pFjPD/BARXnb0y6ddDmVQAt9A4CLiF2jqZUlxbt7LuiDUbhTuxQtclqZ7EFVN6UHRQPHDFp6zeAwUsXO64fx6+f/88DCG//qRpmH3FingQSMFydVnMelv3kPt1Mt13zkDCrTfX1uwFh77VZ6kL60geGmW2SrRKh1ZxdX2+EMzqgS2Asfq2HiubgAH2FMHbH358P9z78xyGkFecsBhmf2eFQ//oAEJZsirLcnQZRLKDVbi2+Ma6W4t2ACKAwi8OQkIDnGgMwJXeBnQ0UiJnAREcEsn8PFg9VzaqsknjgPsemofzrt07GAheXoDg8lesgNjauL7U/MYBwxnFA4Z2N0gWSJnDKC1QuILreIFfgrmiMYB4QMkQyJQIudoViLYUKJ9NPjBFzQiTSN3vfQ/lcP6AIDjjxMXwxt9c5isuB0PPoUzuCDKKW73IF+5EKY8snTcMk+UIOr7IHHCaqwEEKL/fXto1kKN4kooP9yRcBOigESQoJpEqfqjHvv/BHC74WHG2PxAI3jizFN744hoE4ARtpC8UytTKDb4bbKDYKLTD/4vtn1Kmr/AI9bcuIMEAMuADq/hcKr5hA7sbgPb8AEw+THwQxK3y/oIJLhwQBBcWILhwZpmlaQDDbD6FB+WiVm4uleqCh7T/t0wQ+mt2DfJswmOFpAuoJj8PMuBzjoa14jkbiLgh4iJaMMEE4ix6yQSX/M0+2Nvvf8PrlAsKEJRXbHdQLS4gWKrnQZhVbuMyLBMEV4COq8hUfCAOkhQr6CNhuwtw6B+aq6Z/swVkwDCgYFRv3EDbnkLw1/Q7gQj3U4995z1H4eKP7B0MBOefurS6hPVQ3OJH1tVY97juAMUOQlpveMfgsgCrZ+g+V+8mmnMA7xI+us3jAJFlwbrDwZBemPZUkEAywaQAaINNuRO5896j8KZr9gwGgvMKAJw3sxQs7aNRBDr5zfsDz2K5xWdkAWb8PmmLtkfBaOo4l97zy32+WlhB7aBiAgpRPXGrp+BCCMwZwKT/VFz7QiaXTNMo6M575+GqGw7AULLht5bC2ScvERQe/LwCgYkDwFV8AIV1IXrHIGMIeXCURRSOFGeF6DeB3jvm8L6awLwbbxO1IpDi79Rrv88/rVqwKOtqxuFf4Hz+lsNV3vvPWQFDyFtOXwb7DxLcdNsjclwIz1jFBM380CsPec1bRPkmEsX3EqFMfQdQj1Gl1bcCqdiqKRt9ENIRhYlPt7gy63RYeFIgYACpG9h8GMAFKCWwqxnjXwoQlD75vQOB4I9evbwa98u3HbEgYArwlOoqGqSSuUq08k1Z8wdZVXaotvx7ARRVgPtRaGPFlYRTPPcLWoKAFNbOWsGEboDCLyI4ChldJRM84ZcyuPC0Yf7W8DvPXl6A6iB8+duP+B+PAgchGoYSytfMIfItSMI9CmPUdUDUtyVj/YcRozIydc1XsvyvSCtAhIVijDCJ/gmES0GS8x39/f2Qvu4Lo7/pe8FAIHjTy5fCrvvmYdf981bxag58vaq/VAJ6DR2GwKBgzRyhTp0v1hE7rb8sN+8C+Nl+CN5U9C+2exBe9DSBIIA5OWy2Z+L7AD7egoVE0Kd3MPyVdpN3/Y0H4fovHoQhZMVShD+5eAU85QlTIZKv14ef3aMO3kgHfF4gh87BUNgpiLMBE+SpMckPDjPgR778DEAp0L4QIrGft9E/2F0EA5moN4FUFuPswVGN1cydg2DLF4YDwR9ftAKe3IIAROQtlQRW+Y1CnQMgpLB70DsFAYhcbTnNhe6VgTr4QXbxMv5CSCyuOCCSdTWrCOXzwyeYQJwxtNXJvADaLQUItt44EAiWIVx5cQCBVnQzPn9LGBSrLdwHiGYC8W0Ce2bzIanaRsqTQHVUKA6EnPyWEbhbiB3wcErWboIrblIhClSfx6xf543qlwD44i2PwBBSguDSDcvgV4pAs6F1CQKb1m8BAzBip4XOsS8HRf1hiKdwvRajgyClcO9wJ5z1M0bglt+Ape2HjJsQ4NBtJwSBfDAC8ckZgXNULK8P/N0++NJAICiVf8XvL69+o0xAMYrW1oxuHXtSKNmAuxOPETgzRF4Hg/kuwGUEQanE3AUYyvfoH5irmESQHMYhAP1No11gaOf7wb/dBzd9azgQbHrzcni8AAE6vtuCI+4KGDu0v5HXx8S/J9Ag0i6gUaa6+CLqKF+k2Y7A+9QLybbnjDGY8sm3LB6feGXBHQB85J/2w3/fM8z3hY8rlH/5m2NM4LgCBxwyKPR3ArZfZweQg/92MHd2AeaNoFIoGAVDS/tim9fSv1YEmLyJ4wBHuT4o1GtrVbb/AMG7rt4zHAgeg/D+N6fdgWUCT9mJdC4BYdmAMYL7QQhJWnQ/BqnuLUBQvDACNx7gfr/px7y9m1AaBRrQUowVKFJGcKAAwaWbhwXBe9/CQeBTsssE0AUGSCievx2044W3gWLhyFI8W9SUu/B//X5MX0NI2SfUDwksluFj1L8tG2hg1HXKFz1Xfmwv/OShHIaQEgTveesyWLlMWXvzbsADI3QEgDCqk0HcDRhXQDYYzbQC2rNzT8kqyPKULH99cBhWmEQobukcCLbMAUEe8n76QA7v+Ys98NMHhwHBYwsQXFaAoDw0atY46grAugV7VuDFDd5BkWQY831g6xdzbalkYwLQ0T65jBC7tCsRY00g2DGmPgrWtN+CEzgQAH5WgOC9m4cDwXHHZnDpHywdgUAoawSKkVVbKpdWa1nD21FkAhTy7IAbo38OIBTmpzllBn9PCTYg8W2gYJIJpH351GHt0IJPPhN/Bg2KBgTvK5jgZwOC4N0tCOxcpc9mbAGS8vl2L27pum/rCvxPwtj+3rNYewIYgjmP8mOAGWQXQBHaB3DB5oOEDGB4+oECBO+/au9gIFhbgOCcVy1ulZUBRIErlaqVz+YLUMcUGJgEAngyVSfUjVI+WMv3joUTlwSBBdEg7wIgNhc+jlIsOCAweSSA8ECh/A9cs6/aJQwhp/zGFJx/7hJB+RiNA/wj5fBMXf4fAWPvBLQFxZSoF9ZjBzfqhyYPJO3za0JxT/rEAkllgqNgrvSYm7jr7nnYVDDBUCA4+XlTsOHcxc6cOX2jejaUVk/xj0hjShduwQv8YoEaZwYc81fcK2VMJFx5RBBnJRJj6zwNertLGN2XILjiz/fCUFKC4DWvXhQUCRbEbkxAUvkcIPotoa3DyooH3u1ZPTp5niLdxQa58CiYILKrmFTacSnQOTgWLhSsqB+00lUf9f2PCxB8dMtwXxqfOjMNp58+zeicWzFjBYi4AbIuhFt9iAVQX7vLfyZubqTRkbDP/UIe+xYJeT7VeaoMdV/8vv58zC1boAhKbC8KH03Vcxt9ikWj7/NI1eV56PTJ84o/bv7GI1X64vOH+V/HGwB88fPzzazDuoJe28AEIVXfI69X35G/xsVT7y6Cw/nbMWL1bcPmXm8RAaJM4ZWjYgnk/S9YSLKO+vXdQqQNYxFxD4xB2P3XChB8/JPDfFBSyssKELz0jGlh8dbaI+cCAGaL6AWGgiHy/OGseKW406VwABsQ6bRSZnpRWT1w6i5QAm0z5bDf0RheGdk0gOMinGdjc/7STYdh22cPw1Dy0tOnAgj0BZHL1LUHQ55rAMId0zngzoyU1slShvnyl6Vj4rkCYBNvZM/+HO776Xy0fUr27a8nQe0foAiwnjuNbuqfoHRFp8hA1bqFhIso/rjhnw9V9y84ZbEaPS6YSD/1aRncRPVXxsjmRz71hzz2J/rz4HmLpvKduG5m15psesmuIr3Gq9Tmad+CctHMwOoX0VlkZGlWnqGth6pepTjeDmsKFG0w5LM8Xcek2X1m8oMSwj3KOl66XYtYHQBQ9SUArLLl3yaSoOe/tsZINl2TYbZ7x/q5Auw7Y9G/jgOi9B6heoz1BX7fyPLRqR/GIvC3dqB2IHo8SrsCfWYAcm7YsQayL5AuVdM58XroUH1sO4c9KV+eBag2O8o5jf5PJMpvcM8DYLSlEucAwO75r8oX5wcQ+gvbNCetFRgBA0/LQyevPjlgIqU4smNqcLC2QnnqXgNDKpqxB0HEv7vKkuWij0h9J1+u7fzWFgB5fmRLkTmnAxyMKMSz+CgLEFtQ3Z/pvwnmNIiYYsAfpwGDzzAeOLwzgcAC4OQZxUMcCEbJntJArrWsLykf1TomlQ8g3IB3wdKpbdAAYOQG8q3tbBxlcaoW9M7y3bYAUQWio0itqFGaAiM5fcrfUE8zhQUPBwaFcfXYoMbQz9z2EQGCkzdqg37dpr+YwgEiSsZ2HVNXcQC0ZXYzzpV12/9mK4fpzRA5yxcW2Ty5dgcgT/hSCtMg8KzaWnejFP4iSS2+AA654IjRLweB159v5WT6cEHi5MVo35ajVTQHQ9sO3efyrnmETc10WgDs3vGE3QUMtoIW9RDIHyhxL3wmB4UBiV3wuHWrcYAilg2tQtH0TfLZmOW3z8jrseqBtkkCBdSCewpI5ZEcW5eDUqqpp0ACrL1mkuJ4ecvsR3B380ziP9qbh/lZ5LEAG7BdDAUE9PIBXEsWymFWaRgF4sxh5iP6CGNxANq5BK0KyoUwL48BWrCQbMfn4wJB5RlWaMvQdRVCycz6gXwlx/sAODIVrL8UAYAiFthdLObVYmYeGNRDg14MDwzk1ImAJSjOWSmlKM/ivb5QK1gwB5m6fLymHJ3n5n256+PVB3BZIZRhWDOSoNd169rmAgDDMDnRJm79AMqgGnnqi+/eXjSYMf9tCWvRDtKkEUUdrMsWknYPfrC2glRdVi+L5MfSmXfAg/WHGTwPMHIwNHrDljoQAq8viNeXOwFO8+weffp39LZ7419l61URuP/X6jQePb/4Ea6glZYOQ3r0GywWDa3ruvIXY1Zt6vboUyccJmiExwg8NhCflEFiTvwZmoS2fgLr35Xlo1fGWFNavQoKHRfguITdeARPBUdcANxRuALK6Hyehx4Q2H0zIVB5DTVDT1Dwh5V9gPXtjrjBHuhFjIHYWg9XgrwnoTTpEqxitSEZZXvP0tZBoVT3eVQ7nl/M9JLLtkjqbyT6vy3/aMdx24jwEr3OGEO/p8iExQswgO3Tt2w2XlUWwKTHG6XJmQdZVmjmq8qE8kDuNjQQBUCbbK1wXYc/k2KF6DMDuFs/DyB15U0b/xq3QUSS/932D29+4uZiDTeBY/3Jew8kGkg8EWMHSPQtWIHMYsu+nc7IB2mUaUi2bccin/lilg9OHjplmkUA4pauJew0aNNl107NQkI6/7/1H35t7SyWINCKid0n8jymAFL5dabew7t9eQN6IHRcDjptkfz+uFW7lqyUjo5yXZ9f5aFsCw6LJIwHI78EdMll16WVX0onAEq5swBBcUpwVtHtbnM6qBYee1ovn2y8rnr6SD+h3BschOLCHC3di04pbX1cXJB6Fh5bm4iSfdqHliF0//XvHOV41sbrpjZDD+kFgFLuvHn9tmxq/tQRCEA+gHgKiitIC7N+jNVXykqCBqQ7kP6QlKJ5G9uXl5e8F2mPUfw2xuJTcwMHyBwQ5SveHE/auCXu87v67yXPeOFds8XG+fK2E2STQp7HPoRo6tS/sX08r8t/Rx9moO3D1BmN2/ccoK0H3pkAqnbe3r9Jh7Lmr3G19I7+fj9jtXg5APoflMTv54qA9+rLtnRTvpbeDMDljq89qQDA/PoCclurjJTlQsQ3R9jBixMMPZtxpBWhx0LuL7kW6QpnmQgbua5Al3fWw7Y8ZZ2BBXDLI4QnLUT5vJ8FyzNmdq3DPJstrOaVxZzX8M/DpNWjYgeInvjpOpmyWvAYAsPiZq61g3P6J63bsoG1/Axi+d5p3uhhsohFC+aA0IanQbSDJrf8imvrPGSbZyP7+74yMQAaKb8tXA5TZxYdbiiumapzAQAIx8WuYiDqBlpqb8vRAoClFwYApSg256BYHwCZUOSkAJC/DAAFzcPO4u6Go5BtKRQ/BwPIYADQ8qyZXTMZZCcW+4UXF6OsyZDWFQ+8DqKKWTgAMhcI4wHAKLatE+wuCoC6LK5cDwCoACbKdxd9FgrGncUrnNtHv9M7h1I6l/8FAVO2ym5DPSIAAAAASUVORK5CYII=`,e.metaId=`d_2hxd99brRo`})),bh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=`ffffffff-ffff-ffff-ffff-ffffffffffff`})),xh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=`00000000-0000-0000-0000-000000000000`})),Sh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i})),Ch=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Sh();function n(e){return typeof e==`string`&&t.default.test(e)}e.default=n})),wh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ch();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);let n;return Uint8Array.of((n=parseInt(e.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(e.slice(9,13),16))>>>8,n&255,(n=parseInt(e.slice(14,18),16))>>>8,n&255,(n=parseInt(e.slice(19,23),16))>>>8,n&255,(n=parseInt(e.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}e.default=n})),Th=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unsafeStringify=void 0;var t=Ch(),n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));function r(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+`-`+n[e[t+4]]+n[e[t+5]]+`-`+n[e[t+6]]+n[e[t+7]]+`-`+n[e[t+8]]+n[e[t+9]]+`-`+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}e.unsafeStringify=r;function i(e,n=0){let i=r(e,n);if(!(0,t.default)(i))throw TypeError(`Stringified UUID is invalid`);return i}e.default=i})),Eh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t,n=new Uint8Array(16);function r(){if(!t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);t=crypto.getRandomValues.bind(crypto)}return t(n)}e.default=r})),Dh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.updateV1State=void 0;var t=Eh(),n=Th(),r={};function i(e,i,s){let c,l=e?._v6??!1;if(e){let t=Object.keys(e);t.length===1&&t[0]===`_v6`&&(e=void 0)}if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.nsecs,e.clockseq,e.node,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.nsecs,l?void 0:r.clockseq,l?void 0:r.node,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=(n[8]<<8|n[9])&16383),e.msecs=t,e}e.updateV1State=a;function o(e,t,n,r,i,a,o=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),n??=0,r??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=0xb1d069b5400;let s=((t&268435455)*1e4+n)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let c=t/4294967296*1e4&268435455;a[o++]=c>>>8&255,a[o++]=c&255,a[o++]=c>>>24&15|16,a[o++]=c>>>16&255,a[o++]=r>>>8|128,a[o++]=r&255;for(let e=0;e<6;++e)a[o++]=i[e];return a}e.default=i})),Oh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wh(),n=Th();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),kh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return n(i(a(e),e.length*8))}function n(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length*4;n++)t[n]=e[n>>2]>>>n%4*8&255;return t}function r(e){return(e+64>>>9<<4)+14+1}function i(e,t){let n=new Uint32Array(r(t)).fill(0);n.set(e),n[t>>5]|=128<<t%32,n[n.length-1]=t,e=n;let i=1732584193,a=-271733879,s=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){let n=i,r=a,p=s,m=c;i=l(i,a,s,c,e[t],7,-680876936),c=l(c,i,a,s,e[t+1],12,-389564586),s=l(s,c,i,a,e[t+2],17,606105819),a=l(a,s,c,i,e[t+3],22,-1044525330),i=l(i,a,s,c,e[t+4],7,-176418897),c=l(c,i,a,s,e[t+5],12,1200080426),s=l(s,c,i,a,e[t+6],17,-1473231341),a=l(a,s,c,i,e[t+7],22,-45705983),i=l(i,a,s,c,e[t+8],7,1770035416),c=l(c,i,a,s,e[t+9],12,-1958414417),s=l(s,c,i,a,e[t+10],17,-42063),a=l(a,s,c,i,e[t+11],22,-1990404162),i=l(i,a,s,c,e[t+12],7,1804603682),c=l(c,i,a,s,e[t+13],12,-40341101),s=l(s,c,i,a,e[t+14],17,-1502002290),a=l(a,s,c,i,e[t+15],22,1236535329),i=u(i,a,s,c,e[t+1],5,-165796510),c=u(c,i,a,s,e[t+6],9,-1069501632),s=u(s,c,i,a,e[t+11],14,643717713),a=u(a,s,c,i,e[t],20,-373897302),i=u(i,a,s,c,e[t+5],5,-701558691),c=u(c,i,a,s,e[t+10],9,38016083),s=u(s,c,i,a,e[t+15],14,-660478335),a=u(a,s,c,i,e[t+4],20,-405537848),i=u(i,a,s,c,e[t+9],5,568446438),c=u(c,i,a,s,e[t+14],9,-1019803690),s=u(s,c,i,a,e[t+3],14,-187363961),a=u(a,s,c,i,e[t+8],20,1163531501),i=u(i,a,s,c,e[t+13],5,-1444681467),c=u(c,i,a,s,e[t+2],9,-51403784),s=u(s,c,i,a,e[t+7],14,1735328473),a=u(a,s,c,i,e[t+12],20,-1926607734),i=d(i,a,s,c,e[t+5],4,-378558),c=d(c,i,a,s,e[t+8],11,-2022574463),s=d(s,c,i,a,e[t+11],16,1839030562),a=d(a,s,c,i,e[t+14],23,-35309556),i=d(i,a,s,c,e[t+1],4,-1530992060),c=d(c,i,a,s,e[t+4],11,1272893353),s=d(s,c,i,a,e[t+7],16,-155497632),a=d(a,s,c,i,e[t+10],23,-1094730640),i=d(i,a,s,c,e[t+13],4,681279174),c=d(c,i,a,s,e[t],11,-358537222),s=d(s,c,i,a,e[t+3],16,-722521979),a=d(a,s,c,i,e[t+6],23,76029189),i=d(i,a,s,c,e[t+9],4,-640364487),c=d(c,i,a,s,e[t+12],11,-421815835),s=d(s,c,i,a,e[t+15],16,530742520),a=d(a,s,c,i,e[t+2],23,-995338651),i=f(i,a,s,c,e[t],6,-198630844),c=f(c,i,a,s,e[t+7],10,1126891415),s=f(s,c,i,a,e[t+14],15,-1416354905),a=f(a,s,c,i,e[t+5],21,-57434055),i=f(i,a,s,c,e[t+12],6,1700485571),c=f(c,i,a,s,e[t+3],10,-1894986606),s=f(s,c,i,a,e[t+10],15,-1051523),a=f(a,s,c,i,e[t+1],21,-2054922799),i=f(i,a,s,c,e[t+8],6,1873313359),c=f(c,i,a,s,e[t+15],10,-30611744),s=f(s,c,i,a,e[t+6],15,-1560198380),a=f(a,s,c,i,e[t+13],21,1309151649),i=f(i,a,s,c,e[t+4],6,-145523070),c=f(c,i,a,s,e[t+11],10,-1120210379),s=f(s,c,i,a,e[t+2],15,718787259),a=f(a,s,c,i,e[t+9],21,-343485551),i=o(i,n),a=o(a,r),s=o(s,p),c=o(c,m)}return Uint32Array.of(i,a,s,c)}function a(e){if(e.length===0)return new Uint32Array;let t=new Uint32Array(r(e.length*8)).fill(0);for(let n=0;n<e.length;n++)t[n>>2]|=(e[n]&255)<<n%4*8;return t}function o(e,t){let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function s(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,i,a){return o(s(o(o(t,e),o(r,a)),i),n)}function l(e,t,n,r,i,a,o){return c(t&n|~t&r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return c(t&r|n&~r,e,t,i,a,o)}function d(e,t,n,r,i,a,o){return c(t^n^r,e,t,i,a,o)}function f(e,t,n,r,i,a,o){return c(n^(t|~r),e,t,i,a,o)}e.default=t})),Ah=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=e.stringToBytes=void 0;var t=wh(),n=Th();function r(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}e.stringToBytes=r,e.DNS=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,e.URL=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function i(e,i,a,o,s,c){let l=typeof a==`string`?r(a):a,u=typeof o==`string`?(0,t.default)(o):o;if(typeof o==`string`&&(o=(0,t.default)(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=i(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return(0,n.unsafeStringify)(d)}e.default=i})),jh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0;var t=kh(),n=Ah(),r=Ah();Object.defineProperty(e,"DNS",{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,"URL",{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(48,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Mh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}})),Nh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Mh(),n=Eh(),r=Th();function i(e,i,a){if(t.default.randomUUID&&!i&&!e)return t.default.randomUUID();e||={};let o=e.random??e.rng?.()??(0,n.default)();if(o.length<16)throw Error(`Random bytes length must be >= 16`);if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=o[e];return i}return(0,r.unsafeStringify)(o)}e.default=i})),Ph=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function n(e,t){return e<<t|e>>>32-t}function r(e){let r=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],a=new Uint8Array(e.length+1);a.set(e),a[e.length]=128,e=a;let o=e.length/4+2,s=Math.ceil(o/16),c=Array(s);for(let t=0;t<s;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];c[t]=n}c[s-1][14]=(e.length-1)*8/2**32,c[s-1][14]=Math.floor(c[s-1][14]),c[s-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<s;++e){let a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=c[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=i[0],s=i[1],l=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){let i=Math.floor(e/20),c=n(o,5)+t(i,s,l,u)+d+r[i]+a[e]>>>0;d=u,u=l,l=n(s,30)>>>0,s=o,o=c}i[0]=i[0]+o>>>0,i[1]=i[1]+s>>>0,i[2]=i[2]+l>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}e.default=r})),Fh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0;var t=Ph(),n=Ah(),r=Ah();Object.defineProperty(e,"DNS",{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,"URL",{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(80,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Ih=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Th(),n=Dh(),r=Oh();function i(e,i,a){e??={},a??=0;let o=(0,n.default)({...e,_v6:!0},new Uint8Array(16));if(o=(0,r.default)(o),i){if(a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;e++)i[a+e]=o[e];return i}return(0,t.unsafeStringify)(o)}e.default=i})),Lh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wh(),n=Th();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),Rh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.updateV7State=void 0;var t=Eh(),n=Th(),r={};function i(e,i,s){let c;if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.seq,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.seq,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}e.updateV7State=a;function o(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}e.default=i})),zh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ch();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}e.default=n})),Bh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.validate=e.v7=e.v6ToV1=e.v6=e.v5=e.v4=e.v3=e.v1ToV6=e.v1=e.stringify=e.parse=e.NIL=e.MAX=void 0;var t=bh();Object.defineProperty(e,"MAX",{enumerable:!0,get:function(){return t.default}});var n=xh();Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return n.default}});var r=wh();Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.default}});var i=Th();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.default}});var a=Dh();Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return a.default}});var o=Oh();Object.defineProperty(e,"v1ToV6",{enumerable:!0,get:function(){return o.default}});var s=jh();Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return s.default}});var c=Nh();Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return c.default}});var l=Fh();Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return l.default}});var u=Ih();Object.defineProperty(e,"v6",{enumerable:!0,get:function(){return u.default}});var d=Lh();Object.defineProperty(e,"v6ToV1",{enumerable:!0,get:function(){return d.default}});var f=Rh();Object.defineProperty(e,"v7",{enumerable:!0,get:function(){return f.default}});var p=Ch();Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return p.default}});var m=zh();Object.defineProperty(e,"version",{enumerable:!0,get:function(){return m.default}})})),Vh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.BitcoinProvider=e.Keplr=e.EthereumProviderRpcError=void 0;var r=ph(),i=hh(),a=n(at()),o=n(J()),s=gh(),c=_h(),l=vh(),u=n(ee()),d=yh(),f=Bh(),p=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}};e.EthereumProviderRpcError=p,e.Keplr=class e{constructor(){this.enigmaUtils=new Map,this.version=l.BUILD_VERSION,this.mode=`extension`,this.defaultOptions={},this.ethereum=new h(this),this.starknet=void 0,this.bitcoin=new g(this)}static staticRequestMethod(e,t){let n=`ReactNativeWebView`in window,r=n?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=n?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:e,args:i.JSONUint8Array.wrap(t)};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})}requestMethod(t,n){return e.staticRequestMethod(t,n)}static getKeplr(n=1500){return t(this,void 0,void 0,function*(){yield m();let t=`ReactNativeWebView`in window,r=typeof navigator<`u`&&`userAgent`in navigator?navigator.userAgent.includes(`Firefox`):!1;if(!(!t&&!r&&window.keplrRequestMetaIdSupport==null))return new Promise((t,r)=>{let i=setTimeout(()=>{t(void 0)},n);e.staticRequestMethod(`ping`,[]).then(()=>{clearTimeout(i),t(new e)}).catch(n=>{(n?.message)?.includes(`Invalid method: ping`)?(clearTimeout(i),t(new e)):r(n)})})})}ping(){return t(this,void 0,void 0,function*(){yield this.requestMethod(`ping`,[])})}enable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`enable`,[e])})}disable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`disable`,[e])})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);e.features?.includes(`stargate`)||e.features?.includes(`no-legacy-stdTx`),yield this.requestMethod(`experimentalSuggestChain`,[e])})}getKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKey`,[e])})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKeysSettled`,[e])})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return`length`in n,yield this.requestMethod(`sendTx`,[e,n,r])})}signAmino(e,n,r,i={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signAmino`,[e,n,r,(0,a.default)(this.defaultOptions.sign??{},i)])})}signDirect(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirect`,[e,n,{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},(0,a.default)(this.defaultOptions.sign??{},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,authInfoBytes:s.authInfoBytes,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber)},signature:t.signature}})}signDirectAux(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirectAux`,[e,n,{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},(0,a.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,publicKey:s.publicKey||void 0,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber),sequence:o.default.fromString(s.sequence)},signature:t.signature}})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signArbitrary`,[e,n,r])})}signICNSAdr36(e,t,n,r,i){return this.requestMethod(`signICNSAdr36`,[e,t,n,r,i])}verifyArbitrary(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`verifyArbitrary`,[e,n,r,i])})}signEthereum(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signEthereum`,[e,n,r,i])})}getOfflineSigner(e,t){return new s.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new s.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new s.CosmJSOfflineSignerOnlyAmino(e,this,n):new s.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestToken`,[e,n,r])})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getSecret20ViewingKey`,[e,n])})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaPubKey`,[e])})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaTxEncryptionKey`,[e,n])})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaEncrypt`,[e,n,r])})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaDecrypt`,[e,n,r])})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new c.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,i,o={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`experimentalSignEIP712CosmosTx_v0`,[e,n,r,i,(0,a.default)(this.defaultOptions.sign??{},o)])})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfosWithoutEndpoints`,[])})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`changeKeyRingName`,[{defaultName:e,editable:n}])})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`sendEthereumTx`,[e,n])})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestERC20`,[e,n])})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfoWithoutEndpoints`,[e])})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKey`,[e])})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKeysSettled`,[e])})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetTx`,[e,n,r])})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetDeployAccountTransaction`,[e,n])})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKey`,[e])})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKeysSettled`,[e])})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbt`,[e,n,r])})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbts`,[e,n,r])})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__getAnalyticsId`,[])})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoWithdrawRewards`,[e,n,r])})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoDelegate`,[e,n,r])})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoExecuteCosmWasm`,[e,n,r])})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__webpageClosed`,[])})}};var m=()=>document.readyState===`complete`?Promise.resolve():new Promise(e=>{let t=n=>{n.target&&n.target.readyState===`complete`&&(e(),document.removeEventListener(`readystatechange`,t))};document.addEventListener(`readystatechange`,t)}),h=class e extends u.default{constructor(n){if(super(),this.keplr=n,this.eip6963ProviderInfo={uuid:(0,f.v4)(),name:`Keplr`,rdns:`app.keplr`,icon:`data:image/png;base64,${d.KeplrLogoBase64}`},this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.isKeplr=!0,this.isMetaMask=!0,this._isConnected=!1,this._currentChainId=null,this._initProviderState=()=>t(this,void 0,void 0,function*(){let t=yield e.requestMethod(`request`,{method:`keplr_initProviderState`});if(t){let{currentEvmChainId:e,currentChainId:n,selectedAddress:r}=t;n!=null&&e!=null&&r!=null&&(this._handleConnect(e),this._handleChainChanged(e),this._currentChainId=n,this._handleAccountsChanged(r))}}),this._initProviderState(),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){if(this._currentChainId&&(yield n.getChainInfoWithoutEndpoints(this._currentChainId))){let e=null;try{e=(yield n.getKey(this._currentChainId)).ethereumHexAddress}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}})),window.addEventListener(`keplr_chainChanged`,e=>{if(e.detail.origin===window.location.origin){let t=e.detail.evmChainId;this._handleChainChanged(t)}}),window.addEventListener(`keplr_ethSubscription`,e=>{let t=e.detail.origin,n=e.detail.providerId;if(t===window.location.origin&&n===this.eip6963ProviderInfo?.uuid){let t=e.detail.data;this.emit(`message`,{type:`eth_subscription`,data:t})}}),this.eip6963ProviderInfo){let e=new CustomEvent(r.EIP6963EventNames.Announce,{detail:Object.freeze({info:this.eip6963ProviderInfo,provider:this})});window.addEventListener(r.EIP6963EventNames.Request,()=>window.dispatchEvent(e)),window.dispatchEvent(e)}}static requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`ethereum`,args:i.JSONUint8Array.wrap(n),ethereumProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){let e=c.error;t(e.code&&!e.module?new p(e.code,e.message,e.data):Error(e));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}_handleConnect(e){return t(this,void 0,void 0,function*(){if(!this._isConnected){this._isConnected=!0;let t=`0x${e.toString(16)}`;this.emit(`connect`,{chainId:t})}})}_handleDisconnect(){return t(this,void 0,void 0,function*(){this._isConnected&&(yield e.requestMethod(`request`,{method:`keplr_disconnect`}),this._isConnected=!1,this.chainId=null,this.selectedAddress=null,this.networkVersion=null,this.emit(`disconnect`))})}_handleChainChanged(e){return t(this,void 0,void 0,function*(){let t=`0x${e.toString(16)}`;t!==this.chainId&&(this.chainId=t,this.networkVersion=e.toString(10),this.emit(`chainChanged`,t))})}_handleAccountsChanged(e){return t(this,void 0,void 0,function*(){this.selectedAddress!==e&&(this.selectedAddress=e,e?this.emit(`accountsChanged`,[e]):this.emit(`accountsChanged`,[]))})}isConnected(){return this._isConnected}request({method:n,params:r,chainId:i}){return t(this,void 0,void 0,function*(){if(typeof n!=`string`)throw Error("Invalid paramater: `method` must be a string");return this._isConnected||(yield this._initProviderState()),yield e.requestMethod(`request`,{method:n,params:r,providerId:this.eip6963ProviderInfo?.uuid,chainId:i})})}enable(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`eth_requestAccounts`})})}net_version(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`net_version`})})}},g=class e extends u.default{constructor(e){super(),this.keplr=e,this._handleNetworkChanged=e=>t(this,void 0,void 0,function*(){this.emit(`networkChanged`,e)}),this._handleAccountsChanged=e=>t(this,void 0,void 0,function*(){e&&e.length>0?(this.emit(`accountChanged`,e),this.emit(`accountsChanged`,e)):(this.emit(`accountChanged`,[``]),this.emit(`accountsChanged`,[``]))}),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)})),window.addEventListener(`keplr_bitcoinChainChanged`,e=>t(this,void 0,void 0,function*(){if(e.detail.origin===window.location.origin){let t=e.detail.network,n=null;try{n=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleNetworkChanged(t),this._handleAccountsChanged(n)}})),window.addEventListener(`keplr_bitcoinAccountsChanged`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}))}static _requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`bitcoin`,args:i.JSONUint8Array.wrap(n),bitcoinProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}getAccounts(){return e._requestMethod(`getAccounts`,[])}requestAccounts(){return t(this,void 0,void 0,function*(){return e._requestMethod(`requestAccounts`,[])})}disconnect(){return t(this,void 0,void 0,function*(){return e._requestMethod(`disconnect`,[])})}getNetwork(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getNetwork`,[])})}switchNetwork(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchNetwork`,[n])})}getChain(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getChain`,[])})}switchChain(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchChain`,[n])})}getPublicKey(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getPublicKey`,[])})}getBalance(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getBalance`,[])})}getInscriptions(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`getInscriptions`,[n,r])})}signMessage(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signMessage`,[n,r])})}sendBitcoin(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`sendBitcoin`,[n,r])})}pushTx(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushTx`,[n])})}pushPsbt(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushPsbt`,[n])})}signPsbt(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbt`,[n,r])})}signPsbts(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbts`,[n,r])})}getAddress(){return t(this,void 0,void 0,function*(){return(yield this.getAccounts())[0]})}connectWallet(){return t(this,void 0,void 0,function*(){return this.requestAccounts()})}};e.BitcoinProvider=g})),Hh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrFallback=void 0;var n=Vh();e.KeplrFallback=class extends n.Keplr{constructor(e){super(),this.onKeplrNotDetected=e,this.isKeplrDetected=null,this.onKeplrNotDetected&&n.Keplr.getKeplr(500).then(e=>{var t;e||(t=this.onKeplrNotDetected)==null||t.call(this)})}requestMethod(e,r){return t(this,void 0,void 0,function*(){if(this.isKeplrDetected??((yield n.Keplr.getKeplr(500))?this.isKeplrDetected=!0:this.isKeplrDetected=!1),this.isKeplrDetected)return n.Keplr.staticRequestMethod(e,r);{let t=window.keplr;if(t)return t[e](...r);throw Error(`Can't detect keplr fallback`)}})}}})),Uh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Vh(),e),n(Hh(),e)})),Wh=a(((e,t)=>{var n=(function(e){var t=1e7,r=7,i=9007199254740992,a=p(i),o=`0123456789abcdefghijklmnopqrstuvwxyz`,s=typeof BigInt==`function`;function c(e,t,n,r){return e===void 0?c[0]:t===void 0||+t==10&&!n?z(e):pe(e,t,n,r)}function l(e,t){this.value=e,this.sign=t,this.isSmall=!1}l.prototype=Object.create(c.prototype);function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}u.prototype=Object.create(c.prototype);function d(e){this.value=e}d.prototype=Object.create(c.prototype);function f(e){return-i<e&&e<i}function p(e){return e<1e7?[e]:e<0x5af3107a4000?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/0x5af3107a4000)]}function m(e){h(e);var n=e.length;if(n<4&&F(e,a)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){for(var t=e.length;e[--t]===0;);e.length=t+1}function g(e){for(var t=Array(e),n=-1;++n<e;)t[n]=0;return t}function _(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(l=0;l<i;l++)c=e[l]+n[l]+o,o=+(c>=s),a[l]=c-o*s;for(;l<r;)c=e[l]+o,o=+(c===s),a[l++]=c-o*s;return o>0&&a.push(o),a}function y(e,t){return e.length>=t.length?v(e,t):v(t,e)}function b(e,n){var r=e.length,i=Array(r),a=t,o,s;for(s=0;s<r;s++)o=e[s]-a+n,n=Math.floor(o/a),i[s]=o-n*a,n+=1;for(;n>0;)i[s++]=n%a,n=Math.floor(n/a);return i}l.prototype.add=function(e){var t=z(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new l(b(n,Math.abs(r)),this.sign):new l(y(n,r),this.sign)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){var t=z(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new u(n+r);r=p(Math.abs(r))}return new l(b(r,Math.abs(n)),n<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(e){return new d(this.value+z(e).value)},d.prototype.plus=d.prototype.add;function x(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(c=0;c<i;c++)l=e[c]-o-n[c],l<0?(l+=s,o=1):o=0,a[c]=l;for(c=i;c<r;c++){if(l=e[c]-o,l<0)l+=s;else{a[c++]=l;break}a[c]=l}for(;c<r;c++)a[c]=e[c];return h(a),a}function S(e,t,n){var r;return F(e,t)>=0?r=x(e,t):(r=x(t,e),n=!n),r=m(r),typeof r==`number`?(n&&(r=-r),new u(r)):new l(r,n)}function C(e,n,r){var i=e.length,a=Array(i),o=-n,s=t,c,d;for(c=0;c<i;c++)d=e[c]+o,o=Math.floor(d/s),d%=s,a[c]=d<0?d+s:d;return a=m(a),typeof a==`number`?(r&&(a=-a),new u(a)):new l(a,r)}l.prototype.subtract=function(e){var t=z(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?C(n,Math.abs(r),this.sign):S(n,r,this.sign)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){var t=z(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new u(n-r):C(r,Math.abs(n),n>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(e){return new d(this.value-z(e).value)},d.prototype.minus=d.prototype.subtract,l.prototype.negate=function(){return new l(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},d.prototype.negate=function(){return new d(-this.value)},l.prototype.abs=function(){return new l(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function w(e,n){var r=e.length,i=n.length,a=g(r+i),o=t,s,c,l,u,d;for(l=0;l<r;++l){u=e[l];for(var f=0;f<i;++f)d=n[f],s=u*d+a[l+f],c=Math.floor(s/o),a[l+f]=s-c*o,a[l+f+1]+=c}return h(a),a}function T(e,n){var r=e.length,i=Array(r),a=t,o=0,s,c;for(c=0;c<r;c++)s=e[c]*n+o,o=Math.floor(s/a),i[c]=s-o*a;for(;o>0;)i[c++]=o%a,o=Math.floor(o/a);return i}function E(e,t){for(var n=[];t-- >0;)n.push(0);return n.concat(e)}function D(e,t){var n=Math.max(e.length,t.length);if(n<=30)return w(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),a=t.slice(n),o=t.slice(0,n),s=D(i,o),c=D(r,a),l=y(y(s,E(x(x(D(y(i,r),y(o,a)),s),c),n)),E(c,2*n));return h(l),l}function O(e,t){return-.012*e-.012*t+15e-6*e*t>0}l.prototype.multiply=function(e){var n=z(e),r=this.value,i=n.value,a=this.sign!==n.sign,o;if(n.isSmall){if(i===0)return c[0];if(i===1)return this;if(i===-1)return this.negate();if(o=Math.abs(i),o<t)return new l(T(r,o),a);i=p(o)}return O(r.length,i.length)?new l(D(r,i),a):new l(w(r,i),a)},l.prototype.times=l.prototype.multiply;function k(e,n,r){return e<t?new l(T(n,e),r):new l(w(n,p(e)),r)}u.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new u(e.value*this.value):k(Math.abs(e.value),p(Math.abs(this.value)),this.sign!==e.sign)},l.prototype._multiplyBySmall=function(e){return e.value===0?c[0]:e.value===1?this:e.value===-1?this.negate():k(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return z(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(e){return new d(this.value*z(e).value)},d.prototype.times=d.prototype.multiply;function A(e){var n=e.length,r=g(n+n),i=t,a,o,s,c,l;for(s=0;s<n;s++){c=e[s],o=0-c*c;for(var u=s;u<n;u++)l=e[u],a=c*l*2+r[s+u]+o,o=Math.floor(a/i),r[s+u]=a-o*i;r[s+n]=o}return h(r),r}l.prototype.square=function(){return new l(A(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return f(e)?new u(e):new l(A(p(Math.abs(this.value))),!1)},d.prototype.square=function(e){return new d(this.value*this.value)};function j(e,n){var r=e.length,i=n.length,a=t,o=g(n.length),s=n[i-1],c=Math.ceil(a/(2*s)),l=T(e,c),u=T(n,c),d,f,p,h,_,v,y;for(l.length<=r&&l.push(0),u.push(0),s=u[i-1],f=r-i;f>=0;f--){for(d=a-1,l[f+i]!==s&&(d=Math.floor((l[f+i]*a+l[f+i-1])/s)),p=0,h=0,v=u.length,_=0;_<v;_++)p+=d*u[_],y=Math.floor(p/a),h+=l[f+_]-(p-y*a),p=y,h<0?(l[f+_]=h+a,h=-1):(l[f+_]=h,h=0);for(;h!==0;){for(--d,p=0,_=0;_<v;_++)p+=l[f+_]-a+u[_],p<0?(l[f+_]=p+a,p=0):(l[f+_]=p,p=1);h+=p}o[f]=d}return l=N(l,c)[0],[m(o),m(l)]}function M(e,n){for(var r=e.length,i=n.length,a=[],o=[],s=t,c,l,u,d,f;r;){if(o.unshift(e[--r]),h(o),F(o,n)<0){a.push(0);continue}l=o.length,u=o[l-1]*s+o[l-2],d=n[i-1]*s+n[i-2],l>i&&(u=(u+1)*s),c=Math.ceil(u/d);do{if(f=T(n,c),F(f,o)<=0)break;c--}while(c);a.push(c),o=x(o,f)}return a.reverse(),[m(a),m(o)]}function N(e,n){var r=e.length,i=g(r),a=t,o,s,c=0,l;for(o=r-1;o>=0;--o)l=c*a+e[o],s=_(l/n),c=l-s*n,i[o]=s|0;return[i,c|0]}function P(e,n){var r,i=z(n);if(s)return[new d(e.value/i.value),new d(e.value%i.value)];var a=e.value,o=i.value,f;if(o===0)throw Error(`Cannot divide by zero`);if(e.isSmall)return i.isSmall?[new u(_(a/o)),new u(a%o)]:[c[0],e];if(i.isSmall){if(o===1)return[e,c[0]];if(o==-1)return[e.negate(),c[0]];var h=Math.abs(o);if(h<t){r=N(a,h),f=m(r[0]);var g=r[1];return e.sign&&(g=-g),typeof f==`number`?(e.sign!==i.sign&&(f=-f),[new u(f),new u(g)]):[new l(f,e.sign!==i.sign),new u(g)]}o=p(h)}var v=F(a,o);if(v===-1)return[c[0],e];if(v===0)return[c[e.sign===i.sign?1:-1],c[0]];r=a.length+o.length<=200?j(a,o):M(a,o),f=r[0];var y=e.sign!==i.sign,b=r[1],x=e.sign;return typeof f==`number`?(y&&(f=-f),f=new u(f)):f=new l(f,y),typeof b==`number`?(x&&(b=-b),b=new u(b)):b=new l(b,x),[f,b]}l.prototype.divmod=function(e){var t=P(this,e);return{quotient:t[0],remainder:t[1]}},d.prototype.divmod=u.prototype.divmod=l.prototype.divmod,l.prototype.divide=function(e){return P(this,e)[0]},d.prototype.over=d.prototype.divide=function(e){return new d(this.value/z(e).value)},u.prototype.over=u.prototype.divide=l.prototype.over=l.prototype.divide,l.prototype.mod=function(e){return P(this,e)[1]},d.prototype.mod=d.prototype.remainder=function(e){return new d(this.value%z(e).value)},u.prototype.remainder=u.prototype.mod=l.prototype.remainder=l.prototype.mod,l.prototype.pow=function(e){var t=z(e),n=this.value,r=t.value,i,a,o;if(r===0)return c[1];if(n===0)return c[0];if(n===1)return c[1];if(n===-1)return t.isEven()?c[1]:c[-1];if(t.sign)return c[0];if(!t.isSmall)throw Error(`The exponent `+t.toString()+` is too large.`);if(this.isSmall&&f(i=n**+r))return new u(_(i));for(a=this,o=c[1];r&!0&&(o=o.times(a),--r),r!==0;)r/=2,a=a.square();return o},u.prototype.pow=l.prototype.pow,d.prototype.pow=function(e){var t=z(e),n=this.value,r=t.value,i=BigInt(0),a=BigInt(1),o=BigInt(2);if(r===i)return c[1];if(n===i)return c[0];if(n===a)return c[1];if(n===BigInt(-1))return t.isEven()?c[1]:c[-1];if(t.isNegative())return new d(i);for(var s=this,l=c[1];(r&a)===a&&(l=l.times(s),--r),r!==i;)r/=o,s=s.square();return l},l.prototype.modPow=function(e,t){if(e=z(e),t=z(t),t.isZero())throw Error(`Cannot take modPow with modulus 0`);var n=c[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(c[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return c[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},d.prototype.modPow=u.prototype.modPow=l.prototype.modPow;function F(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}l.prototype.compareAbs=function(e){var t=z(e),n=this.value,r=t.value;return t.isSmall?1:F(n,r)},u.prototype.compareAbs=function(e){var t=z(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},d.prototype.compareAbs=function(e){var t=this.value,n=z(e).value;return t=t>=0?t:-t,n=n>=0?n:-n,t===n?0:t>n?1:-1},l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=z(e),n=this.value,r=t.value;return this.sign===t.sign?t.isSmall?this.sign?-1:1:F(n,r)*(this.sign?-1:1):t.sign?1:-1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=z(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0===t.sign?n<0?1:-1:n<0?-1:1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=z(e).value;return t===n?0:t>n?1:-1},d.prototype.compareTo=d.prototype.compare,l.prototype.equals=function(e){return this.compare(e)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals,l.prototype.notEquals=function(e){return this.compare(e)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals,l.prototype.greater=function(e){return this.compare(e)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater,l.prototype.lesser=function(e){return this.compare(e)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser,l.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals,l.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals,l.prototype.isEven=function(){return(this.value[0]&1)==0},u.prototype.isEven=function(){return(this.value&1)==0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},l.prototype.isOdd=function(){return(this.value[0]&1)==1},u.prototype.isOdd=function(){return(this.value&1)==1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},l.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,l.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,l.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},l.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},l.prototype.isDivisibleBy=function(e){var t=z(e);return t.isZero()?!1:t.isUnit()?!0:t.compareAbs(2)===0?this.isEven():this.mod(t).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=l.prototype.isDivisibleBy;function I(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(49))return!0}function L(e,t){for(var r=e.prev(),i=r,a=0,o,s,c;i.isEven();)i=i.divide(2),a++;next:for(s=0;s<t.length;s++)if(!e.lesser(t[s])&&(c=n(t[s]).modPow(i,e),!(c.isUnit()||c.equals(r)))){for(o=a-1;o!=0;o--){if(c=c.square().mod(e),c.isUnit())return!1;if(c.equals(r))continue next}return!1}return!0}l.prototype.isPrime=function(t){var r=I(this);if(r!==e)return r;var i=this.abs(),a=i.bitLength();if(a<=64)return L(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*a.toJSNumber(),s=Math.ceil(t===!0?2*o**2:o),c=[],l=0;l<s;l++)c.push(n(l+2));return L(i,c)},d.prototype.isPrime=u.prototype.isPrime=l.prototype.isPrime,l.prototype.isProbablePrime=function(t,r){var i=I(this);if(i!==e)return i;for(var a=this.abs(),o=t===e?5:t,s=[],c=0;c<o;c++)s.push(n.randBetween(2,a.minus(2),r));return L(a,s)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=l.prototype.isProbablePrime,l.prototype.modInv=function(e){for(var t=n.zero,r=n.one,i=z(e),a=this.abs(),o,s,c;!a.isZero();)o=i.divide(a),s=t,c=i,t=r,i=a,r=s.subtract(o.multiply(r)),a=c.subtract(o.multiply(a));if(!i.isUnit())throw Error(this.toString()+` and `+e.toString()+` are not co-prime`);return t.compare(0)===-1&&(t=t.add(e)),this.isNegative()?t.negate():t},d.prototype.modInv=u.prototype.modInv=l.prototype.modInv,l.prototype.next=function(){var e=this.value;return this.sign?C(e,1,this.sign):new l(b(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<i?new u(e+1):new l(a,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},l.prototype.prev=function(){var e=this.value;return this.sign?new l(b(e,1),!0):C(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-i?new u(e-1):new l(a,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var ee=R.length,te=R[ee-1];function ne(e){return Math.abs(e)<=t}l.prototype.shiftLeft=function(e){var t=z(e).toJSNumber();if(!ne(t))throw Error(String(t)+` is too large for shifting.`);if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=ee;)n=n.multiply(te),t-=ee-1;return n.multiply(R[t])},d.prototype.shiftLeft=u.prototype.shiftLeft=l.prototype.shiftLeft,l.prototype.shiftRight=function(e){var t,n=z(e).toJSNumber();if(!ne(n))throw Error(String(n)+` is too large for shifting.`);if(n<0)return this.shiftLeft(-n);for(var r=this;n>=ee;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;t=P(r,te),r=t[1].isNegative()?t[0].prev():t[0],n-=ee-1}return t=P(r,R[n]),t[1].isNegative()?t[0].prev():t[0]},d.prototype.shiftRight=u.prototype.shiftRight=l.prototype.shiftRight;function re(e,t,r){t=z(t);for(var i=e.isNegative(),a=t.isNegative(),o=i?e.not():e,s=a?t.not():t,c=0,l=0,u=null,d=null,f=[];!o.isZero()||!s.isZero();)u=P(o,te),c=u[1].toJSNumber(),i&&(c=te-1-c),d=P(s,te),l=d[1].toJSNumber(),a&&(l=te-1-l),o=u[0],s=d[0],f.push(r(c,l));for(var p=r(+!!i,+!!a)===0?n(0):n(-1),m=f.length-1;m>=0;--m)p=p.multiply(te).add(n(f[m]));return p}l.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=l.prototype.not,l.prototype.and=function(e){return re(this,e,function(e,t){return e&t})},d.prototype.and=u.prototype.and=l.prototype.and,l.prototype.or=function(e){return re(this,e,function(e,t){return e|t})},d.prototype.or=u.prototype.or=l.prototype.or,l.prototype.xor=function(e){return re(this,e,function(e,t){return e^t})},d.prototype.xor=u.prototype.xor=l.prototype.xor;var ie=1<<30,ae=(t&-t)*(t&-t)|ie;function oe(e){var n=e.value,r=typeof n==`number`?n|ie:typeof n==`bigint`?n|BigInt(ie):n[0]+n[1]*t|ae;return r&-r}function se(e,t){if(t.compareTo(e)<=0){var r=se(e,t.square(t)),i=r.p,a=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:a*2+1}:{p:i,e:a*2}}return{p:n(1),e:0}}l.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),e.compareTo(n(0))===0?n(0):n(se(e,n(2)).e).add(n(1))},d.prototype.bitLength=u.prototype.bitLength=l.prototype.bitLength;function ce(e,t){return e=z(e),t=z(t),e.greater(t)?e:t}function le(e,t){return e=z(e),t=z(t),e.lesser(t)?e:t}function ue(e,t){if(e=z(e).abs(),t=z(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n=c[1],r,i;e.isEven()&&t.isEven();)r=le(oe(e),oe(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(oe(e));do{for(;t.isEven();)t=t.divide(oe(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function de(e,t){return e=z(e).abs(),t=z(t).abs(),e.divide(ue(e,t)).multiply(t)}function fe(e,n,r){e=z(e),n=z(n);var i=r||Math.random,a=le(e,n),o=ce(e,n).subtract(a).add(1);if(o.isSmall)return a.add(Math.floor(i()*o));for(var s=ge(o,t).value,l=[],u=!0,d=0;d<s.length;d++){var f=u?s[d]+(d+1<s.length?s[d+1]/t:0):t,p=_(i()*f);l.push(p),p<s[d]&&(u=!1)}return a.add(c.fromArray(l,t,!1))}var pe=function(e,t,n,r){n||=o,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var i=e.length,a,s=Math.abs(t),c={};for(a=0;a<n.length;a++)c[n[a]]=a;for(a=0;a<i;a++){var l=e[a];if(l!==`-`&&l in c&&c[l]>=s){if(l===`1`&&s===1)continue;throw Error(l+` is not a valid digit in base `+t+`.`)}}t=z(t);var u=[],d=e[0]===`-`;for(a=+!!d;a<e.length;a++){var l=e[a];if(l in c)u.push(z(c[l]));else if(l===`<`){var f=a;do a++;while(e[a]!==`>`&&a<e.length);u.push(z(e.slice(f+1,a)))}else throw Error(l+` is not a valid character`)}return me(u,t,d)};function me(e,t,n){var r=c[0],i=c[1],a;for(a=e.length-1;a>=0;a--)r=r.add(e[a].times(i)),i=i.times(t);return n?r.negate():r}function he(e,t){return t||=o,e<t.length?t[e]:`<`+e+`>`}function ge(e,t){if(t=n(t),t.isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw Error(`Cannot convert nonzero numbers to base 0.`)}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var a=[],o=e,s;o.isNegative()||o.compareAbs(t)>=0;){s=o.divmod(t),o=s.quotient;var c=s.remainder;c.isNegative()&&(c=t.minus(c).abs(),o=o.next()),a.push(c.toJSNumber())}return a.push(o.toJSNumber()),{value:a.reverse(),isNegative:i}}function _e(e,t,n){var r=ge(e,t);return(r.isNegative?`-`:``)+r.value.map(function(e){return he(e,n)}).join(``)}l.prototype.toArray=function(e){return ge(this,e)},u.prototype.toArray=function(e){return ge(this,e)},d.prototype.toArray=function(e){return ge(this,e)},l.prototype.toString=function(t,n){if(t===e&&(t=10),t!==10||n)return _e(this,t,n);for(var r=this.value,i=r.length,a=String(r[--i]),o=`0000000`,s;--i>=0;)s=String(r[i]),a+=o.slice(s.length)+s;return(this.sign?`-`:``)+a},u.prototype.toString=function(t,n){return t===e&&(t=10),t!=10||n?_e(this,t,n):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=l.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},l.prototype.valueOf=function(){return parseInt(this.toString(),10)},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function ve(e){if(f(+e)){var t=+e;if(t===_(t))return s?new d(BigInt(t)):new u(t);throw Error(`Invalid integer: `+e)}var n=e[0]===`-`;n&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw Error(`Invalid integer: `+i.join(`e`));if(i.length===2){var a=i[1];if(a[0]===`+`&&(a=a.slice(1)),a=+a,a!==_(a)||!f(a))throw Error(`Invalid integer: `+a+` is not a valid exponent.`);var o=i[0],c=o.indexOf(`.`);if(c>=0&&(a-=o.length-c-1,o=o.slice(0,c)+o.slice(c+1)),a<0)throw Error(`Cannot include negative exponent part for integers`);o+=Array(a+1).join(`0`),e=o}if(!/^([0-9][0-9]*)$/.test(e))throw Error(`Invalid integer: `+e);if(s)return new d(BigInt(n?`-`+e:e));for(var p=[],m=e.length,g=r,v=m-g;m>0;)p.push(+e.slice(v,m)),v-=g,v<0&&(v=0),m-=g;return h(p),new l(p,n)}function ye(e){if(s)return new d(BigInt(e));if(f(e)){if(e!==_(e))throw Error(e+` is not an integer.`);return new u(e)}return ve(e.toString())}function z(e){return typeof e==`number`?ye(e):typeof e==`string`?ve(e):typeof e==`bigint`?new d(e):e}for(var be=0;be<1e3;be++)c[be]=z(be),be>0&&(c[-be]=z(-be));return c.one=c[1],c.zero=c[0],c.minusOne=c[-1],c.max=ce,c.min=le,c.gcd=ue,c.lcm=de,c.isInstance=function(e){return e instanceof l||e instanceof u||e instanceof d},c.randBetween=fe,c.fromArray=function(e,t,n){return me(e.map(z),z(t||10),n)},c})();t!==void 0&&t.hasOwnProperty(`exports`)&&(t.exports=n),typeof define==`function`&&define.amd&&define(function(){return n})})),Gh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.exponentDecStringToDecString=e.isExponentDecString=e.isValidDecimalString=e.isValidIntegerString=void 0;var t=/^-?\d+$/,n=/^-?\d+.?\d*$/,r=/^(-?)([\d.]+)e([-+])([\d]+)$/;function i(e){return t.test(e)}e.isValidIntegerString=i;function a(e){return n.test(e)}e.isValidDecimalString=a;function o(e){return r.test(e)}e.isExponentDecString=o;function s(e){let t=``;for(let n=0;n<e;n++)t+=`0`;return t}function c(e){for(;e.length>0&&e[0]===`0`;)e=e.slice(1);return e.length===0||e[0]===`.`?`0`+e:e}function l(e){let t=e.split(r);if(t.length!==6)return e;let n=t[1]===`-`,i=t[2],a=i.indexOf(`.`),o=t[4],l=parseInt(o)*(t[3]===`-`?-1:1);if(a>=0){let e=i.length-a-1;l-=e,i=c(i.replace(`.`,``))}let u=n?`-`:``;if(l<0){if(i.length>-l){let e=i.length+l;return u+(i.slice(0,e)+`.`+i.slice(e))}return u+`0.`+s(-(i.length+l))+i}else return u+i+s(l)}e.exponentDecStringToDecString=l})),Kh=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uint=e.Int=void 0;var n=t(Wh()),r=Gh(),i=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.int=(0,n.default)(e)}else this.int=(0,n.default)(e);this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxInt))throw Error(`Integer out of range ${this.int.toString()}`)}toString(){return this.int.toString(10)}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}isZero(){return this.int.eq((0,n.default)(0))}equals(e){return this.int.equals(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.greaterOrEquals(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.lesserOrEquals(e.int)}abs(){return new e(this.int.abs())}absUInt(){return new a(this.int.abs())}add(t){return new e(this.int.add(t.int))}sub(t){return new e(this.int.subtract(t.int))}mul(t){return new e(this.int.multiply(t.int))}div(t){return new e(this.int.divide(t.int))}mod(t){return new e(this.int.mod(t.int))}neg(){return new e(this.int.negate())}pow(t){return new e(this.int.pow(t.toBigNumber()))}toBigNumber(){return this.int}};e.Int=i,i.maxInt=(0,n.default)(`115792089237316195423570985008687907853269984665640564039457584007913129639935`);var a=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.uint=(0,n.default)(e)}else this.uint=(0,n.default)(e);if(this.uint.isNegative())throw TypeError(`Uint should not be negative`);this.checkBitLen()}checkBitLen(){if(this.uint.abs().bitLength().gt(256))throw Error(`Integer out of range ${this.uint.toString()}`)}toString(){return this.uint.toString(10)}isZero(){return this.uint.eq((0,n.default)(0))}equals(e){return this.uint.equals(e.uint)}gt(e){return this.uint.gt(e.uint)}gte(e){return this.uint.greaterOrEquals(e.uint)}lt(e){return this.uint.lt(e.uint)}lte(e){return this.uint.lesserOrEquals(e.uint)}add(t){return new e(this.uint.add(t.uint))}sub(t){return new e(this.uint.subtract(t.uint))}mul(t){return new e(this.uint.multiply(t.uint))}div(t){return new e(this.uint.divide(t.uint))}mod(t){return new e(this.uint.mod(t.uint))}pow(t){return new e(this.uint.pow(t.toBigNumber()))}toBigNumber(){return this.uint}};e.Uint=a})),qh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integerStringToUSLocaleString=void 0;function t(e){if(e.indexOf(`.`)>=0)throw Error(`${e} is not integer`);if(typeof BigInt<`u`)return BigInt(e).toLocaleString(`en-US`);let t=e,n=[];for(let e=t.length;e>0;e-=3)n.push(t.slice(Math.max(0,e-3),e));return n.reverse().join(`,`)}e.integerStringToUSLocaleString=t})),Jh=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Dec=void 0;var n=t(Wh()),r=Kh(),i=Gh(),a=qh(),o=class e{static calcPrecisionMultiplier(t){if(t<0)throw Error(`Invalid prec`);if(t>e.precision)throw Error(`Too much precision`);let r=t.toString(),i=e.precisionMultipliers.get(r);if(i)return i;let a=e.precision-t,o=(0,n.default)(10).pow(a);return e.precisionMultipliers.set(r,o),o}static reduceDecimalsFromString(t){let n=t.indexOf(`.`);if(n<0)return{res:t,isDownToZero:!1};let r=t.length-1-n-e.precision;if(r<=0)return{res:t,isDownToZero:!1};let i=t.slice(0,t.length-r);return{res:i,isDownToZero:/^[0.]*$/.test(i)}}constructor(t,a=0){if(typeof t==`number`&&(t=t.toString()),typeof t==`string`){if(t.length===0)throw Error(`empty string`);if(!(0,i.isValidDecimalString)(t))if((0,i.isExponentDecString)(t))t=(0,i.exponentDecStringToDecString)(t);else throw Error(`invalid decimal: ${t}`);let r=e.reduceDecimalsFromString(t);r.isDownToZero,t=r.res,t.indexOf(`.`)>=0&&(a=t.length-t.indexOf(`.`)-1,t=t.replace(`.`,``)),this.int=(0,n.default)(t)}else t instanceof r.Int||t instanceof r.Uint?this.int=(0,n.default)(t.toString()):this.int=(0,n.default)(t);this.int=this.int.multiply(e.calcPrecisionMultiplier(a)),this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxDec))throw Error(`Integer out of range ${this.int.toString()}`)}isZero(){return this.int.eq((0,n.default)(0))}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}equals(e){return this.int.eq(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.geq(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.leq(e.int)}neg(){return new e(this.int.negate(),e.precision)}abs(){return new e(this.int.abs(),e.precision)}add(t){return new e(this.int.add(t.int),e.precision)}sub(t){return new e(this.int.subtract(t.int),e.precision)}pow(t){if(t.isZero())return new e(1);if(t.isNegative())return new e(1).quo(this.pow(t.abs()));let n=new e(this.int,e.precision),i=new e(1);for(let e=t;e.gt(new r.Int(1));e=e.div(new r.Int(2)))e.mod(new r.Int(2)).isZero()||(i=i.mul(n)),n=n.mul(n);return n.mul(i)}approxSqrt(){return this.approxRoot(2)}approxRoot(t,n=300){if(this.isNegative())return this.neg().approxRoot(t).neg();if(t===1||this.isZero()||this.equals(e.one))return this;if(t===0)return e.one;let[i,a]=[e.one,e.one];for(let o=0;a.abs().gt(e.smallestDec)&&o<n;o++){let n=i.pow(new r.Int(t-1));n.isZero()&&(n=e.smallestDec),a=this.quo(n),a=a.sub(i),a=a.quoTruncate(new e(t)),i=i.add(a)}return i}mul(t){return new e(this.mulRaw(t).chopPrecisionAndRound(),e.precision)}mulTruncate(t){return new e(this.mulRaw(t).chopPrecisionAndTruncate(),e.precision)}mulRoundUp(t){return new e(this.mulRaw(t).chopPrecisionAndRoundUp(),e.precision)}mulRaw(t){return new e(this.int.multiply(t.int),e.precision)}quo(t){return new e(this.quoRaw(t).chopPrecisionAndRound(),e.precision)}quoTruncate(t){return new e(this.quoRaw(t).chopPrecisionAndTruncate(),e.precision)}quoRoundUp(t){return new e(this.quoRaw(t).chopPrecisionAndRoundUp(),e.precision)}quoRaw(t){let n=e.calcPrecisionMultiplier(0);return new e(this.int.multiply(n).multiply(n).divide(t.int),e.precision)}isInteger(){let t=e.calcPrecisionMultiplier(0);return this.int.remainder(t).equals((0,n.default)(0))}chopPrecisionAndRound(){if(this.isNegative())return this.abs().chopPrecisionAndRound().negate();let t=e.calcPrecisionMultiplier(0),r=t.divide((0,n.default)(2)),{quotient:i,remainder:a}=this.int.divmod(t);return a.equals((0,n.default)(0))||a.lt(r)?i:a.gt(r)?i.add((0,n.default)(1)):i.divide((0,n.default)(2)).equals((0,n.default)(0))?i:i.add((0,n.default)(1))}chopPrecisionAndRoundUp(){if(this.isNegative())return this.abs().chopPrecisionAndTruncate().negate();let t=e.calcPrecisionMultiplier(0),{quotient:r,remainder:i}=this.int.divmod(t);return i.equals((0,n.default)(0))?r:r.add((0,n.default)(1))}chopPrecisionAndTruncate(){let t=e.calcPrecisionMultiplier(0);return this.int.divide(t)}toString(t=e.precision,r=!1){let i=e.calcPrecisionMultiplier(0),{quotient:o,remainder:s}=this.int.abs().divmod(i),c=s.toString(10);for(let t=0,n=c.length;t<e.precision-n;t++)c=`0`+c;c=c.substring(0,t);let l=this.isNegative()&&!(o.eq((0,n.default)(0))&&c.length===0),u=r?(0,a.integerStringToUSLocaleString)(o.toString()):o.toString();return`${l?`-`:``}${u}${c.length>0?`.`+c:``}`}round(){return new r.Int(this.chopPrecisionAndRound())}roundUp(){return new r.Int(this.chopPrecisionAndRoundUp())}truncate(){return new r.Int(this.chopPrecisionAndTruncate())}roundDec(){return new e(this.chopPrecisionAndRound(),0)}roundUpDec(){return new e(this.chopPrecisionAndRoundUp(),0)}truncateDec(){return new e(this.chopPrecisionAndTruncate(),0)}};e.Dec=o,o.precision=18,o.decimalPrecisionBits=60,o.maxDec=(0,n.default)(`133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535`),o.precisionMultipliers=new Map,o.zero=new o(0),o.smallestDec=new o(`1`,o.precision),o.one=new o(1),r.Int.prototype.toDec=function(){return new o(this)},r.Uint.prototype.toDec=function(){return new o(this)}})),Yh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DecUtils=void 0;var t=Jh(),n=Kh(),r=class e{static trim(e){let t=typeof e==`string`?e:e.toString();if(t.indexOf(`.`)<0)return t;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)t=t.slice(0,e);return t.length>0&&t[t.length-1]===`.`&&(t=t.slice(0,t.length-1)),t}static getTenExponentN(r){if(r<-t.Dec.precision)throw Error(`Too little precision`);if(e.tenExponentNs[r.toString()])return e.tenExponentNs[r.toString()];let i=new t.Dec(10).pow(new n.Int(r));return e.tenExponentNs[r.toString()]=i,i}static getTenExponentNInPrecisionRange(n){if(n>t.Dec.precision)throw Error(`Too much precision`);return e.getTenExponentN(n)}static getPrecisionDec(t){return e.getTenExponentNInPrecisionRange(t)}};e.DecUtils=r,r.tenExponentNs={}})),Xh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Coin=void 0;var t=Kh();e.Coin=class e{static parse(t){let n=RegExp(`([0-9]+)[ ]*([a-zA-Z]+)$`).exec(t);if(!n||n.length!==3)throw Error(`Invalid coin str`);let r=n[2],i=n[1];return new e(r,i)}constructor(e,n){this.denom=e,this.amount=n instanceof t.Int?n:new t.Int(n)}toString(){return`${this.amount.toString()}${this.denom}`}}})),Zh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoinUtils=void 0;var t=Xh(),n=Kh(),r=Jh(),i=Yh(),a=qh(),o=class e{static createCoinsFromPrimitives(e){return e.map(e=>new t.Coin(e.denom,e.amount))}static amountOf(e,t){let r=e.find(e=>e.denom===t);return r?r.amount:new n.Int(0)}static exclude(e,t){return e.filter(e=>t.indexOf(e.denom)===0)}static concat(...e){return e.length===0?[]:e.slice().reduce((e,n)=>{let r=e.find(e=>e.denom===n.denom);if(r){let i=new t.Coin(r.denom,r.amount.add(n.amount));e.push(i)}else{let r=new t.Coin(n.denom,n.amount);e.push(r)}return e},[])}static getCoinFromDecimals(e,n,i){let a=e.find(e=>e.coinDenom===i);if(!a)throw Error(`Invalid currency`);let o=new r.Dec(1);for(let e=0;e<a.coinDecimals;e++)o=o.mul(new r.Dec(10));let s=new r.Dec(n);if(s=s.mul(o),!new r.Dec(s.truncate()).equals(s))throw Error(`Can't divide anymore`);return new t.Coin(a.coinMinimalDenom,s.truncate())}static parseDecAndDenomFromCoin(e,t){let n=e.find(e=>e.coinMinimalDenom===t.denom);n||={coinDecimals:0,coinDenom:t.denom,coinMinimalDenom:t.denom};let i=new r.Dec(1);for(let e=0;e<n.coinDecimals;e++)i=i.mul(new r.Dec(10));return{amount:new r.Dec(t.amount).quoTruncate(i).toString(n.coinDecimals),denom:n.coinDenom}}static shrinkDecimals(t,n,i,a=!1){if(t.equals(new r.Dec(0)))return`0`;let o=t.isNegative(),s=t.abs().truncate(),c=t.abs().sub(new r.Dec(s)),l=Math.max(i-s.toString().length+1,n),u=l===0?``:c.toString(l).replace(`0.`,``),d=a?e.integerStringToUSLocaleString(s.toString()):s.toString();return(o?`-`:``)+d+(u.length>0?`.`:``)+u}static coinToTrimmedString(e,t,n=` `){let a=new r.Dec(e.amount).quoTruncate(i.DecUtils.getPrecisionDec(t.coinDecimals));return`${i.DecUtils.trim(a)}${n}${t.coinDenom}`}};e.CoinUtils=o,o.integerStringToUSLocaleString=a.integerStringToUSLocaleString})),Qh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntPretty=void 0;var t=Kh(),n=Jh(),r=Yh(),i=Zh();e.IntPretty=class e{constructor(e){if(this.floatingDecimalPointRight=0,this._options={maxDecimals:0,trim:!1,shrink:!1,ready:!0,locale:!0,inequalitySymbol:!1,inequalitySymbolSeparator:` `},typeof e==`object`&&`toDec`in e?e=e.toDec():e instanceof n.Dec||(e=new n.Dec(e)),e.isZero()){this.dec=e;return}let r=e,i=0;for(let e=0;e<18&&!(!r.truncate().equals(new t.Int(0))&&r.equals(new n.Dec(r.truncate())));e++)r=r.mul(new n.Dec(10)),i++;this.dec=e,this._options.maxDecimals=i}get options(){return this._options}moveDecimalPointLeft(e){let t=this.clone();return t.floatingDecimalPointRight+=-e,t}moveDecimalPointRight(e){let t=this.clone();return t.floatingDecimalPointRight+=e,t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t._options.maxDecimals=e,t}inequalitySymbol(e){let t=this.clone();return t._options.inequalitySymbol=e,t}inequalitySymbolSeparator(e){let t=this.clone();return t._options.inequalitySymbolSeparator=e,t}trim(e){let t=this.clone();return t._options.trim=e,t}shrink(e){let t=this.clone();return t._options.shrink=e,t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t._options.ready=e,t}get isReady(){return this._options.ready}add(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().add(t));return r._options=Object.assign({},this._options),r}sub(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().sub(t));return r._options=Object.assign({},this._options),r}mul(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().mul(t));return r._options=Object.assign({},this._options),r}quo(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().quo(t));return r._options=Object.assign({},this._options),r}toDec(){if(this.floatingDecimalPointRight===0)return this.dec;if(this.floatingDecimalPointRight>0)return this.dec.mulTruncate(r.DecUtils.getTenExponentN(this.floatingDecimalPointRight));{let e=-this.floatingDecimalPointRight,t=this.dec;for(;e>0;)if(e>=n.Dec.precision)t=t.mulTruncate(r.DecUtils.getTenExponentN(-n.Dec.precision)),e-=n.Dec.precision;else{t=t.mulTruncate(r.DecUtils.getTenExponentN(-(e%n.Dec.precision)));break}return t}}toString(){return this.toStringWithSymbols(``,``)}toStringWithSymbols(e,t){let n=this.toDec();if(this._options.inequalitySymbol&&!n.isZero()&&n.abs().lt(r.DecUtils.getTenExponentN(-this._options.maxDecimals))){let i=n.isNegative();return`${i?`>`:`<`}${this._options.inequalitySymbolSeparator}${i?`-`:``}${e}${r.DecUtils.getTenExponentN(-this._options.maxDecimals).toString(this._options.maxDecimals,this._options.locale)}${t}`}let a;a=this._options.shrink?i.CoinUtils.shrinkDecimals(n,0,this._options.maxDecimals,this._options.locale):n.toString(this._options.maxDecimals,this._options.locale),this._options.trim&&(a=r.DecUtils.trim(a));let o=a.charAt(0)===`-`;return o&&(a=a.slice(1)),`${o?`-`:``}${e}${a}${t}`}clone(){let t=new e(this.dec);return t.dec=this.dec,t.floatingDecimalPointRight=this.floatingDecimalPointRight,t._options=Object.assign({},this._options),t}}})),$h=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoinPretty=void 0;var t=Qh(),n=Jh(),r=Yh();e.CoinPretty=class e{constructor(e,i){this._currency=e,this._options={separator:` `,upperCase:!1,lowerCase:!1,hideDenom:!1,hideIBCMetadata:!1},typeof i==`object`&&`toDec`in i?i=i.toDec():i instanceof n.Dec||(i=new n.Dec(i)),this.intPretty=new t.IntPretty(i.quoTruncate(r.DecUtils.getTenExponentNInPrecisionRange(e.coinDecimals))).maxDecimals(e.coinDecimals)}get options(){return Object.assign(Object.assign({},this._options),this.intPretty.options)}get denom(){return this.currency.coinDenom}get currency(){return this._currency}setCurrency(e){let t=this.clone();return t.intPretty=this.intPretty.moveDecimalPointRight(this._currency.coinDecimals-e.coinDecimals),t._currency=e,t}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}hideDenom(e){let t=this.clone();return t._options.hideDenom=e,t}hideIBCMetadata(e){let t=this.clone();return t._options.hideIBCMetadata=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.add(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}sub(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.sub(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toCoin(){let e=this.toDec().mulTruncate(r.DecUtils.getTenExponentNInPrecisionRange(this.currency.coinDecimals)).truncate();return{denom:this.currency.coinMinimalDenom,amount:e.toString()}}toString(){let e=this.denom;this._options.hideIBCMetadata&&`originCurrency`in this.currency&&this.currency.originCurrency&&(e=this.currency.originCurrency.coinDenom),this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this._options.separator;return this._options.hideDenom&&(e=``,t=``),this.intPretty.toStringWithSymbols(``,`${t}${e}`)}clone(){let t=new e(this._currency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),eg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PricePretty=void 0;var t=Qh(),n=Yh();e.PricePretty=class e{constructor(e,n){this._fiatCurrency=e,this._options={separator:``,upperCase:!1,lowerCase:!1,locale:`en-US`},this.intPretty=new t.IntPretty(n).maxDecimals(e.maxDecimals).shrink(!0).trim(!0).locale(!1).inequalitySymbol(!0),this._options.locale=e.locale}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}get symbol(){return this._fiatCurrency.symbol}get fiatCurrency(){return this._fiatCurrency}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){let e=this.symbol;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this.toDec(),r=this.options;if(r.inequalitySymbol&&!t.isZero()&&t.abs().lt(n.DecUtils.getTenExponentN(-r.maxDecimals)))return this.intPretty.toStringWithSymbols(`${e}${this._options.separator}`,``);let i=parseFloat(this.intPretty.toString()).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals}),a=i.charAt(0)===`-`;return a&&(i=i.slice(1)),`${a?`-`:``}${e}${this._options.separator}${i}`}clone(){let t=new e(this._fiatCurrency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),tg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RatePretty=void 0;var t=Qh();e.RatePretty=class e{constructor(e){this._options={separator:``,symbol:`%`},this.intPretty=new t.IntPretty(e),this.intPretty=this.intPretty.maxDecimals(3).shrink(!1).trim(!0).locale(!0).inequalitySymbol(!0)}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}separator(e){let t=this.clone();return t._options.separator=e,t}symbol(e){let t=this.clone();return t._options.symbol=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){return this.intPretty.moveDecimalPointRight(2).toStringWithSymbols(``,`${this._options.separator}${this._options.symbol}`)}clone(){let t=new e(0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),ng=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Qh(),e),n($h(),e),n(Xh(),e),n(Kh(),e),n(Jh(),e),n(Zh(),e),n(Yh(),e),n(eg(),e),n(tg(),e)})),rg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSimpleFetchError=e.SimpleFetchError=void 0;var t=class e extends Error{constructor(t,n,r){super(`Failed to get response from ${new URL(n,t).toString()}`),this.baseURL=t,this.url=n,this.response=r,Object.setPrototypeOf(this,e.prototype)}};e.SimpleFetchError=t;function n(e){return e instanceof t}e.isSimpleFetchError=n})),ig=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.simpleFetch=e.makeURL=void 0;var r=rg();function i(e,t){let n=new URL(e);return e=o(n.origin),t=o(n.pathname)+`/`+a(t),o(e+`/`+a(t))}e.makeURL=i;function a(e){return e.length>0&&e[0]===`/`?e.slice(1):e}function o(e){return e.length>0&&e[e.length-1]===`/`?e.slice(0,e.length-1):e}function s(e,a,o){return t(this,void 0,void 0,function*(){typeof a!=`string`&&(a&&(o=a),a=``),a===`/`&&(a=``);let t=i(e,a),s=o||{},{headers:l}=s,u=n(s,[`headers`]),d=yield fetch(t,Object.assign({headers:Object.assign({accept:`application/json, text/plain, */*`},l)},u)),f;if((d.headers.get(`content-type`)||``).startsWith(`application/json`))f=yield d.json();else{let e=yield d.text(),t=e.trim();f=t.startsWith(`{`)&&t.endsWith(`}`)?JSON.parse(t):e}let p={url:t,data:f,headers:d.headers,status:d.status,statusText:d.statusText};if(!(o?.validateStatus||c)(d.status))throw new r.SimpleFetchError(e,a,p);return p})}e.simpleFetch=s;function c(e){return e===200}})),ag=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),og=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(ig(),e),n(rg(),e),n(ag(),e)})),sg=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseAccount=void 0;var n=ng(),r=og();e.BaseAccount=class e{static fetchFromRest(n,i,a=!1){return t(this,void 0,void 0,function*(){let t=yield(0,r.simpleFetch)(n,`/cosmos/auth/v1beta1/accounts/${i}`,{validateStatus:function(e){return e>=200&&e<300||e===404}});return e.fromProtoJSON(t.data,a?i:``)})}static fromProtoJSON(t,r=``){if(!t.account){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);return new e(``,r,new n.Int(0),new n.Int(0))}let i=t.account,a=i[`@type`]||``,o=i.BaseAccount||i.baseAccount||i.base_account;o&&(i=o);let s=i.account;s&&(i=s);let c=i.BaseVestingAccount||i.baseVestingAccount||i.base_vesting_account;if(c){i=c;let e=i.BaseAccount||i.baseAccount||i.base_account;e&&(i=e)}let l=i.address;if(!l){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);l=r}let u=i.account_number,d=i.sequence;return new e(a,l,new n.Int(u||`0`),new n.Int(d||`0`))}constructor(e,t,n,r){this.type=e,this.address=t,this.accountNumber=n,this.sequence=r}getType(){return this.type}getAddress(){return this.address}getAccountNumber(){return this.accountNumber}getSequence(){return this.sequence}}})),cg,lg=t((()=>{cg=`logger/5.8.0`}));function ug(){try{let e=[];if([`NFD`,`NFC`,`NFKD`,`NFKC`].forEach(t=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad normalize`)}catch{e.push(t)}}),e.length)throw Error(`missing `+e.join(`, `));if(`é`.normalize(`NFD`)!==`é`)throw Error(`broken implementation`)}catch(e){return e.message}return null}var dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg=t((()=>{lg(),dg=!1,fg=!1,pg={debug:1,default:2,info:2,warning:3,error:4,off:5},mg=pg.default,hg=null,gg=ug(),(function(e){e.DEBUG=`DEBUG`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.OFF=`OFF`})(_g||={}),(function(e){e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e.NOT_IMPLEMENTED=`NOT_IMPLEMENTED`,e.UNSUPPORTED_OPERATION=`UNSUPPORTED_OPERATION`,e.NETWORK_ERROR=`NETWORK_ERROR`,e.SERVER_ERROR=`SERVER_ERROR`,e.TIMEOUT=`TIMEOUT`,e.BUFFER_OVERRUN=`BUFFER_OVERRUN`,e.NUMERIC_FAULT=`NUMERIC_FAULT`,e.MISSING_NEW=`MISSING_NEW`,e.INVALID_ARGUMENT=`INVALID_ARGUMENT`,e.MISSING_ARGUMENT=`MISSING_ARGUMENT`,e.UNEXPECTED_ARGUMENT=`UNEXPECTED_ARGUMENT`,e.CALL_EXCEPTION=`CALL_EXCEPTION`,e.INSUFFICIENT_FUNDS=`INSUFFICIENT_FUNDS`,e.NONCE_EXPIRED=`NONCE_EXPIRED`,e.REPLACEMENT_UNDERPRICED=`REPLACEMENT_UNDERPRICED`,e.UNPREDICTABLE_GAS_LIMIT=`UNPREDICTABLE_GAS_LIMIT`,e.TRANSACTION_REPLACED=`TRANSACTION_REPLACED`,e.ACTION_REJECTED=`ACTION_REJECTED`})(vg||={}),yg=`0123456789abcdef`,bg=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();pg[n]??this.throwArgumentError(`invalid log level name`,`logLevel`,e),!(mg>pg[n])&&console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(fg)return this.makeError(`censored error`,n,{});n||=e.errors.UNKNOWN_ERROR,r||={};let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let n=``;for(let e=0;e<t.length;e++)n+=yg[t[e]>>4],n+=yg[t[e]&15];i.push(e+`=Uint8Array(0x`+n+`)`)}else i.push(e+`=`+JSON.stringify(t))}catch{i.push(e+`=`+JSON.stringify(r[e].toString()))}}),i.push(`code=${n}`),i.push(`version=${this.version}`);let a=t,o=``;switch(n){case vg.NUMERIC_FAULT:{o=`NUMERIC_FAULT`;let e=t;switch(e){case`overflow`:case`underflow`:case`division-by-zero`:o+=`-`+e;break;case`negative-power`:case`negative-width`:o+=`-unsupported`;break;case`unbound-bitwise-result`:o+=`-unbound-result`;break}break}case vg.CALL_EXCEPTION:case vg.INSUFFICIENT_FUNDS:case vg.MISSING_NEW:case vg.NONCE_EXPIRED:case vg.REPLACEMENT_UNDERPRICED:case vg.TRANSACTION_REPLACED:case vg.UNPREDICTABLE_GAS_LIMIT:o=n;break}o&&(t+=` [ See: https://links.ethers.org/v5-errors-`+o+` ]`),i.length&&(t+=` (`+i.join(`, `)+`)`);let s=Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){t??=`platform missing String.prototype.normalize`,gg&&this.throwError(`platform missing String.prototype.normalize`,e.errors.UNSUPPORTED_OPERATION,{operation:`String.prototype.normalize`,form:gg})}checkSafeUint53(t,n){typeof t==`number`&&(n??=`value not safe`,(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`out-of-safe-range`,value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`non-integer`,value:t}))}checkArgumentCount(t,n,r){r=r?`: `+r:``,t<n&&this.throwError(`missing argument`+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError(`too many arguments`+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError(`cannot instantiate abstract class `+JSON.stringify(n.name)+` directly; use a sub-class`,e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:`new`}):(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return hg||=new e(cg),hg}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError(`cannot permanently disable censorship`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`}),dg){if(!t)return;this.globalLogger().throwError(`error censorship permanent`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`})}fg=!!t,dg=!!n}static setLogLevel(t){let n=pg[t.toLowerCase()];if(n==null){e.globalLogger().warn(`invalid log level - `+t);return}mg=n}static from(t){return new e(t)}},bg.errors=vg,bg.levels=_g})),Sg,Cg=t((()=>{Sg=`bytes/5.8.0`}));function wg(e){return!!e.toHexString}function Tg(e){return e.slice||=function(){let t=Array.prototype.slice.call(arguments);return Tg(new Uint8Array(Array.prototype.slice.apply(e,t)))},e}function Eg(e){return Mg(e)&&!(e.length%2)||Og(e)}function Dg(e){return typeof e==`number`&&e==e&&e%1==0}function Og(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==`string`||!Dg(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let n=e[t];if(!Dg(n)||n<0||n>=256)return!1}return!0}function kg(e,t){if(t||={},typeof e==`number`){Ig.checkSafeUint53(e,`invalid arrayify value`);let t=[];for(;e;)t.unshift(e&255),e=parseInt(String(e/256));return t.length===0&&t.push(0),Tg(new Uint8Array(t))}if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wg(e)&&(e=e.toHexString()),Mg(e)){let n=e.substring(2);n.length%2&&(t.hexPad===`left`?n=`0`+n:t.hexPad===`right`?n+=`0`:Ig.throwArgumentError(`hex data is odd-length`,`value`,e));let r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return Tg(new Uint8Array(r))}return Og(e)?Tg(new Uint8Array(e)):Ig.throwArgumentError(`invalid arrayify value`,`value`,e)}function Ag(e){let t=e.map(e=>kg(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),Tg(r)}function jg(e){let t=kg(e);if(t.length===0)return t;let n=0;for(;n<t.length&&t[n]===0;)n++;return n&&(t=t.slice(n)),t}function Mg(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function Ng(e,t){if(t||={},typeof e==`number`){Ig.checkSafeUint53(e,`invalid hexlify value`);let t=``;for(;e;)t=Lg[e&15]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t=`0`+t),`0x`+t):`0x00`}if(typeof e==`bigint`)return e=e.toString(16),e.length%2?`0x0`+e:`0x`+e;if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wg(e))return e.toHexString();if(Mg(e))return e.length%2&&(t.hexPad===`left`?e=`0x0`+e.substring(2):t.hexPad===`right`?e+=`0`:Ig.throwArgumentError(`hex data is odd-length`,`value`,e)),e.toLowerCase();if(Og(e)){let t=`0x`;for(let n=0;n<e.length;n++){let r=e[n];t+=Lg[(r&240)>>4]+Lg[r&15]}return t}return Ig.throwArgumentError(`invalid hexlify value`,`value`,e)}function Pg(e){if(typeof e!=`string`)e=Ng(e);else if(!Mg(e)||e.length%2)return null;return(e.length-2)/2}function Fg(e,t,n){return typeof e==`string`?(!Mg(e)||e.length%2)&&Ig.throwArgumentError(`invalid hexData`,`value`,e):e=Ng(e),t=2+2*t,n==null?`0x`+e.substring(t):`0x`+e.substring(t,2+2*n)}var Ig,Lg,Rg=t((()=>{xg(),Cg(),Ig=new bg(Sg),Lg=`0123456789abcdef`})),zg,Bg=t((()=>{zg=`bignumber/5.8.0`}));function Vg(e){if(typeof e!=`string`)return Vg(e.toString(16));if(e[0]===`-`)return e=e.substring(1),e[0]===`-`&&Jg.throwArgumentError(`invalid hex`,`value`,e),e=Vg(e),e===`0x00`?e:`-`+e;if(e.substring(0,2)!==`0x`&&(e=`0x`+e),e===`0x`)return`0x00`;for(e.length%2&&(e=`0x0`+e.substring(2));e.length>4&&e.substring(0,4)===`0x00`;)e=`0x`+e.substring(4);return e}function Hg(e){return Qg.from(Vg(e))}function Y(e){let t=Qg.from(e).toHexString();return t[0]===`-`?new qg(`-`+t.substring(3),16):new qg(t.substring(2),16)}function Ug(e,t,n){let r={fault:e,operation:t};return n!=null&&(r.value=n),Jg.throwError(e,bg.errors.NUMERIC_FAULT,r)}function Wg(e){return new qg(e,36).toString(16)}function Gg(e){return new qg(e,16).toString(36)}var Kg,qg,Jg,Yg,Xg,Zg,Qg,$g=t((()=>{Kg=i(j()),Rg(),xg(),Bg(),qg=Kg.default.BN,Jg=new bg(zg),Yg={},Xg=9007199254740991,Zg=!1,Qg=class e{constructor(e,t){e!==Yg&&Jg.throwError(`cannot call constructor directly; use BigNumber.from`,bg.errors.UNSUPPORTED_OPERATION,{operation:`new (BigNumber)`}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Hg(Y(this).fromTwos(e))}toTwos(e){return Hg(Y(this).toTwos(e))}abs(){return this._hex[0]===`-`?e.from(this._hex.substring(1)):this}add(e){return Hg(Y(this).add(Y(e)))}sub(e){return Hg(Y(this).sub(Y(e)))}div(t){return e.from(t).isZero()&&Ug(`division-by-zero`,`div`),Hg(Y(this).div(Y(t)))}mul(e){return Hg(Y(this).mul(Y(e)))}mod(e){let t=Y(e);return t.isNeg()&&Ug(`division-by-zero`,`mod`),Hg(Y(this).umod(t))}pow(e){let t=Y(e);return t.isNeg()&&Ug(`negative-power`,`pow`),Hg(Y(this).pow(t))}and(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`and`),Hg(Y(this).and(t))}or(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`or`),Hg(Y(this).or(t))}xor(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`xor`),Hg(Y(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`mask`),Hg(Y(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`shl`),Hg(Y(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`shr`),Hg(Y(this).shrn(e))}eq(e){return Y(this).eq(Y(e))}lt(e){return Y(this).lt(Y(e))}lte(e){return Y(this).lte(Y(e))}gt(e){return Y(this).gt(Y(e))}gte(e){return Y(this).gte(Y(e))}isNegative(){return this._hex[0]===`-`}isZero(){return Y(this).isZero()}toNumber(){try{return Y(this).toNumber()}catch{Ug(`overflow`,`toNumber`,this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Jg.throwError(`this platform does not support BigInt`,bg.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Zg||(Zg=!0,Jg.warn(`BigNumber.toString does not accept any parameters; base-10 is assumed`)):arguments[0]===16?Jg.throwError(`BigNumber.toString does not accept any parameters; use bigNumber.toHexString()`,bg.errors.UNEXPECTED_ARGUMENT,{}):Jg.throwError(`BigNumber.toString does not accept parameters`,bg.errors.UNEXPECTED_ARGUMENT,{})),Y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:`BigNumber`,hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if(typeof t==`string`)return t.match(/^-?0x[0-9a-f]+$/i)?new e(Yg,Vg(t)):t.match(/^-?[0-9]+$/)?new e(Yg,Vg(new qg(t))):Jg.throwArgumentError(`invalid BigNumber string`,`value`,t);if(typeof t==`number`)return t%1&&Ug(`underflow`,`BigNumber.from`,t),(t>=Xg||t<=-9007199254740991)&&Ug(`overflow`,`BigNumber.from`,t),e.from(String(t));let n=t;if(typeof n==`bigint`)return e.from(n.toString());if(Og(n))return e.from(Ng(n));if(n)if(n.toHexString){let t=n.toHexString();if(typeof t==`string`)return e.from(t)}else{let t=n._hex;if(t==null&&n.type===`BigNumber`&&(t=n.hex),typeof t==`string`&&(Mg(t)||t[0]===`-`&&Mg(t.substring(1))))return e.from(t)}return Jg.throwArgumentError(`invalid BigNumber value`,`value`,t)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}})),e_=t((()=>{$g(),Rg(),xg(),Bg()})),t_=a(((e,t)=>{m(),s(),(function(){var e=`input is invalid type`,n=`finalize already called`,r=typeof window==`object`,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`;!i.JS_SHA3_NO_NODE_JS&&typeof o==`object`&&o.versions&&o.versions.node?i=h:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&typeof t==`object`&&t.exports,c=typeof define==`function`&&define.amd,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,u=`0123456789abcdef`.split(``),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],p=[1,256,65536,16777216],m=[6,1536,393216,100663296],g=[0,8,16,24],_=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=[`hex`,`buffer`,`arrayBuffer`,`array`,`digest`],x={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var S=function(e,t,n){return function(r){return new L(e,t,e).update(r)[n]()}},C=function(e,t,n){return function(r,i){return new L(e,t,i).update(r)[n]()}},w=function(e,t,n){return function(t,r,i,a){return k[`cshake`+e].update(t,r,i,a)[n]()}},T=function(e,t,n){return function(t,r,i,a){return k[`kmac`+e].update(t,r,i,a)[n]()}},E=function(e,t,n,r){for(var i=0;i<b.length;++i){var a=b[i];e[a]=t(n,r,a)}return e},D=function(e,t){var n=S(e,t,`hex`);return n.create=function(){return new L(e,t,e)},n.update=function(e){return n.create().update(e)},E(n,S,e,t)},O=[{name:`keccak`,padding:p,bits:v,createMethod:D},{name:`sha3`,padding:m,bits:v,createMethod:D},{name:`shake`,padding:d,bits:y,createMethod:function(e,t){var n=C(e,t,`hex`);return n.create=function(n){return new L(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},E(n,C,e,t)}},{name:`cshake`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=w(e,t,`hex`);return r.create=function(r,i,a){return!i&&!a?k[`shake`+e].create(r):new L(e,t,r).bytepad([i,a],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},E(r,w,e,t)}},{name:`kmac`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=T(e,t,`hex`);return r.create=function(r,i,a){return new R(e,t,i).bytepad([`KMAC`,a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},E(r,T,e,t)}}],k={},A=[],j=0;j<O.length;++j)for(var M=O[j],N=M.bits,P=0;P<N.length;++P){var F=M.name+`_`+N[P];if(A.push(F),k[F]=M.createMethod(N[P],M.padding),M.name!==`sha3`){var I=M.name+N[P];A.push(I),k[I]=k[F]}}function L(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(n&31)>>3;for(var r=0;r<50;++r)this.s[r]=0}L.prototype.update=function(t){if(this.finalized)throw Error(n);var r,i=typeof t;if(i!==`string`){if(i===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);r=!0}for(var a=this.blocks,o=this.byteCount,s=t.length,c=this.blockCount,u=0,d=this.s,f,p;u<s;){if(this.reset)for(this.reset=!1,a[0]=this.block,f=1;f<c+1;++f)a[f]=0;if(r)for(f=this.start;u<s&&f<o;++u)a[f>>2]|=t[u]<<g[f++&3];else for(f=this.start;u<s&&f<o;++u)p=t.charCodeAt(u),p<128?a[f>>2]|=p<<g[f++&3]:p<2048?(a[f>>2]|=(192|p>>6)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):p<55296||p>=57344?(a[f>>2]|=(224|p>>12)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):(p=65536+((p&1023)<<10|t.charCodeAt(++u)&1023),a[f>>2]|=(240|p>>18)<<g[f++&3],a[f>>2]|=(128|p>>12&63)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]);if(this.lastByteIndex=f,f>=o){for(this.start=f-o,this.block=a[c],f=0;f<c;++f)d[f]^=a[f];ee(d),this.reset=!0}else this.start=f}return this},L.prototype.encode=function(e,t){var n=e&255,r=1,i=[n];for(e>>=8,n=e&255;n>0;)i.unshift(n),e>>=8,n=e&255,++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},L.prototype.encodeString=function(t){var n,r=typeof t;if(r!==`string`){if(r===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);n=!0}var i=0,a=t.length;if(n)i=a;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((s&1023)<<10|t.charCodeAt(++o)&1023),i+=4)}return i+=this.encode(i*8),this.update(t),i},L.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[t&3],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];ee(r)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=``,s;a<n;){for(i=0;i<e&&a<n;++i,++a)s=t[i],o+=u[s>>4&15]+u[s&15]+u[s>>12&15]+u[s>>8&15]+u[s>>20&15]+u[s>>16&15]+u[s>>28&15]+u[s>>24&15];a%e===0&&(ee(t),i=0)}return r&&(s=t[i],o+=u[s>>4&15]+u[s&15],r>1&&(o+=u[s>>12&15]+u[s>>8&15]),r>2&&(o+=u[s>>20&15]+u[s>>16&15])),o},L.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a<n;){for(i=0;i<e&&a<n;++i,++a)c[a]=t[i];a%e===0&&ee(t)}return r&&(c[i]=t[i],s=s.slice(0,o)),s},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=[],s,c;a<n;){for(i=0;i<e&&a<n;++i,++a)s=a<<2,c=t[i],o[s]=c&255,o[s+1]=c>>8&255,o[s+2]=c>>16&255,o[s+3]=c>>24&255;a%e===0&&ee(t)}return r&&(s=a<<2,c=t[i],o[s]=c&255,r>1&&(o[s+1]=c>>8&255),r>2&&(o[s+2]=c>>16&255)),o};function R(e,t,n){L.call(this,e,t,n)}R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var ee=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,ye,z,be,xe,Se,Ce,we;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(o<<1|s>>>31),n=p^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|l>>>31),n=a^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(u<<1|d>>>31),n=s^(d<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=l^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],h=e[1],ce=e[11]<<4|e[10]>>>28,le=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,A=e[21]<<3|e[20]>>>29,xe=e[31]<<9|e[30]>>>23,Se=e[30]<<9|e[31]>>>23,ie=e[40]<<18|e[41]>>>14,ae=e[41]<<18|e[40]>>>14,F=e[2]<<1|e[3]>>>31,I=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,ue=e[22]<<10|e[23]>>>22,de=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,Ce=e[42]<<2|e[43]>>>30,we=e[43]<<2|e[42]>>>30,ge=e[5]<<30|e[4]>>>2,_e=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,fe=e[34]<<15|e[35]>>>17,pe=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ve=e[17]<<23|e[16]>>>9,ye=e[16]<<23|e[17]>>>9,ee=e[26]<<25|e[27]>>>7,te=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,me=e[47]<<24|e[46]>>>8,he=e[46]<<24|e[47]>>>8,oe=e[8]<<27|e[9]>>>5,se=e[9]<<27|e[8]>>>5,D=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,z=e[29]<<7|e[28]>>>25,be=e[28]<<7|e[29]>>>25,ne=e[38]<<8|e[39]>>>24,re=e[39]<<8|e[38]>>>24,C=e[48]<<14|e[49]>>>18,w=e[49]<<14|e[48]>>>18,e[0]=m^~g&y,e[1]=h^~v&b,e[10]=T^~D&k,e[11]=E^~O&A,e[20]=F^~L&ee,e[21]=I^~R&te,e[30]=oe^~ce&ue,e[31]=se^~le&de,e[40]=ge^~ve&z,e[41]=_e^~ye&be,e[2]=g^~y&x,e[3]=v^~b&S,e[12]=D^~k&j,e[13]=O^~A&M,e[22]=L^~ee&ne,e[23]=R^~te&re,e[32]=ce^~ue&fe,e[33]=le^~de&pe,e[42]=ve^~z&xe,e[43]=ye^~be&Se,e[4]=y^~x&C,e[5]=b^~S&w,e[14]=k^~j&N,e[15]=A^~M&P,e[24]=ee^~ne&ie,e[25]=te^~re&ae,e[34]=ue^~fe&me,e[35]=de^~pe&he,e[44]=z^~xe&Ce,e[45]=be^~Se&we,e[6]=x^~C&m,e[7]=S^~w&h,e[16]=j^~N&T,e[17]=M^~P&E,e[26]=ne^~ie&F,e[27]=re^~ae&I,e[36]=fe^~me&oe,e[37]=pe^~he&se,e[46]=xe^~Ce&ge,e[47]=Se^~we&_e,e[8]=C^~m&g,e[9]=w^~h&v,e[18]=N^~T&D,e[19]=P^~E&O,e[28]=ie^~F&L,e[29]=ae^~I&R,e[38]=me^~oe&ce,e[39]=he^~se&le,e[48]=Ce^~ge&ve,e[49]=we^~_e&ye,e[0]^=_[r],e[1]^=_[r+1]};if(s)t.exports=k;else{for(j=0;j<A.length;++j)i[A[j]]=k[A[j]];c&&define(function(){return k})}})()})),n_=r({keccak256:()=>r_});function r_(e){return`0x`+i_.default.keccak_256(kg(e))}var i_,a_=t((()=>{i_=i(t_()),Rg()})),o_,s_=t((()=>{o_=`rlp/5.8.0`}));function c_(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function l_(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(l_(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=c_(t.length);return n.unshift(247+n.length),n.concat(t)}Eg(e)||d_.throwArgumentError(`RLP object must be BytesLike`,`object`,e);let t=Array.prototype.slice.call(kg(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=c_(t.length);return n.unshift(183+n.length),n.concat(t)}function u_(e){return Ng(l_(e))}var d_,f_=t((()=>{Rg(),xg(),s_(),d_=new bg(o_)})),p_,m_=t((()=>{p_=`address/5.8.0`})),h_=r({getAddress:()=>y_,getContractAddress:()=>S_,getCreate2Address:()=>C_,getIcapAddress:()=>x_,isAddress:()=>b_});function g_(e){Mg(e,20)||w_.throwArgumentError(`invalid address`,`address`,e),e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=kg(r_(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}function __(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}function v_(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>E_[e]).join(``);for(;t.length>=D_;){let e=t.substring(0,D_);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}function y_(e){let t=null;if(typeof e!=`string`&&w_.throwArgumentError(`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==`0x`&&(e=`0x`+e),t=g_(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&w_.throwArgumentError(`bad address checksum`,`address`,e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==v_(e)&&w_.throwArgumentError(`bad icap checksum`,`address`,e),t=Wg(e.substring(4));t.length<40;)t=`0`+t;t=g_(`0x`+t)}else w_.throwArgumentError(`invalid address`,`address`,e);return t}function b_(e){try{return y_(e),!0}catch{}return!1}function x_(e){let t=Gg(y_(e).substring(2)).toUpperCase();for(;t.length<30;)t=`0`+t;return`XE`+v_(`XE00`+t)+t}function S_(e){let t=null;try{t=y_(e.from)}catch{w_.throwArgumentError(`missing from address`,`transaction`,e)}let n=jg(kg(Qg.from(e.nonce).toHexString()));return y_(Fg(r_(u_([t,n])),12))}function C_(e,t,n){return Pg(t)!==32&&w_.throwArgumentError(`salt must be 32 bytes`,`salt`,t),Pg(n)!==32&&w_.throwArgumentError(`initCodeHash must be 32 bytes`,`initCodeHash`,n),y_(Fg(r_(Ag([`0xff`,y_(e),t,n])),12))}var w_,T_,E_,D_,O_=t((()=>{Rg(),e_(),a_(),f_(),xg(),m_(),w_=new bg(p_),T_=9007199254740991,E_={};for(let e=0;e<10;e++)E_[String(e)]=String(e);for(let e=0;e<26;e++)E_[String.fromCharCode(65+e)]=String(10+e);D_=Math.floor(__(T_))})),k_=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.Bech32Address=void 0;var a=i(Je()),o=A(),s=(O_(),n(h_));e.Bech32Address=class e{static shortenAddress(e,t){if(t>=e.length)return e;let n=e.indexOf(`1`),r=e.slice(0,n),i=e.slice(n+1);if(t-=r.length,t-=3,--t,t<=0)return``;let a=Math.floor(i.length/2),o=i.slice(0,a),s=i.slice(a);for(;t<o.length+s.length;)(o.length+s.length)%2==1&&o.length>0?o=o.slice(0,o.length-1):s=s.slice(1);return r+`1`+o+`...`+s}static fromBech32(t,n){let r=a.default.decode(t);if(n&&r.prefix!==n)throw Error(`Unmatched prefix`);return new e(new Uint8Array((0,a.fromWords)(r.words)))}static validate(e,t){let{prefix:n}=a.default.decode(e);if(t&&t!==n)throw Error(`Unexpected prefix (expected: ${t}, actual: ${n})`)}static defaultBech32Config(e,t=`val`,n=`cons`,r=`pub`,i=`oper`){return{bech32PrefixAccAddr:e,bech32PrefixAccPub:e+r,bech32PrefixValAddr:e+t+i,bech32PrefixValPub:e+t+i+r,bech32PrefixConsAddr:e+t+n,bech32PrefixConsPub:e+t+n+r}}constructor(e){this.address=e}toBech32(e){let t=a.default.toWords(this.address);return a.default.encode(e,t)}toHex(e=!0){let t=o.Buffer.from(this.address).toString(`hex`);if(t.length===0)throw Error(`Empty address`);return e?(0,s.getAddress)(`0x`+t):`0x`+t}}})),A_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChainIdHelper=void 0;var t=class e{static parse(t){if(t===`injective-777`||t===`injective-888`)return{identifier:t,version:0};let n=t.split(e.VersionFormatRegExp).filter(Boolean);return n.length===2?{identifier:n[0],version:parseInt(n[1])}:{identifier:t,version:0}}static hasChainVersion(t){return e.parse(t).identifier!==t}};e.ChainIdHelper=t,t.VersionFormatRegExp=/(.+)-([\d]+)/})),j_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthermintChainIdHelper=void 0;var t=A_();e.EthermintChainIdHelper=class{static parse(e){let n=t.ChainIdHelper.parse(e);if(e.startsWith(`injective`))return[`injective-777`,`injective-888`].includes(e)?Object.assign({ethChainId:5},n):Object.assign({ethChainId:1},n);let r=e.match(`^([a-z]{1,})_{1}([1-9][0-9]*)-{1}([1-9][0-9]*)$`);if(!r||r.length!==4||r[1]===``||Number.isNaN(parseFloat(r[2]))||!Number.isInteger(parseFloat(r[2])))throw Error(`Invalid chainId for ethermint: ${e}`);return Object.assign(Object.assign({},n),{ethChainId:parseFloat(r[2])})}}})),M_=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(A_(),e),n(j_(),e)})),N_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WsReadyState=void 0,(function(e){e[e.CONNECTING=0]=`CONNECTING`,e[e.OPEN=1]=`OPEN`,e[e.CLOSING=2]=`CLOSING`,e[e.CLOSED=3]=`CLOSED`,e[e.NONE=4]=`NONE`})(e.WsReadyState||={})})),P_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TendermintTxTracer=void 0;var t=N_(),n=A();e.TendermintTxTracer=class{constructor(e,t,n={}){this.url=e,this.wsEndpoint=t,this.options=n,this.newBlockSubscribes=[],this.txSubscribes=new Map,this.pendingQueries=new Map,this.listeners={},this.onOpen=e=>{this.newBlockSubscribes.length>0&&this.sendSubscribeBlockRpc();for(let[e,t]of this.txSubscribes)this.sendSubscribeTxRpc(e,t.params);for(let[e,t]of this.pendingQueries)this.sendQueryRpc(e,t.method,t.params);for(let t of this.listeners.open??[])t(e)},this.onMessage=e=>{for(let t of this.listeners.message??[])t(e);if(e.data)try{let t=JSON.parse(e.data);if(t?.id&&this.pendingQueries.has(t.id)&&(t.error?this.pendingQueries.get(t.id).rejector(Error(t.error.data||t.error.message)):t.result?.tx_result?this.pendingQueries.get(t.id).resolver(t.result.tx_result):this.pendingQueries.get(t.id).resolver(t.result),this.pendingQueries.delete(t.id)),t?.result?.data?.type===`tendermint/event/NewBlock`)for(let e of this.newBlockSubscribes)e.handler(t.result.data.value);t?.result?.data?.type===`tendermint/event/Tx`&&t?.id&&this.txSubscribes.has(t.id)&&(t.error?this.txSubscribes.get(t.id).rejector(Error(t.error.data||t.error.message)):this.txSubscribes.get(t.id).resolver(t.result.data.value.TxResult.result),this.txSubscribes.delete(t.id))}catch{}},this.onClose=e=>{for(let t of this.listeners.close??[])t(e)},this.ws=this.options.wsObject?new this.options.wsObject(this.getWsEndpoint()):new WebSocket(this.getWsEndpoint()),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose}getWsEndpoint(){let e=this.url;if(e.startsWith(`http`)&&(e=e.replace(`http`,`ws`)),!e.endsWith(this.wsEndpoint)){let t=this.wsEndpoint.startsWith(`/`)?this.wsEndpoint:`/`+this.wsEndpoint;e=e.endsWith(`/`)?e+t.slice(1):e+t}return e}close(){this.ws.close()}get readyState(){switch(this.ws.readyState){case 0:return t.WsReadyState.CONNECTING;case 1:return t.WsReadyState.OPEN;case 2:return t.WsReadyState.CLOSING;case 3:return t.WsReadyState.CLOSED;default:return t.WsReadyState.NONE}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}subscribeBlock(e){return this.newBlockSubscribes.push({handler:e}),this.newBlockSubscribes.length===1&&this.sendSubscribeBlockRpc(),()=>{this.newBlockSubscribes=this.newBlockSubscribes.filter(t=>t.handler!==e)}}sendSubscribeBlockRpc(){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:[`tm.event='NewBlock'`],id:1}))}traceTx(e){return new Promise(t=>{this.queryTx(e).then(n=>{if(e instanceof Uint8Array){t(n);return}if(n?.total_count!==`0`){t(n);return}}).catch(()=>{}),this.subscribeTx(e).then(t)}).then(e=>new Promise(t=>{setTimeout(()=>t(e),100)}))}subscribeTx(e){if(e instanceof Uint8Array){let t=this.createRandomId(),r={query:`tm.event='Tx' AND tx.hash='${n.Buffer.from(e).toString(`hex`).toUpperCase()}'`};return new Promise((e,n)=>{this.txSubscribes.set(t,{params:r,resolver:e,rejector:n}),this.sendSubscribeTxRpc(t,r)})}else{let t=this.createRandomId(),n={query:`tm.event='Tx' and `+Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}}sendSubscribeTxRpc(e,n){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:n,id:e}))}queryTx(e){if(e instanceof Uint8Array)return this.query(`tx`,{hash:n.Buffer.from(e).toString(`base64`),prove:!1});{let t={query:Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return this.query(`tx_search`,t)}}query(e,t){let n=this.createRandomId();return new Promise((r,i)=>{this.pendingQueries.set(n,{method:e,params:t,resolver:r,rejector:i}),this.sendQueryRpc(n,e,t)})}sendQueryRpc(e,n,r){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:n,params:r,id:e}))}createRandomId(){return parseInt(Array.from({length:6}).map(()=>Math.floor(Math.random()*100)).join(``))}}})),F_=a(((e,t)=>{t.exports=r;var n=I_();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),I_=a((e=>{m();var t=e;t.asPromise=$a(),t.base64=eo(),t.EventEmitter=to(),t.float=no(),t.inquire=ro(),t.utf8=io(),t.pool=ao(),t.LongBits=F_(),t.isNode=!!(h!==void 0&&h&&h.process&&h.process.versions&&h.process.versions.node),t.global=t.isNode&&h||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||``}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+`: `+this.message},t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),L_=a(((e,t)=>{t.exports=u;var n=I_(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),R_=a(((e,t)=>{t.exports=i;var n=L_();(i.prototype=Object.create(n.prototype)).constructor=i;var r=I_();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),z_=a(((e,t)=>{t.exports=s;var n=I_(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),B_=a(((e,t)=>{t.exports=i;var n=z_();(i.prototype=Object.create(n.prototype)).constructor=i;var r=I_();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),V_=a(((e,t)=>{t.exports=r;var n=I_();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),H_=a((e=>{var t=e;t.Service=V_()})),U_=a(((e,t)=>{t.exports={}})),W_=a((e=>{var t=e;t.build=`minimal`,t.Writer=L_(),t.BufferWriter=R_(),t.Reader=z_(),t.BufferReader=B_(),t.util=I_(),t.rpc=H_(),t.roots=U_(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),G_=a(((e,t)=>{t.exports=W_()})),K_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgInstallBundleResponse=e.MsgInstallBundle=e.MsgProvisionResponse=e.MsgProvision=e.MsgWalletSpendActionResponse=e.MsgWalletSpendAction=e.MsgWalletActionResponse=e.MsgWalletAction=e.MsgDeliverInboundResponse=e.MsgDeliverInbound=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`agoric.swingset`;function i(){return{messages:[],nums:[],ack:`0`,submitter:new Uint8Array}}e.MsgDeliverInbound={encode(e,t=r.default.Writer.create()){for(let n of e.messages)t.uint32(10).string(n);t.uint32(18).fork();for(let n of e.nums)t.uint64(n);return t.ldelim(),e.ack!==`0`&&t.uint32(24).uint64(e.ack),e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(n.string());break;case 2:if((e&7)==2){let e=n.uint32()+n.pos;for(;n.pos<e;)o.nums.push(x(n.uint64()))}else o.nums.push(x(n.uint64()));break;case 3:o.ack=x(n.uint64());break;case 4:o.submitter=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>String(e)):[],nums:Array.isArray(e?.nums)?e.nums.map(e=>String(e)):[],ack:S(e.ack)?String(e.ack):`0`,submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e):t.messages=[],e.nums?t.nums=e.nums.map(e=>e):t.nums=[],e.ack!==void 0&&(t.ack=e.ack),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=i();return t.messages=e.messages?.map(e=>e)||[],t.nums=e.nums?.map(e=>e)||[],t.ack=e.ack??`0`,t.submitter=e.submitter??new Uint8Array,t}};function a(){return{}}e.MsgDeliverInboundResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return o},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return a()}};function o(){return{owner:new Uint8Array,action:``}}e.MsgWalletAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.action!==``&&t.uint32(18).string(e.action),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.action=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,action:S(e.action)?String(e.action):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.action!==void 0&&(t.action=e.action),t},fromPartial(e){let t=o();return t.owner=e.owner??new Uint8Array,t.action=e.action??``,t}};function s(){return{}}e.MsgWalletActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{owner:new Uint8Array,spendAction:``}}e.MsgWalletSpendAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.spendAction!==``&&t.uint32(18).string(e.spendAction),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.spendAction=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,spendAction:S(e.spendAction)?String(e.spendAction):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.spendAction!==void 0&&(t.spendAction=e.spendAction),t},fromPartial(e){let t=c();return t.owner=e.owner??new Uint8Array,t.spendAction=e.spendAction??``,t}};function l(){return{}}e.MsgWalletSpendActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{nickname:``,address:new Uint8Array,powerFlags:[],submitter:new Uint8Array}}e.MsgProvision={encode(e,t=r.default.Writer.create()){e.nickname!==``&&t.uint32(10).string(e.nickname),e.address.length!==0&&t.uint32(18).bytes(e.address);for(let n of e.powerFlags)t.uint32(26).string(n);return e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.nickname=n.string();break;case 2:a.address=n.bytes();break;case 3:a.powerFlags.push(n.string());break;case 4:a.submitter=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{nickname:S(e.nickname)?String(e.nickname):``,address:S(e.address)?v(e.address):new Uint8Array,powerFlags:Array.isArray(e?.powerFlags)?e.powerFlags.map(e=>String(e)):[],submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.nickname!==void 0&&(t.nickname=e.nickname),e.address!==void 0&&(t.address=b(e.address===void 0?new Uint8Array:e.address)),e.powerFlags?t.powerFlags=e.powerFlags.map(e=>e):t.powerFlags=[],e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=u();return t.nickname=e.nickname??``,t.address=e.address??new Uint8Array,t.powerFlags=e.powerFlags?.map(e=>e)||[],t.submitter=e.submitter??new Uint8Array,t}};function d(){return{}}e.MsgProvisionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{bundle:``,submitter:new Uint8Array,compressedBundle:new Uint8Array,uncompressedSize:`0`}}e.MsgInstallBundle={encode(e,t=r.default.Writer.create()){return e.bundle!==``&&t.uint32(10).string(e.bundle),e.submitter.length!==0&&t.uint32(18).bytes(e.submitter),e.compressedBundle.length!==0&&t.uint32(26).bytes(e.compressedBundle),e.uncompressedSize!==`0`&&t.uint32(32).int64(e.uncompressedSize),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bundle=n.string();break;case 2:a.submitter=n.bytes();break;case 3:a.compressedBundle=n.bytes();break;case 4:a.uncompressedSize=x(n.int64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bundle:S(e.bundle)?String(e.bundle):``,submitter:S(e.submitter)?v(e.submitter):new Uint8Array,compressedBundle:S(e.compressedBundle)?v(e.compressedBundle):new Uint8Array,uncompressedSize:S(e.uncompressedSize)?String(e.uncompressedSize):`0`}},toJSON(e){let t={};return e.bundle!==void 0&&(t.bundle=e.bundle),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),e.compressedBundle!==void 0&&(t.compressedBundle=b(e.compressedBundle===void 0?new Uint8Array:e.compressedBundle)),e.uncompressedSize!==void 0&&(t.uncompressedSize=e.uncompressedSize),t},fromPartial(e){let t=f();return t.bundle=e.bundle??``,t.submitter=e.submitter??new Uint8Array,t.compressedBundle=e.compressedBundle??new Uint8Array,t.uncompressedSize=e.uncompressedSize??`0`,t}};function p(){return{}}e.MsgInstallBundleResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),q_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`cosmos.base.v1beta1`;function i(){return{denom:``,amount:``}}e.Coin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{denom:``,amount:``}}e.DecCoin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=a();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function o(){return{int:``}}e.IntProto={encode(e,t=r.default.Writer.create()){return e.int!==``&&t.uint32(10).string(e.int),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.int=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{int:c(e.int)?String(e.int):``}},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=o();return t.int=e.int??``,t}};function s(){return{dec:``}}e.DecProto={encode(e,t=r.default.Writer.create()){return e.dec!==``&&t.uint32(10).string(e.dec),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.dec=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{dec:c(e.dec)?String(e.dec):``}},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=s();return t.dec=e.dec??``,t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function c(e){return e!=null}})),J_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={encode(t,n=r.default.Writer.create()){for(let r of t.sendEnabled)e.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return t.defaultSendEnabled===!0&&n.uint32(16).bool(t.defaultSendEnabled),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.sendEnabled.push(e.SendEnabled.decode(i,i.uint32()));break;case 2:s.defaultSendEnabled=i.bool();break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{sendEnabled:Array.isArray(t?.sendEnabled)?t.sendEnabled.map(t=>e.SendEnabled.fromJSON(t)):[],defaultSendEnabled:f(t.defaultSendEnabled)?!!t.defaultSendEnabled:!1}},toJSON(t){let n={};return t.sendEnabled?n.sendEnabled=t.sendEnabled.map(t=>t?e.SendEnabled.toJSON(t):void 0):n.sendEnabled=[],t.defaultSendEnabled!==void 0&&(n.defaultSendEnabled=t.defaultSendEnabled),n},fromPartial(t){let n=a();return n.sendEnabled=t.sendEnabled?.map(t=>e.SendEnabled.fromPartial(t))||[],n.defaultSendEnabled=t.defaultSendEnabled??!1,n}};function o(){return{denom:``,enabled:!1}}e.SendEnabled={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.enabled=n.bool();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,enabled:f(e.enabled)?!!e.enabled:!1}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){let t=o();return t.denom=e.denom??``,t.enabled=e.enabled??!1,t}};function s(){return{address:``,coins:[]}}e.Input={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=s();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function c(){return{address:``,coins:[]}}e.Output={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=c();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function l(){return{total:[]}}e.Supply={encode(e,t=r.default.Writer.create()){for(let n of e.total)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=l();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:Array.isArray(e?.total)?e.total.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.total?t.total=e.total.map(e=>e?i.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){let t=l();return t.total=e.total?.map(e=>i.Coin.fromPartial(e))||[],t}};function u(){return{denom:``,exponent:0,aliases:[]}}e.DenomUnit={encode(e,t=r.default.Writer.create()){e.denom!==``&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(let n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.exponent=n.uint32();break;case 3:a.aliases.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,exponent:f(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e?.aliases)?e.aliases.map(e=>String(e)):[]}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){let t=u();return t.denom=e.denom??``,t.exponent=e.exponent??0,t.aliases=e.aliases?.map(e=>e)||[],t}};function d(){return{description:``,denomUnits:[],base:``,display:``,name:``,symbol:``}}e.Metadata={encode(t,n=r.default.Writer.create()){t.description!==``&&n.uint32(10).string(t.description);for(let r of t.denomUnits)e.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return t.base!==``&&n.uint32(26).string(t.base),t.display!==``&&n.uint32(34).string(t.display),t.name!==``&&n.uint32(42).string(t.name),t.symbol!==``&&n.uint32(50).string(t.symbol),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.description=i.string();break;case 2:o.denomUnits.push(e.DenomUnit.decode(i,i.uint32()));break;case 3:o.base=i.string();break;case 4:o.display=i.string();break;case 5:o.name=i.string();break;case 6:o.symbol=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{description:f(t.description)?String(t.description):``,denomUnits:Array.isArray(t?.denomUnits)?t.denomUnits.map(t=>e.DenomUnit.fromJSON(t)):[],base:f(t.base)?String(t.base):``,display:f(t.display)?String(t.display):``,name:f(t.name)?String(t.name):``,symbol:f(t.symbol)?String(t.symbol):``}},toJSON(t){let n={};return t.description!==void 0&&(n.description=t.description),t.denomUnits?n.denomUnits=t.denomUnits.map(t=>t?e.DenomUnit.toJSON(t):void 0):n.denomUnits=[],t.base!==void 0&&(n.base=t.base),t.display!==void 0&&(n.display=t.display),t.name!==void 0&&(n.name=t.name),t.symbol!==void 0&&(n.symbol=t.symbol),n},fromPartial(t){let n=d();return n.description=t.description??``,n.denomUnits=t.denomUnits?.map(t=>e.DenomUnit.fromPartial(t))||[],n.base=t.base??``,n.display=t.display??``,n.name=t.name??``,n.symbol=t.symbol??``,n}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function f(e){return e!=null}})),Y_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_(),a=J_();e.protobufPackage=`cosmos.bank.v1beta1`;function o(){return{fromAddress:``,toAddress:``,amount:[]}}e.MsgSend={encode(e,t=r.default.Writer.create()){e.fromAddress!==``&&t.uint32(10).string(e.fromAddress),e.toAddress!==``&&t.uint32(18).string(e.toAddress);for(let n of e.amount)i.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.fromAddress=n.string();break;case 2:s.toAddress=n.string();break;case 3:s.amount.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{fromAddress:u(e.fromAddress)?String(e.fromAddress):``,toAddress:u(e.toAddress)?String(e.toAddress):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=o();return t.fromAddress=e.fromAddress??``,t.toAddress=e.toAddress??``,t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t}};function s(){return{}}e.MsgSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{inputs:[],outputs:[]}}e.MsgMultiSend={encode(e,t=r.default.Writer.create()){for(let n of e.inputs)a.Input.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.outputs)a.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.inputs.push(a.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(a.Output.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{inputs:Array.isArray(e?.inputs)?e.inputs.map(e=>a.Input.fromJSON(e)):[],outputs:Array.isArray(e?.outputs)?e.outputs.map(e=>a.Output.fromJSON(e)):[]}},toJSON(e){let t={};return e.inputs?t.inputs=e.inputs.map(e=>e?a.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?a.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){let t=c();return t.inputs=e.inputs?.map(e=>a.Input.fromPartial(e))||[],t.outputs=e.outputs?.map(e=>a.Output.fromPartial(e))||[],t}};function l(){return{}}e.MsgMultiSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),X_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Timestamp={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),Z_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.crypto`;function i(){return{total:`0`,index:`0`,leafHash:new Uint8Array,aunts:[]}}e.Proof={encode(e,t=r.default.Writer.create()){e.total!==`0`&&t.uint32(8).int64(e.total),e.index!==`0`&&t.uint32(16).int64(e.index),e.leafHash.length!==0&&t.uint32(26).bytes(e.leafHash);for(let n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total=g(n.int64());break;case 2:o.index=g(n.int64());break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:_(e.total)?String(e.total):`0`,index:_(e.index)?String(e.index):`0`,leafHash:_(e.leafHash)?d(e.leafHash):new Uint8Array,aunts:Array.isArray(e?.aunts)?e.aunts.map(e=>d(e)):[]}},toJSON(e){let t={};return e.total!==void 0&&(t.total=e.total),e.index!==void 0&&(t.index=e.index),e.leafHash!==void 0&&(t.leafHash=p(e.leafHash===void 0?new Uint8Array:e.leafHash)),e.aunts?t.aunts=e.aunts.map(e=>p(e===void 0?new Uint8Array:e)):t.aunts=[],t},fromPartial(e){let t=i();return t.total=e.total??`0`,t.index=e.index??`0`,t.leafHash=e.leafHash??new Uint8Array,t.aunts=e.aunts?.map(e=>e)||[],t}};function a(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={encode(t,n=r.default.Writer.create()){return t.key.length!==0&&n.uint32(10).bytes(t.key),t.proof!==void 0&&e.Proof.encode(t.proof,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.key=i.bytes();break;case 2:s.proof=e.Proof.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{key:_(t.key)?d(t.key):new Uint8Array,proof:_(t.proof)?e.Proof.fromJSON(t.proof):void 0}},toJSON(t){let n={};return t.key!==void 0&&(n.key=p(t.key===void 0?new Uint8Array:t.key)),t.proof!==void 0&&(n.proof=t.proof?e.Proof.toJSON(t.proof):void 0),n},fromPartial(t){let n=a();return n.key=t.key??new Uint8Array,n.proof=t.proof!==void 0&&t.proof!==null?e.Proof.fromPartial(t.proof):void 0,n}};function o(){return{key:``,input:``,output:``}}e.DominoOp={encode(e,t=r.default.Writer.create()){return e.key!==``&&t.uint32(10).string(e.key),e.input!==``&&t.uint32(18).string(e.input),e.output!==``&&t.uint32(26).string(e.output),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.string();break;case 2:a.input=n.string();break;case 3:a.output=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:_(e.key)?String(e.key):``,input:_(e.input)?String(e.input):``,output:_(e.output)?String(e.output):``}},toJSON(e){let t={};return e.key!==void 0&&(t.key=e.key),e.input!==void 0&&(t.input=e.input),e.output!==void 0&&(t.output=e.output),t},fromPartial(e){let t=o();return t.key=e.key??``,t.input=e.input??``,t.output=e.output??``,t}};function s(){return{type:``,key:new Uint8Array,data:new Uint8Array}}e.ProofOp={encode(e,t=r.default.Writer.create()){return e.type!==``&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.type=n.string();break;case 2:a.key=n.bytes();break;case 3:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{type:_(e.type)?String(e.type):``,key:_(e.key)?d(e.key):new Uint8Array,data:_(e.data)?d(e.data):new Uint8Array}},toJSON(e){let t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=p(e.key===void 0?new Uint8Array:e.key)),e.data!==void 0&&(t.data=p(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=s();return t.type=e.type??``,t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function c(){return{ops:[]}}e.ProofOps={encode(t,n=r.default.Writer.create()){for(let r of t.ops)e.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.ops.push(e.ProofOp.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{ops:Array.isArray(t?.ops)?t.ops.map(t=>e.ProofOp.fromJSON(t)):[]}},toJSON(t){let n={};return t.ops?n.ops=t.ops.map(t=>t?e.ProofOp.toJSON(t):void 0):n.ops=[],n},fromPartial(t){let n=c();return n.ops=t.ops?.map(t=>e.ProofOp.fromPartial(t))||[],n}};var l=(()=>{if(l!==void 0)return l;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),u=l.atob||(e=>l.Buffer.from(e,`base64`).toString(`binary`));function d(e){let t=u(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var f=l.btoa||(e=>l.Buffer.from(e,`binary`).toString(`base64`));function p(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return f(t.join(``))}function g(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function _(e){return e!=null}})),Q_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Consensus=e.App=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.version`;function i(){return{protocol:`0`,software:``}}e.App={encode(e,t=r.default.Writer.create()){return e.protocol!==`0`&&t.uint32(8).uint64(e.protocol),e.software!==``&&t.uint32(18).string(e.software),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.protocol=o(n.uint64());break;case 2:s.software=n.string();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{protocol:s(e.protocol)?String(e.protocol):`0`,software:s(e.software)?String(e.software):``}},toJSON(e){let t={};return e.protocol!==void 0&&(t.protocol=e.protocol),e.software!==void 0&&(t.software=e.software),t},fromPartial(e){let t=i();return t.protocol=e.protocol??`0`,t.software=e.software??``,t}};function a(){return{block:`0`,app:`0`}}e.Consensus={encode(e,t=r.default.Writer.create()){return e.block!==`0`&&t.uint32(8).uint64(e.block),e.app!==`0`&&t.uint32(16).uint64(e.app),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:s.block=o(n.uint64());break;case 2:s.app=o(n.uint64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{block:s(e.block)?String(e.block):`0`,app:s(e.app)?String(e.app):`0`}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.app!==void 0&&(t.app=e.app),t},fromPartial(e){let t=a();return t.block=e.block??`0`,t.app=e.app??`0`,t}};function o(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function s(e){return e!=null}})),$_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.crypto`;function i(){return{ed25519:void 0,secp256k1:void 0}}e.PublicKey={encode(e,t=r.default.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{ed25519:u(e.ed25519)?s(e.ed25519):void 0,secp256k1:u(e.secp256k1)?s(e.secp256k1):void 0}},toJSON(e){let t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519===void 0?void 0:l(e.ed25519)),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1===void 0?void 0:l(e.secp256k1)),t},fromPartial(e){let t=i();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),ev=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=$_();e.protobufPackage=`tendermint.types`;function a(){return{validators:[],proposer:void 0,totalVotingPower:`0`}}e.ValidatorSet={encode(t,n=r.default.Writer.create()){for(let r of t.validators)e.Validator.encode(r,n.uint32(10).fork()).ldelim();return t.proposer!==void 0&&e.Validator.encode(t.proposer,n.uint32(18).fork()).ldelim(),t.totalVotingPower!==`0`&&n.uint32(24).int64(t.totalVotingPower),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.validators.push(e.Validator.decode(i,i.uint32()));break;case 2:s.proposer=e.Validator.decode(i,i.uint32());break;case 3:s.totalVotingPower=p(i.int64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{validators:Array.isArray(t?.validators)?t.validators.map(t=>e.Validator.fromJSON(t)):[],proposer:g(t.proposer)?e.Validator.fromJSON(t.proposer):void 0,totalVotingPower:g(t.totalVotingPower)?String(t.totalVotingPower):`0`}},toJSON(t){let n={};return t.validators?n.validators=t.validators.map(t=>t?e.Validator.toJSON(t):void 0):n.validators=[],t.proposer!==void 0&&(n.proposer=t.proposer?e.Validator.toJSON(t.proposer):void 0),t.totalVotingPower!==void 0&&(n.totalVotingPower=t.totalVotingPower),n},fromPartial(t){let n=a();return n.validators=t.validators?.map(t=>e.Validator.fromPartial(t))||[],n.proposer=t.proposer!==void 0&&t.proposer!==null?e.Validator.fromPartial(t.proposer):void 0,n.totalVotingPower=t.totalVotingPower??`0`,n}};function o(){return{address:new Uint8Array,pubKey:void 0,votingPower:`0`,proposerPriority:`0`}}e.Validator={encode(e,t=r.default.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==`0`&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.address=n.bytes();break;case 2:s.pubKey=i.PublicKey.decode(n,n.uint32());break;case 3:s.votingPower=p(n.int64());break;case 4:s.proposerPriority=p(n.int64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{address:g(e.address)?u(e.address):new Uint8Array,pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`,proposerPriority:g(e.proposerPriority)?String(e.proposerPriority):`0`}},toJSON(e){let t={};return e.address!==void 0&&(t.address=f(e.address===void 0?new Uint8Array:e.address)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),e.proposerPriority!==void 0&&(t.proposerPriority=e.proposerPriority),t},fromPartial(e){let t=o();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t.proposerPriority=e.proposerPriority??`0`,t}};function s(){return{pubKey:void 0,votingPower:`0`}}e.SimpleValidator={encode(e,t=r.default.Writer.create()){return e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(16).int64(e.votingPower),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.pubKey=i.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=p(n.int64());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`}},toJSON(e){let t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),t},fromPartial(e){let t=s();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t}};var c=(()=>{if(c!==void 0)return c;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),l=c.atob||(e=>c.Buffer.from(e,`base64`).toString(`binary`));function u(e){let t=l(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var d=c.btoa||(e=>c.Buffer.from(e,`binary`).toString(`base64`));function f(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return d(t.join(``))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),tv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=Z_(),o=Q_(),s=ev();e.protobufPackage=`tendermint.types`;var c;(function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]=`BLOCK_ID_FLAG_UNKNOWN`,e[e.BLOCK_ID_FLAG_ABSENT=1]=`BLOCK_ID_FLAG_ABSENT`,e[e.BLOCK_ID_FLAG_COMMIT=2]=`BLOCK_ID_FLAG_COMMIT`,e[e.BLOCK_ID_FLAG_NIL=3]=`BLOCK_ID_FLAG_NIL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.BlockIDFlag||={});function l(e){switch(e){case 0:case`BLOCK_ID_FLAG_UNKNOWN`:return c.BLOCK_ID_FLAG_UNKNOWN;case 1:case`BLOCK_ID_FLAG_ABSENT`:return c.BLOCK_ID_FLAG_ABSENT;case 2:case`BLOCK_ID_FLAG_COMMIT`:return c.BLOCK_ID_FLAG_COMMIT;case 3:case`BLOCK_ID_FLAG_NIL`:return c.BLOCK_ID_FLAG_NIL;default:return c.UNRECOGNIZED}}e.blockIDFlagFromJSON=l;function u(e){switch(e){case c.BLOCK_ID_FLAG_UNKNOWN:return`BLOCK_ID_FLAG_UNKNOWN`;case c.BLOCK_ID_FLAG_ABSENT:return`BLOCK_ID_FLAG_ABSENT`;case c.BLOCK_ID_FLAG_COMMIT:return`BLOCK_ID_FLAG_COMMIT`;case c.BLOCK_ID_FLAG_NIL:return`BLOCK_ID_FLAG_NIL`;default:return`UNKNOWN`}}e.blockIDFlagToJSON=u;var d;(function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]=`SIGNED_MSG_TYPE_UNKNOWN`,e[e.SIGNED_MSG_TYPE_PREVOTE=1]=`SIGNED_MSG_TYPE_PREVOTE`,e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]=`SIGNED_MSG_TYPE_PRECOMMIT`,e[e.SIGNED_MSG_TYPE_PROPOSAL=32]=`SIGNED_MSG_TYPE_PROPOSAL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.SignedMsgType||={});function f(e){switch(e){case 0:case`SIGNED_MSG_TYPE_UNKNOWN`:return d.SIGNED_MSG_TYPE_UNKNOWN;case 1:case`SIGNED_MSG_TYPE_PREVOTE`:return d.SIGNED_MSG_TYPE_PREVOTE;case 2:case`SIGNED_MSG_TYPE_PRECOMMIT`:return d.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case`SIGNED_MSG_TYPE_PROPOSAL`:return d.SIGNED_MSG_TYPE_PROPOSAL;default:return d.UNRECOGNIZED}}e.signedMsgTypeFromJSON=f;function p(e){switch(e){case d.SIGNED_MSG_TYPE_UNKNOWN:return`SIGNED_MSG_TYPE_UNKNOWN`;case d.SIGNED_MSG_TYPE_PREVOTE:return`SIGNED_MSG_TYPE_PREVOTE`;case d.SIGNED_MSG_TYPE_PRECOMMIT:return`SIGNED_MSG_TYPE_PRECOMMIT`;case d.SIGNED_MSG_TYPE_PROPOSAL:return`SIGNED_MSG_TYPE_PROPOSAL`;default:return`UNKNOWN`}}e.signedMsgTypeToJSON=p;function g(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={encode(e,t=r.default.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.total=n.uint32();break;case 2:a.hash=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{total:R(e.total)?Number(e.total):0,hash:R(e.hash)?j(e.hash):new Uint8Array}},toJSON(e){let t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=N(e.hash===void 0?new Uint8Array:e.hash)),t},fromPartial(e){let t=g();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function _(){return{index:0,bytes:new Uint8Array,proof:void 0}}e.Part={encode(e,t=r.default.Writer.create()){return e.index!==0&&t.uint32(8).uint32(e.index),e.bytes.length!==0&&t.uint32(18).bytes(e.bytes),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{index:R(e.index)?Number(e.index):0,bytes:R(e.bytes)?j(e.bytes):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.bytes!==void 0&&(t.bytes=N(e.bytes===void 0?new Uint8Array:e.bytes)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=_();return t.index=e.index??0,t.bytes=e.bytes??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};function v(){return{hash:new Uint8Array,partSetHeader:void 0}}e.BlockID={encode(t,n=r.default.Writer.create()){return t.hash.length!==0&&n.uint32(10).bytes(t.hash),t.partSetHeader!==void 0&&e.PartSetHeader.encode(t.partSetHeader,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.hash=i.bytes();break;case 2:o.partSetHeader=e.PartSetHeader.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{hash:R(t.hash)?j(t.hash):new Uint8Array,partSetHeader:R(t.partSetHeader)?e.PartSetHeader.fromJSON(t.partSetHeader):void 0}},toJSON(t){let n={};return t.hash!==void 0&&(n.hash=N(t.hash===void 0?new Uint8Array:t.hash)),t.partSetHeader!==void 0&&(n.partSetHeader=t.partSetHeader?e.PartSetHeader.toJSON(t.partSetHeader):void 0),n},fromPartial(t){let n=v();return n.hash=t.hash??new Uint8Array,n.partSetHeader=t.partSetHeader!==void 0&&t.partSetHeader!==null?e.PartSetHeader.fromPartial(t.partSetHeader):void 0,n}};function y(){return{version:void 0,chainId:``,height:`0`,time:void 0,lastBlockId:void 0,lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={encode(t,n=r.default.Writer.create()){return t.version!==void 0&&o.Consensus.encode(t.version,n.uint32(10).fork()).ldelim(),t.chainId!==``&&n.uint32(18).string(t.chainId),t.height!==`0`&&n.uint32(24).int64(t.height),t.time!==void 0&&i.Timestamp.encode(P(t.time),n.uint32(34).fork()).ldelim(),t.lastBlockId!==void 0&&e.BlockID.encode(t.lastBlockId,n.uint32(42).fork()).ldelim(),t.lastCommitHash.length!==0&&n.uint32(50).bytes(t.lastCommitHash),t.dataHash.length!==0&&n.uint32(58).bytes(t.dataHash),t.validatorsHash.length!==0&&n.uint32(66).bytes(t.validatorsHash),t.nextValidatorsHash.length!==0&&n.uint32(74).bytes(t.nextValidatorsHash),t.consensusHash.length!==0&&n.uint32(82).bytes(t.consensusHash),t.appHash.length!==0&&n.uint32(90).bytes(t.appHash),t.lastResultsHash.length!==0&&n.uint32(98).bytes(t.lastResultsHash),t.evidenceHash.length!==0&&n.uint32(106).bytes(t.evidenceHash),t.proposerAddress.length!==0&&n.uint32(114).bytes(t.proposerAddress),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=y();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.version=o.Consensus.decode(a,a.uint32());break;case 2:c.chainId=a.string();break;case 3:c.height=L(a.int64());break;case 4:c.time=F(i.Timestamp.decode(a,a.uint32()));break;case 5:c.lastBlockId=e.BlockID.decode(a,a.uint32());break;case 6:c.lastCommitHash=a.bytes();break;case 7:c.dataHash=a.bytes();break;case 8:c.validatorsHash=a.bytes();break;case 9:c.nextValidatorsHash=a.bytes();break;case 10:c.consensusHash=a.bytes();break;case 11:c.appHash=a.bytes();break;case 12:c.lastResultsHash=a.bytes();break;case 13:c.evidenceHash=a.bytes();break;case 14:c.proposerAddress=a.bytes();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{version:R(t.version)?o.Consensus.fromJSON(t.version):void 0,chainId:R(t.chainId)?String(t.chainId):``,height:R(t.height)?String(t.height):`0`,time:R(t.time)?I(t.time):void 0,lastBlockId:R(t.lastBlockId)?e.BlockID.fromJSON(t.lastBlockId):void 0,lastCommitHash:R(t.lastCommitHash)?j(t.lastCommitHash):new Uint8Array,dataHash:R(t.dataHash)?j(t.dataHash):new Uint8Array,validatorsHash:R(t.validatorsHash)?j(t.validatorsHash):new Uint8Array,nextValidatorsHash:R(t.nextValidatorsHash)?j(t.nextValidatorsHash):new Uint8Array,consensusHash:R(t.consensusHash)?j(t.consensusHash):new Uint8Array,appHash:R(t.appHash)?j(t.appHash):new Uint8Array,lastResultsHash:R(t.lastResultsHash)?j(t.lastResultsHash):new Uint8Array,evidenceHash:R(t.evidenceHash)?j(t.evidenceHash):new Uint8Array,proposerAddress:R(t.proposerAddress)?j(t.proposerAddress):new Uint8Array}},toJSON(t){let n={};return t.version!==void 0&&(n.version=t.version?o.Consensus.toJSON(t.version):void 0),t.chainId!==void 0&&(n.chainId=t.chainId),t.height!==void 0&&(n.height=t.height),t.time!==void 0&&(n.time=t.time.toISOString()),t.lastBlockId!==void 0&&(n.lastBlockId=t.lastBlockId?e.BlockID.toJSON(t.lastBlockId):void 0),t.lastCommitHash!==void 0&&(n.lastCommitHash=N(t.lastCommitHash===void 0?new Uint8Array:t.lastCommitHash)),t.dataHash!==void 0&&(n.dataHash=N(t.dataHash===void 0?new Uint8Array:t.dataHash)),t.validatorsHash!==void 0&&(n.validatorsHash=N(t.validatorsHash===void 0?new Uint8Array:t.validatorsHash)),t.nextValidatorsHash!==void 0&&(n.nextValidatorsHash=N(t.nextValidatorsHash===void 0?new Uint8Array:t.nextValidatorsHash)),t.consensusHash!==void 0&&(n.consensusHash=N(t.consensusHash===void 0?new Uint8Array:t.consensusHash)),t.appHash!==void 0&&(n.appHash=N(t.appHash===void 0?new Uint8Array:t.appHash)),t.lastResultsHash!==void 0&&(n.lastResultsHash=N(t.lastResultsHash===void 0?new Uint8Array:t.lastResultsHash)),t.evidenceHash!==void 0&&(n.evidenceHash=N(t.evidenceHash===void 0?new Uint8Array:t.evidenceHash)),t.proposerAddress!==void 0&&(n.proposerAddress=N(t.proposerAddress===void 0?new Uint8Array:t.proposerAddress)),n},fromPartial(t){let n=y();return n.version=t.version!==void 0&&t.version!==null?o.Consensus.fromPartial(t.version):void 0,n.chainId=t.chainId??``,n.height=t.height??`0`,n.time=t.time??void 0,n.lastBlockId=t.lastBlockId!==void 0&&t.lastBlockId!==null?e.BlockID.fromPartial(t.lastBlockId):void 0,n.lastCommitHash=t.lastCommitHash??new Uint8Array,n.dataHash=t.dataHash??new Uint8Array,n.validatorsHash=t.validatorsHash??new Uint8Array,n.nextValidatorsHash=t.nextValidatorsHash??new Uint8Array,n.consensusHash=t.consensusHash??new Uint8Array,n.appHash=t.appHash??new Uint8Array,n.lastResultsHash=t.lastResultsHash??new Uint8Array,n.evidenceHash=t.evidenceHash??new Uint8Array,n.proposerAddress=t.proposerAddress??new Uint8Array,n}};function b(){return{txs:[]}}e.Data={encode(e,t=r.default.Writer.create()){for(let n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.txs.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{txs:Array.isArray(e?.txs)?e.txs.map(e=>j(e)):[]}},toJSON(e){let t={};return e.txs?t.txs=e.txs.map(e=>N(e===void 0?new Uint8Array:e)):t.txs=[],t},fromPartial(e){let t=b();return t.txs=e.txs?.map(e=>e)||[],t}};function x(){return{type:0,height:`0`,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(34).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(42).fork()).ldelim(),t.validatorAddress.length!==0&&n.uint32(50).bytes(t.validatorAddress),t.validatorIndex!==0&&n.uint32(56).int32(t.validatorIndex),t.signature.length!==0&&n.uint32(66).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=x();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.blockId=e.BlockID.decode(a,a.uint32());break;case 5:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 6:s.validatorAddress=a.bytes();break;case 7:s.validatorIndex=a.int32();break;case 8:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,validatorAddress:R(t.validatorAddress)?j(t.validatorAddress):new Uint8Array,validatorIndex:R(t.validatorIndex)?Number(t.validatorIndex):0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.validatorAddress!==void 0&&(n.validatorAddress=N(t.validatorAddress===void 0?new Uint8Array:t.validatorAddress)),t.validatorIndex!==void 0&&(n.validatorIndex=Math.round(t.validatorIndex)),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=x();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.validatorAddress=t.validatorAddress??new Uint8Array,n.validatorIndex=t.validatorIndex??0,n.signature=t.signature??new Uint8Array,n}};function S(){return{height:`0`,round:0,blockId:void 0,signatures:[]}}e.Commit={encode(t,n=r.default.Writer.create()){t.height!==`0`&&n.uint32(8).int64(t.height),t.round!==0&&n.uint32(16).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(26).fork()).ldelim();for(let r of t.signatures)e.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=S();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.height=L(i.int64());break;case 2:o.round=i.int32();break;case 3:o.blockId=e.BlockID.decode(i,i.uint32());break;case 4:o.signatures.push(e.CommitSig.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.CommitSig.fromJSON(t)):[]}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.CommitSig.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=S();return n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.signatures=t.signatures?.map(t=>e.CommitSig.fromPartial(t))||[],n}};function C(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}e.CommitSig={encode(e,t=r.default.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&i.Timestamp.encode(P(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=C();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=F(i.Timestamp.decode(n,n.uint32()));break;case 4:o.signature=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{blockIdFlag:R(e.blockIdFlag)?l(e.blockIdFlag):0,validatorAddress:R(e.validatorAddress)?j(e.validatorAddress):new Uint8Array,timestamp:R(e.timestamp)?I(e.timestamp):void 0,signature:R(e.signature)?j(e.signature):new Uint8Array}},toJSON(e){let t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=u(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=N(e.validatorAddress===void 0?new Uint8Array:e.validatorAddress)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=N(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=C();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function w(){return{type:0,height:`0`,round:0,polRound:0,blockId:void 0,timestamp:void 0,signature:new Uint8Array}}e.Proposal={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.polRound!==0&&n.uint32(32).int32(t.polRound),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(42).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(50).fork()).ldelim(),t.signature.length!==0&&n.uint32(58).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=w();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.polRound=a.int32();break;case 5:s.blockId=e.BlockID.decode(a,a.uint32());break;case 6:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 7:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,polRound:R(t.polRound)?Number(t.polRound):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.polRound!==void 0&&(n.polRound=Math.round(t.polRound)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=w();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.polRound=t.polRound??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.signature=t.signature??new Uint8Array,n}};function T(){return{header:void 0,commit:void 0}}e.SignedHeader={encode(t,n=r.default.Writer.create()){return t.header!==void 0&&e.Header.encode(t.header,n.uint32(10).fork()).ldelim(),t.commit!==void 0&&e.Commit.encode(t.commit,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=T();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.header=e.Header.decode(i,i.uint32());break;case 2:o.commit=e.Commit.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{header:R(t.header)?e.Header.fromJSON(t.header):void 0,commit:R(t.commit)?e.Commit.fromJSON(t.commit):void 0}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.commit!==void 0&&(n.commit=t.commit?e.Commit.toJSON(t.commit):void 0),n},fromPartial(t){let n=T();return n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.commit=t.commit!==void 0&&t.commit!==null?e.Commit.fromPartial(t.commit):void 0,n}};function E(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={encode(t,n=r.default.Writer.create()){return t.signedHeader!==void 0&&e.SignedHeader.encode(t.signedHeader,n.uint32(10).fork()).ldelim(),t.validatorSet!==void 0&&s.ValidatorSet.encode(t.validatorSet,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signedHeader=e.SignedHeader.decode(i,i.uint32());break;case 2:o.validatorSet=s.ValidatorSet.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signedHeader:R(t.signedHeader)?e.SignedHeader.fromJSON(t.signedHeader):void 0,validatorSet:R(t.validatorSet)?s.ValidatorSet.fromJSON(t.validatorSet):void 0}},toJSON(t){let n={};return t.signedHeader!==void 0&&(n.signedHeader=t.signedHeader?e.SignedHeader.toJSON(t.signedHeader):void 0),t.validatorSet!==void 0&&(n.validatorSet=t.validatorSet?s.ValidatorSet.toJSON(t.validatorSet):void 0),n},fromPartial(t){let n=E();return n.signedHeader=t.signedHeader!==void 0&&t.signedHeader!==null?e.SignedHeader.fromPartial(t.signedHeader):void 0,n.validatorSet=t.validatorSet!==void 0&&t.validatorSet!==null?s.ValidatorSet.fromPartial(t.validatorSet):void 0,n}};function D(){return{blockId:void 0,blockSize:`0`,header:void 0,numTxs:`0`}}e.BlockMeta={encode(t,n=r.default.Writer.create()){return t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(10).fork()).ldelim(),t.blockSize!==`0`&&n.uint32(16).int64(t.blockSize),t.header!==void 0&&e.Header.encode(t.header,n.uint32(26).fork()).ldelim(),t.numTxs!==`0`&&n.uint32(32).int64(t.numTxs),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=D();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.blockId=e.BlockID.decode(i,i.uint32());break;case 2:o.blockSize=L(i.int64());break;case 3:o.header=e.Header.decode(i,i.uint32());break;case 4:o.numTxs=L(i.int64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,blockSize:R(t.blockSize)?String(t.blockSize):`0`,header:R(t.header)?e.Header.fromJSON(t.header):void 0,numTxs:R(t.numTxs)?String(t.numTxs):`0`}},toJSON(t){let n={};return t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.blockSize!==void 0&&(n.blockSize=t.blockSize),t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.numTxs!==void 0&&(n.numTxs=t.numTxs),n},fromPartial(t){let n=D();return n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.blockSize=t.blockSize??`0`,n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.numTxs=t.numTxs??`0`,n}};function O(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={encode(e,t=r.default.Writer.create()){return e.rootHash.length!==0&&t.uint32(10).bytes(e.rootHash),e.data.length!==0&&t.uint32(18).bytes(e.data),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=O();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{rootHash:R(e.rootHash)?j(e.rootHash):new Uint8Array,data:R(e.data)?j(e.data):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.rootHash!==void 0&&(t.rootHash=N(e.rootHash===void 0?new Uint8Array:e.rootHash)),e.data!==void 0&&(t.data=N(e.data===void 0?new Uint8Array:e.data)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=O();return t.rootHash=e.rootHash??new Uint8Array,t.data=e.data??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};var k=(()=>{if(k!==void 0)return k;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),A=k.atob||(e=>k.Buffer.from(e,`base64`).toString(`binary`));function j(e){let t=A(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var M=k.btoa||(e=>k.Buffer.from(e,`binary`).toString(`base64`));function N(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return M(t.join(``))}function P(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function F(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function I(e){return e instanceof Date?e:typeof e==`string`?new Date(e):F(i.Timestamp.fromJSON(e))}function L(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function R(e){return e!=null}})),nv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Any=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{typeUrl:``,value:new Uint8Array}}e.Any={encode(e,t=r.default.Writer.create()){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{typeUrl:u(e.typeUrl)?String(e.typeUrl):``,value:u(e.value)?s(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=l(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=i();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),rv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Duration=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Duration={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),iv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=tv(),o=nv(),s=rv(),c=q_();e.protobufPackage=`cosmos.staking.v1beta1`;var l;(function(e){e[e.BOND_STATUS_UNSPECIFIED=0]=`BOND_STATUS_UNSPECIFIED`,e[e.BOND_STATUS_UNBONDED=1]=`BOND_STATUS_UNBONDED`,e[e.BOND_STATUS_UNBONDING=2]=`BOND_STATUS_UNBONDING`,e[e.BOND_STATUS_BONDED=3]=`BOND_STATUS_BONDED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(l=e.BondStatus||={});function u(e){switch(e){case 0:case`BOND_STATUS_UNSPECIFIED`:return l.BOND_STATUS_UNSPECIFIED;case 1:case`BOND_STATUS_UNBONDED`:return l.BOND_STATUS_UNBONDED;case 2:case`BOND_STATUS_UNBONDING`:return l.BOND_STATUS_UNBONDING;case 3:case`BOND_STATUS_BONDED`:return l.BOND_STATUS_BONDED;default:return l.UNRECOGNIZED}}e.bondStatusFromJSON=u;function d(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return`BOND_STATUS_UNSPECIFIED`;case l.BOND_STATUS_UNBONDED:return`BOND_STATUS_UNBONDED`;case l.BOND_STATUS_UNBONDING:return`BOND_STATUS_UNBONDING`;case l.BOND_STATUS_BONDED:return`BOND_STATUS_BONDED`;default:return`UNKNOWN`}}e.bondStatusToJSON=d;function f(){return{header:void 0,valset:[]}}e.HistoricalInfo={encode(t,n=r.default.Writer.create()){t.header!==void 0&&a.Header.encode(t.header,n.uint32(10).fork()).ldelim();for(let r of t.valset)e.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=f();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.header=a.Header.decode(i,i.uint32());break;case 2:s.valset.push(e.Validator.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{header:I(t.header)?a.Header.fromJSON(t.header):void 0,valset:Array.isArray(t?.valset)?t.valset.map(t=>e.Validator.fromJSON(t)):[]}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?a.Header.toJSON(t.header):void 0),t.valset?n.valset=t.valset.map(t=>t?e.Validator.toJSON(t):void 0):n.valset=[],n},fromPartial(t){let n=f();return n.header=t.header!==void 0&&t.header!==null?a.Header.fromPartial(t.header):void 0,n.valset=t.valset?.map(t=>e.Validator.fromPartial(t))||[],n}};function p(){return{rate:``,maxRate:``,maxChangeRate:``}}e.CommissionRates={encode(e,t=r.default.Writer.create()){return e.rate!==``&&t.uint32(10).string(e.rate),e.maxRate!==``&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==``&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.rate=n.string();break;case 2:a.maxRate=n.string();break;case 3:a.maxChangeRate=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{rate:I(e.rate)?String(e.rate):``,maxRate:I(e.maxRate)?String(e.maxRate):``,maxChangeRate:I(e.maxChangeRate)?String(e.maxChangeRate):``}},toJSON(e){let t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){let t=p();return t.rate=e.rate??``,t.maxRate=e.maxRate??``,t.maxChangeRate=e.maxChangeRate??``,t}};function m(){return{commissionRates:void 0,updateTime:void 0}}e.Commission={encode(t,n=r.default.Writer.create()){return t.commissionRates!==void 0&&e.CommissionRates.encode(t.commissionRates,n.uint32(10).fork()).ldelim(),t.updateTime!==void 0&&i.Timestamp.encode(M(t.updateTime),n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=m();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.commissionRates=e.CommissionRates.decode(a,a.uint32());break;case 2:s.updateTime=N(i.Timestamp.decode(a,a.uint32()));break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{commissionRates:I(t.commissionRates)?e.CommissionRates.fromJSON(t.commissionRates):void 0,updateTime:I(t.updateTime)?P(t.updateTime):void 0}},toJSON(t){let n={};return t.commissionRates!==void 0&&(n.commissionRates=t.commissionRates?e.CommissionRates.toJSON(t.commissionRates):void 0),t.updateTime!==void 0&&(n.updateTime=t.updateTime.toISOString()),n},fromPartial(t){let n=m();return n.commissionRates=t.commissionRates!==void 0&&t.commissionRates!==null?e.CommissionRates.fromPartial(t.commissionRates):void 0,n.updateTime=t.updateTime??void 0,n}};function h(){return{moniker:``,identity:``,website:``,securityContact:``,details:``}}e.Description={encode(e,t=r.default.Writer.create()){return e.moniker!==``&&t.uint32(10).string(e.moniker),e.identity!==``&&t.uint32(18).string(e.identity),e.website!==``&&t.uint32(26).string(e.website),e.securityContact!==``&&t.uint32(34).string(e.securityContact),e.details!==``&&t.uint32(42).string(e.details),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=h();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.moniker=n.string();break;case 2:a.identity=n.string();break;case 3:a.website=n.string();break;case 4:a.securityContact=n.string();break;case 5:a.details=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{moniker:I(e.moniker)?String(e.moniker):``,identity:I(e.identity)?String(e.identity):``,website:I(e.website)?String(e.website):``,securityContact:I(e.securityContact)?String(e.securityContact):``,details:I(e.details)?String(e.details):``}},toJSON(e){let t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){let t=h();return t.moniker=e.moniker??``,t.identity=e.identity??``,t.website=e.website??``,t.securityContact=e.securityContact??``,t.details=e.details??``,t}};function g(){return{operatorAddress:``,consensusPubkey:void 0,jailed:!1,status:0,tokens:``,delegatorShares:``,description:void 0,unbondingHeight:`0`,unbondingTime:void 0,commission:void 0,minSelfDelegation:``}}e.Validator={encode(t,n=r.default.Writer.create()){return t.operatorAddress!==``&&n.uint32(10).string(t.operatorAddress),t.consensusPubkey!==void 0&&o.Any.encode(t.consensusPubkey,n.uint32(18).fork()).ldelim(),t.jailed===!0&&n.uint32(24).bool(t.jailed),t.status!==0&&n.uint32(32).int32(t.status),t.tokens!==``&&n.uint32(42).string(t.tokens),t.delegatorShares!==``&&n.uint32(50).string(t.delegatorShares),t.description!==void 0&&e.Description.encode(t.description,n.uint32(58).fork()).ldelim(),t.unbondingHeight!==`0`&&n.uint32(64).int64(t.unbondingHeight),t.unbondingTime!==void 0&&i.Timestamp.encode(M(t.unbondingTime),n.uint32(74).fork()).ldelim(),t.commission!==void 0&&e.Commission.encode(t.commission,n.uint32(82).fork()).ldelim(),t.minSelfDelegation!==``&&n.uint32(90).string(t.minSelfDelegation),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=g();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.operatorAddress=a.string();break;case 2:c.consensusPubkey=o.Any.decode(a,a.uint32());break;case 3:c.jailed=a.bool();break;case 4:c.status=a.int32();break;case 5:c.tokens=a.string();break;case 6:c.delegatorShares=a.string();break;case 7:c.description=e.Description.decode(a,a.uint32());break;case 8:c.unbondingHeight=F(a.int64());break;case 9:c.unbondingTime=N(i.Timestamp.decode(a,a.uint32()));break;case 10:c.commission=e.Commission.decode(a,a.uint32());break;case 11:c.minSelfDelegation=a.string();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{operatorAddress:I(t.operatorAddress)?String(t.operatorAddress):``,consensusPubkey:I(t.consensusPubkey)?o.Any.fromJSON(t.consensusPubkey):void 0,jailed:I(t.jailed)?!!t.jailed:!1,status:I(t.status)?u(t.status):0,tokens:I(t.tokens)?String(t.tokens):``,delegatorShares:I(t.delegatorShares)?String(t.delegatorShares):``,description:I(t.description)?e.Description.fromJSON(t.description):void 0,unbondingHeight:I(t.unbondingHeight)?String(t.unbondingHeight):`0`,unbondingTime:I(t.unbondingTime)?P(t.unbondingTime):void 0,commission:I(t.commission)?e.Commission.fromJSON(t.commission):void 0,minSelfDelegation:I(t.minSelfDelegation)?String(t.minSelfDelegation):``}},toJSON(t){let n={};return t.operatorAddress!==void 0&&(n.operatorAddress=t.operatorAddress),t.consensusPubkey!==void 0&&(n.consensusPubkey=t.consensusPubkey?o.Any.toJSON(t.consensusPubkey):void 0),t.jailed!==void 0&&(n.jailed=t.jailed),t.status!==void 0&&(n.status=d(t.status)),t.tokens!==void 0&&(n.tokens=t.tokens),t.delegatorShares!==void 0&&(n.delegatorShares=t.delegatorShares),t.description!==void 0&&(n.description=t.description?e.Description.toJSON(t.description):void 0),t.unbondingHeight!==void 0&&(n.unbondingHeight=t.unbondingHeight),t.unbondingTime!==void 0&&(n.unbondingTime=t.unbondingTime.toISOString()),t.commission!==void 0&&(n.commission=t.commission?e.Commission.toJSON(t.commission):void 0),t.minSelfDelegation!==void 0&&(n.minSelfDelegation=t.minSelfDelegation),n},fromPartial(t){let n=g();return n.operatorAddress=t.operatorAddress??``,n.consensusPubkey=t.consensusPubkey!==void 0&&t.consensusPubkey!==null?o.Any.fromPartial(t.consensusPubkey):void 0,n.jailed=t.jailed??!1,n.status=t.status??0,n.tokens=t.tokens??``,n.delegatorShares=t.delegatorShares??``,n.description=t.description!==void 0&&t.description!==null?e.Description.fromPartial(t.description):void 0,n.unbondingHeight=t.unbondingHeight??`0`,n.unbondingTime=t.unbondingTime??void 0,n.commission=t.commission!==void 0&&t.commission!==null?e.Commission.fromPartial(t.commission):void 0,n.minSelfDelegation=t.minSelfDelegation??``,n}};function _(){return{addresses:[]}}e.ValAddresses={encode(e,t=r.default.Writer.create()){for(let n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.addresses.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{addresses:Array.isArray(e?.addresses)?e.addresses.map(e=>String(e)):[]}},toJSON(e){let t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){let t=_();return t.addresses=e.addresses?.map(e=>e)||[],t}};function v(){return{delegatorAddress:``,validatorAddress:``}}e.DVPair={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=v();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function y(){return{pairs:[]}}e.DVPairs={encode(t,n=r.default.Writer.create()){for(let r of t.pairs)e.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=y();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.pairs.push(e.DVPair.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{pairs:Array.isArray(t?.pairs)?t.pairs.map(t=>e.DVPair.fromJSON(t)):[]}},toJSON(t){let n={};return t.pairs?n.pairs=t.pairs.map(t=>t?e.DVPair.toJSON(t):void 0):n.pairs=[],n},fromPartial(t){let n=y();return n.pairs=t.pairs?.map(t=>e.DVPair.fromPartial(t))||[],n}};function b(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``}}e.DVVTriplet={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:I(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:I(e.validatorDstAddress)?String(e.validatorDstAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){let t=b();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t}};function x(){return{triplets:[]}}e.DVVTriplets={encode(t,n=r.default.Writer.create()){for(let r of t.triplets)e.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.triplets.push(e.DVVTriplet.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{triplets:Array.isArray(t?.triplets)?t.triplets.map(t=>e.DVVTriplet.fromJSON(t)):[]}},toJSON(t){let n={};return t.triplets?n.triplets=t.triplets.map(t=>t?e.DVVTriplet.toJSON(t):void 0):n.triplets=[],n},fromPartial(t){let n=x();return n.triplets=t.triplets?.map(t=>e.DVVTriplet.fromPartial(t))||[],n}};function S(){return{delegatorAddress:``,validatorAddress:``,shares:``}}e.Delegation={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.shares!==``&&t.uint32(26).string(e.shares),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.shares=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``,shares:I(e.shares)?String(e.shares):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){let t=S();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.shares=e.shares??``,t}};function C(){return{delegatorAddress:``,validatorAddress:``,entries:[]}}e.UnbondingDelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorAddress!==``&&n.uint32(18).string(t.validatorAddress);for(let r of t.entries)e.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=C();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorAddress=i.string();break;case 3:o.entries.push(e.UnbondingDelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorAddress:I(t.validatorAddress)?String(t.validatorAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorAddress!==void 0&&(n.validatorAddress=t.validatorAddress),t.entries?n.entries=t.entries.map(t=>t?e.UnbondingDelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=C();return n.delegatorAddress=t.delegatorAddress??``,n.validatorAddress=t.validatorAddress??``,n.entries=t.entries?.map(t=>e.UnbondingDelegationEntry.fromPartial(t))||[],n}};function w(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,balance:``}}e.UnbondingDelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.balance!==``&&t.uint32(34).string(e.balance),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=w();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,balance:I(e.balance)?String(e.balance):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){let t=w();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.balance=e.balance??``,t}};function T(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,sharesDst:``}}e.RedelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.sharesDst!==``&&t.uint32(34).string(e.sharesDst),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=T();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,sharesDst:I(e.sharesDst)?String(e.sharesDst):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),t},fromPartial(e){let t=T();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.sharesDst=e.sharesDst??``,t}};function E(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,entries:[]}}e.Redelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorSrcAddress!==``&&n.uint32(18).string(t.validatorSrcAddress),t.validatorDstAddress!==``&&n.uint32(26).string(t.validatorDstAddress);for(let r of t.entries)e.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorSrcAddress=i.string();break;case 3:o.validatorDstAddress=i.string();break;case 4:o.entries.push(e.RedelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorSrcAddress:I(t.validatorSrcAddress)?String(t.validatorSrcAddress):``,validatorDstAddress:I(t.validatorDstAddress)?String(t.validatorDstAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorSrcAddress!==void 0&&(n.validatorSrcAddress=t.validatorSrcAddress),t.validatorDstAddress!==void 0&&(n.validatorDstAddress=t.validatorDstAddress),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=E();return n.delegatorAddress=t.delegatorAddress??``,n.validatorSrcAddress=t.validatorSrcAddress??``,n.validatorDstAddress=t.validatorDstAddress??``,n.entries=t.entries?.map(t=>e.RedelegationEntry.fromPartial(t))||[],n}};function D(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:``}}e.Params={encode(e,t=r.default.Writer.create()){return e.unbondingTime!==void 0&&s.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==``&&t.uint32(42).string(e.bondDenom),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=D();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.unbondingTime=s.Duration.decode(n,n.uint32());break;case 2:a.maxValidators=n.uint32();break;case 3:a.maxEntries=n.uint32();break;case 4:a.historicalEntries=n.uint32();break;case 5:a.bondDenom=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{unbondingTime:I(e.unbondingTime)?s.Duration.fromJSON(e.unbondingTime):void 0,maxValidators:I(e.maxValidators)?Number(e.maxValidators):0,maxEntries:I(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:I(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:I(e.bondDenom)?String(e.bondDenom):``}},toJSON(e){let t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?s.Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),t},fromPartial(e){let t=D();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?s.Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??``,t}};function O(){return{delegation:void 0,balance:void 0}}e.DelegationResponse={encode(t,n=r.default.Writer.create()){return t.delegation!==void 0&&e.Delegation.encode(t.delegation,n.uint32(10).fork()).ldelim(),t.balance!==void 0&&c.Coin.encode(t.balance,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=O();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegation=e.Delegation.decode(i,i.uint32());break;case 2:o.balance=c.Coin.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegation:I(t.delegation)?e.Delegation.fromJSON(t.delegation):void 0,balance:I(t.balance)?c.Coin.fromJSON(t.balance):void 0}},toJSON(t){let n={};return t.delegation!==void 0&&(n.delegation=t.delegation?e.Delegation.toJSON(t.delegation):void 0),t.balance!==void 0&&(n.balance=t.balance?c.Coin.toJSON(t.balance):void 0),n},fromPartial(t){let n=O();return n.delegation=t.delegation!==void 0&&t.delegation!==null?e.Delegation.fromPartial(t.delegation):void 0,n.balance=t.balance!==void 0&&t.balance!==null?c.Coin.fromPartial(t.balance):void 0,n}};function k(){return{redelegationEntry:void 0,balance:``}}e.RedelegationEntryResponse={encode(t,n=r.default.Writer.create()){return t.redelegationEntry!==void 0&&e.RedelegationEntry.encode(t.redelegationEntry,n.uint32(10).fork()).ldelim(),t.balance!==``&&n.uint32(34).string(t.balance),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=k();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegationEntry=e.RedelegationEntry.decode(i,i.uint32());break;case 4:o.balance=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegationEntry:I(t.redelegationEntry)?e.RedelegationEntry.fromJSON(t.redelegationEntry):void 0,balance:I(t.balance)?String(t.balance):``}},toJSON(t){let n={};return t.redelegationEntry!==void 0&&(n.redelegationEntry=t.redelegationEntry?e.RedelegationEntry.toJSON(t.redelegationEntry):void 0),t.balance!==void 0&&(n.balance=t.balance),n},fromPartial(t){let n=k();return n.redelegationEntry=t.redelegationEntry!==void 0&&t.redelegationEntry!==null?e.RedelegationEntry.fromPartial(t.redelegationEntry):void 0,n.balance=t.balance??``,n}};function A(){return{redelegation:void 0,entries:[]}}e.RedelegationResponse={encode(t,n=r.default.Writer.create()){t.redelegation!==void 0&&e.Redelegation.encode(t.redelegation,n.uint32(10).fork()).ldelim();for(let r of t.entries)e.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=A();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegation=e.Redelegation.decode(i,i.uint32());break;case 2:o.entries.push(e.RedelegationEntryResponse.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegation:I(t.redelegation)?e.Redelegation.fromJSON(t.redelegation):void 0,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(t){let n={};return t.redelegation!==void 0&&(n.redelegation=t.redelegation?e.Redelegation.toJSON(t.redelegation):void 0),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntryResponse.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=A();return n.redelegation=t.redelegation!==void 0&&t.redelegation!==null?e.Redelegation.fromPartial(t.redelegation):void 0,n.entries=t.entries?.map(t=>e.RedelegationEntryResponse.fromPartial(t))||[],n}};function j(){return{notBondedTokens:``,bondedTokens:``}}e.Pool={encode(e,t=r.default.Writer.create()){return e.notBondedTokens!==``&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==``&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=j();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.notBondedTokens=n.string();break;case 2:a.bondedTokens=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{notBondedTokens:I(e.notBondedTokens)?String(e.notBondedTokens):``,bondedTokens:I(e.bondedTokens)?String(e.bondedTokens):``}},toJSON(e){let t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){let t=j();return t.notBondedTokens=e.notBondedTokens??``,t.bondedTokens=e.bondedTokens??``,t}};function M(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function N(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function P(e){return e instanceof Date?e:typeof e==`string`?new Date(e):N(i.Timestamp.fromJSON(e))}function F(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function I(e){return e!=null}})),av=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=iv(),o=nv(),s=q_();e.protobufPackage=`cosmos.staking.v1beta1`;function c(){return{description:void 0,commission:void 0,minSelfDelegation:``,delegatorAddress:``,validatorAddress:``,pubkey:void 0,value:void 0}}e.MsgCreateValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==``&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==``&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&o.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&s.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,l=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:l.description=a.Description.decode(n,n.uint32());break;case 2:l.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:l.minSelfDelegation=n.string();break;case 4:l.delegatorAddress=n.string();break;case 5:l.validatorAddress=n.string();break;case 6:l.pubkey=o.Any.decode(n,n.uint32());break;case 7:l.value=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,commission:x(e.commission)?a.CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``,delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,pubkey:x(e.pubkey)?o.Any.fromJSON(e.pubkey):void 0,value:x(e.value)?s.Coin.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?o.Any.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?s.Coin.toJSON(e.value):void 0),t},fromPartial(e){let t=c();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?a.CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??``,t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?o.Any.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?s.Coin.fromPartial(e.value):void 0,t}};function l(){return{}}e.MsgCreateValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{description:void 0,validatorAddress:``,commissionRate:``,minSelfDelegation:``}}e.MsgEditValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==``&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==``&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,commissionRate:x(e.commissionRate)?String(e.commissionRate):``,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){let t=u();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??``,t.commissionRate=e.commissionRate??``,t.minSelfDelegation=e.minSelfDelegation??``,t}};function d(){return{}}e.MsgEditValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgDelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=f();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function p(){return{}}e.MsgDelegateResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};function m(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,amount:void 0}}e.MsgBeginRedelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;case 4:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:x(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:x(e.validatorDstAddress)?String(e.validatorDstAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=m();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function h(){return{completionTime:void 0}}e.MsgBeginRedelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=h();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=h();return t.completionTime=e.completionTime??void 0,t}};function g(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgUndelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=g();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function _(){return{completionTime:void 0}}e.MsgUndelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=_();return t.completionTime=e.completionTime??void 0,t}};function v(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function y(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function b(e){return e instanceof Date?e:typeof e==`string`?new Date(e):y(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function x(e){return e!=null}})),ov=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Grant=e.GenericAuthorization=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=nv();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{msg:``}}e.GenericAuthorization={encode(e,t=r.default.Writer.create()){return e.msg!==``&&t.uint32(10).string(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.msg=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{msg:d(e.msg)?String(e.msg):``}},toJSON(e){let t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){let t=o();return t.msg=e.msg??``,t}};function s(){return{authorization:void 0,expiration:void 0}}e.Grant={encode(e,t=r.default.Writer.create()){return e.authorization!==void 0&&a.Any.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&i.Timestamp.encode(c(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:c.authorization=a.Any.decode(n,n.uint32());break;case 2:c.expiration=l(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{authorization:d(e.authorization)?a.Any.fromJSON(e.authorization):void 0,expiration:d(e.expiration)?u(e.expiration):void 0}},toJSON(e){let t={};return e.authorization!==void 0&&(t.authorization=e.authorization?a.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){let t=s();return t.authorization=e.authorization!==void 0&&e.authorization!==null?a.Any.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function c(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function l(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function u(e){return e instanceof Date?e:typeof e==`string`?new Date(e):l(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),sv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=ov(),a=nv();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{granter:``,grantee:``,grant:void 0}}e.MsgGrant={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.grant!==void 0&&i.Grant.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.granter=n.string();break;case 2:s.grantee=n.string();break;case 3:s.grant=i.Grant.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,grant:y(e.grant)?i.Grant.fromJSON(e.grant):void 0}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?i.Grant.toJSON(e.grant):void 0),t},fromPartial(e){let t=o();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.grant=e.grant!==void 0&&e.grant!==null?i.Grant.fromPartial(e.grant):void 0,t}};function s(){return{results:[]}}e.MsgExecResponse={encode(e,t=r.default.Writer.create()){for(let n of e.results)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.results.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{results:Array.isArray(e?.results)?e.results.map(e=>g(e)):[]}},toJSON(e){let t={};return e.results?t.results=e.results.map(e=>v(e===void 0?new Uint8Array:e)):t.results=[],t},fromPartial(e){let t=s();return t.results=e.results?.map(e=>e)||[],t}};function c(){return{grantee:``,msgs:[]}}e.MsgExec={encode(e,t=r.default.Writer.create()){e.grantee!==``&&t.uint32(10).string(e.grantee);for(let n of e.msgs)a.Any.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.grantee=n.string();break;case 2:o.msgs.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{grantee:y(e.grantee)?String(e.grantee):``,msgs:Array.isArray(e?.msgs)?e.msgs.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(e=>e?a.Any.toJSON(e):void 0):t.msgs=[],t},fromPartial(e){let t=c();return t.grantee=e.grantee??``,t.msgs=e.msgs?.map(e=>a.Any.fromPartial(e))||[],t}};function l(){return{}}e.MsgGrantResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{granter:``,grantee:``,msgTypeUrl:``}}e.MsgRevoke={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==``&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.msgTypeUrl=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,msgTypeUrl:y(e.msgTypeUrl)?String(e.msgTypeUrl):``}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){let t=u();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.msgTypeUrl=e.msgTypeUrl??``,t}};function d(){return{}}e.MsgRevokeResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};var f=(()=>{if(f!==void 0)return f;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),p=f.atob||(e=>f.Buffer.from(e,`base64`).toString(`binary`));function g(e){let t=p(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var _=f.btoa||(e=>f.Buffer.from(e,`binary`).toString(`base64`));function v(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return _(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function y(e){return e!=null}})),cv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=q_(),o=nv(),s=rv();e.protobufPackage=`cosmos.gov.v1beta1`;var c;(function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]=`VOTE_OPTION_UNSPECIFIED`,e[e.VOTE_OPTION_YES=1]=`VOTE_OPTION_YES`,e[e.VOTE_OPTION_ABSTAIN=2]=`VOTE_OPTION_ABSTAIN`,e[e.VOTE_OPTION_NO=3]=`VOTE_OPTION_NO`,e[e.VOTE_OPTION_NO_WITH_VETO=4]=`VOTE_OPTION_NO_WITH_VETO`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.VoteOption||={});function l(e){switch(e){case 0:case`VOTE_OPTION_UNSPECIFIED`:return c.VOTE_OPTION_UNSPECIFIED;case 1:case`VOTE_OPTION_YES`:return c.VOTE_OPTION_YES;case 2:case`VOTE_OPTION_ABSTAIN`:return c.VOTE_OPTION_ABSTAIN;case 3:case`VOTE_OPTION_NO`:return c.VOTE_OPTION_NO;case 4:case`VOTE_OPTION_NO_WITH_VETO`:return c.VOTE_OPTION_NO_WITH_VETO;default:return c.UNRECOGNIZED}}e.voteOptionFromJSON=l;function u(e){switch(e){case c.VOTE_OPTION_UNSPECIFIED:return`VOTE_OPTION_UNSPECIFIED`;case c.VOTE_OPTION_YES:return`VOTE_OPTION_YES`;case c.VOTE_OPTION_ABSTAIN:return`VOTE_OPTION_ABSTAIN`;case c.VOTE_OPTION_NO:return`VOTE_OPTION_NO`;case c.VOTE_OPTION_NO_WITH_VETO:return`VOTE_OPTION_NO_WITH_VETO`;default:return`UNKNOWN`}}e.voteOptionToJSON=u;var d;(function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]=`PROPOSAL_STATUS_UNSPECIFIED`,e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]=`PROPOSAL_STATUS_DEPOSIT_PERIOD`,e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]=`PROPOSAL_STATUS_VOTING_PERIOD`,e[e.PROPOSAL_STATUS_PASSED=3]=`PROPOSAL_STATUS_PASSED`,e[e.PROPOSAL_STATUS_REJECTED=4]=`PROPOSAL_STATUS_REJECTED`,e[e.PROPOSAL_STATUS_FAILED=5]=`PROPOSAL_STATUS_FAILED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.ProposalStatus||={});function f(e){switch(e){case 0:case`PROPOSAL_STATUS_UNSPECIFIED`:return d.PROPOSAL_STATUS_UNSPECIFIED;case 1:case`PROPOSAL_STATUS_DEPOSIT_PERIOD`:return d.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case`PROPOSAL_STATUS_VOTING_PERIOD`:return d.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case`PROPOSAL_STATUS_PASSED`:return d.PROPOSAL_STATUS_PASSED;case 4:case`PROPOSAL_STATUS_REJECTED`:return d.PROPOSAL_STATUS_REJECTED;case 5:case`PROPOSAL_STATUS_FAILED`:return d.PROPOSAL_STATUS_FAILED;default:return d.UNRECOGNIZED}}e.proposalStatusFromJSON=f;function p(e){switch(e){case d.PROPOSAL_STATUS_UNSPECIFIED:return`PROPOSAL_STATUS_UNSPECIFIED`;case d.PROPOSAL_STATUS_DEPOSIT_PERIOD:return`PROPOSAL_STATUS_DEPOSIT_PERIOD`;case d.PROPOSAL_STATUS_VOTING_PERIOD:return`PROPOSAL_STATUS_VOTING_PERIOD`;case d.PROPOSAL_STATUS_PASSED:return`PROPOSAL_STATUS_PASSED`;case d.PROPOSAL_STATUS_REJECTED:return`PROPOSAL_STATUS_REJECTED`;case d.PROPOSAL_STATUS_FAILED:return`PROPOSAL_STATUS_FAILED`;default:return`UNKNOWN`}}e.proposalStatusToJSON=p;function g(){return{option:0,weight:``}}e.WeightedVoteOption={encode(e,t=r.default.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==``&&t.uint32(18).string(e.weight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.option=n.int32();break;case 2:a.weight=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{option:P(e.option)?l(e.option):0,weight:P(e.weight)?String(e.weight):``}},toJSON(e){let t={};return e.option!==void 0&&(t.option=u(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){let t=g();return t.option=e.option??0,t.weight=e.weight??``,t}};function _(){return{title:``,description:``}}e.TextProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:P(e.title)?String(e.title):``,description:P(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=_();return t.title=e.title??``,t.description=e.description??``,t}};function v(){return{proposalId:`0`,depositor:``,amount:[]}}e.Deposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=N(n.uint64());break;case 2:o.depositor=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:P(e.proposalId)?String(e.proposalId):`0`,depositor:P(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=v();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>a.Coin.fromPartial(e))||[],t}};function y(){return{proposalId:`0`,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}e.Proposal={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.content!==void 0&&o.Any.encode(t.content,n.uint32(18).fork()).ldelim(),t.status!==0&&n.uint32(24).int32(t.status),t.finalTallyResult!==void 0&&e.TallyResult.encode(t.finalTallyResult,n.uint32(34).fork()).ldelim(),t.submitTime!==void 0&&i.Timestamp.encode(A(t.submitTime),n.uint32(42).fork()).ldelim(),t.depositEndTime!==void 0&&i.Timestamp.encode(A(t.depositEndTime),n.uint32(50).fork()).ldelim();for(let e of t.totalDeposit)a.Coin.encode(e,n.uint32(58).fork()).ldelim();return t.votingStartTime!==void 0&&i.Timestamp.encode(A(t.votingStartTime),n.uint32(66).fork()).ldelim(),t.votingEndTime!==void 0&&i.Timestamp.encode(A(t.votingEndTime),n.uint32(74).fork()).ldelim(),n},decode(t,n){let s=t instanceof r.default.Reader?t:new r.default.Reader(t),c=n===void 0?s.len:s.pos+n,l=y();for(;s.pos<c;){let t=s.uint32();switch(t>>>3){case 1:l.proposalId=N(s.uint64());break;case 2:l.content=o.Any.decode(s,s.uint32());break;case 3:l.status=s.int32();break;case 4:l.finalTallyResult=e.TallyResult.decode(s,s.uint32());break;case 5:l.submitTime=j(i.Timestamp.decode(s,s.uint32()));break;case 6:l.depositEndTime=j(i.Timestamp.decode(s,s.uint32()));break;case 7:l.totalDeposit.push(a.Coin.decode(s,s.uint32()));break;case 8:l.votingStartTime=j(i.Timestamp.decode(s,s.uint32()));break;case 9:l.votingEndTime=j(i.Timestamp.decode(s,s.uint32()));break;default:s.skipType(t&7);break}}return l},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,content:P(t.content)?o.Any.fromJSON(t.content):void 0,status:P(t.status)?f(t.status):0,finalTallyResult:P(t.finalTallyResult)?e.TallyResult.fromJSON(t.finalTallyResult):void 0,submitTime:P(t.submitTime)?M(t.submitTime):void 0,depositEndTime:P(t.depositEndTime)?M(t.depositEndTime):void 0,totalDeposit:Array.isArray(t?.totalDeposit)?t.totalDeposit.map(e=>a.Coin.fromJSON(e)):[],votingStartTime:P(t.votingStartTime)?M(t.votingStartTime):void 0,votingEndTime:P(t.votingEndTime)?M(t.votingEndTime):void 0}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.content!==void 0&&(n.content=t.content?o.Any.toJSON(t.content):void 0),t.status!==void 0&&(n.status=p(t.status)),t.finalTallyResult!==void 0&&(n.finalTallyResult=t.finalTallyResult?e.TallyResult.toJSON(t.finalTallyResult):void 0),t.submitTime!==void 0&&(n.submitTime=t.submitTime.toISOString()),t.depositEndTime!==void 0&&(n.depositEndTime=t.depositEndTime.toISOString()),t.totalDeposit?n.totalDeposit=t.totalDeposit.map(e=>e?a.Coin.toJSON(e):void 0):n.totalDeposit=[],t.votingStartTime!==void 0&&(n.votingStartTime=t.votingStartTime.toISOString()),t.votingEndTime!==void 0&&(n.votingEndTime=t.votingEndTime.toISOString()),n},fromPartial(t){let n=y();return n.proposalId=t.proposalId??`0`,n.content=t.content!==void 0&&t.content!==null?o.Any.fromPartial(t.content):void 0,n.status=t.status??0,n.finalTallyResult=t.finalTallyResult!==void 0&&t.finalTallyResult!==null?e.TallyResult.fromPartial(t.finalTallyResult):void 0,n.submitTime=t.submitTime??void 0,n.depositEndTime=t.depositEndTime??void 0,n.totalDeposit=t.totalDeposit?.map(e=>a.Coin.fromPartial(e))||[],n.votingStartTime=t.votingStartTime??void 0,n.votingEndTime=t.votingEndTime??void 0,n}};function b(){return{yes:``,abstain:``,no:``,noWithVeto:``}}e.TallyResult={encode(e,t=r.default.Writer.create()){return e.yes!==``&&t.uint32(10).string(e.yes),e.abstain!==``&&t.uint32(18).string(e.abstain),e.no!==``&&t.uint32(26).string(e.no),e.noWithVeto!==``&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.yes=n.string();break;case 2:a.abstain=n.string();break;case 3:a.no=n.string();break;case 4:a.noWithVeto=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{yes:P(e.yes)?String(e.yes):``,abstain:P(e.abstain)?String(e.abstain):``,no:P(e.no)?String(e.no):``,noWithVeto:P(e.noWithVeto)?String(e.noWithVeto):``}},toJSON(e){let t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){let t=b();return t.yes=e.yes??``,t.abstain=e.abstain??``,t.no=e.no??``,t.noWithVeto=e.noWithVeto??``,t}};function x(){return{proposalId:`0`,voter:``,option:0,options:[]}}e.Vote={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.voter!==``&&n.uint32(18).string(t.voter),t.option!==0&&n.uint32(24).int32(t.option);for(let r of t.options)e.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.proposalId=N(i.uint64());break;case 2:o.voter=i.string();break;case 3:o.option=i.int32();break;case 4:o.options.push(e.WeightedVoteOption.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,voter:P(t.voter)?String(t.voter):``,option:P(t.option)?l(t.option):0,options:Array.isArray(t?.options)?t.options.map(t=>e.WeightedVoteOption.fromJSON(t)):[]}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.voter!==void 0&&(n.voter=t.voter),t.option!==void 0&&(n.option=u(t.option)),t.options?n.options=t.options.map(t=>t?e.WeightedVoteOption.toJSON(t):void 0):n.options=[],n},fromPartial(t){let n=x();return n.proposalId=t.proposalId??`0`,n.voter=t.voter??``,n.option=t.option??0,n.options=t.options?.map(t=>e.WeightedVoteOption.fromPartial(t))||[],n}};function S(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={encode(e,t=r.default.Writer.create()){for(let n of e.minDeposit)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&s.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.minDeposit.push(a.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{minDeposit:Array.isArray(e?.minDeposit)?e.minDeposit.map(e=>a.Coin.fromJSON(e)):[],maxDepositPeriod:P(e.maxDepositPeriod)?s.Duration.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){let t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?a.Coin.toJSON(e):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?s.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){let t=S();return t.minDeposit=e.minDeposit?.map(e=>a.Coin.fromPartial(e))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?s.Duration.fromPartial(e.maxDepositPeriod):void 0,t}};function C(){return{votingPeriod:void 0}}e.VotingParams={encode(e,t=r.default.Writer.create()){return e.votingPeriod!==void 0&&s.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=C();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.votingPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{votingPeriod:P(e.votingPeriod)?s.Duration.fromJSON(e.votingPeriod):void 0}},toJSON(e){let t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?s.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){let t=C();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?s.Duration.fromPartial(e.votingPeriod):void 0,t}};function w(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={encode(e,t=r.default.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=w();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.quorum=n.bytes();break;case 2:a.threshold=n.bytes();break;case 3:a.vetoThreshold=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{quorum:P(e.quorum)?D(e.quorum):new Uint8Array,threshold:P(e.threshold)?D(e.threshold):new Uint8Array,vetoThreshold:P(e.vetoThreshold)?D(e.vetoThreshold):new Uint8Array}},toJSON(e){let t={};return e.quorum!==void 0&&(t.quorum=k(e.quorum===void 0?new Uint8Array:e.quorum)),e.threshold!==void 0&&(t.threshold=k(e.threshold===void 0?new Uint8Array:e.threshold)),e.vetoThreshold!==void 0&&(t.vetoThreshold=k(e.vetoThreshold===void 0?new Uint8Array:e.vetoThreshold)),t},fromPartial(e){let t=w();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var T=(()=>{if(T!==void 0)return T;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),E=T.atob||(e=>T.Buffer.from(e,`base64`).toString(`binary`));function D(e){let t=E(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var O=T.btoa||(e=>T.Buffer.from(e,`binary`).toString(`base64`));function k(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return O(t.join(``))}function A(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function j(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function M(e){return e instanceof Date?e:typeof e==`string`?new Date(e):j(i.Timestamp.fromJSON(e))}function N(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function P(e){return e!=null}})),lv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=cv(),a=nv(),o=q_();e.protobufPackage=`cosmos.gov.v1beta1`;function s(){return{content:void 0,initialDeposit:[],proposer:``}}e.MsgSubmitProposal={encode(e,t=r.default.Writer.create()){e.content!==void 0&&a.Any.encode(e.content,t.uint32(10).fork()).ldelim();for(let n of e.initialDeposit)o.Coin.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==``&&t.uint32(26).string(e.proposer),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:c.content=a.Any.decode(n,n.uint32());break;case 2:c.initialDeposit.push(o.Coin.decode(n,n.uint32()));break;case 3:c.proposer=n.string();break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{content:g(e.content)?a.Any.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e?.initialDeposit)?e.initialDeposit.map(e=>o.Coin.fromJSON(e)):[],proposer:g(e.proposer)?String(e.proposer):``}},toJSON(e){let t={};return e.content!==void 0&&(t.content=e.content?a.Any.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(e=>e?o.Coin.toJSON(e):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){let t=s();return t.content=e.content!==void 0&&e.content!==null?a.Any.fromPartial(e.content):void 0,t.initialDeposit=e.initialDeposit?.map(e=>o.Coin.fromPartial(e))||[],t.proposer=e.proposer??``,t}};function c(){return{proposalId:`0`}}e.MsgSubmitProposalResponse={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),t},fromPartial(e){let t=c();return t.proposalId=e.proposalId??`0`,t}};function l(){return{proposalId:`0`,voter:``,option:0}}e.MsgVote={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.voter=n.string();break;case 3:a.option=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,option:g(e.option)?(0,i.voteOptionFromJSON)(e.option):0}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=(0,i.voteOptionToJSON)(e.option)),t},fromPartial(e){let t=l();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.option=e.option??0,t}};function u(){return{}}e.MsgVoteResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{proposalId:`0`,voter:``,options:[]}}e.MsgVoteWeighted={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter);for(let n of e.options)i.WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=h(n.uint64());break;case 2:o.voter=n.string();break;case 3:o.options.push(i.WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,options:Array.isArray(e?.options)?e.options.map(e=>i.WeightedVoteOption.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(e=>e?i.WeightedVoteOption.toJSON(e):void 0):t.options=[],t},fromPartial(e){let t=d();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.options=e.options?.map(e=>i.WeightedVoteOption.fromPartial(e))||[],t}};function f(){return{}}e.MsgVoteWeightedResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}};function p(){return{proposalId:`0`,depositor:``,amount:[]}}e.MsgDeposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)o.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.depositor=n.string();break;case 3:a.amount.push(o.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,depositor:g(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>o.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?o.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=p();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>o.Coin.fromPartial(e))||[],t}};function m(){return{}}e.MsgDepositResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return m()}};function h(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),uv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.distribution.v1beta1`;function a(){return{delegatorAddress:``,withdrawAddress:``}}e.MsgSetWithdrawAddress={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==``&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,withdrawAddress:p(e.withdrawAddress)?String(e.withdrawAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){let t=a();return t.delegatorAddress=e.delegatorAddress??``,t.withdrawAddress=e.withdrawAddress??``,t}};function o(){return{}}e.MsgSetWithdrawAddressResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return o()}};function s(){return{delegatorAddress:``,validatorAddress:``}}e.MsgWithdrawDelegatorReward={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=s();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function c(){return{}}e.MsgWithdrawDelegatorRewardResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return c()}};function l(){return{validatorAddress:``}}e.MsgWithdrawValidatorCommission={encode(e,t=r.default.Writer.create()){return e.validatorAddress!==``&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=l();return t.validatorAddress=e.validatorAddress??``,t}};function u(){return{}}e.MsgWithdrawValidatorCommissionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{amount:[],depositor:``}}e.MsgFundCommunityPool={encode(e,t=r.default.Writer.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==``&&t.uint32(18).string(e.depositor),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[],depositor:p(e.depositor)?String(e.depositor):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){let t=d();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.depositor=e.depositor??``,t}};function f(){return{}}e.MsgFundCommunityPoolResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function p(e){return e!=null}})),dv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Model=e.AbsoluteTxPosition=e.ContractCodeHistoryEntry=e.ContractInfo=e.CodeInfo=e.Params=e.AccessConfig=e.AccessTypeParam=e.contractCodeHistoryOperationTypeToJSON=e.contractCodeHistoryOperationTypeFromJSON=e.ContractCodeHistoryOperationType=e.accessTypeToJSON=e.accessTypeFromJSON=e.AccessType=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv();e.protobufPackage=`cosmwasm.wasm.v1`;var a;(function(e){e[e.ACCESS_TYPE_UNSPECIFIED=0]=`ACCESS_TYPE_UNSPECIFIED`,e[e.ACCESS_TYPE_NOBODY=1]=`ACCESS_TYPE_NOBODY`,e[e.ACCESS_TYPE_ONLY_ADDRESS=2]=`ACCESS_TYPE_ONLY_ADDRESS`,e[e.ACCESS_TYPE_EVERYBODY=3]=`ACCESS_TYPE_EVERYBODY`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AccessType||={});function o(e){switch(e){case 0:case`ACCESS_TYPE_UNSPECIFIED`:return a.ACCESS_TYPE_UNSPECIFIED;case 1:case`ACCESS_TYPE_NOBODY`:return a.ACCESS_TYPE_NOBODY;case 2:case`ACCESS_TYPE_ONLY_ADDRESS`:return a.ACCESS_TYPE_ONLY_ADDRESS;case 3:case`ACCESS_TYPE_EVERYBODY`:return a.ACCESS_TYPE_EVERYBODY;default:return a.UNRECOGNIZED}}e.accessTypeFromJSON=o;function s(e){switch(e){case a.ACCESS_TYPE_UNSPECIFIED:return`ACCESS_TYPE_UNSPECIFIED`;case a.ACCESS_TYPE_NOBODY:return`ACCESS_TYPE_NOBODY`;case a.ACCESS_TYPE_ONLY_ADDRESS:return`ACCESS_TYPE_ONLY_ADDRESS`;case a.ACCESS_TYPE_EVERYBODY:return`ACCESS_TYPE_EVERYBODY`;default:return`UNKNOWN`}}e.accessTypeToJSON=s;var c;(function(e){e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED=0]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT=1]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE=2]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS=3]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.ContractCodeHistoryOperationType||={});function l(e){switch(e){case 0:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;case 1:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;case 2:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;case 3:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;default:return c.UNRECOGNIZED}}e.contractCodeHistoryOperationTypeFromJSON=l;function u(e){switch(e){case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`;default:return`UNKNOWN`}}e.contractCodeHistoryOperationTypeToJSON=u;function d(){return{value:0}}e.AccessTypeParam={encode(e,t=r.default.Writer.create()){return e.value!==0&&t.uint32(8).int32(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.value=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{value:D(e.value)?o(e.value):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=s(e.value)),t},fromPartial(e){let t=d();return t.value=e.value??0,t}};function f(){return{permission:0,address:``}}e.AccessConfig={encode(e,t=r.default.Writer.create()){return e.permission!==0&&t.uint32(8).int32(e.permission),e.address!==``&&t.uint32(18).string(e.address),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.permission=n.int32();break;case 2:a.address=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{permission:D(e.permission)?o(e.permission):0,address:D(e.address)?String(e.address):``}},toJSON(e){let t={};return e.permission!==void 0&&(t.permission=s(e.permission)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){let t=f();return t.permission=e.permission??0,t.address=e.address??``,t}};function p(){return{codeUploadAccess:void 0,instantiateDefaultPermission:0,maxWasmCodeSize:`0`}}e.Params={encode(t,n=r.default.Writer.create()){return t.codeUploadAccess!==void 0&&e.AccessConfig.encode(t.codeUploadAccess,n.uint32(10).fork()).ldelim(),t.instantiateDefaultPermission!==0&&n.uint32(16).int32(t.instantiateDefaultPermission),t.maxWasmCodeSize!==`0`&&n.uint32(24).uint64(t.maxWasmCodeSize),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=p();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeUploadAccess=e.AccessConfig.decode(i,i.uint32());break;case 2:o.instantiateDefaultPermission=i.int32();break;case 3:o.maxWasmCodeSize=E(i.uint64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeUploadAccess:D(t.codeUploadAccess)?e.AccessConfig.fromJSON(t.codeUploadAccess):void 0,instantiateDefaultPermission:D(t.instantiateDefaultPermission)?o(t.instantiateDefaultPermission):0,maxWasmCodeSize:D(t.maxWasmCodeSize)?String(t.maxWasmCodeSize):`0`}},toJSON(t){let n={};return t.codeUploadAccess!==void 0&&(n.codeUploadAccess=t.codeUploadAccess?e.AccessConfig.toJSON(t.codeUploadAccess):void 0),t.instantiateDefaultPermission!==void 0&&(n.instantiateDefaultPermission=s(t.instantiateDefaultPermission)),t.maxWasmCodeSize!==void 0&&(n.maxWasmCodeSize=t.maxWasmCodeSize),n},fromPartial(t){let n=p();return n.codeUploadAccess=t.codeUploadAccess!==void 0&&t.codeUploadAccess!==null?e.AccessConfig.fromPartial(t.codeUploadAccess):void 0,n.instantiateDefaultPermission=t.instantiateDefaultPermission??0,n.maxWasmCodeSize=t.maxWasmCodeSize??`0`,n}};function g(){return{codeHash:new Uint8Array,creator:``,instantiateConfig:void 0}}e.CodeInfo={encode(t,n=r.default.Writer.create()){return t.codeHash.length!==0&&n.uint32(10).bytes(t.codeHash),t.creator!==``&&n.uint32(18).string(t.creator),t.instantiateConfig!==void 0&&e.AccessConfig.encode(t.instantiateConfig,n.uint32(42).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeHash=i.bytes();break;case 2:o.creator=i.string();break;case 5:o.instantiateConfig=e.AccessConfig.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeHash:D(t.codeHash)?C(t.codeHash):new Uint8Array,creator:D(t.creator)?String(t.creator):``,instantiateConfig:D(t.instantiateConfig)?e.AccessConfig.fromJSON(t.instantiateConfig):void 0}},toJSON(t){let n={};return t.codeHash!==void 0&&(n.codeHash=T(t.codeHash===void 0?new Uint8Array:t.codeHash)),t.creator!==void 0&&(n.creator=t.creator),t.instantiateConfig!==void 0&&(n.instantiateConfig=t.instantiateConfig?e.AccessConfig.toJSON(t.instantiateConfig):void 0),n},fromPartial(t){let n=g();return n.codeHash=t.codeHash??new Uint8Array,n.creator=t.creator??``,n.instantiateConfig=t.instantiateConfig!==void 0&&t.instantiateConfig!==null?e.AccessConfig.fromPartial(t.instantiateConfig):void 0,n}};function _(){return{codeId:`0`,creator:``,admin:``,label:``,created:void 0,ibcPortId:``,extension:void 0}}e.ContractInfo={encode(t,n=r.default.Writer.create()){return t.codeId!==`0`&&n.uint32(8).uint64(t.codeId),t.creator!==``&&n.uint32(18).string(t.creator),t.admin!==``&&n.uint32(26).string(t.admin),t.label!==``&&n.uint32(34).string(t.label),t.created!==void 0&&e.AbsoluteTxPosition.encode(t.created,n.uint32(42).fork()).ldelim(),t.ibcPortId!==``&&n.uint32(50).string(t.ibcPortId),t.extension!==void 0&&i.Any.encode(t.extension,n.uint32(58).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=_();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.codeId=E(a.uint64());break;case 2:s.creator=a.string();break;case 3:s.admin=a.string();break;case 4:s.label=a.string();break;case 5:s.created=e.AbsoluteTxPosition.decode(a,a.uint32());break;case 6:s.ibcPortId=a.string();break;case 7:s.extension=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{codeId:D(t.codeId)?String(t.codeId):`0`,creator:D(t.creator)?String(t.creator):``,admin:D(t.admin)?String(t.admin):``,label:D(t.label)?String(t.label):``,created:D(t.created)?e.AbsoluteTxPosition.fromJSON(t.created):void 0,ibcPortId:D(t.ibcPortId)?String(t.ibcPortId):``,extension:D(t.extension)?i.Any.fromJSON(t.extension):void 0}},toJSON(t){let n={};return t.codeId!==void 0&&(n.codeId=t.codeId),t.creator!==void 0&&(n.creator=t.creator),t.admin!==void 0&&(n.admin=t.admin),t.label!==void 0&&(n.label=t.label),t.created!==void 0&&(n.created=t.created?e.AbsoluteTxPosition.toJSON(t.created):void 0),t.ibcPortId!==void 0&&(n.ibcPortId=t.ibcPortId),t.extension!==void 0&&(n.extension=t.extension?i.Any.toJSON(t.extension):void 0),n},fromPartial(t){let n=_();return n.codeId=t.codeId??`0`,n.creator=t.creator??``,n.admin=t.admin??``,n.label=t.label??``,n.created=t.created!==void 0&&t.created!==null?e.AbsoluteTxPosition.fromPartial(t.created):void 0,n.ibcPortId=t.ibcPortId??``,n.extension=t.extension!==void 0&&t.extension!==null?i.Any.fromPartial(t.extension):void 0,n}};function v(){return{operation:0,codeId:`0`,updated:void 0,msg:new Uint8Array}}e.ContractCodeHistoryEntry={encode(t,n=r.default.Writer.create()){return t.operation!==0&&n.uint32(8).int32(t.operation),t.codeId!==`0`&&n.uint32(16).uint64(t.codeId),t.updated!==void 0&&e.AbsoluteTxPosition.encode(t.updated,n.uint32(26).fork()).ldelim(),t.msg.length!==0&&n.uint32(34).bytes(t.msg),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.operation=i.int32();break;case 2:o.codeId=E(i.uint64());break;case 3:o.updated=e.AbsoluteTxPosition.decode(i,i.uint32());break;case 4:o.msg=i.bytes();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{operation:D(t.operation)?l(t.operation):0,codeId:D(t.codeId)?String(t.codeId):`0`,updated:D(t.updated)?e.AbsoluteTxPosition.fromJSON(t.updated):void 0,msg:D(t.msg)?C(t.msg):new Uint8Array}},toJSON(t){let n={};return t.operation!==void 0&&(n.operation=u(t.operation)),t.codeId!==void 0&&(n.codeId=t.codeId),t.updated!==void 0&&(n.updated=t.updated?e.AbsoluteTxPosition.toJSON(t.updated):void 0),t.msg!==void 0&&(n.msg=T(t.msg===void 0?new Uint8Array:t.msg)),n},fromPartial(t){let n=v();return n.operation=t.operation??0,n.codeId=t.codeId??`0`,n.updated=t.updated!==void 0&&t.updated!==null?e.AbsoluteTxPosition.fromPartial(t.updated):void 0,n.msg=t.msg??new Uint8Array,n}};function y(){return{blockHeight:`0`,txIndex:`0`}}e.AbsoluteTxPosition={encode(e,t=r.default.Writer.create()){return e.blockHeight!==`0`&&t.uint32(8).uint64(e.blockHeight),e.txIndex!==`0`&&t.uint32(16).uint64(e.txIndex),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.blockHeight=E(n.uint64());break;case 2:a.txIndex=E(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{blockHeight:D(e.blockHeight)?String(e.blockHeight):`0`,txIndex:D(e.txIndex)?String(e.txIndex):`0`}},toJSON(e){let t={};return e.blockHeight!==void 0&&(t.blockHeight=e.blockHeight),e.txIndex!==void 0&&(t.txIndex=e.txIndex),t},fromPartial(e){let t=y();return t.blockHeight=e.blockHeight??`0`,t.txIndex=e.txIndex??`0`,t}};function b(){return{key:new Uint8Array,value:new Uint8Array}}e.Model={encode(e,t=r.default.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.bytes();break;case 2:a.value=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:D(e.key)?C(e.key):new Uint8Array,value:D(e.value)?C(e.value):new Uint8Array}},toJSON(e){let t={};return e.key!==void 0&&(t.key=T(e.key===void 0?new Uint8Array:e.key)),e.value!==void 0&&(t.value=T(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=b();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};var x=(()=>{if(x!==void 0)return x;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),S=x.atob||(e=>x.Buffer.from(e,`base64`).toString(`binary`));function C(e){let t=S(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var w=x.btoa||(e=>x.Buffer.from(e,`binary`).toString(`base64`));function T(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return w(t.join(``))}function E(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function D(e){return e!=null}})),fv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClearAdminResponse=e.MsgClearAdmin=e.MsgUpdateAdminResponse=e.MsgUpdateAdmin=e.MsgMigrateContractResponse=e.MsgMigrateContract=e.MsgExecuteContractResponse=e.MsgExecuteContract=e.MsgInstantiateContractResponse=e.MsgInstantiateContract=e.MsgStoreCodeResponse=e.MsgStoreCode=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=dv(),a=q_();e.protobufPackage=`cosmwasm.wasm.v1`;function o(){return{sender:``,wasmByteCode:new Uint8Array,instantiatePermission:void 0}}e.MsgStoreCode={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.wasmByteCode.length!==0&&t.uint32(18).bytes(e.wasmByteCode),e.instantiatePermission!==void 0&&i.AccessConfig.encode(e.instantiatePermission,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.sender=n.string();break;case 2:s.wasmByteCode=n.bytes();break;case 5:s.instantiatePermission=i.AccessConfig.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,wasmByteCode:E(e.wasmByteCode)?S(e.wasmByteCode):new Uint8Array,instantiatePermission:E(e.instantiatePermission)?i.AccessConfig.fromJSON(e.instantiatePermission):void 0}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.wasmByteCode!==void 0&&(t.wasmByteCode=w(e.wasmByteCode===void 0?new Uint8Array:e.wasmByteCode)),e.instantiatePermission!==void 0&&(t.instantiatePermission=e.instantiatePermission?i.AccessConfig.toJSON(e.instantiatePermission):void 0),t},fromPartial(e){let t=o();return t.sender=e.sender??``,t.wasmByteCode=e.wasmByteCode??new Uint8Array,t.instantiatePermission=e.instantiatePermission!==void 0&&e.instantiatePermission!==null?i.AccessConfig.fromPartial(e.instantiatePermission):void 0,t}};function s(){return{codeId:`0`}}e.MsgStoreCodeResponse={encode(e,t=r.default.Writer.create()){return e.codeId!==`0`&&t.uint32(8).uint64(e.codeId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.codeId=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{codeId:E(e.codeId)?String(e.codeId):`0`}},toJSON(e){let t={};return e.codeId!==void 0&&(t.codeId=e.codeId),t},fromPartial(e){let t=s();return t.codeId=e.codeId??`0`,t}};function c(){return{sender:``,admin:``,codeId:`0`,label:``,msg:new Uint8Array,funds:[]}}e.MsgInstantiateContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.admin!==``&&t.uint32(18).string(e.admin),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.label!==``&&t.uint32(34).string(e.label),e.msg.length!==0&&t.uint32(42).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.admin=n.string();break;case 3:o.codeId=T(n.uint64());break;case 4:o.label=n.string();break;case 5:o.msg=n.bytes();break;case 6:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,admin:E(e.admin)?String(e.admin):``,codeId:E(e.codeId)?String(e.codeId):`0`,label:E(e.label)?String(e.label):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.admin!==void 0&&(t.admin=e.admin),e.codeId!==void 0&&(t.codeId=e.codeId),e.label!==void 0&&(t.label=e.label),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=c();return t.sender=e.sender??``,t.admin=e.admin??``,t.codeId=e.codeId??`0`,t.label=e.label??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function l(){return{address:``,data:new Uint8Array}}e.MsgInstantiateContractResponse={encode(e,t=r.default.Writer.create()){return e.address!==``&&t.uint32(10).string(e.address),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:E(e.address)?String(e.address):``,data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=l();return t.address=e.address??``,t.data=e.data??new Uint8Array,t}};function u(){return{sender:``,contract:``,msg:new Uint8Array,funds:[]}}e.MsgExecuteContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.msg.length!==0&&t.uint32(26).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(42).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.contract=n.string();break;case 3:o.msg=n.bytes();break;case 5:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=u();return t.sender=e.sender??``,t.contract=e.contract??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function d(){return{data:new Uint8Array}}e.MsgExecuteContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=d();return t.data=e.data??new Uint8Array,t}};function f(){return{sender:``,contract:``,codeId:`0`,msg:new Uint8Array}}e.MsgMigrateContract={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.msg.length!==0&&t.uint32(34).bytes(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.contract=n.string();break;case 3:a.codeId=T(n.uint64());break;case 4:a.msg=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,codeId:E(e.codeId)?String(e.codeId):`0`,msg:E(e.msg)?S(e.msg):new Uint8Array}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.codeId!==void 0&&(t.codeId=e.codeId),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),t},fromPartial(e){let t=f();return t.sender=e.sender??``,t.contract=e.contract??``,t.codeId=e.codeId??`0`,t.msg=e.msg??new Uint8Array,t}};function p(){return{data:new Uint8Array}}e.MsgMigrateContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=p();return t.data=e.data??new Uint8Array,t}};function g(){return{sender:``,newAdmin:``,contract:``}}e.MsgUpdateAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.newAdmin!==``&&t.uint32(18).string(e.newAdmin),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.newAdmin=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,newAdmin:E(e.newAdmin)?String(e.newAdmin):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=g();return t.sender=e.sender??``,t.newAdmin=e.newAdmin??``,t.contract=e.contract??``,t}};function _(){return{}}e.MsgUpdateAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return _()}};function v(){return{sender:``,contract:``}}e.MsgClearAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=v();return t.sender=e.sender??``,t.contract=e.contract??``,t}};function y(){return{}}e.MsgClearAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return y()}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),pv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ModuleVersion=e.CancelSoftwareUpgradeProposal=e.SoftwareUpgradeProposal=e.Plan=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=nv();e.protobufPackage=`cosmos.upgrade.v1beta1`;function o(){return{name:``,time:void 0,height:`0`,info:``,upgradedClientState:void 0}}e.Plan={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.time!==void 0&&i.Timestamp.encode(u(e.time),t.uint32(18).fork()).ldelim(),e.height!==`0`&&t.uint32(24).int64(e.height),e.info!==``&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&a.Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,c=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:c.name=n.string();break;case 2:c.time=d(i.Timestamp.decode(n,n.uint32()));break;case 3:c.height=p(n.int64());break;case 4:c.info=n.string();break;case 5:c.upgradedClientState=a.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{name:m(e.name)?String(e.name):``,time:m(e.time)?f(e.time):void 0,height:m(e.height)?String(e.height):`0`,info:m(e.info)?String(e.info):``,upgradedClientState:m(e.upgradedClientState)?a.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=e.height),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?a.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=o();return t.name=e.name??``,t.time=e.time??void 0,t.height=e.height??`0`,t.info=e.info??``,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?a.Any.fromPartial(e.upgradedClientState):void 0,t}};function s(){return{title:``,description:``,plan:void 0}}e.SoftwareUpgradeProposal={encode(t,n=r.default.Writer.create()){return t.title!==``&&n.uint32(10).string(t.title),t.description!==``&&n.uint32(18).string(t.description),t.plan!==void 0&&e.Plan.encode(t.plan,n.uint32(26).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=s();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.title=i.string();break;case 2:o.description=i.string();break;case 3:o.plan=e.Plan.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{title:m(t.title)?String(t.title):``,description:m(t.description)?String(t.description):``,plan:m(t.plan)?e.Plan.fromJSON(t.plan):void 0}},toJSON(t){let n={};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.plan!==void 0&&(n.plan=t.plan?e.Plan.toJSON(t.plan):void 0),n},fromPartial(t){let n=s();return n.title=t.title??``,n.description=t.description??``,n.plan=t.plan!==void 0&&t.plan!==null?e.Plan.fromPartial(t.plan):void 0,n}};function c(){return{title:``,description:``}}e.CancelSoftwareUpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=c();return t.title=e.title??``,t.description=e.description??``,t}};function l(){return{name:``,version:`0`}}e.ModuleVersion={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.version!==`0`&&t.uint32(16).uint64(e.version),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.name=n.string();break;case 2:a.version=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{name:m(e.name)?String(e.name):``,version:m(e.version)?String(e.version):`0`}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=e.version),t},fromPartial(e){let t=l();return t.name=e.name??``,t.version=e.version??`0`,t}};function u(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function d(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function f(e){return e instanceof Date?e:typeof e==`string`?new Date(e):d(i.Timestamp.fromJSON(e))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),mv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.Height=e.UpgradeProposal=e.ClientUpdateProposal=e.ClientConsensusStates=e.ConsensusStateWithHeight=e.IdentifiedClientState=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv(),a=pv();e.protobufPackage=`ibc.core.client.v1`;function o(){return{clientId:``,clientState:void 0}}e.IdentifiedClientState={encode(e,t=r.default.Writer.create()){return e.clientId!==``&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&i.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.clientId=n.string();break;case 2:s.clientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{clientId:m(e.clientId)?String(e.clientId):``,clientState:m(e.clientState)?i.Any.fromJSON(e.clientState):void 0}},toJSON(e){let t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?i.Any.toJSON(e.clientState):void 0),t},fromPartial(e){let t=o();return t.clientId=e.clientId??``,t.clientState=e.clientState!==void 0&&e.clientState!==null?i.Any.fromPartial(e.clientState):void 0,t}};function s(){return{height:void 0,consensusState:void 0}}e.ConsensusStateWithHeight={encode(t,n=r.default.Writer.create()){return t.height!==void 0&&e.Height.encode(t.height,n.uint32(10).fork()).ldelim(),t.consensusState!==void 0&&i.Any.encode(t.consensusState,n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,c=s();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:c.height=e.Height.decode(a,a.uint32());break;case 2:c.consensusState=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{height:m(t.height)?e.Height.fromJSON(t.height):void 0,consensusState:m(t.consensusState)?i.Any.fromJSON(t.consensusState):void 0}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height?e.Height.toJSON(t.height):void 0),t.consensusState!==void 0&&(n.consensusState=t.consensusState?i.Any.toJSON(t.consensusState):void 0),n},fromPartial(t){let n=s();return n.height=t.height!==void 0&&t.height!==null?e.Height.fromPartial(t.height):void 0,n.consensusState=t.consensusState!==void 0&&t.consensusState!==null?i.Any.fromPartial(t.consensusState):void 0,n}};function c(){return{clientId:``,consensusStates:[]}}e.ClientConsensusStates={encode(t,n=r.default.Writer.create()){t.clientId!==``&&n.uint32(10).string(t.clientId);for(let r of t.consensusStates)e.ConsensusStateWithHeight.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.clientId=i.string();break;case 2:o.consensusStates.push(e.ConsensusStateWithHeight.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{clientId:m(t.clientId)?String(t.clientId):``,consensusStates:Array.isArray(t?.consensusStates)?t.consensusStates.map(t=>e.ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(t){let n={};return t.clientId!==void 0&&(n.clientId=t.clientId),t.consensusStates?n.consensusStates=t.consensusStates.map(t=>t?e.ConsensusStateWithHeight.toJSON(t):void 0):n.consensusStates=[],n},fromPartial(t){let n=c();return n.clientId=t.clientId??``,n.consensusStates=t.consensusStates?.map(t=>e.ConsensusStateWithHeight.fromPartial(t))||[],n}};function l(){return{title:``,description:``,subjectClientId:``,substituteClientId:``}}e.ClientUpdateProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.subjectClientId!==``&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==``&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.subjectClientId=n.string();break;case 4:a.substituteClientId=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,subjectClientId:m(e.subjectClientId)?String(e.subjectClientId):``,substituteClientId:m(e.substituteClientId)?String(e.substituteClientId):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){let t=l();return t.title=e.title??``,t.description=e.description??``,t.subjectClientId=e.subjectClientId??``,t.substituteClientId=e.substituteClientId??``,t}};function u(){return{title:``,description:``,plan:void 0,upgradedClientState:void 0}}e.UpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.plan!==void 0&&a.Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&i.Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=u();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.title=n.string();break;case 2:s.description=n.string();break;case 3:s.plan=a.Plan.decode(n,n.uint32());break;case 4:s.upgradedClientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,plan:m(e.plan)?a.Plan.fromJSON(e.plan):void 0,upgradedClientState:m(e.upgradedClientState)?i.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?a.Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?i.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=u();return t.title=e.title??``,t.description=e.description??``,t.plan=e.plan!==void 0&&e.plan!==null?a.Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?i.Any.fromPartial(e.upgradedClientState):void 0,t}};function d(){return{revisionNumber:`0`,revisionHeight:`0`}}e.Height={encode(e,t=r.default.Writer.create()){return e.revisionNumber!==`0`&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==`0`&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.revisionNumber=p(n.uint64());break;case 2:a.revisionHeight=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{revisionNumber:m(e.revisionNumber)?String(e.revisionNumber):`0`,revisionHeight:m(e.revisionHeight)?String(e.revisionHeight):`0`}},toJSON(e){let t={};return e.revisionNumber!==void 0&&(t.revisionNumber=e.revisionNumber),e.revisionHeight!==void 0&&(t.revisionHeight=e.revisionHeight),t},fromPartial(e){let t=d();return t.revisionNumber=e.revisionNumber??`0`,t.revisionHeight=e.revisionHeight??`0`,t}};function f(){return{allowedClients:[]}}e.Params={encode(e,t=r.default.Writer.create()){for(let n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.allowedClients.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{allowedClients:Array.isArray(e?.allowedClients)?e.allowedClients.map(e=>String(e)):[]}},toJSON(e){let t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(e=>e):t.allowedClients=[],t},fromPartial(e){let t=f();return t.allowedClients=e.allowedClients?.map(e=>e)||[],t}};function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),hv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgTransferResponse=e.MsgTransfer=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_(),a=mv();e.protobufPackage=`ibc.applications.transfer.v1`;function o(){return{sourcePort:``,sourceChannel:``,token:void 0,sender:``,receiver:``,timeoutHeight:void 0,timeoutTimestamp:`0`,memo:``}}e.MsgTransfer={encode(e,t=r.default.Writer.create()){return e.sourcePort!==``&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==``&&t.uint32(18).string(e.sourceChannel),e.token!==void 0&&i.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),e.sender!==``&&t.uint32(34).string(e.sender),e.receiver!==``&&t.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&a.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp!==`0`&&t.uint32(56).uint64(e.timeoutTimestamp),e.memo!==``&&t.uint32(66).string(e.memo),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,l=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:l.sourcePort=n.string();break;case 2:l.sourceChannel=n.string();break;case 3:l.token=i.Coin.decode(n,n.uint32());break;case 4:l.sender=n.string();break;case 5:l.receiver=n.string();break;case 6:l.timeoutHeight=a.Height.decode(n,n.uint32());break;case 7:l.timeoutTimestamp=c(n.uint64());break;case 8:l.memo=n.string();break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{sourcePort:l(e.sourcePort)?String(e.sourcePort):``,sourceChannel:l(e.sourceChannel)?String(e.sourceChannel):``,token:l(e.token)?i.Coin.fromJSON(e.token):void 0,sender:l(e.sender)?String(e.sender):``,receiver:l(e.receiver)?String(e.receiver):``,timeoutHeight:l(e.timeoutHeight)?a.Height.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:l(e.timeoutTimestamp)?String(e.timeoutTimestamp):`0`,memo:l(e.memo)?String(e.memo):``}},toJSON(e){let t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.token!==void 0&&(t.token=e.token?i.Coin.toJSON(e.token):void 0),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=e.timeoutTimestamp),e.memo!==void 0&&(t.memo=e.memo),t},fromPartial(e){let t=o();return t.sourcePort=e.sourcePort??``,t.sourceChannel=e.sourceChannel??``,t.token=e.token!==void 0&&e.token!==null?i.Coin.fromPartial(e.token):void 0,t.sender=e.sender??``,t.receiver=e.receiver??``,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?a.Height.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??`0`,t.memo=e.memo??``,t}};function s(){return{}}e.MsgTransferResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function l(e){return e!=null}})),gv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UnknownMessage=void 0;var t=A();e.UnknownMessage=class{constructor(e,t){this._typeUrl=e,this._value=t}get typeUrl(){return this._typeUrl}get value(){return this._value}toJSON(){return{typeUrl:this._typeUrl,value:t.Buffer.from(this._value).toString(`base64`)}}}})),_v=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.StakeAuthorization_Validators=e.StakeAuthorization=e.authorizationTypeToJSON=e.authorizationTypeFromJSON=e.AuthorizationType=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.staking.v1beta1`;var a;(function(e){e[e.AUTHORIZATION_TYPE_UNSPECIFIED=0]=`AUTHORIZATION_TYPE_UNSPECIFIED`,e[e.AUTHORIZATION_TYPE_DELEGATE=1]=`AUTHORIZATION_TYPE_DELEGATE`,e[e.AUTHORIZATION_TYPE_UNDELEGATE=2]=`AUTHORIZATION_TYPE_UNDELEGATE`,e[e.AUTHORIZATION_TYPE_REDELEGATE=3]=`AUTHORIZATION_TYPE_REDELEGATE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AuthorizationType||={});function o(e){switch(e){case 0:case`AUTHORIZATION_TYPE_UNSPECIFIED`:return a.AUTHORIZATION_TYPE_UNSPECIFIED;case 1:case`AUTHORIZATION_TYPE_DELEGATE`:return a.AUTHORIZATION_TYPE_DELEGATE;case 2:case`AUTHORIZATION_TYPE_UNDELEGATE`:return a.AUTHORIZATION_TYPE_UNDELEGATE;case 3:case`AUTHORIZATION_TYPE_REDELEGATE`:return a.AUTHORIZATION_TYPE_REDELEGATE;default:return a.UNRECOGNIZED}}e.authorizationTypeFromJSON=o;function s(e){switch(e){case a.AUTHORIZATION_TYPE_UNSPECIFIED:return`AUTHORIZATION_TYPE_UNSPECIFIED`;case a.AUTHORIZATION_TYPE_DELEGATE:return`AUTHORIZATION_TYPE_DELEGATE`;case a.AUTHORIZATION_TYPE_UNDELEGATE:return`AUTHORIZATION_TYPE_UNDELEGATE`;case a.AUTHORIZATION_TYPE_REDELEGATE:return`AUTHORIZATION_TYPE_REDELEGATE`;default:return`UNKNOWN`}}e.authorizationTypeToJSON=s;function c(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}e.StakeAuthorization={encode(t,n=r.default.Writer.create()){return t.maxTokens!==void 0&&i.Coin.encode(t.maxTokens,n.uint32(10).fork()).ldelim(),t.allowList!==void 0&&e.StakeAuthorization_Validators.encode(t.allowList,n.uint32(18).fork()).ldelim(),t.denyList!==void 0&&e.StakeAuthorization_Validators.encode(t.denyList,n.uint32(26).fork()).ldelim(),t.authorizationType!==0&&n.uint32(32).int32(t.authorizationType),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=c();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.maxTokens=i.Coin.decode(a,a.uint32());break;case 2:s.allowList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 3:s.denyList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 4:s.authorizationType=a.int32();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{maxTokens:u(t.maxTokens)?i.Coin.fromJSON(t.maxTokens):void 0,allowList:u(t.allowList)?e.StakeAuthorization_Validators.fromJSON(t.allowList):void 0,denyList:u(t.denyList)?e.StakeAuthorization_Validators.fromJSON(t.denyList):void 0,authorizationType:u(t.authorizationType)?o(t.authorizationType):0}},toJSON(t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens?i.Coin.toJSON(t.maxTokens):void 0),t.allowList!==void 0&&(n.allowList=t.allowList?e.StakeAuthorization_Validators.toJSON(t.allowList):void 0),t.denyList!==void 0&&(n.denyList=t.denyList?e.StakeAuthorization_Validators.toJSON(t.denyList):void 0),t.authorizationType!==void 0&&(n.authorizationType=s(t.authorizationType)),n},fromPartial(t){let n=c();return n.maxTokens=t.maxTokens!==void 0&&t.maxTokens!==null?i.Coin.fromPartial(t.maxTokens):void 0,n.allowList=t.allowList!==void 0&&t.allowList!==null?e.StakeAuthorization_Validators.fromPartial(t.allowList):void 0,n.denyList=t.denyList!==void 0&&t.denyList!==null?e.StakeAuthorization_Validators.fromPartial(t.denyList):void 0,n.authorizationType=t.authorizationType??0,n}};function l(){return{address:[]}}e.StakeAuthorization_Validators={encode(e,t=r.default.Writer.create()){for(let n of e.address)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:Array.isArray(e?.address)?e.address.map(e=>String(e)):[]}},toJSON(e){let t={};return e.address?t.address=e.address.map(e=>e):t.address=[],t},fromPartial(e){let t=l();return t.address=e.address?.map(e=>e)||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),vv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SendAuthorization=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{spendLimit:[]}}e.SendAuthorization={encode(e,t=r.default.Writer.create()){for(let n of e.spendLimit)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.spendLimit.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{spendLimit:Array.isArray(e?.spendLimit)?e.spendLimit.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(e=>e?i.Coin.toJSON(e):void 0):t.spendLimit=[],t},fromPartial(e){let t=a();return t.spendLimit=e.spendLimit?.map(e=>i.Coin.fromPartial(e))||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure())})),yv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultProtoCodec=e.ProtoCodec=void 0;var r=K_(),i=Y_(),a=av(),o=sv(),s=lv(),c=uv(),l=fv(),u=hv(),d=gv(),f=ov(),p=_v(),m=vv(),h=A();n(gv(),e);var g=class{constructor(){this.typeUrlMap=new Map}unpackAnyFactory(e){if(this.typeUrlMap.has(e))return this.typeUrlMap.get(e)}unpackAny(e){let t=this.unpackAnyFactory(e.typeUrl);if(!t)return new d.UnknownMessage(e.typeUrl,e.value);let n=t.decode(e.value);return Object.assign(Object.assign({},e),{unpacked:n})}unpackedAnyToJSONRecursive(e){if(e instanceof d.UnknownMessage)return e.toJSON();let t=this.unpackAnyFactory(e.typeUrl);if(t&&`unpacked`in e&&e.unpacked){let n=e=>{let t=typeof e==`object`&&!(e instanceof d.UnknownMessage)&&`typeUrl`in e&&e.typeUrl&&typeof e.typeUrl==`string`&&`value`in e&&e.value&&typeof e.value==`string`;if(t)try{h.Buffer.from(e.value,`base64`)}catch{return!1}return t},r=e=>{let t=this.unpackAnyFactory(e.typeUrl),n=h.Buffer.from(e.value,`base64`);if(!t)return new d.UnknownMessage(e.typeUrl,n).toJSON();let r=t.decode(n);return{typeUrl:e.typeUrl,value:t.toJSON(r)}},i=e=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}else for(let t in e){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}return e},a=t.toJSON(e.unpacked);if(a&&typeof a==`object`)return a=i(a),{typeUrl:e.typeUrl,value:a}}return new d.UnknownMessage(e.typeUrl,e.value).toJSON()}registerAny(e,t){this.typeUrlMap.set(e,t)}};e.ProtoCodec=g,e.defaultProtoCodec=new g,e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgWalletSpendAction`,r.MsgWalletSpendAction),e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgProvision`,r.MsgProvision),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgSend`,i.MsgSend),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgMultiSend`,i.MsgMultiSend),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgDelegate`,a.MsgDelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgUndelegate`,a.MsgUndelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgBeginRedelegate`,a.MsgBeginRedelegate),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgExecuteContract`,l.MsgExecuteContract),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgInstantiateContract`,l.MsgInstantiateContract),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward`,c.MsgWithdrawDelegatorReward),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgSetWithdrawAddress`,c.MsgSetWithdrawAddress),e.defaultProtoCodec.registerAny(`/ibc.applications.transfer.v1.MsgTransfer`,u.MsgTransfer),e.defaultProtoCodec.registerAny(`/cosmos.gov.v1beta1.MsgVote`,s.MsgVote),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgGrant`,o.MsgGrant),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.GenericAuthorization`,f.GenericAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.StakeAuthorization`,p.StakeAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.SendAuthorization`,m.SendAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgRevoke`,o.MsgRevoke),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgExec`,o.MsgExec)})),bv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function i(){return{signatures:[]}}e.MultiSignature={encode(e,t=r.default.Writer.create()){for(let n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>c(e)):[]}},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>u(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=i();return t.signatures=e.signatures?.map(e=>e)||[],t}};function a(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={encode(e,t=r.default.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{extraBitsStored:d(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:d(e.elems)?c(e.elems):new Uint8Array}},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=u(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=a();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var o=(()=>{if(o!==void 0)return o;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),s=o.atob||(e=>o.Buffer.from(e,`base64`).toString(`binary`));function c(e){let t=s(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var l=o.btoa||(e=>o.Buffer.from(e,`binary`).toString(`base64`));function u(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return l(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),xv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv(),a=bv();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var o;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(o=e.SignMode||={});function s(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return o.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return o.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return o.SIGN_MODE_TEXTUAL;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return o.SIGN_MODE_LEGACY_AMINO_JSON;default:return o.UNRECOGNIZED}}e.signModeFromJSON=s;function c(e){switch(e){case o.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case o.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case o.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case o.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;default:return`UNKNOWN`}}e.signModeToJSON=c;function l(){return{signatures:[]}}e.SignatureDescriptors={encode(t,n=r.default.Writer.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=l();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t)):[]}},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=l();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function u(){return{publicKey:void 0,data:void 0,sequence:`0`}}e.SignatureDescriptor={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&i.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=u();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=i.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=x(a.uint64());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:S(t.publicKey)?i.Any.fromJSON(t.publicKey):void 0,data:S(t.data)?e.SignatureDescriptor_Data.fromJSON(t.data):void 0,sequence:S(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?i.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(n.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=u();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?i.Any.fromPartial(t.publicKey):void 0,n.data=t.data!==void 0&&t.data!==null?e.SignatureDescriptor_Data.fromPartial(t.data):void 0,n.sequence=t.sequence??`0`,n}};function d(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:S(t.single)?e.SignatureDescriptor_Data_Single.fromJSON(t.single):void 0,multi:S(t.multi)?e.SignatureDescriptor_Data_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=d();return n.single=t.single!==void 0&&t.single!==null?e.SignatureDescriptor_Data_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.SignatureDescriptor_Data_Multi.fromPartial(t.multi):void 0,n}};function f(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:S(e.mode)?s(e.mode):0,signature:S(e.signature)?v(e.signature):new Uint8Array}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=c(e.mode)),e.signature!==void 0&&(t.signature=b(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=f();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function p(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&a.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.signatures)e.SignatureDescriptor_Data.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=a.CompactBitArray.decode(i,i.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:S(t.bitarray)?a.CompactBitArray.fromJSON(t.bitarray):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?a.CompactBitArray.toJSON(t.bitarray):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=p();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?a.CompactBitArray.fromPartial(t.bitarray):void 0,n.signatures=t.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],n}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),Sv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=xv(),a=nv(),o=bv(),s=q_();e.protobufPackage=`cosmos.tx.v1beta1`;function c(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={encode(t,n=r.default.Writer.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(i,i.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(i,i.uint32());break;case 3:o.signatures.push(i.bytes());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{body:E(t.body)?e.TxBody.fromJSON(t.body):void 0,authInfo:E(t.authInfo)?e.AuthInfo.fromJSON(t.authInfo):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(e=>S(e)):[]}},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>w(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=c();return n.body=t.body!==void 0&&t.body!==null?e.TxBody.fromPartial(t.body):void 0,n.authInfo=t.authInfo!==void 0&&t.authInfo!==null?e.AuthInfo.fromPartial(t.authInfo):void 0,n.signatures=t.signatures?.map(e=>e)||[],n}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={encode(e,t=r.default.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>S(e)):[]}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>w(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function u(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:`0`}}e.SignDoc={encode(e,t=r.default.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==`0`&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.chainId=n.string();break;case 4:a.accountNumber=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,chainId:E(e.chainId)?String(e.chainId):``,accountNumber:E(e.accountNumber)?String(e.accountNumber):`0`}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=e.accountNumber),t},fromPartial(e){let t=u();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,t.accountNumber=e.accountNumber??`0`,t}};function d(){return{messages:[],memo:``,timeoutHeight:`0`,extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={encode(e,t=r.default.Writer.create()){for(let n of e.messages)a.Any.encode(n,t.uint32(10).fork()).ldelim();e.memo!==``&&t.uint32(18).string(e.memo),e.timeoutHeight!==`0`&&t.uint32(24).uint64(e.timeoutHeight);for(let n of e.extensionOptions)a.Any.encode(n,t.uint32(8186).fork()).ldelim();for(let n of e.nonCriticalExtensionOptions)a.Any.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(a.Any.decode(n,n.uint32()));break;case 2:o.memo=n.string();break;case 3:o.timeoutHeight=T(n.uint64());break;case 1023:o.extensionOptions.push(a.Any.decode(n,n.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>a.Any.fromJSON(e)):[],memo:E(e.memo)?String(e.memo):``,timeoutHeight:E(e.timeoutHeight)?String(e.timeoutHeight):`0`,extensionOptions:Array.isArray(e?.extensionOptions)?e.extensionOptions.map(e=>a.Any.fromJSON(e)):[],nonCriticalExtensionOptions:Array.isArray(e?.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e?a.Any.toJSON(e):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){let t=d();return t.messages=e.messages?.map(e=>a.Any.fromPartial(e))||[],t.memo=e.memo??``,t.timeoutHeight=e.timeoutHeight??`0`,t.extensionOptions=e.extensionOptions?.map(e=>a.Any.fromPartial(e))||[],t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>a.Any.fromPartial(e))||[],t}};function f(){return{signerInfos:[],fee:void 0}}e.AuthInfo={encode(t,n=r.default.Writer.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=f();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(i,i.uint32()));break;case 2:o.fee=e.Fee.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signerInfos:Array.isArray(t?.signerInfos)?t.signerInfos.map(t=>e.SignerInfo.fromJSON(t)):[],fee:E(t.fee)?e.Fee.fromJSON(t.fee):void 0}},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],n.fee=t.fee!==void 0&&t.fee!==null?e.Fee.fromPartial(t.fee):void 0,n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:`0`}}e.SignerInfo={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&a.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.modeInfo!==void 0&&e.ModeInfo.encode(t.modeInfo,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.publicKey=a.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=T(i.uint64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:E(t.publicKey)?a.Any.fromJSON(t.publicKey):void 0,modeInfo:E(t.modeInfo)?e.ModeInfo.fromJSON(t.modeInfo):void 0,sequence:E(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?a.Any.toJSON(t.publicKey):void 0),t.modeInfo!==void 0&&(n.modeInfo=t.modeInfo?e.ModeInfo.toJSON(t.modeInfo):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=p();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?a.Any.fromPartial(t.publicKey):void 0,n.modeInfo=t.modeInfo!==void 0&&t.modeInfo!==null?e.ModeInfo.fromPartial(t.modeInfo):void 0,n.sequence=t.sequence??`0`,n}};function g(){return{single:void 0,multi:void 0}}e.ModeInfo={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(i,i.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:E(t.single)?e.ModeInfo_Single.fromJSON(t.single):void 0,multi:E(t.multi)?e.ModeInfo_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=g();return n.single=t.single!==void 0&&t.single!==null?e.ModeInfo_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.ModeInfo_Multi.fromPartial(t.multi):void 0,n}};function _(){return{mode:0}}e.ModeInfo_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:E(e.mode)?(0,i.signModeFromJSON)(e.mode):0}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,i.signModeToJSON)(e.mode)),t},fromPartial(e){let t=_();return t.mode=e.mode??0,t}};function v(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&o.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,s=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=o.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:E(t.bitarray)?o.CompactBitArray.fromJSON(t.bitarray):void 0,modeInfos:Array.isArray(t?.modeInfos)?t.modeInfos.map(t=>e.ModeInfo.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?o.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=v();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?o.CompactBitArray.fromPartial(t.bitarray):void 0,n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function y(){return{amount:[],gasLimit:`0`,payer:``,granter:``}}e.Fee={encode(e,t=r.default.Writer.create()){for(let n of e.amount)s.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==`0`&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.amount.push(s.Coin.decode(n,n.uint32()));break;case 2:a.gasLimit=T(n.uint64());break;case 3:a.payer=n.string();break;case 4:a.granter=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>s.Coin.fromJSON(e)):[],gasLimit:E(e.gasLimit)?String(e.gasLimit):`0`,payer:E(e.payer)?String(e.payer):``,granter:E(e.granter)?String(e.granter):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?s.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=e.gasLimit),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=y();return t.amount=e.amount?.map(e=>s.Coin.fromPartial(e))||[],t.gasLimit=e.gasLimit??`0`,t.payer=e.payer??``,t.granter=e.granter??``,t}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),Cv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtoSignDocDecoder=void 0;var t=Sv(),n=yv();e.ProtoSignDocDecoder=class e{static decode(n){return new e(t.SignDoc.decode(n))}constructor(e,t=n.defaultProtoCodec){this.signDoc=e,this.protoCodec=t}get txBody(){return this._txBody||=t.TxBody.decode(this.signDoc.bodyBytes),this._txBody}get txMsgs(){let e=[];for(let t of this.txBody.messages)e.push(this.protoCodec.unpackAny(t));return e}get authInfo(){return this._authInfo||=t.AuthInfo.decode(this.signDoc.authInfoBytes),this._authInfo}get chainId(){return this.signDoc.chainId}get accountNumber(){return this.signDoc.accountNumber.toString()}toBytes(){return t.SignDoc.encode(this.signDoc).finish()}toJSON(){return{txBody:Object.assign(Object.assign({},t.TxBody.toJSON(this.txBody)),{messages:this.txMsgs.map(e=>this.protoCodec.unpackedAnyToJSONRecursive(e))}),authInfo:t.AuthInfo.toJSON(this.authInfo),chainId:this.chainId,accountNumber:this.accountNumber}}}})),wv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Tv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseKVStore=void 0,e.BaseKVStore=class{constructor(e,t){this.provider=e,this._prefix=t}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return(yield this.provider.get())[t]})}set(e,t){let n=this.prefix()+`/`+e;return this.provider.set({[n]:t})}prefix(){return this._prefix}}})),Ev=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionKVStore=void 0;var n=Tv();e.ExtensionKVStore=class e extends n.BaseKVStore{constructor(t){if(e.KVStoreProvider||typeof browser>`u`||!browser.storage||!browser.storage.local||(e.KVStoreProvider={get:browser.storage.local.get,set:browser.storage.local.set,multiGet:browser.storage.local.get}),!e.KVStoreProvider)throw Error(`Can't initialize kv store for browser extension`);super(e.KVStoreProvider,t)}multiGet(n){return t(this,void 0,void 0,function*(){n=Array.from(new Set(n));let t=(yield e.KVStoreProvider.multiGet(n.map(e=>this.prefix()+`/`+e)))??{},r=Object.keys(t);for(let e of r){let n=e.slice(this.prefix().length+1);t[n]=t[e],delete t[e]}return t})}}})),Dv=a((e=>{s(),Object.defineProperty(e,"__esModule",{value:!0}),e.MemoryKVStore=void 0;var t=Tv(),n=class{constructor(){this.store={}}get(){return Promise.resolve(this.store)}set(e){return this.store=Object.assign(Object.assign({},this.store),e),Promise.resolve()}checkNotPrimitiveField(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n==`object`&&n){if(n.constructor!==Object&&n.constructor!==Array)throw Error(`${t} may not be serializable: ${n.constructor.name}`);this.checkNotPrimitiveField(n)}})}};e.MemoryKVStore=class extends t.BaseKVStore{constructor(e){super(new n,e)}}})),Ov=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LocalKVStore=void 0,e.LocalKVStore=class{constructor(e){this._prefix=e}get(e){let t=this.prefix()+`/`+e,n=localStorage.getItem(t);return n===null?Promise.resolve(void 0):Promise.resolve(JSON.parse(n))}set(e,t){let n=this.prefix()+`/`+e;return t===null?Promise.resolve(localStorage.removeItem(n)):Promise.resolve(localStorage.setItem(n,JSON.stringify(t)))}prefix(){return this._prefix}}})),kv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.IndexedDBKVStore=void 0,e.IndexedDBKVStore=class{constructor(e){this._prefix=e}get(e){return t(this,void 0,void 0,function*(){let t=(yield this.getDB()).transaction([this.prefix()],`readonly`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.get(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{i.result?n(i.result.data):n(void 0)}})})}set(e,n){return t(this,void 0,void 0,function*(){if(n===null){let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.delete(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{n()}})}else{let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((r,i)=>{let a=t.put({key:e,data:n});a.onerror=e=>{e.stopPropagation(),i(e.target)},a.onsuccess=()=>{r()}})}})}prefix(){return this._prefix}getDB(){return t(this,void 0,void 0,function*(){return this.cachedDB?this.cachedDB:new Promise((e,t)=>{let n=window.indexedDB.open(this.prefix());n.onerror=e=>{e.stopPropagation(),t(e.target)},n.onupgradeneeded=e=>{e.target.result.createObjectStore(this.prefix(),{keyPath:`key`})},n.onsuccess=()=>{this.cachedDB=n.result,e(n.result)}})})}}})),Av=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixKVStore=void 0,e.PrefixKVStore=class{constructor(e,t){this.kvStore=e,this._prefix=t}prefix(){return this._prefix}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.get(t)})}set(e,n){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.set(t,n)})}}})),jv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.WrapMultiGetKVStore=void 0,e.WrapMultiGetKVStore=class{constructor(e){this.kvStore=e}multiGet(e){return t(this,void 0,void 0,function*(){e=Array.from(new Set(e));let n={},r=[];for(let i of e)r.push(t(this,void 0,void 0,function*(){n[i]=yield this.kvStore.get(i)}));return yield Promise.all(r),n})}}})),Mv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(wv(),e),n(Ev(),e),n(Tv(),e),n(Dv(),e),n(Ov(),e),n(kv(),e),n(Av(),e),n(jv(),e)})),Nv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=M(),n=P();function r(e){let n=t(`sha256`).update(e).digest();try{return t(`rmd160`).update(n).digest()}catch{return t(`ripemd160`).update(n).digest()}}e.hash160=r;function i(e,t){return n(`sha512`,e).update(t).digest()}e.hmacSHA512=i})),Pv=a(((e,t)=>{_();var n=P(),r=v.alloc(1,1),i=v.alloc(1,0);function a(e,t,a,o,s){let c=v.alloc(32,0),l=v.alloc(32,1);c=n(`sha256`,c).update(l).update(i).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),c=n(`sha256`,c).update(l).update(r).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest();let u=l;for(;!o(u)||!a(u);)c=n(`sha256`,c).update(l).update(i).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest(),u=l;return u}t.exports=a})),Fv=a(((e,t)=>{_();var n=L(),r=F().ec,i=new r(`secp256k1`),a=Pv(),o=v.alloc(32,0),s=v.from(`fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`,`hex`),c=v.from(`fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`,`hex`),l=i.curve.n,u=l.shrn(1),d=i.curve.g,f=`Expected Private`,p=`Expected Point`,m=`Expected Tweak`,h=`Expected Hash`,g=`Expected Signature`,y=`Expected Extra Data (32 bytes)`;function b(e){return e instanceof Uint8Array&&e.length===32}function x(e){return b(e)?s.compare(e)>0:!1}function S(e){if(!(e instanceof Uint8Array)||e.length<33)return!1;let t=e[0],n=e.subarray(1,33);if(o.compare(n)===0||c.compare(n)<=0)return!1;if((t===2||t===3)&&e.length===33){try{A(e)}catch{return!1}return!0}let r=e.subarray(33);return o.compare(r)===0||c.compare(r)<=0?!1:t===4&&e.length===65}function C(e){return e[0]!==4}function w(e){return S(e)?C(e):!1}function T(e){return b(e)?o.compare(e)<0&&s.compare(e)>0:!1}function E(e){let t=e.subarray(0,32),n=e.subarray(32,64);return e instanceof Uint8Array&&e.length===64&&s.compare(t)>0&&s.compare(n)>0}function D(e,t){return e===void 0&&t!==void 0?C(t):e===void 0?!0:e}function O(e){return new n(e)}function k(e){return e.toArrayLike(v,`be`,32)}function A(e){return i.curve.decodePoint(e)}function j(e,t){return v.from(e._encode(t))}function M(e,t,n){if(!S(e)||!S(t))throw TypeError(p);let r=A(e),i=A(t),a=r.add(i);return a.isInfinity()?null:j(a,D(n,e))}function N(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=A(e);if(o.compare(t)===0)return j(i,r);let a=O(t),s=d.mul(a),c=i.add(s);return c.isInfinity()?null:j(c,r)}function P(e,t){if(!S(e))throw TypeError(p);let n=A(e);if(n.isInfinity())throw TypeError(p);return j(n,D(t,e))}function I(e,t){if(!T(e))throw TypeError(f);let n=O(e),r=d.mul(n);return r.isInfinity()?null:j(r,D(t))}function R(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=A(e),a=O(t),o=i.mul(a);return o.isInfinity()?null:j(o,r)}function ee(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=O(e),r=O(t),i=k(n.add(r).umod(l));return T(i)?i:null}function te(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=O(e),r=O(t),i=k(n.sub(r).umod(l));return T(i)?i:null}function ne(e,t){return ie(e,t)}function re(e,t,n){return ie(e,t,n)}function ie(e,t,n){if(!b(e))throw TypeError(h);if(!T(t))throw TypeError(f);if(n!==void 0&&!b(n))throw TypeError(y);let r=O(t),i=O(e),o,s;a(e,t,function(e){let t=O(e),n=d.mul(t);return!(n.isInfinity()||(o=n.x.umod(l),o.isZero()===0)||(s=t.invm(l).mul(i.add(r.mul(o))).umod(l),s.isZero()===0))},T,n),s.cmp(u)>0&&(s=l.sub(s));let c=v.allocUnsafe(64);return k(o).copy(c,0),k(s).copy(c,32),c}function ae(e,t,n,r){if(!b(e))throw TypeError(h);if(!S(t))throw TypeError(p);if(!E(n))throw TypeError(g);let i=A(t),a=O(n.subarray(0,32)),o=O(n.subarray(32,64));if(r&&o.cmp(u)>0||a.gtn(0)<=0||o.gtn(0)<=0)return!1;let s=O(e),c=o.invm(l),f=s.mul(c).umod(l),m=a.mul(c).umod(l),_=d.mulAdd(f,i,m);return _.isInfinity()?!1:_.x.umod(l).eq(a)}t.exports={isPoint:S,isPointCompressed:w,isPrivate:T,pointAdd:M,pointAddScalar:N,pointCompress:P,pointFromScalar:I,pointMultiply:R,privateAdd:ee,privateSub:te,sign:ne,signWithEntropy:re,verify:ae}})),Iv=a(((e,t)=>{var n={Array:function(e){return e!=null&&e.constructor===Array},Boolean:function(e){return typeof e==`boolean`},Function:function(e){return typeof e==`function`},Nil:function(e){return e==null},Number:function(e){return typeof e==`number`},Object:function(e){return typeof e==`object`},String:function(e){return typeof e==`string`},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(e){return e}.bind(null,r);t.exports=n})),Lv=a(((e,t)=>{var n=Iv();function r(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function i(e){return n.Nil(e)?``:r(e.constructor)}function a(e){return n.Function(e)?``:n.String(e)?JSON.stringify(e):e&&n.Object(e)?``:e}function o(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():r(e):n.Array(e)?`Array`:e&&n.Object(e)?`Object`:e===void 0?``:e}function c(e,t,n){var r=a(t);return`Expected `+s(e)+`, got`+(n===``?``:` `+n)+(r===``?``:` `+r)}function l(e,t,n){n||=i(t),this.message=c(e,t,n),o(this,l),this.__type=e,this.__value=t,this.__valueTypeName=n}l.prototype=Object.create(Error.prototype),l.prototype.constructor=l;function u(e,t,n,r,i){var a=`" of type `;return t===`key`&&(a=`" with key type `),c(`property "`+s(n)+a+s(e),r,i)}function d(e,t,n,r,a){e?(a||=i(r),this.message=u(e,n,t,r,a)):this.message=`Unexpected property "`+t+`"`,o(this,l),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=a}d.prototype=Object.create(Error.prototype),d.prototype.constructor=l;function f(e,t){return new l(e,{},t)}function p(e,t,n){return e instanceof d?(t=t+`.`+e.__property,e=new d(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof l&&(e=new d(e.__type,t,n,e.__value,e.__valueTypeName)),o(e),e}t.exports={TfTypeError:l,TfPropertyTypeError:d,tfCustomError:f,tfSubError:p,tfJSON:s,getValueTypeName:i}})),Rv=a(((e,t)=>{_();var n=Iv(),r=Lv();function i(e){return v.isBuffer(e)}function a(e){return typeof e==`string`&&/^([0-9a-f]{2})+$/i.test(e)}function o(e,t){var n=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw r.tfCustomError(n+`(Length: `+t+`)`,n+`(Length: `+i.length+`)`)}return i.toJSON=function(){return n},i}var s=o.bind(null,n.Array),c=o.bind(null,i),l=o.bind(null,a),u=o.bind(null,n.String);function d(e,t,r){r||=n.Number;function i(n,i){return r(n,i)&&n>e&&n<t}return i.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},i}var f=2**53-1;function p(e){return typeof e==`number`&&isFinite(e)}function m(e){return e<<24>>24===e}function h(e){return e<<16>>16===e}function g(e){return(e|0)===e}function y(e){return typeof e==`number`&&e>=-f&&e<=f&&Math.floor(e)===e}function b(e){return(e&255)===e}function x(e){return(e&65535)===e}function S(e){return e>>>0===e}function C(e){return typeof e==`number`&&e>=0&&e<=f&&Math.floor(e)===e}var w={ArrayN:s,Buffer:i,BufferN:c,Finite:p,Hex:a,HexN:l,Int8:m,Int16:h,Int32:g,Int53:y,Range:d,StringN:u,UInt8:b,UInt16:x,UInt32:S,UInt53:C};for(var T in w)w[T].toJSON=function(e){return e}.bind(null,T);t.exports=w})),zv=a(((e,t)=>{var n=Lv(),r=Iv(),i=n.tfJSON,a=n.TfTypeError,o=n.TfPropertyTypeError,s=n.tfSubError,c=n.getValueTypeName,l={arrayOf:function(e,t){e=u(e),t||={};function n(n,i){return!r.Array(n)||r.Nil(n)||t.minLength!==void 0&&n.length<t.minLength||t.maxLength!==void 0&&n.length>t.maxLength||t.length!==void 0&&n.length!==t.length?!1:n.every(function(t,n){try{return d(e,t,i)}catch(e){throw s(e,n)}})}return n.toJSON=function(){var n=`[`+i(e)+`]`;return t.length===void 0?(t.minLength!==void 0||t.maxLength!==void 0)&&(n+=`{`+(t.minLength===void 0?0:t.minLength)+`,`+(t.maxLength===void 0?1/0:t.maxLength)+`}`):n+=`{`+t.length+`}`,n},n},maybe:function e(t){t=u(t);function n(n,i){return r.Nil(n)||t(n,i,e)}return n.toJSON=function(){return`?`+i(t)},n},map:function(e,t){e=u(e),t&&=u(t);function n(n,i){if(!r.Object(n)||r.Nil(n))return!1;for(var a in n){try{t&&d(t,a,i)}catch(e){throw s(e,a,`key`)}try{var o=n[a];d(e,o,i)}catch(e){throw s(e,a)}}return!0}return t?n.toJSON=function(){return`{`+i(t)+`: `+i(e)+`}`}:n.toJSON=function(){return`{`+i(e)+`}`},n},object:function(e){var t={};for(var n in e)t[n]=u(e[n]);function a(e,n){if(!r.Object(e)||r.Nil(e))return!1;var i;try{for(i in t){var a=t[i],c=e[i];d(a,c,n)}}catch(e){throw s(e,i)}if(n){for(i in e)if(!t[i])throw new o(void 0,i)}return!0}return a.toJSON=function(){return i(t)},a},anyOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.some(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(`|`)},t},allOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.every(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(` & `)},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return r.Nil(t)||r.Nil(t.length)||n&&t.length!==e.length?!1:e.every(function(e,r){try{return d(e,t[r],n)}catch(e){throw s(e,r)}})}return t.toJSON=function(){return`(`+e.map(i).join(`, `)+`)`},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};l.oneOf=l.anyOf;function u(e){if(r.String(e))return e[0]===`?`?l.maybe(e.slice(1)):r[e]||l.quacksLike(e);if(e&&r.Object(e)){if(r.Array(e)){if(e.length!==1)throw TypeError(`Expected compile() parameter of type Array of length 1`);return l.arrayOf(e[0])}return l.object(e)}else if(r.Function(e))return e;return l.value(e)}function d(e,t,n,i){if(r.Function(e)){if(e(t,n))return!0;throw new a(i||e,t)}return d(u(e),t,n)}for(var f in r)d[f]=r[f];for(f in l)d[f]=l[f];var p=Rv();for(f in p)d[f]=p[f];d.compile=u,d.TfTypeError=a,d.TfPropertyTypeError=o,t.exports=d})),Bv=a(((e,t)=>{_();var n=ua();function r(e,t){if(t!==void 0&&e[0]!==t)throw Error(`Invalid network version`);if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw Error(`Invalid WIF length`);if(e[33]!==1)throw Error(`Invalid compression flag`);return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,t,n){var r=new v(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}function a(e,t){return r(n.decode(e),t)}function o(e,t,r){return typeof e==`number`?n.encode(i(e,t,r)):n.encode(i(e.version,e.privateKey,e.compressed))}t.exports={decode:a,decodeRaw:r,encode:o,encodeRaw:i}})),Vv=a((e=>{_(),Object.defineProperty(e,"__esModule",{value:!0});var t=Nv(),n=ua(),r=Fv(),i=zv(),a=Bv(),o=i.BufferN(32),s=i.compile({wif:i.UInt8,bip32:{public:i.UInt32,private:i.UInt32}}),c={messagePrefix:`Bitcoin Signed Message:
|
|
20
|
+
Approved: ${i.toString()}`))}),o.forEach(e=>{r||(Pu(i[e].methods,a[e].methods)?Pu(i[e].events,a[e].events)||(r=K(`NON_CONFORMING_NAMESPACES`,`${n} namespaces events don't satisfy namespace events for ${e}`)):r=K(`NON_CONFORMING_NAMESPACES`,`${n} namespaces methods don't satisfy namespace methods for ${e}`))}),r}function xp(e){let t={};return Object.keys(e).forEach(n=>{n.includes(`:`)?t[n]=e[n]:e[n].chains?.forEach(r=>{t[r]={methods:e[n].methods,events:e[n].events}})}),t}function Sp(e){return[...new Set(e.map(e=>e.includes(`:`)?e.split(`:`)[0]:e))]}function Cp(e){let t={};return Object.keys(e).forEach(n=>{n.includes(`:`)?t[n]=e[n]:Af(e[n].accounts)?.forEach(r=>{t[r]={accounts:e[n].accounts.filter(e=>e.includes(`${r}:`)),methods:e[n].methods,events:e[n].events}})}),t}function wp(e,t){return Kf(e,!1)&&e<=t.max&&e>=t.min}function Tp(){let e=Tu();return new Promise(t=>{switch(e){case yu.browser:t(Ep());break;case yu.reactNative:t(Dp());break;case yu.node:t(Op());break;default:t(!0)}})}function Ep(){return wu()&&navigator?.onLine}async function Dp(){return xu()&&typeof h<`u`&&h?.NetInfo?(await h?.NetInfo.fetch())?.isConnected:!0}function Op(){return!0}function kp(e){switch(Tu()){case yu.browser:Ap(e);break;case yu.reactNative:jp(e);break;case yu.node:break}}function Ap(e){!xu()&&wu()&&(window.addEventListener(`online`,()=>e(!0)),window.addEventListener(`offline`,()=>e(!1)))}function jp(e){xu()&&typeof h<`u`&&h?.NetInfo&&h?.NetInfo.addEventListener(t=>e(t?.isConnected))}function Mp(){return wu()&&(0,ct.getDocument)()?(0,ct.getDocument)()?.visibilityState===`visible`:!0}var Np={},Pp=class{static get(e){return Np[e]}static set(e,t){Np[e]=t}static delete(e){delete Np[e]}};function Fp(e){let t=Oe.decode(e);if(t.length<33)throw Error(`Too short to contain a public key`);return t.slice(1,33)}function Ip({publicKey:e,signature:t,payload:n}){let r=Rp(n.method),i=128|parseInt(n.version?.toString()||`4`),a=Bp(n.address),o=n.era===`00`?new Uint8Array([0]):Rp(n.era);if(o.length!==1&&o.length!==2)throw Error(`Invalid era length`);let s=parseInt(n.nonce,16),c=new Uint8Array([s&255,s>>8&255]),l=Hp(BigInt(`0x${zp(n.tip)}`)),u=new Uint8Array([0,...e,a,...t,...o,...c,...l,...r]),d=Vp(u.length+1);return new Uint8Array([...d,i,...u])}function Lp(e){return`0x`+tt((0,du.blake2b)(Rp(e),void 0,32),`base16`)}function Rp(e){return new Uint8Array(e.replace(/^0x/,``).match(/.{1,2}/g).map(e=>parseInt(e,16)))}function zp(e){return e.startsWith(`0x`)?e.slice(2):e}function Bp(e){let t=Oe.decode(e)[0];return t===42?0:t===60?2:1}function Vp(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([t&255,t>>8&255])}else if(e<1<<30){let t=e<<2|2;return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}else throw Error(`Compact encoding > 2^30 not supported`)}function Hp(e){if(e<1n<<6n)return new Uint8Array([Number(e<<2n)]);if(e<1n<<14n){let t=e<<2n|1n;return new Uint8Array([Number(t&255n),Number(t>>8n&255n)])}else if(e<1n<<30n){let t=e<<2n|2n;return new Uint8Array([Number(t&255n),Number(t>>8n&255n),Number(t>>16n&255n),Number(t>>24n&255n)])}else throw Error(`BigInt compact encoding not supported > 2^30`)}function Up(e){let t=Rp(e.signature);return Lp(tt(Ip({publicKey:Fp(e.transaction.address),signature:t,payload:e.transaction}),`base16`))}function Wp({logger:e,name:t}){let n=typeof e==`string`?uu({opts:{level:e,name:t}}).logger:e;return n.level=typeof e==`string`?e:e.level,n}var Gp=`cosmiframe`,Kp=`cosmiframe_keystorechange`,qp=class{_mutable;actions;_env;logger;constructor(){this._mutable={state:U.Init}}get env(){return this._env}setEnv(e){this._env=e}setActions=e=>{this.actions=e};get isMobile(){return this.env?.device===`mobile`}get mutable(){return this._mutable}get state(){return this.mutable.state}get isInit(){return this.state===`Init`}get isDone(){return this.state===`Done`}get isError(){return this.state===`Error`}get isPending(){return this.state===`Pending`}get data(){return this.mutable.data}get message(){return this.mutable.message}setState(e){this.logger?.debug(`[State Change] ${this.state} (${this.walletStatus}) -> ${e} (${this.chainName}/${this.walletName})`),this._mutable.state=e,this.actions?.state?.(e)}setData(e){this._mutable.data=e,this.actions?.data?.(e)}setMessage(e){this.logger?.debug(`[Message Set] ${e} (${this.chainName}/${this.walletName})`),this._mutable.message=e,this.actions?.message?.(e)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init)}get walletStatus(){return na(this.state,this.message)}get isWalletOnceConnect(){return this.isWalletConnected||this.isWalletError}get isWalletConnecting(){return this.walletStatus===`Connecting`}get isWalletConnected(){return this.walletStatus===`Connected`}get isWalletDisconnected(){return this.walletStatus===`Disconnected`}get isWalletRejected(){return this.walletStatus===`Rejected`}get isWalletNotExist(){return this.walletStatus===`NotExist`}get isWalletError(){return this.walletStatus===`Error`}},Jp=class extends qp{clientMutable={state:U.Init};emitter;_walletInfo;callbacks;session;walletConnectOptions;isActive=!1;throwErrors=!1;constructor(e){super(),this._walletInfo=e}get appUrl(){return this.client?.appUrl}get qrUrl(){return this.client?.qrUrl}activate(){this.isActive=!0}inactivate(){this.isActive=!1}get client(){return this.clientMutable?.data}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0}initClientError(e){this.logger?.error(`${this.walletPrettyName} initClientError: ${e?.message}`),this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.isModeExtension?this.setClientNotExist():this.setError(`InitClientError: ${e.message}`)}get walletInfo(){return this._walletInfo}get isModeExtension(){return this.walletInfo.mode===`extension`}get isModeWalletConnect(){return this.walletInfo.mode===`wallet-connect`}get downloadInfo(){let e=this.walletInfo.downloads||[];return e=e.filter(e=>e.device===this.env?.device||!e.device),e.length===1||(e=e.filter(e=>e.os===this.env?.os||!e.os),e.length===1)||(e=e.filter(e=>e.browser===this.env?.browser||!e.browser)),e[0]}get walletName(){return this.walletInfo.name}get walletPrettyName(){return this.walletInfo.prettyName}get rejectMessageSource(){return typeof this.walletInfo.rejectMessage==`string`?this.walletInfo.rejectMessage:this.walletInfo.rejectMessage?.source}get rejectMessageTarget(){if(typeof this.walletInfo.rejectMessage!=`string`)return this.walletInfo.rejectMessage?.target}get rejectCode(){return this.walletInfo.rejectCode}rejectMatched(e){return this.rejectMessageSource&&e.message===this.rejectMessageSource||this.rejectCode&&e.code===this.rejectCode}updateCallbacks(e){this.callbacks={...this.callbacks,...e}}_disconnect=async(e,t)=>{await this.callbacks?.beforeDisconnect?.(),await this.client?.disconnect?.(t),this.clientMutable.state!==U.Error&&this.reset(),this.walletName!==`cosmiframe`&&window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`),e&&(this.emitter?.emit(`sync_disconnect`,this.chainName),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")),await this.callbacks?.afterDisconnect?.()};disconnect=async(e,t)=>{await this._disconnect(e,t)};setClientNotExist(e){let t=e===void 0?Error():e;t.message=Yi.message,this.setError(t)}setRejected(e){let t=e===void 0?Error():e;t.message=Xi.message,this.setError(t)}setError(e){let t=typeof e==`string`||e===void 0?Error(e):e;if(this.setState(U.Error),this.setMessage(t.message),this.throwErrors===!0||this.throwErrors===`connect_only`&&t.name===`ConnectError`)throw t}connect=async e=>{await this.callbacks?.beforeConnect?.();let t=typeof this.walletInfo.mobileDisabled==`boolean`?this.walletInfo.mobileDisabled:this.walletInfo.mobileDisabled();if(this.isMobile&&t){this.setError(new $i(`This wallet is not supported on mobile, please use desktop browsers.`));return}e&&(this.emitter?.emit(`sync_connect`,this.chainName),this.logger?.debug(`[Event Emit] \`sync_connect\` (${this.chainName}/${this.walletName})`));try{if(!this.client&&(this.setState(U.Pending),this.setMessage(`InitClient`),await this.initClient(this.walletInfo.mode===`wallet-connect`?this.walletConnectOptions:void 0),this.emitter?.emit(`broadcast_client`,this.client),this.logger?.debug("[WALLET EVENT] Emit `broadcast_client`"),!this.client)){this.setClientNotExist(new $i);return}await this.update()}catch(e){this.setError(new $i(e.message))}await this.callbacks?.afterConnect?.()}},Yp=class extends Jp{mainWallet;chainRecord;_rpcEndpoint;_restEndpoint;connectChains;offlineSigner;namespace=`cosmos`;preferredSignType;constructor(e,t){super(e),this.chainRecord=t,this.preferredSignType=t.clientOptions?.preferredSignType||`amino`}get chain(){return this.chainRecord.chain}get assetList(){return this.chainRecord.assetList}get isTestNet(){return this.chainName.includes(`testnet`)}get preferredEndpoints(){return this.chainRecord.preferredEndpoints}get rpcEndpoints(){return this.preferredEndpoints?.rpc||[]}get restEndpoints(){return this.preferredEndpoints?.rest||[]}get isLazy(){return this.preferredEndpoints.isLazy}addEndpoints(e){this.chainRecord.preferredEndpoints={isLazy:e?.isLazy??this.preferredEndpoints?.isLazy,rpc:[...e?.rpc||[],...this.preferredEndpoints?.rpc||[]],rest:[...e?.rest||[],...this.preferredEndpoints?.rest||[]]}}get chainName(){return this.chainRecord.name}get chainLogoUrl(){return this.assetList?.assets[0]?.logo_URIs?.svg||this.assetList?.assets[0]?.logo_URIs?.png||void 0}get stargateOptions(){return this.chainRecord.clientOptions?.stargate}get signingStargateOptions(){return this.chainRecord.clientOptions?.signingStargate||this.chainRecord.clientOptions?.stargate}get signingCosmwasmOptions(){return this.chainRecord.clientOptions?.signingCosmwasm}get assets(){return this.assetList?.assets}get chainId(){return this.chain?.chain_id}get cosmwasmEnabled(){return this.chain?.codebase?.cosmwasm_enabled}get username(){return this.data?.username}get address(){return this.data?.address}setData(e){this.logger?.debug(`[Data Change] ${JSON.stringify(this.data)} -> ${JSON.stringify(e)} (${this.chainName}/${this.walletName})`),this._mutable.data=e,this.actions?.data?.(e);let t=window.localStorage.getItem(`cosmos-kit@2:core//accounts`),n=t?JSON.parse(t):[];e===void 0?n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace):(n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace),n.push(e)),window?.localStorage.setItem(`cosmos-kit@2:core//accounts`,JSON.stringify(n)),this.session?.update()}initClient(e){throw Error(`initClient not implemented`)}async update(e={connect:!0}){this.setState(U.Pending),this.setMessage(void 0);try{e.connect&&(this.connectChains?await this.connectChains():await this?.client?.connect?.(this.chainId));let t;try{this.logger?.debug(`Fetching ${this.walletName} ${this.chainId} account.`),t=await this?.client?.getSimpleAccount(this.chainId)}catch(e){if(this.rejectMatched(e)){this.logger?.debug(`Fetching rejected.`),this.setRejected(new $i);return}if(this.client&&this?.client?.addChain)this.logger?.debug(`Going to add chain ${this.chainId}`),await this.client.addChain(this.chainRecord),t=await this.client.getSimpleAccount(this.chainId);else throw e}this.setData(t),this.setState(U.Done),this.setMessage(void 0)}catch(e){e&&this.rejectMatched(e)?this.setRejected(new $i):this.setError(new $i(e.message))}!this.isWalletRejected&&this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}getRpcEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-yNiv3ygK.js`);return{getIsLazy:e}},[]),n=t(void 0,this.isLazy,this._rpcEndpoint?.isLazy,e,this.logger);if(n)return this._rpcEndpoint||this.rpcEndpoints[0]||Promise.reject(`No endpoint available.`);let{isValidEndpoint:r}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-yNiv3ygK.js`);return{isValidEndpoint:e}},[]);if(this._rpcEndpoint&&await r(this._rpcEndpoint,`rpc`,n,this.logger))return this._rpcEndpoint;let{getFastestEndpoint:i}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-yNiv3ygK.js`);return{getFastestEndpoint:e}},[]);return this._rpcEndpoint=await i(this.rpcEndpoints,`rpc`,this.logger),this._rpcEndpoint};getRestEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-yNiv3ygK.js`);return{getIsLazy:e}},[]),n=t(void 0,this.isLazy,this._restEndpoint?.isLazy,e,this.logger);if(n)return this._restEndpoint||this.restEndpoints[0]||Promise.reject(`No endpoint available.`);let r=`rest`,{isValidEndpoint:i}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-yNiv3ygK.js`);return{isValidEndpoint:e}},[]);if(this._restEndpoint&&await i(this._restEndpoint,r,n,this.logger))return this._restEndpoint;let{getFastestEndpoint:a}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-yNiv3ygK.js`);return{getFastestEndpoint:e}},[]);return this._restEndpoint=await a(this.restEndpoints,r,this.logger),this._restEndpoint};getStargateClient=async()=>{let e=await this.getRpcEndpoint(),{StargateClient:t}=await g(async()=>{let{StargateClient:e}=await import(`./build-CpWkW2tw.js`).then(e=>i(e.t()));return{StargateClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t.connect(e,this.stargateOptions)};getCosmWasmClient=async()=>{let e=await this.getRpcEndpoint(),{CosmWasmClient:t}=await g(async()=>{let{CosmWasmClient:e}=await import(`./build-CWk0QocV.js`).then(e=>i(e.default));return{CosmWasmClient:e}},__vite__mapDeps([10,1,2,3,4,5,6,7,0,8,9]));return t.connect(e)};getNameService=async()=>{let e=await this.getCosmWasmClient(),{getNameServiceRegistryFromChainName:t}=await g(async()=>{let{getNameServiceRegistryFromChainName:e}=await import(`./utils-yNiv3ygK.js`);return{getNameServiceRegistryFromChainName:e}},[]),n=t(this.chainName),{NameService:r}=await g(async()=>{let{NameService:e}=await import(`./name-service-tewBv0Xj.js`);return{NameService:e}},[]);return new r(e,n)};async initOfflineSigner(e){if(this.client===void 0)throw Error(`WalletClient is not initialized`);e&&(this.preferredSignType=e),this.offlineSigner=await this.client.getOfflineSigner(this.chainId,this.preferredSignType)}getSigningStargateClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningStargateClient:t}=await g(async()=>{let{SigningStargateClient:e}=await import(`./build-CpWkW2tw.js`).then(e=>i(e.t()));return{SigningStargateClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t.connectWithSigner(e,this.offlineSigner,this.signingStargateOptions)};getSigningCosmWasmClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningCosmWasmClient:t}=await g(async()=>{let{SigningCosmWasmClient:e}=await import(`./build-CWk0QocV.js`).then(e=>i(e.default));return{SigningCosmWasmClient:e}},__vite__mapDeps([10,1,2,3,4,5,6,7,0,8,9]));return t.connectWithSigner(e,this.offlineSigner,this.signingCosmwasmOptions)};getSigningClient=async e=>{switch(e){case`stargate`:return await this.getSigningStargateClient();case`cosmwasm`:return await this.getSigningCosmWasmClient();default:return this.getSigningStargateClient()}};estimateFee=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let a;switch(t){case`stargate`:a=this.signingStargateOptions?.gasPrice;break;case`cosmwasm`:a=this.signingCosmwasmOptions?.gasPrice;break;default:a=this.signingStargateOptions?.gasPrice;break}if(!a)throw Error(`Gas price must be set in the client options when auto gas is used.`);let o=await(await this.getSigningClient(t)).simulate(this.address,e,n),{calculateFee:s}=await g(async()=>{let{calculateFee:e}=await import(`./build-CpWkW2tw.js`).then(e=>i(e.t()));return{calculateFee:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return s(Math.round(o*(r||1.4)),a)};sign=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let i=await this.getSigningClient(r),a;return a=t===void 0||typeof t==`number`?await this.estimateFee(e,r,n,t):t,await i.sign(this.address,e,a,n||``)};broadcast=async(e,t)=>{let n=await this.getSigningClient(t),{TxRaw:r}=await g(async()=>{let{TxRaw:e}=await import(`./tx-M8zFD10L.js`).then(e=>i(e.default));return{TxRaw:e}},[]),a=r.encode(e).finish(),o,s;switch(t){case`stargate`:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break;case`cosmwasm`:o=this.signingCosmwasmOptions?.broadcastTimeoutMs,s=this.signingCosmwasmOptions?.broadcastPollIntervalMs;break;default:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break}return n.broadcastTx(a,o,s)};signAndBroadcast=async(e,t,n,r)=>{let i=await this.sign(e,t,n,r);return this.broadcast(i,r)}},Xp=class extends Jp{_chainWalletMap;preferredEndpoints;ChainWallet;constructor(e,t){super(e),this.ChainWallet=t,this.emitter=new ot.default,this.emitter.on(`broadcast_client`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_client\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}),this.emitter.on(`broadcast_env`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_env\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.setEnv(e)})}),this.emitter.on(`sync_connect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_connect\` (${this.walletName})`),await this.connectAll(!0,e),this.update()}),this.emitter.on(`sync_disconnect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_disconnect\` (${this.walletName})`),await this.disconnectAll(!0,e),this.reset()}),this.emitter.on(`reset`,e=>{this.logger?.debug(`[Event Fired] \`reset\` (${this.walletName})`),e.forEach(e=>Array.from(this.chainWalletMap.values()).find(t=>t.chainId===e)?.reset())})}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0,this.actions?.clientState?.(U.Pending),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(e=>{e.initingClient()})}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0,this.actions?.clientState?.(U.Done),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}initClientError(e){if(this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.actions?.clientState?.(U.Error),this.actions?.clientMessage?.(e?.message),this.chainWalletMap?.forEach(t=>{t.initClientError(e)}),this.throwErrors===!0)throw Error(this.clientMutable.message)}onSetChainsDone(){}makeFinalEndpoints(e){let t=e.name.includes(`testnet`);return{isLazy:e.preferredEndpoints?.isLazy,rpc:[...e.preferredEndpoints?.rpc||[],...this.preferredEndpoints?.[e.name]?.rpc||[],...e.chain?.apis?.rpc?.map(e=>e.address)||[],t?`https://rpc.testcosmos.directory/${e.name}`:`https://rpc.cosmos.directory/${e.name}`],rest:[...e.preferredEndpoints?.rest||[],...this.preferredEndpoints?.[e.name]?.rest||[],...e.chain?.apis?.rest?.map(e=>e.address)||[],t?`https://rest.testcosmos.directory/${e.name}`:`https://rest.cosmos.directory/${e.name}`]}}addEnpoints(e){this.getChainWalletList(!1).forEach(t=>{t.addEndpoints(e[t.chainName])})}setChains(e,t=!0){(t||!this._chainWalletMap)&&(this._chainWalletMap=new Map),e.forEach(e=>{let t=new this.ChainWallet(this.walletInfo,{...e,preferredEndpoints:this.makeFinalEndpoints(e)});t.mainWallet=this,t.emitter=this.emitter,t.logger=this.logger,t.throwErrors=this.throwErrors,t.session=this.session,t.walletConnectOptions=this.walletConnectOptions,t.initClient=this.initClient,this._chainWalletMap.set(e.name,t)}),this.onSetChainsDone()}get chainWalletMap(){return this._chainWalletMap}getChainWallet=e=>this.chainWalletMap?.get(e);getChainWalletList=(e=!0)=>{let t=Array.from(this.chainWalletMap.values());return e?t.filter(e=>e.isActive):t};getGlobalStatusAndMessage=(e=!0)=>{let t=this.getChainWalletList(e),n=t.find(e=>e.isWalletNotExist);return n?[n.walletStatus,n.message]:(n=t.find(e=>e.isWalletConnecting),n?[ta.Connecting,void 0]:(n=t.find(e=>e.isWalletDisconnected),n?[ta.Disconnected,`Exist disconnected wallets`]:(n=t.find(e=>e.isError||e.isWalletRejected),n?[n.walletStatus,n.message]:[ta.Connected,void 0])))};async update(){if(this.walletStatus===`NotExist`)return window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`);this.setData(void 0),this.setMessage(void 0),this.setState(U.Done),this.activate(),this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init),this.inactivate()}async connectAll(e=!0,t){let n=this.getChainWalletList(e);if(!(n.length>0&&n.every(e=>e.isModeWalletConnect&&e.connectChains)))for(let e of n)e.chainName!==t&&await e.connect()}async disconnectAll(e=!0,t,n){let r=this.getChainWalletList(e);for(let e of r)e.chainName!==t&&await e.disconnect(!1,n)}},Zp=class extends Yp{constructor(e,t){super(e,t)}},Qp=class{cosmiframe;constructor(e){this.cosmiframe=e}async getSimpleAccount(...e){return await this.cosmiframe.p.getSimpleAccount(...e)}async connect(...e){return await this.cosmiframe.p.connect(...e)}async enable(...e){await this.cosmiframe.p.enable(...e)}async suggestToken(...e){await this.cosmiframe.p.suggestToken(...e)}async addChain(...e){let t=e[0];t&&`clientOptions`in t&&(t={...t,clientOptions:{}},e[0]=t),await this.cosmiframe.p.addChain(...e)}async getAccount(...e){return await this.cosmiframe.p.getAccount(...e)}getOfflineSigner(e,t){return t===`direct`?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return this.cosmiframe.getOfflineSignerAmino(e)}getOfflineSignerDirect(e){return this.cosmiframe.getOfflineSignerDirect(e)}async sign(...e){return await this.cosmiframe.p.sign(...e)}async signAmino(...e){return await this.cosmiframe.p.signAmino(...e)}async signDirect(...e){return await this.cosmiframe.p.signDirect(...e)}async signArbitrary(...e){return await this.cosmiframe.p.signArbitrary(...e)}async getEnigmaPubKey(...e){return await this.cosmiframe.p.getEnigmaPubKey(...e)}async getEnigmaTxEncryptionKey(...e){return await this.cosmiframe.p.getEnigmaTxEncryptionKey(...e)}async enigmaEncrypt(...e){return await this.cosmiframe.p.enigmaEncrypt(...e)}async enigmaDecrypt(...e){return await this.cosmiframe.p.enigmaDecrypt(...e)}async sendTx(...e){return await this.cosmiframe.p.sendTx(...e)}},$p=Object.defineProperty,em=(e,t,n)=>t in e?$p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tm=(e,t)=>$p(e,`name`,{value:t,configurable:!0}),nm=(e,t,n)=>(em(e,typeof t==`symbol`?t:t+``,n),n),rm=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},im=(e,t,n)=>(rm(e,t,`read from private field`),n?n.call(e):t.get(e)),am=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},om=(e,t,n,r)=>(rm(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),sm=class extends Error{constructor(e){super(e),this.name=`CosmiframeTimeoutError`}};tm(sm,`CosmiframeTimeoutError`);var cm=sm,lm=tm((e,t,n)=>new Promise((r,i)=>{let a=null,o=_a(),s=tm(({origin:e,source:n,data:c})=>{!fm(t,e)||n!==window.parent||c.id!==o||(window.removeEventListener(`message`,s),a!==null&&clearTimeout(a),c.type===`success`?r({result:c.response,origin:e}):i(Error(c.error)))},`listener`);window.addEventListener(`message`,s);try{let t={...e,id:o};window.parent.postMessage(t,`*`)}catch(e){window.removeEventListener(`message`,s),i(e)}n&&(a=setTimeout(()=>{window.removeEventListener(`message`,s),i(new cm(`Timed out after ${n}ms waiting for parent to respond.`))},n))}),`callParentMethod`),um=tm(e=>{if(!e||e.type===`error`)return{type:`error`,error:e&&e.type===`error`&&e.error||`Handled by outer wallet.`};if(e.type===`success`)return{type:`success`,response:e.value}},`processOverrideHandler`),dm=tm(()=>typeof window<`u`&&window.self!==window.parent,`isInIframe`),fm=tm((e,t)=>e.some(e=>e===`*`||typeof e==`string`&&t===e||e instanceof RegExp&&e.test(t)),`isOriginAllowed`),pm,mm=class{constructor(e,t){nm(this,`chainId`),am(this,pm,void 0),this.chainId=e,om(this,pm,t)}async getAccounts(){return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},im(this,pm))).result}async signDirect(e,t){return(await lm({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},im(this,pm))).result}};pm=new WeakMap,tm(mm,`CosmiframeDirectSigner`);var hm=mm,gm,_m=class{constructor(e,t){nm(this,`chainId`),am(this,gm,void 0),this.chainId=e,om(this,gm,t)}async getAccounts(){return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},im(this,gm))).result}async signAmino(e,t){return(await lm({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},im(this,gm))).result}};gm=new WeakMap,tm(_m,`CosmiframeAminoSigner`);var vm=_m,ym,bm=class{constructor(e,t){nm(this,`chainId`),am(this,ym,void 0),this.chainId=e,om(this,ym,t)}async getAccounts(){try{return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},im(this,ym))).result}catch{return(await lm({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},im(this,ym))).result}}async signDirect(e,t){return(await lm({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},im(this,ym))).result}async signAmino(e,t){return(await lm({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},im(this,ym))).result}};ym=new WeakMap,tm(bm,`CosmiframeEitherSigner`);var xm=bm,Sm;(function(e){e.IsCosmiframe=`isCosmiframe`,e.GetMetadata=`getMetadata`})(Sm||={});var Cm,wm=class{constructor(e){if(am(this,Cm,void 0),nm(this,`p`),!e.length)throw Error(`You must explicitly allow parent origins.`);if(e.includes(`*`))throw Error("It is very unsafe to allow all origins because a controlling app has the power to manipulate messages before they are signed. If you really want to do this, pass in `UNSAFE_ALLOW_ANY_ORIGIN`.");om(this,Cm,e.includes(`UNSAFE_ALLOW_ANY_ORIGIN`)?[`*`]:[...e]),this.p=new Proxy({getEnigmaUtils:e=>({getPubkey:()=>this.p.getEnigmaPubKey(e),decrypt:(...t)=>this.p.enigmaDecrypt(e,...t),encrypt:(...t)=>this.p.enigmaEncrypt(e,...t),getTxEncryptionKey:(...t)=>this.p.getEnigmaTxEncryptionKey(e,...t)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)})}callParentMethod(e,t){return lm(e,im(this,Cm),t)}async isReady(){if(!dm())return!1;try{let{origin:e,result:t}=await this.callParentMethod({internal:!0,method:Sm.IsCosmiframe,params:[]},500);return e||t}catch(e){if(e instanceof cm)return!1;throw e}}async getMetadata(){return(await this.callParentMethod({internal:!0,method:Sm.GetMetadata,params:[]},500)).result}getKeplrClient(){let e=new Proxy({version:`cosmiframe`,mode:`extension`,defaultOptions:{},getOfflineSigner:this.getOfflineSigner.bind(this),getOfflineSignerOnlyAmino:this.getOfflineSignerAmino.bind(this),getOfflineSignerAuto:e=>Promise.resolve(this.getOfflineSigner(e)),getEnigmaUtils:t=>({getPubkey:()=>e.getEnigmaPubKey(t),decrypt:(...n)=>e.enigmaDecrypt(t,...n),encrypt:(...n)=>e.enigmaEncrypt(t,...n),getTxEncryptionKey:(...n)=>e.getEnigmaTxEncryptionKey(t,...n)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)});return e}getOfflineSigner(e){return new xm(e,im(this,Cm))}getOfflineSignerAmino(e){return new vm(e,im(this,Cm))}getOfflineSignerDirect(e){return new hm(e,im(this,Cm))}static listen(e){let{iframe:t,target:n,getOfflineSignerDirect:r,getOfflineSignerAmino:i,nonSignerOverrides:a,signerOverrides:o,origins:s,metadata:c}=e,l=s?.length?s:[`*`],u={[Sm.IsCosmiframe]:()=>!0,[Sm.GetMetadata]:()=>c||null},d=tm(async({source:e,origin:s,data:c})=>{if(!t.contentWindow)throw Error(`Iframe contentWindow does not exist.`);if(e!==t.contentWindow||!fm(l,s)||!c||typeof c!=`object`||!(`id`in c)||!(`method`in c)||!(`params`in c))return;let{id:d,params:f,chainId:p,signType:m,internal:h}=c,{method:g,signerType:_}=c;_||=m,g=g.replace(/^signer:/,``);let v;try{if(h){if(typeof u[g]!=`function`)throw Error(`Unknown internal method: ${g}`);v={type:`success`,response:await u[g](...f)}}else if(_){if(!p)throw Error(`Missing chainId in signer message request`);let e=typeof o==`function`?await o(p):o;if(e&&g in e){let t=um(await e[g](...f));t&&(v=t)}if(!v){let e=_===`direct`?await r(p):await i(p);if(!(g in e)||typeof e[g]!=`function`)throw Error(`No ${_} signer method '${g}' for chain ID '${p}'.`);v={type:`success`,response:await e[g](...f)}}}else{let e=typeof a==`function`?await a():a;if(e&&g in e){let t=um(await e[g](...f));t&&(v=t)}if(!v){if(!(g in n)||typeof n[g]!=`function`)throw Error(`No method '${g}' on target.`);v={type:`success`,response:await n[g](...f)}}}}catch(e){v={type:`error`,error:e instanceof Error?e.message:`${e}`}}t.contentWindow?.postMessage({...v,id:d},s)},`listener`);return window.addEventListener(`message`,d),()=>window.removeEventListener(`message`,d)}};Cm=new WeakMap,tm(wm,`Cosmiframe`);var Tm=wm,Em=class extends Xp{constructor(e){super(e,Zp)}get walletInfo(){return this._walletInfo}async initClient(){this.initingClient();let e=new Tm(this.walletInfo.allowedParentOrigins);if(!await e.isReady()){this.initClientError(Error(`Failed to detect Cosmiframe parent of allowed origin wrapping this app in an iframe.`));return}let t=await e.getMetadata();t?.name&&typeof t.name==`string`&&(this.walletInfo.prettyName=t.name),t?.imageUrl&&typeof t.imageUrl==`string`&&(this.walletInfo.logo=t.imageUrl),this.initClientDone(new Qp(e))}},Dm={name:Gp,prettyName:`Cosmiframe`,logo:`data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGZpbGw9IiM5MzkzOTMiCiAgICBkPSJNOC4xNCAxMC45NmMtLjA5LjMzLS4xNC42OC0uMTQgMS4wNCAwIDEuMS40NSAyLjEgMS4xNyAyLjgzbC0xLjQyIDEuNDJDNi42NyAxNS4xNiA2IDEzLjY2IDYgMTJjMC0uOTMuMjEtMS44LjU4LTIuNTlMNS4xMSA3Ljk0QzQuNCA5LjEzIDQgMTAuNTIgNCAxMmMwIDIuMjEuOSA0LjIxIDIuMzUgNS42NWwtMS40MiAxLjQyQzMuMTIgMTcuMjYgMiAxNC43NiAyIDEyYzAtMi4wNC42MS0zLjkzIDEuNjYtNS41MUwxLjM5IDQuMjIgMi44IDIuODFsMTguMzggMTguMzgtMS40MSAxLjQxTDguMTQgMTAuOTZ6bTkuMjggMy42M2MuMzctLjc5LjU4LTEuNjYuNTgtMi41OSAwLTEuNjYtLjY3LTMuMTYtMS43Ni00LjI0bC0xLjQyIDEuNDJDMTUuNTUgOS45IDE2IDEwLjkgMTYgMTJjMCAuMzYtLjA1LjcxLS4xNCAxLjA0bDEuNTYgMS41NXpNMjAgMTJjMCAxLjQ4LS40IDIuODctMS4xMSA0LjA2bDEuNDUgMS40NUMyMS4zOSAxNS45MyAyMiAxNC4wNCAyMiAxMmMwLTIuNzYtMS4xMi01LjI2LTIuOTMtNy4wN2wtMS40MiAxLjQyQzE5LjEgNy43OSAyMCA5Ljc5IDIwIDEyeiI+PC9wYXRoPgo8L3N2Zz4=`,mode:`extension`,mobileDisabled:!1,rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[Kp],allowedParentOrigins:[]},Om=e=>new Em({...Dm,allowedParentOrigins:e}),km=i(a(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.bowser=r():n.bowser=r()})(e,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||``},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||``},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case`NT`:return`NT`;case`XP`:return`XP`;case`NT 5.0`:return`2000`;case`NT 5.1`:return`XP`;case`NT 5.2`:return`2003`;case`NT 6.0`:return`Vista`;case`NT 6.1`:return`7`;case`NT 6.2`:return`8`;case`NT 6.3`:return`8.1`;case`NT 10.0`:return`10`;default:return}},e.getMacOSVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),t[0]===10)switch(t[1]){case 5:return`Leopard`;case 6:return`Snow Leopard`;case 7:return`Lion`;case 8:return`Mountain Lion`;case 9:return`Mavericks`;case 10:return`Yosemite`;case 11:return`El Capitan`;case 12:return`Sierra`;case 13:return`High Sierra`;case 14:return`Mojave`;case 15:return`Catalina`;default:return}},e.getAndroidVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?`Cupcake`:t[0]===1&&t[1]>=6?`Donut`:t[0]===2&&t[1]<2?`Eclair`:t[0]===2&&t[1]===2?`Froyo`:t[0]===2&&t[1]>2?`Gingerbread`:t[0]===3?`Honeycomb`:t[0]===4&&t[1]<1?`Ice Cream Sandwich`:t[0]===4&&t[1]<4?`Jelly Bean`:t[0]===4&&t[1]>=4?`KitKat`:t[0]===5?`Lollipop`:t[0]===6?`Marshmallow`:t[0]===7?`Nougat`:t[0]===8?`Oreo`:t[0]===9?`Pie`:void 0},e.getVersionPrecision=function(e){return e.split(`.`).length},e.compareVersions=function(t,n,r){r===void 0&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+Array(n+1).join(`.0`);return e.map(r.split(`.`),(function(e){return Array(20-e.length).join(`0`)+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),--o;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;--o}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];typeof e==`object`&&e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||``},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":`amazon_silk`,"Android Browser":`android`,Bada:`bada`,BlackBerry:`blackberry`,Chrome:`chrome`,Chromium:`chromium`,Electron:`electron`,Epiphany:`epiphany`,Firefox:`firefox`,Focus:`focus`,Generic:`generic`,"Google Search":`google_search`,Googlebot:`googlebot`,"Internet Explorer":`ie`,"K-Meleon":`k_meleon`,Maxthon:`maxthon`,"Microsoft Edge":`edge`,"MZ Browser":`mz`,"NAVER Whale Browser":`naver`,Opera:`opera`,"Opera Coast":`opera_coast`,PhantomJS:`phantomjs`,Puffin:`puffin`,QupZilla:`qupzilla`,QQ:`qq`,QQLite:`qqlite`,Safari:`safari`,Sailfish:`sailfish`,"Samsung Internet for Android":`samsung_internet`,SeaMonkey:`seamonkey`,Sleipnir:`sleipnir`,Swing:`swing`,Tizen:`tizen`,"UC Browser":`uc`,Vivaldi:`vivaldi`,"WebOS Browser":`webos`,WeChat:`wechat`,"Yandex Browser":`yandex`,Roku:`roku`},t.BROWSER_MAP={amazon_silk:`Amazon Silk`,android:`Android Browser`,bada:`Bada`,blackberry:`BlackBerry`,chrome:`Chrome`,chromium:`Chromium`,electron:`Electron`,epiphany:`Epiphany`,firefox:`Firefox`,focus:`Focus`,generic:`Generic`,googlebot:`Googlebot`,google_search:`Google Search`,ie:`Internet Explorer`,k_meleon:`K-Meleon`,maxthon:`Maxthon`,edge:`Microsoft Edge`,mz:`MZ Browser`,naver:`NAVER Whale Browser`,opera:`Opera`,opera_coast:`Opera Coast`,phantomjs:`PhantomJS`,puffin:`Puffin`,qupzilla:`QupZilla`,qq:`QQ Browser`,qqlite:`QQ Browser Lite`,safari:`Safari`,sailfish:`Sailfish`,samsung_internet:`Samsung Internet for Android`,seamonkey:`SeaMonkey`,sleipnir:`Sleipnir`,swing:`Swing`,tizen:`Tizen`,uc:`UC Browser`,vivaldi:`Vivaldi`,webos:`WebOS Browser`,wechat:`WeChat`,yandex:`Yandex Browser`},t.PLATFORMS_MAP={tablet:`tablet`,mobile:`mobile`,desktop:`desktop`,tv:`tv`},t.OS_MAP={WindowsPhone:`Windows Phone`,Windows:`Windows`,MacOS:`macOS`,iOS:`iOS`,Android:`Android`,WebOS:`WebOS`,BlackBerry:`BlackBerry`,Bada:`Bada`,Tizen:`Tizen`,Linux:`Linux`,ChromeOS:`Chrome OS`,PlayStation4:`PlayStation 4`,Roku:`Roku`},t.ENGINE_MAP={EdgeHTML:`EdgeHTML`,Blink:`Blink`,Trident:`Trident`,Presto:`Presto`,Gecko:`Gecko`,WebKit:`WebKit`}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.default=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(t===void 0&&(t=!1),typeof e!=`string`)throw Error(`UserAgent should be a string`);return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:`BROWSER_MAP`,get:function(){return a.BROWSER_MAP}},{key:`ENGINE_MAP`,get:function(){return a.ENGINE_MAP}},{key:`OS_MAP`,get:function(){return a.OS_MAP}},{key:`PLATFORMS_MAP`,get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(t===void 0&&(t=!1),e==null||e===``)throw Error(`UserAgent parameter can't be empty`);this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||``:this.getBrowser().name||``},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||``:t||``},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){e===void 0&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||``:t||``},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||``:this.getEngine().name||``},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];typeof o==`string`?(i[t]=o,a+=1):typeof o==`object`&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(l!==void 0)return l}var u=s.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(d!==void 0)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(p!==void 0)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){t===void 0&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if(typeof i==`string`)return e[0]===`>`||e[0]===`<`?(n=e.substr(1),e[1]===`=`?(r=!0,n=e.substr(2)):t=[],e[0]===`>`?t.push(1):t.push(-1)):e[0]===`=`?n=e.substr(1):e[0]===`~`&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return t===void 0&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return e===void 0&&(e=[]),e.some((function(e){return t.is(e)}))},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:`Googlebot`},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:`Samsung Internet for Android`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:`NAVER Whale Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:`MZ Browser`},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:`Focus`},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:`Swing`},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:`Opera Coast`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:`Opera Touch`},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:`Yandex Browser`},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:`UC Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:`Maxthon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:`Epiphany`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:`Puffin`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:`Sleipnir`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:`K-Meleon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:`WeChat`},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?`QQ Browser Lite`:`QQ Browser`},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:`Internet Explorer`},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:`Vivaldi`},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:`SeaMonkey`},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:`Sailfish`},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:`Amazon Silk`},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:`PhantomJS`},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:`SlimerJS`},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:`BlackBerry`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:`WebOS Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:`Bada`},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:`Tizen`},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:`QupZilla`},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:`Firefox`},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:`Electron`},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:`Miui`},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:`Chromium`},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:`Chrome`},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:`Google Search`},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:`Android Browser`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:`PlayStation 4`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:`Safari`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=e.search(`\\(`)===-1?/^(.*)\/(.*) /:/^(.*)\/(.*)[ \t]\((.*)/;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,`.`),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,`.`);return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:`bot`,vendor:`Google`}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&`Nova`,n={type:a.PLATFORMS_MAP.mobile,vendor:`Huawei`};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Nexus`}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`,model:`Kindle Fire HD 7`}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:`Apple`,model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Nexus`}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName(!0)===`blackberry`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`BlackBerry`}}},{test:function(e){return e.getBrowserName(!0)===`bada`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName()===`windows phone`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Microsoft`}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(`.`)[0]);return e.getOSName(!0)===`android`&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return e.getOSName(!0)===`android`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getOSName(!0)===`macos`},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:`Apple`}}},{test:function(e){return e.getOSName(!0)===`windows`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`linux`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`playstation 4`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`roku`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:function(e){return e.getBrowserName(!0)===`microsoft edge`},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}})}))}))());_();var Am=(e,t)=>{let n=[];for(let t of e)n.push(`${t.port_id}/${t.channel_id}`);let r=`${n.join(`/`)}/${t}`;return`ibc/`+v.from(new Uint8Array(new st.sha256().update(v.from(r)).digest())).toString(`hex`).toUpperCase()},jm=(e,t,n)=>e.find(e=>e.chain_1.chain_name===n&&e.chain_2.chain_name===t),Mm=(e,t,n)=>jm(e,t,n)||jm(e,n,t),Nm=e=>e.channels.find(e=>e.chain_1.port_id===`transfer`&&e.chain_2.port_id===`transfer`),Pm=e=>e.channels.find(e=>e.chain_1.port_id.startsWith(`wasm.`)&&e.chain_2.port_id===`transfer`||e.chain_1.port_id===`transfer`&&e.chain_2.port_id.startsWith(`wasm`)),Fm=(e,t,n,r,i)=>{let a=Mm(e,t,n);if(!a)return[];let o=i.startsWith(`cw20:`)?Pm(a):Nm(a);if(!o)return[];let s;s=a.chain_1.chain_name===t?o.chain_1:o.chain_2;let c=[s],l=r.find(({chain_name:e})=>e===n);if(!l)return c;let u=l.assets.find(e=>e.base===i);if(!u)return c;let d=u.traces?.filter?.(e=>e.type===`ibc`||e.type===`ibc-cw20`)??[];if(!d.length)return c;d.length;let[f]=d;return[...c,...Fm(e,n,f.counterparty.chain_name,r,f.counterparty.base_denom)]},Im=(e,t,n,r,i)=>{let a=Mm(e,t,n);if(a){if(!(i.startsWith(`cw20:`)?Pm(a):Nm(a)))return;let o=Fm(e,t,n,r,i),s=r.find(({chain_name:e})=>e===n);if(!s)return Am(o,i);let c=s.assets.find(e=>e.base===i);return c?Am(o,(c.traces?.find?.(e=>e.type===`ibc`))?.counterparty?.base_denom??c.base):Am(o,i)}},Lm=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u={...l,assets:l.assets.filter(e=>!(l.chain_name===`carbon`&&e.base.startsWith(`ibc/`)))}.assets.filter(e=>!e.base.startsWith(`cw20:`)).map(r=>{let i=Im(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a}),d=Nm(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{e[t.chain.chain_name]=e[t.chain.chain_name]||[];let n=t.assets.map(e=>{try{return{...e,traces:[{type:`ibc`,counterparty:{channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),r={...t,assets:n};return e[t.chain.chain_name].push(r),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Rm=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u=l.assets.filter(e=>e.base.startsWith(`cw20:`)).map(r=>{let i=Im(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a});if(!u.length)return;let d=Pm(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{let n=t;e[n.chain.chain_name]=e[n.chain.chain_name]||[];let r=n.assets.map(e=>{try{return{...e,traces:[{type:`ibc-cw20`,counterparty:{port:t.counterparty.port_id,channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{port:t.chain.port_id,channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),i={...t,assets:r};return e[t.chain.chain_name].push(i),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},zm=(e,t,n)=>{let r=Lm(e,t,n),i=Rm(e,t,n);return r.reduce((e,t)=>{let n=t.chain_name,r=[...t.assets],a=i.find(e=>e.chain_name===n);return a&&[].push.apply(r,a.assets),[{chain_name:n,assets:r},...e]},[])},Bm=class{chainName;fetcher;_chain;_assetList;_assetLists;_ibcData=[];constructor(e){this.chainName=e.chainName,this.fetcher=e.fetcher,this.refresh()}refresh(){this._assetList=this.fetcher.getChainAssetList(this.chainName),this._ibcData=this.fetcher.getChainIbcData(this.chainName),this._chain=this.fetcher.getChain(this.chainName);let e=this._ibcData.reduce((e,t)=>(e.includes(t.chain_1.chain_name)||e.push(t.chain_1.chain_name),e.includes(t.chain_2.chain_name)||e.push(t.chain_2.chain_name),e),[]);this._assetLists=this.fetcher.assetLists.filter(t=>e.includes(t.chain_name))}get chain(){return this._chain}get nativeAssetList(){return this._assetList}get assetLists(){return zm(this.chainName,this._ibcData,this._assetLists)}};s();function Vm(e){e===``&&(e=`.`);var t=e.charAt(0)===`/`;e=Wm(e);for(var n=e.split(`/`),r=[],i=0;i<n.length;i++){var a=n[i];a!==`.`&&(a===`..`&&(t||!t&&r.length>0&&r[0]!==`..`)?r.pop():r.push(a))}if(!t&&r.length<2)switch(r.length){case 1:r[0]===``&&r.unshift(`.`);break;default:r.push(`.`)}return e=r.join(`/`),t&&e.charAt(0)!==`/`&&(e=`/`+e),e}function Hm(e,t=``){if(e===``)return e;e=Vm(e);var n=e.split(`/`),r=n[n.length-1];return r===``&&n.length>1?n[n.length-2]:t.length>0&&r.substr(r.length-t.length)===t?r.substr(0,r.length-t.length):r}var Um=RegExp(`//+`,`g`);function Wm(e){return e=e.replace(Um,`/`),e}var Gm=e=>(0,ut.default)(e).then(e=>{if(e.status>=400)throw Error(`Bad response`);return e.json()}),Km=class{urls=[];_assetLists=[];_chains=[];_ibcData=[];chainInfoList=[];constructor(e={}){e.chains&&(this._chains=e.chains),e.assetLists&&(this._assetLists=e.assetLists),e.ibcData&&(this._ibcData=e.ibcData),e.urls&&(this.urls=e.urls)}get chains(){return this._chains}get assetLists(){return this._assetLists}get ibcData(){return this._ibcData}getChain(e){return this._chains.find(t=>t.chain_name===e)}getChainAssetList(e){return this._assetLists.find(t=>t.chain_name===e)}getGeneratedAssetLists(e){return zm(e,this._ibcData,this._assetLists)}getChainIbcData(e){return this._ibcData.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e)}getChainInfo(e){let t=this.chainInfoList.find(t=>t.chainName===e);return t||(t=new Bm({chainName:e,fetcher:this}),this.chainInfoList.push(t)),t}upsertChain(e){if(!this._chains.find(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type)){this._chains.push(e);return}this._chains=this._chains.map(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type?e:t)}updateAssetList(e){if(!this._assetLists.find(t=>t.chain_name===e.chain_name)){this._assetLists.push(e);return}this._assetLists=this._assetLists.map(t=>t.chain_name===e.chain_name?e:t)}upsertIbcData(e){if(!this._ibcData.find(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name)){this._ibcData.push(e);return}this._ibcData=this._ibcData.map(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name?e:t)}update(e){if(!e.$schema)throw Error(`not a registered JSON schema type`);switch(Hm(e.$schema,`.schema.json`)){case`chain`:this.upsertChain(e);break;case`assetlist`:this.updateAssetList(e);break;case`ibc_data`:this.upsertIbcData(e);break;default:throw Error(`unknown schema type`)}this.chainInfoList.forEach(e=>{e.refresh()})}async fetch(e){let t=await Gm(e);this.update(t)}async fetchUrls(){return Promise.all(this.urls.map(e=>this.fetch(e)))}},qm=class extends qp{isActive=!1;chainRecord;_wallets;namespace=`cosmos`;session;repelWallet=!0;callbackOptions;fetchInfo=!1;constructor(e,t=[]){if(super(),this.chainRecord=e,this._wallets=t,this.repelWallet&&this.wallets.forEach(e=>{e.updateCallbacks({...e.callbacks,beforeConnect:async()=>{this.wallets.forEach(async t=>{!t.isWalletDisconnected&&t!==e&&await t.disconnect(!1,this.callbackOptions?.beforeConnect?.disconnect)})}})}),!this.chainRecord.chain){this.fetchInfo=!0;let t=new Km({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/chain.json`]});t.fetchUrls().then(()=>{this.chainRecord.chain=t.getChain(e.name),this.actions?.render?.(e=>e+1)}).catch(t=>{this.chainRecord.chain=null,this.logger?.warn(`Failed to fetch chain info for chain ${e.name}: [${t.name}] ${t.message}`)})}if(!this.chainRecord.assetList){this.fetchInfo=!0;let t=new Km({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/assetlist.json`]});t.fetchUrls().then(()=>{this.chainRecord.assetList=t.getChainAssetList(e.name)}).catch(t=>{this.chainRecord.assetList=null,this.logger?.warn(`Failed to fetch assetList info for chain ${e.name}: [${t.name}] ${t.message}`)})}this.fetchInfo&&this._wallets.forEach(e=>e.chainRecord=this.chainRecord)}setCallbackOptions(e){this.callbackOptions=e}setEnv(e){this._env=e,this.wallets.forEach(t=>t.setEnv(e))}activate(){this.isActive=!0,this.wallets.forEach(e=>e.activate())}get chainName(){return this.chainRecord.name}get chainLogo(){return this.chainRecord.assetList?.assets[0]?.logo_URIs?.svg||this.chainRecord.assetList?.assets[0]?.logo_URIs?.png||void 0}get wallets(){return this._wallets}get platformEnabledWallets(){return this.isMobile?this._wallets.filter(e=>typeof e.walletInfo.mobileDisabled==`boolean`?!e.walletInfo.mobileDisabled:!e.walletInfo.mobileDisabled()):this._wallets}get isSingleWallet(){return this.wallets.length===1}get current(){if(!this.repelWallet){this.logger.warn("when `repelWallet` is set false, `current` is always undefined.");return}return this.wallets.find(e=>!e.isWalletNotExist&&!e.isWalletDisconnected)}getWallet=e=>this.wallets.find(t=>t.walletName===e);openView=()=>{this.actions?.viewWalletRepo?.(this),this.actions?.viewOpen?.(!0)};closeView=()=>{this.actions?.viewOpen?.(!1)};connect=async(e,t=!0)=>{e?await this.getWallet(e)?.connect(t):this.openView()};disconnect=async(e,t=!0,n)=>{e?await this.getWallet(e)?.disconnect(t,n):await this.current.disconnect(t,n)};getRpcEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRpcEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid RPC endpoint for chain ${this.chainName}!`)};getRestEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRestEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid REST endpoint for chain ${this.chainName}!`)};getStargateClient=async()=>{for(let e of this.wallets)try{return await e.getStargateClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getCosmWasmClient=async()=>{for(let e of this.wallets)try{return await e.getCosmWasmClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getNameService=async()=>{for(let e of this.wallets)try{return await e.getNameService()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint or name service is not registered for chain ${this.chainName}.`)}},Jm=class extends qp{chainRecords=[];walletRepos=[];defaultNameService=`icns`;mainWallets=[];coreEmitter;walletConnectOptions;session;repelWallet=!0;isLazy;throwErrors;subscribeConnectEvents;cosmiframeEnabled;_reconnectMap={};constructor(e,t,n,r,i=!0,a=[/^https?:\/\/localhost(:\d+)?/,/^https:\/\/(.+\.)?osmosis\.zone/,/^https:\/\/(.+\.)?daodao\.zone/,/^https:\/\/.+-da0da0\.vercel\.app/,/^https:\/\/(.+\.)?abstract\.money/],o,s,c,l,u,d){super(),this.throwErrors=r,this.subscribeConnectEvents=i,this.coreEmitter=new ot.default,this.logger=n,s&&(this.defaultNameService=s),this.session=new ca({duration:18e5,callback:()=>{this.mainWallets.forEach(e=>e.disconnectAll(!1)),window?.localStorage.removeItem(`cosmos-kit@2:core//accounts`),window?.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`)},...d}),this.walletConnectOptions=c,this.cosmiframeEnabled=dm()&&!!a?.length,t=[...this.cosmiframeEnabled?[Om(a)]:[],...t],t.forEach(({walletName:e})=>this._reconnectMap[e]=()=>this._reconnect(e,!0)),this.init(e,o,t,c,l,u)}init(e,t,n,r,i,a){this.logger.info(`${e.length} chains and ${n.length} wallets are provided!`),this.isLazy=a?.isLazy,this.chainRecords=e.map(e=>{let n=typeof e==`string`?e:e.chain_name;return Ji(e,t,i,a?.endpoints?.[n],this.isLazy,this.logger)}),this.mainWallets=n.map(e=>(e.logger=this.logger,e.throwErrors=this.throwErrors,e.session=this.session,e.walletConnectOptions=this.walletConnectOptions,e?.setChains(this.chainRecords),e)),this.chainRecords.forEach((e,t)=>{let r=new qm(e,n.map(({getChainWallet:t})=>t(e.name)));r.logger=this.logger,r.repelWallet=this.repelWallet,r.session=this.session,this.walletRepos.push(r),r.fetchInfo&&(this.chainRecords[t]=r.chainRecord)}),this.checkEndpoints(a?.endpoints)}checkEndpoints(e){Object.keys(e||{}).map(e=>{this.chainRecords.findIndex(t=>t.name===e)===-1&&this.logger?.warn(`You are providing endpointOptions with unrecognized chain NAME ${e} (NOT found such chain in ChainProvider property "chains")`)})}setWalletRepel(e){this.repelWallet=e,this.walletRepos.forEach(t=>t.repelWallet=e),window?.localStorage.setItem(`cosmos-kit@2:core//repel-wallet`,e.toString())}addEndpoints=e=>{this.mainWallets.forEach(t=>{t.addEnpoints(e)})};addChains=(e,t,n,r)=>{let i=e.map(e=>{let i=typeof e==`string`?e:e.chain_name;return Ji(e,t,n,r?.[i],this.isLazy,this.logger)});i.forEach(e=>{let t=this.chainRecords.findIndex(t=>t.name===e.name);t==-1?this.chainRecords.push(e):this.chainRecords[t]=e}),this.checkEndpoints(r),this.mainWallets.forEach(e=>{e.setChains(i,!1)}),i.forEach((e,t)=>{let n=new qm(e,this.mainWallets.map(({getChainWallet:t})=>t(e.name)));n.setActions({viewOpen:this.actions?.viewOpen,viewWalletRepo:this.actions?.viewWalletRepo}),n.wallets.forEach(e=>{e.setActions({data:this.actions?.data,state:this.actions?.state,message:this.actions?.message})}),n.logger=this.logger,n.repelWallet=this.repelWallet,n.session=this.session,n.fetchInfo&&(this.chainRecords[t]=n.chainRecord);let r=this.walletRepos.findIndex(e=>e.chainName===n.chainName);r==-1?this.walletRepos.push(n):this.walletRepos[r]=n})};on=(e,t)=>{this.coreEmitter.on(e,t)};off=(e,t)=>{this.coreEmitter.off(e,t)};get activeRepos(){return this.walletRepos.filter(e=>e.isActive===!0)}getMainWallet=e=>{let t=this.mainWallets.find(t=>t.walletName===e);if(!t)throw new Qi(e);return t};getWalletRepo=e=>{let t=this.walletRepos.find(t=>t.chainName===e);if(!t)throw Error(`Chain ${e} is not provided.`);return t};getChainWallet=(e,t)=>{let n=this.getMainWallet(t).getChainWallet(e);if(!n)throw Error(`${e} is not provided!`);return n};getChainRecord=e=>{let t=this.chainRecords.find(t=>t.name===e);if(!t)throw Error(`${e} is not provided!`);return t};getChainLogo=e=>{let t=this.getChainRecord(e);return t?.assetList?.assets[0]?.logo_URIs?.svg||t?.assetList?.assets[0]?.logo_URIs?.png||void 0};getNameService=async e=>{let t;if(e)t=e;else{if(!this.defaultNameService)throw Error(`defaultNameService is undefined`);let{getNameServiceRegistryFromName:e}=await g(async()=>{let{getNameServiceRegistryFromName:e}=await import(`./utils-yNiv3ygK.js`);return{getNameServiceRegistryFromName:e}},[]),n=e(this.defaultNameService);if(!n)throw Error(`Unknown defaultNameService `+this.defaultNameService);t=n.chainName}return await this.getWalletRepo(t).getNameService()};_reconnect=async(e,t=!1,n)=>{t&&this.getMainWallet(e)?.isWalletDisconnected||(this.logger?.debug("[Event Emit] `refresh_connection` (manager)"),this.coreEmitter.emit(`refresh_connection`),await this.getMainWallet(e).connect(),await Promise.all(this.getMainWallet(e).getChainWalletList(!0).map((e,t)=>n?n.includes(e.chainName)?e.connect(!1):void 0:t===0?e.connect(!0):void 0)))};_restoreAccounts=async()=>{let e=this.cosmiframeEnabled?Gp:window.localStorage.getItem(`cosmos-kit@2:core//current-wallet`);if(e)try{let t=this.getMainWallet(e);t.activate();let n;if(t.clientMutable.state===U.Done){let e=window.localStorage.getItem(`cosmos-kit@2:core//accounts`);if(e&&e!==`[]`){let r=JSON.parse(e).flatMap(e=>{let n=t.getChainWalletList(!1).find(t=>t.chainRecord.chain?.chain_id===e.chainId&&t.namespace===e.namespace);return n?.activate(),t.walletInfo.mode===`wallet-connect`&&(n?.setData(e),n?.setState(U.Done)),n||[]});t.setState(U.Done);let i=r.flatMap(e=>{try{let t=this.getWalletRepo(e.chainName);return t.activate(),t.chainRecord}catch{return[]}}),a=async()=>{try{return await t.client?.enable?.(i.map(e=>e.chain.chain_id)),!0}catch(e){if(e instanceof Error&&t.rejectMatched(e))return this.logger?.error(`Failed to connect to stored chains: ${e.message}`),!1;throw e}};try{if(!await a())return}catch{for(let e of i)await t.client?.addChain?.(e);if(!await a())return}n=i.map(e=>e.name)}}t.walletInfo.mode!==`wallet-connect`&&await this._reconnect(e,void 0,n)}catch(e){if(e instanceof Qi)this.logger?.warn(e.message);else throw e}};_handleCosmiframeKeystoreChangeEvent=e=>{typeof e.data==`object`&&`event`in e.data&&e.data.event===`cosmiframe_keystorechange`&&(window.dispatchEvent(new Event(Kp)),this._reconnect(Gp))};onMounted=async()=>{if(typeof window>`u`)return;this.cosmiframeEnabled&&window.addEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent);let e=km.default.getParser(window.navigator.userAgent),t={browser:e.getBrowserName(!0),device:e.getPlatform().type||`desktop`,os:e.getOSName(!0)};this.setEnv(t),this.walletRepos.forEach(e=>e.setEnv(t)),await Promise.all(this.mainWallets.map(async e=>{e.setEnv(t),e.emitter?.emit(`broadcast_env`,t),this.subscribeConnectEvents&&(e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.addEventListener(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to window`)}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.on?.(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to wallet client ${e.walletPrettyName}`)})),e.walletInfo.mode===`wallet-connect`?await e.initClient(this.walletConnectOptions):await e.initClient()})),await this._restoreAccounts()};onUnmounted=()=>{typeof window>`u`||(this.cosmiframeEnabled&&window.removeEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent),this.mainWallets.forEach(e=>{e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.removeEventListener(t,this._reconnectMap[e.walletName])}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.off?.(t,this._reconnectMap[e.walletName])})}))}},Ym={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},Xm=class extends Yp{constructor(e,t){super(e,t)}},Zm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Qm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),$m=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),eh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),th=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EIP6963EventNames=void 0,(function(e){e.Announce=`eip6963:announceProvider`,e.Request=`eip6963:requestProvider`})(e.EIP6963EventNames||={})})),rh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ih=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ah=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAIN_TYPE_TO_GENESIS_HASH=e.GENESIS_HASH_TO_CHAIN_TYPE=e.NETWORK_TO_GENESIS_HASH=e.GENESIS_HASH_TO_NETWORK=e.ChainType=e.Network=e.GenesisHash=e.BitcoinSignMessageType=void 0,(function(e){e.ECDSA=`ecdsa`,e.BIP322_SIMPLE=`bip322-simple`})(e.BitcoinSignMessageType||={});var t;(function(e){e.MAINNET=`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`,e.TESTNET=`000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943`,e.SIGNET=`00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6`})(t=e.GenesisHash||={});var n;(function(e){e.MAINNET=`mainnet`,e.LIVENET=`livenet`,e.TESTNET=`testnet`,e.SIGNET=`signet`})(n=e.Network||={});var r;(function(e){e.BITCOIN_MAINNET=`BITCOIN_MAINNET`,e.BITCOIN_TESTNET=`BITCOIN_TESTNET`,e.BITCOIN_SIGNET=`BITCOIN_SIGNET`})(r=e.ChainType||={}),e.GENESIS_HASH_TO_NETWORK={[t.MAINNET]:n.MAINNET,[t.TESTNET]:n.TESTNET,[t.SIGNET]:n.SIGNET},e.NETWORK_TO_GENESIS_HASH={[n.MAINNET]:t.MAINNET,[n.LIVENET]:t.MAINNET,[n.TESTNET]:t.TESTNET,[n.SIGNET]:t.SIGNET},e.GENESIS_HASH_TO_CHAIN_TYPE={[t.MAINNET]:r.BITCOIN_MAINNET,[t.TESTNET]:r.BITCOIN_TESTNET,[t.SIGNET]:r.BITCOIN_SIGNET},e.CHAIN_TYPE_TO_GENESIS_HASH={[r.BITCOIN_MAINNET]:t.MAINNET,[r.BITCOIN_TESTNET]:t.TESTNET,[r.BITCOIN_SIGNET]:t.SIGNET}})),oh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(th(),e),n(nh(),e),n(rh(),e),n(ih(),e),n(ah(),e)})),sh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ch=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthTxStatus=e.EthSignType=void 0,(function(e){e.MESSAGE=`message`,e.TRANSACTION=`transaction`,e.EIP712=`eip-712`})(e.EthSignType||={}),(function(e){e.Success=`0x1`,e.Failure=`0x0`})(e.EthTxStatus||={})})),lh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),uh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),dh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),fh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ph=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Zm(),e),n(Qm(),e),n($m(),e),n(eh(),e),n(oh(),e),n(sh(),e),n(ch(),e),n(lh(),e),n(uh(),e),n(dh(),e),n(fh(),e)})),mh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),hh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSONUint8Array=void 0;var t=mh();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),J=a(((e,t)=>{t.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function i(e){return(e&&e.__isLong__)===!0}r.isLong=i;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,(e|0)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}r.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}r.fromNumber=c;function l(e,t,n){return new r(e,t,n)}r.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return y;if(typeof t==`number`?(n=t,t=!1):t=!!t,n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}r.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}r.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);r.ZERO=y;var b=s(0,!0);r.UZERO=b;var x=s(1);r.ONE=x;var S=s(1,!0);r.UONE=S;var C=s(-1);r.NEG_ONE=C;var w=l(-1,2147483647,!1);r.MAX_VALUE=w;var T=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);r.MIN_VALUE=E;var D=r.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return i(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=r+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=f(e)),n)return l(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=r*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=t*p+r*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(n)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var t,r,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(t=this.shr(1).div(e).shl(1),t.eq(y)?e.isNegative()?x:C:(r=this.sub(e.mul(t)),a=t.add(r.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(t),p=d.mul(e);p.isNegative()||p.gt(r);)t-=s,d=c(t,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),r=r.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return i(e)||(e=f(e)),n?l((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.and=function(e){return i(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return i(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return i(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var n=this.low;return l(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return l(t,0,this.unsigned);else return l(t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}})),gh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),_h=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),vh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BUILD_VERSION=void 0,e.BUILD_VERSION=`0.12.313`})),yh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.metaId=e.KeplrLogoBase64=void 0,e.KeplrLogoBase64=`iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACPfSURBVHgBzV0L0B9VdT9nvy/vB6nVOg4GEx/VER3A1iqo9aMzFgWtoOhgsYaHYNV2lNEqxAdfmKHTakuDTge1FJK2tqOtGqoWFWti8TFSxGDriFSbIK+qgB95h+Tb09397+49r3t3/99/LT0zm//e9917fud3zr27SRB+EbKd1gAcOhFg/kSYmjoBiJ4JhMsB6LHFJetS+wfoAowOQOKnumGVUfSX+23Ba0uRfFaGsh6pNKDqP2PzQN5TbNxqjAeqi2CuWLuvAuU74eT1O+AXIAhDSaX0g+fBFL6ymHShfFhT5RvdknNLzsTIb+cChmzb2OJqJY8aQG9gaAUXaXLbOH0gL4mXmXHC/HYUv1thEWyDk9bPwQAyOQC2H1wHGb29uNtQdLcmFJBv2AsFAPVQJDQPlFBYFACpso7+kFm17g/9sUgr3QFWNI3VtQWO0KaCGXbDBLJwAFSKz2cLjtvglhNFGmr6NomgxEQdT1kYK8N0uzBwH3bosHJo3EKkD1ZG0X6ctAFEW6cAAiwYCAsDwM2HL4e8tHpa45a7NN2UUaxBmFAPmpdt+rGDq0zdrpP2I6yRig06ANHNHuAwjxlzFp67fhOMKeMBoLT6Kby+GHMGmklySVosJAO+ajK9LX6Uxl51eyqZp/tYvVcPbRklynQ7au913aaeBwLRz+6CDU4dhw2yvhVh++EzIcPvBOXXc+SXJz3LMVYeEblOYxKZMx/kF4V70aZPv+q+7ceUmaivHTu0hDSWqzwRWa4rAsTtcOuuM6Gn9APAzYfeVszsM8UAazoVCgDj1DELneqrBgrq/ilyKUFwFE2R8cX8UABD1OmaOx87pkw137gxoP9ssq91xfUZ+Pddl0MP6QbAVwt/Pw+boY+MCQzsquNY6VhCHUoGNeY4fUKjVLR9JdIC8IkxkTrqkerVPsNsHxCk17RUPtFstJw6tE2RfNAPl35Cs7XrSHcGhWPHADBWIJj25XJ8ipbJcUmlZR01Fs+bh0vg+eujBhwHQOnzoaD9pFAi25ZhD2XzPKmHNAAQyC/zHbCelFNGicBPpxP8jZFA0El37xyaHA8oqm8uBGfB89Zv84p8AJTRPuD24m4dpKSLAdhPPGKv8wx4+1l8dO/vtVWL1PvQKMIIxOtFo3VKKy9y4JNmkboflef2N5K5gglO8nYHfgxAhfJHwQQkL9EmXgfHqNcnLkBSwWAPEUFfrG3Xs6k8b+dg66N6RpS7DNMvAp+vwTXrB2Lt7dqugWm4HhyxANhe+P2U5fcBQy0mYh+nntOmL0BcoMREK8vNr8uiCgnKkAEixIO5Zo41IOKKrgPNWFvw1liuVDWHvNi+f/NHs6BErmdJ/Tnugt5Clhl5mVPdUnCkLnMhfVwC8hUz5c69qifm4vYBLrWT285Jq7aUdAOM4ut02ycAkLECilgGb1+1naNcugLJAPPF1iFlid7FxmjH6VO3R99d2zdOwa2k+gNpNVGGcObc5vPRExZvKFwxjahLil1olGf7qd0DgWIXjM+5Hbusg2syxMvVU9RSWv/R/tbvWyUflMZoQ9YwE6vfhxHK1ensy3HC6FlypG56ixZnBDJ1bf/2OwPeU8Qyeh6n5kDrGxZoGSA7CrMiqPEubjFdF5tTnzbGkrkoy+L5HgslGSbyPG4QR85YTp7PABi10sbqTTBIym8T2jnpvsV8EEwQ6EhG8Ha+ZtXHHHjk8M+hr1D7R1TQK1ftumIAtI1Nuo+Vpw+GAHod8rR5qXSqX5mOWzixcpanrIM8RhL9yP6UzM0fLljg1PVzIwY4cujMTovuQBVQD2tnc+zy2ynG6NoGdjJBbO5QWxdoa4aoj9fHwl46jIMBX6Tqt8+j/DwEixcswNsTJNYSwxVkzaIlcF55UwEAc9wwFgA8ZUQnYOt2AcN1b4mybvCh7IN6UH8zLx2ggVcnnY66BqpnxdcILDCaZ3Dn3/RK/nNJAGN7EUy9slkTwBsPeXZhJE3JuoicNn47jJhllwvoVe5RuaJ5Mz7avgCHTZutnBqzy0U0eXblKGIlRuaOHMnXT8ONB2d6Bo+9JeaeTJ2By9pyXslbQ8RRAUU6oI68sdOlpkikkSQIRxoPL4dadmgUSqHzURH5ukaOiqQS1kxPw4nTWfkFL/WDTEr6xR5xBY6v9NGqoFeJEu08BdcrHoDLFr7KQ9np2Glv/EKRSAYoCJQED0GDX2Q5wOYKajAuoW55N5UXAKA8m1mI+jvbUL+6CwGEKFdKQlHDmYRrNWBAgYMzAbZWG5IIZIASGpGTZ+eFdXEPGsf6yZs1wEUnTBeJYzrbmZyOwWgMBRZy7YlL4A1rp2Eh8m8PzsNp39yfrOMqE5i76FK0l1d0+tHjV8Hrj10KQ8h39x2Bk2/5WRisZCQ2HrXKU7GCmKDM6SpCmC9cQA7rus25n3TFEgMNY8U8mErEXIK2UOZvEdK0vvEpKwZT/l2H5uGc2x8S7KDHQzFPaDOC21LlvDCqF1xTmt06sX1JAMk0h8nqDAaICOOgp2BWiB20GZvfZU9bARufuhyGkFL5p9/6INx9KHdezTb7EwfhdQxAKV9LXqaQddOdf3Uu0ndKMIEet58eYIsKBeuIWT7P8sow0UazxGW/unw45R8slP/tB+HHxW87mAoMUbOBmZ4T/Y4h0ykAjSPj+Pxx23aOrQOvUmKgAMdVeaxXBwicJc5duwQ2Pm0Y5T98lODlheXfUyi/sXxyqF9s/2KULgJhgLRPlDKNOSxIJqJ/VGUTMIDxgaQsGsaZq7Q03u7Zx0zDNSesgiGkVP4ZtxSWfyAHHnsYP68WBhNl4NQEVZMzc3M3PZSv71O3nYAecxIXULdHM5Zfry1DVpHS8z5u+RR8/uTOzVJvOffbP4fv7Tka37K2WU5+m9Of+jFxNz3pKeBCqX9S2hd9eXSfGqu1NpTbKrS3xy2fhs+dshqOWTTMjN/63T3w9QcfsSwIvrI9RWOPOn3FBoEdgj0QM57SaTIwELjbz9Y1CDfgLzKKotFN2efaFVPwuResLkDQ/2/QpWTj9/bCP9x9UG4x7UwgrsT+9E88Va0DgbfJmx4jXpAt3WETZThem7HEYYCkwgnc7TLPO2YxwudeOJzy//TO/fDRXQeqIcLcmoHNDE0ZueWx9s7alm8BHYabyAXELDpeFmk3qRsa0wWkqLdRzmdfdMxgyv/AD/bDBwsA8LDDzmYhjFDXEeBN1FUgL2V6nMVfqL+vymI0HWPDvlK6gJx3qG4JBPLdOSj5y+euLKL+KRhCKuXfsb+eQ+phVZlQFgoqT0vsYcnNMjFAWslxIupL8UNbP+/DuoDE+CY+GMm7j18Gr3vSYhhCPvajg/Bn39+/YIvXRI9Obuvr2fOknILGz1guIAkOitdDb2ToZpQ+gqxrFJEPq2OsyVJ++QDvKpT/rmcugyHkE3cdgvfdvq+w/BBUsgFHWzyMW7ws8IHbMoMoGy+oFgzQ2/r1AkdamMlBhDUmdQEx9xJJe2UXP31pBYAh5BsPHIG33bqX+fwI9VcgAIguQKVQC4aktH0mK7V3CwsCo0EXQ2sPl4A0iebNsGYMce9F/rWc8+QlcOVJwxzxfm9uHs7/+sMOKBNb0Ja71cKaJrVyqWMr1rms4el7BoHUL6p3wJqyxDZvoF2ATuvAS4OgzH72L0/Blc8ZxvLv3p/Dq3fMwd4jsfUKGvLjIzU5cpuCH9WS2vz3k+4gMNKZmx1jBow9sGy3YMnB3eM2/jIGwrUrM9j6opWweoBTvlL5Z29/GPYeptbvV2M5oAuTJVtu6tQZ3ikOF17f61MUBul2AWQjUlccJccUjBEqXpDUMYAOsqIgqBf3uJUIn3nJquK0b/K9fqn813zlYbh3/zx7nsaeO/bwVRWKzlvWg3jMYILM2GgouhrvbWDKr8diRHTyqudldDEBA3Dl60+/YiA4rrD8T79k5WDKf+2/KuXrSL2OzsEtr6HClIuReiEvZjYUtf5Yi44YgEwSI/Vic9KBHjpbtElZoF1bh/Kb8Zo6q4sj3utnVlT0P6nsKXz9a7/8MNyzb/RaF1Nb3fYolsRcRb0u6mfZsnM1mhc7RCTxMigR+EWsWhUn66EpmEB4n6RcDFusMvtDL1wOz3rM5Kd8lfJvKix/b171G+iVfV6uwc7+hORxjZ/y2k26hNYFJIIC36ezQxVj3Y5FMCsQljuBYP1dBbbjgutTr3j+MnjpcYtgCLlo+174/oPz7nd8Md9vlOvRvicC1F3BHiWTuotpo8y+lBz17baOuCWHIYaIATzLZ+l3PGcpXHT8EhhC3vn1/fCt+4+MLF8xdgAitidzdcpnBU37VP+BDnNG1lNm9tAea1MwQI/V96iM2j9kFTYzTET/VXpCy9f9mMOeOv8dv7a0AsAQcsUtB+BT/3UYmtM9d0wBCt/3G8OJWQ7PoQ7r9PrukM6DID53t8wJUPSzSLTKv7SZ6r+XlG35OQDJeV307MUVAIaQq79zELb85yFBx9jhkxF4XT5pv36b79I7hngnsRGId2wXeox3AayOg2jZ3qe9NOoXLsiBxeZ52vpFsOmUYU75rr7tYAWACtA84FV/d6/ZiiaftfmXP7hleOuRUmaXtWtdu9ba4xzAt/IIgiMTEqDRwdoA4sUAzyqOeDfPDKf8D912cOTzXcrn/5SL3RLz8wkNDLHArnVTXNkOQHoDopZ+L4NUoOi5q0AK4UmNFXj5zQNOIDoGWLsqg2tftgJWL5mcYq7/j8Pw4VsPyrknAk7sEfwhv0kCo+4PIK3sCbbWvT8KxWYkPQEFDr5Ioh6SzUfmRhYq5ZB5mFep/E+eWZzyrZpc+Z/6wSNw5TcOmICPK5UrQdO8LjfH5R7tq/VzrR57Wjp248EFAEZHBp+2sQuNZA5kmroY67OntBZZXE88plD+WYXyV0+u/HKPf+lX9tf/hg60IBBKM0qH5FYU2bt6Ga+Q7ENXaOqxcUU+RMSNA6TEXYBAIEVHCdbAKK8pY/my7uhmcjXV/RYgXr0U4dozVgym/Ndv2xuOqVvF1kzAx3Zjgjgz+FtVBxie23DcgJOMZzq69oNAdFpRpLhRpqH80BxVQ5zAZxmprf+q314Gxz9u8vP98mj39z69F/YVr3UzV3HsX/5Cct2BOYl0QCHSAO62D2MKj+QDqDFNphX/HIBsD+gkRgMpCxeKl44sgITES5pJdwOXzyyF054y+RHvvXtq5R+i4JoSikT2Sdc4ls/7AkgDw+tL5IsOrIi+HVExgKVx25NUZJXWflDeKP9PJg8mAMDJa6eqa1Iplf+GT+2F+/bkYlGxy7qhiQ9AKCpm+e5a6TYAFgiNLaWAwCcVEV083ee7PI9SxL+pKw291a4J/PjHJej3+2hIpfx/rJWP2u+Dq1hUAPHKYuWectHz95ohmnyAxOt3nQFJSW4DvUFa6zZ5jdhPoMVJnWEFGuxAaCGyp/D1Gz7JLF9t9bjiW4tnrBVYQIqXj2OUJ9Ns/FT9UC+OgvRBkLZstRuwL3sUMJyI37iDR1v5nyiUP1e/0/don8Ac77b1HIYw7Vm5Trf16zw3Jqg7cllAVJaCrJ5fOJL4OUCkN49iWlZwJsb/QUSJ9kS88X8k77nxAPzgJ/PGvyOApG6eX2Y0ZcyHx2IFnQaQykHzKhj6uwMAP45ICgpg9NoGJg9/qP3D+RKHVD0Ir0b5xB8FFii/3r3jf45WZwiefxfWD5D09a2ylQFYJkD/lbhj+bFX596HIcbae4Oh/MeiSwCoC+ehOl4dXaq83raN8qm6qkWkum19VS9F2nqhHa/flj8KAFhVvCfY8rpVcOzqrJpDVs8nq+fE58fvm3q6LMtZ+ypd/8PMObtYm0zUleNnTV7RJiN5NX1lug/TNugCKX6FD0I0XLR/Nwl1IoaqTPh6aJnC97OPAgIKObY4Ov7wq1bCBX8/2vsLyua/nrU7ZdzCOXUbt8AeV7AF4Ni7gSrfNXXGEInlzaqOaut1Lb2x3PaqmYFknbYNYw3OAMgYAdu6MGIEePTk6Y+fgut+d1X15jBlKfwKLIDqitfNTFsYWXRj2YRifQwLGUu2rICCLSRDGJZoruiDardQKT0ovqH7AJYRMCTdw0jBRKG+6P/R3QI2UoLg2nNXVZ+Me/Ru6D8HV+GZqhdLY94oXbqczOmrAUqj6Ky9wKX+Biyesl2AejGAVToJpQsrdhTfx+pFjPD/BARXnb0y6ddDmVQAt9A4CLiF2jqZUlxbt7LuiDUbhTuxQtclqZ7EFVN6UHRQPHDFp6zeAwUsXO64fx6+f/88DCG//qRpmH3FingQSMFydVnMelv3kPt1Mt13zkDCrTfX1uwFh77VZ6kL60geGmW2SrRKh1ZxdX2+EMzqgS2Asfq2HiubgAH2FMHbH358P9z78xyGkFecsBhmf2eFQ//oAEJZsirLcnQZRLKDVbi2+Ma6W4t2ACKAwi8OQkIDnGgMwJXeBnQ0UiJnAREcEsn8PFg9VzaqsknjgPsemofzrt07GAheXoDg8lesgNjauL7U/MYBwxnFA4Z2N0gWSJnDKC1QuILreIFfgrmiMYB4QMkQyJQIudoViLYUKJ9NPjBFzQiTSN3vfQ/lcP6AIDjjxMXwxt9c5isuB0PPoUzuCDKKW73IF+5EKY8snTcMk+UIOr7IHHCaqwEEKL/fXto1kKN4kooP9yRcBOigESQoJpEqfqjHvv/BHC74WHG2PxAI3jizFN744hoE4ARtpC8UytTKDb4bbKDYKLTD/4vtn1Kmr/AI9bcuIMEAMuADq/hcKr5hA7sbgPb8AEw+THwQxK3y/oIJLhwQBBcWILhwZpmlaQDDbD6FB+WiVm4uleqCh7T/t0wQ+mt2DfJswmOFpAuoJj8PMuBzjoa14jkbiLgh4iJaMMEE4ix6yQSX/M0+2Nvvf8PrlAsKEJRXbHdQLS4gWKrnQZhVbuMyLBMEV4COq8hUfCAOkhQr6CNhuwtw6B+aq6Z/swVkwDCgYFRv3EDbnkLw1/Q7gQj3U4995z1H4eKP7B0MBOefurS6hPVQ3OJH1tVY97juAMUOQlpveMfgsgCrZ+g+V+8mmnMA7xI+us3jAJFlwbrDwZBemPZUkEAywaQAaINNuRO5896j8KZr9gwGgvMKAJw3sxQs7aNRBDr5zfsDz2K5xWdkAWb8PmmLtkfBaOo4l97zy32+WlhB7aBiAgpRPXGrp+BCCMwZwKT/VFz7QiaXTNMo6M575+GqGw7AULLht5bC2ScvERQe/LwCgYkDwFV8AIV1IXrHIGMIeXCURRSOFGeF6DeB3jvm8L6awLwbbxO1IpDi79Rrv88/rVqwKOtqxuFf4Hz+lsNV3vvPWQFDyFtOXwb7DxLcdNsjclwIz1jFBM380CsPec1bRPkmEsX3EqFMfQdQj1Gl1bcCqdiqKRt9ENIRhYlPt7gy63RYeFIgYACpG9h8GMAFKCWwqxnjXwoQlD75vQOB4I9evbwa98u3HbEgYArwlOoqGqSSuUq08k1Z8wdZVXaotvx7ARRVgPtRaGPFlYRTPPcLWoKAFNbOWsGEboDCLyI4ChldJRM84ZcyuPC0Yf7W8DvPXl6A6iB8+duP+B+PAgchGoYSytfMIfItSMI9CmPUdUDUtyVj/YcRozIydc1XsvyvSCtAhIVijDCJ/gmES0GS8x39/f2Qvu4Lo7/pe8FAIHjTy5fCrvvmYdf981bxag58vaq/VAJ6DR2GwKBgzRyhTp0v1hE7rb8sN+8C+Nl+CN5U9C+2exBe9DSBIIA5OWy2Z+L7AD7egoVE0Kd3MPyVdpN3/Y0H4fovHoQhZMVShD+5eAU85QlTIZKv14ef3aMO3kgHfF4gh87BUNgpiLMBE+SpMckPDjPgR778DEAp0L4QIrGft9E/2F0EA5moN4FUFuPswVGN1cydg2DLF4YDwR9ftAKe3IIAROQtlQRW+Y1CnQMgpLB70DsFAYhcbTnNhe6VgTr4QXbxMv5CSCyuOCCSdTWrCOXzwyeYQJwxtNXJvADaLQUItt44EAiWIVx5cQCBVnQzPn9LGBSrLdwHiGYC8W0Ce2bzIanaRsqTQHVUKA6EnPyWEbhbiB3wcErWboIrblIhClSfx6xf543qlwD44i2PwBBSguDSDcvgV4pAs6F1CQKb1m8BAzBip4XOsS8HRf1hiKdwvRajgyClcO9wJ5z1M0bglt+Ape2HjJsQ4NBtJwSBfDAC8ckZgXNULK8P/N0++NJAICiVf8XvL69+o0xAMYrW1oxuHXtSKNmAuxOPETgzRF4Hg/kuwGUEQanE3AUYyvfoH5irmESQHMYhAP1No11gaOf7wb/dBzd9azgQbHrzcni8AAE6vtuCI+4KGDu0v5HXx8S/J9Ag0i6gUaa6+CLqKF+k2Y7A+9QLybbnjDGY8sm3LB6feGXBHQB85J/2w3/fM8z3hY8rlH/5m2NM4LgCBxwyKPR3ArZfZweQg/92MHd2AeaNoFIoGAVDS/tim9fSv1YEmLyJ4wBHuT4o1GtrVbb/AMG7rt4zHAgeg/D+N6fdgWUCT9mJdC4BYdmAMYL7QQhJWnQ/BqnuLUBQvDACNx7gfr/px7y9m1AaBRrQUowVKFJGcKAAwaWbhwXBe9/CQeBTsssE0AUGSCievx2044W3gWLhyFI8W9SUu/B//X5MX0NI2SfUDwksluFj1L8tG2hg1HXKFz1Xfmwv/OShHIaQEgTveesyWLlMWXvzbsADI3QEgDCqk0HcDRhXQDYYzbQC2rNzT8kqyPKULH99cBhWmEQobukcCLbMAUEe8n76QA7v+Ys98NMHhwHBYwsQXFaAoDw0atY46grAugV7VuDFDd5BkWQY831g6xdzbalkYwLQ0T65jBC7tCsRY00g2DGmPgrWtN+CEzgQAH5WgOC9m4cDwXHHZnDpHywdgUAoawSKkVVbKpdWa1nD21FkAhTy7IAbo38OIBTmpzllBn9PCTYg8W2gYJIJpH351GHt0IJPPhN/Bg2KBgTvK5jgZwOC4N0tCOxcpc9mbAGS8vl2L27pum/rCvxPwtj+3rNYewIYgjmP8mOAGWQXQBHaB3DB5oOEDGB4+oECBO+/au9gIFhbgOCcVy1ulZUBRIErlaqVz+YLUMcUGJgEAngyVSfUjVI+WMv3joUTlwSBBdEg7wIgNhc+jlIsOCAweSSA8ECh/A9cs6/aJQwhp/zGFJx/7hJB+RiNA/wj5fBMXf4fAWPvBLQFxZSoF9ZjBzfqhyYPJO3za0JxT/rEAkllgqNgrvSYm7jr7nnYVDDBUCA4+XlTsOHcxc6cOX2jejaUVk/xj0hjShduwQv8YoEaZwYc81fcK2VMJFx5RBBnJRJj6zwNertLGN2XILjiz/fCUFKC4DWvXhQUCRbEbkxAUvkcIPotoa3DyooH3u1ZPTp5niLdxQa58CiYILKrmFTacSnQOTgWLhSsqB+00lUf9f2PCxB8dMtwXxqfOjMNp58+zeicWzFjBYi4AbIuhFt9iAVQX7vLfyZubqTRkbDP/UIe+xYJeT7VeaoMdV/8vv58zC1boAhKbC8KH03Vcxt9ikWj7/NI1eV56PTJ84o/bv7GI1X64vOH+V/HGwB88fPzzazDuoJe28AEIVXfI69X35G/xsVT7y6Cw/nbMWL1bcPmXm8RAaJM4ZWjYgnk/S9YSLKO+vXdQqQNYxFxD4xB2P3XChB8/JPDfFBSyssKELz0jGlh8dbaI+cCAGaL6AWGgiHy/OGseKW406VwABsQ6bRSZnpRWT1w6i5QAm0z5bDf0RheGdk0gOMinGdjc/7STYdh22cPw1Dy0tOnAgj0BZHL1LUHQ55rAMId0zngzoyU1slShvnyl6Vj4rkCYBNvZM/+HO776Xy0fUr27a8nQe0foAiwnjuNbuqfoHRFp8hA1bqFhIso/rjhnw9V9y84ZbEaPS6YSD/1aRncRPVXxsjmRz71hzz2J/rz4HmLpvKduG5m15psesmuIr3Gq9Tmad+CctHMwOoX0VlkZGlWnqGth6pepTjeDmsKFG0w5LM8Xcek2X1m8oMSwj3KOl66XYtYHQBQ9SUArLLl3yaSoOe/tsZINl2TYbZ7x/q5Auw7Y9G/jgOi9B6heoz1BX7fyPLRqR/GIvC3dqB2IHo8SrsCfWYAcm7YsQayL5AuVdM58XroUH1sO4c9KV+eBag2O8o5jf5PJMpvcM8DYLSlEucAwO75r8oX5wcQ+gvbNCetFRgBA0/LQyevPjlgIqU4smNqcLC2QnnqXgNDKpqxB0HEv7vKkuWij0h9J1+u7fzWFgB5fmRLkTmnAxyMKMSz+CgLEFtQ3Z/pvwnmNIiYYsAfpwGDzzAeOLwzgcAC4OQZxUMcCEbJntJArrWsLykf1TomlQ8g3IB3wdKpbdAAYOQG8q3tbBxlcaoW9M7y3bYAUQWio0itqFGaAiM5fcrfUE8zhQUPBwaFcfXYoMbQz9z2EQGCkzdqg37dpr+YwgEiSsZ2HVNXcQC0ZXYzzpV12/9mK4fpzRA5yxcW2Ty5dgcgT/hSCtMg8KzaWnejFP4iSS2+AA654IjRLweB159v5WT6cEHi5MVo35ajVTQHQ9sO3efyrnmETc10WgDs3vGE3QUMtoIW9RDIHyhxL3wmB4UBiV3wuHWrcYAilg2tQtH0TfLZmOW3z8jrseqBtkkCBdSCewpI5ZEcW5eDUqqpp0ACrL1mkuJ4ecvsR3B380ziP9qbh/lZ5LEAG7BdDAUE9PIBXEsWymFWaRgF4sxh5iP6CGNxANq5BK0KyoUwL48BWrCQbMfn4wJB5RlWaMvQdRVCycz6gXwlx/sAODIVrL8UAYAiFthdLObVYmYeGNRDg14MDwzk1ImAJSjOWSmlKM/ivb5QK1gwB5m6fLymHJ3n5n256+PVB3BZIZRhWDOSoNd169rmAgDDMDnRJm79AMqgGnnqi+/eXjSYMf9tCWvRDtKkEUUdrMsWknYPfrC2glRdVi+L5MfSmXfAg/WHGTwPMHIwNHrDljoQAq8viNeXOwFO8+weffp39LZ7419l61URuP/X6jQePb/4Ea6glZYOQ3r0GywWDa3ruvIXY1Zt6vboUyccJmiExwg8NhCflEFiTvwZmoS2fgLr35Xlo1fGWFNavQoKHRfguITdeARPBUdcANxRuALK6Hyehx4Q2H0zIVB5DTVDT1Dwh5V9gPXtjrjBHuhFjIHYWg9XgrwnoTTpEqxitSEZZXvP0tZBoVT3eVQ7nl/M9JLLtkjqbyT6vy3/aMdx24jwEr3OGEO/p8iExQswgO3Tt2w2XlUWwKTHG6XJmQdZVmjmq8qE8kDuNjQQBUCbbK1wXYc/k2KF6DMDuFs/DyB15U0b/xq3QUSS/932D29+4uZiDTeBY/3Jew8kGkg8EWMHSPQtWIHMYsu+nc7IB2mUaUi2bccin/lilg9OHjplmkUA4pauJew0aNNl107NQkI6/7/1H35t7SyWINCKid0n8jymAFL5dabew7t9eQN6IHRcDjptkfz+uFW7lqyUjo5yXZ9f5aFsCw6LJIwHI78EdMll16WVX0onAEq5swBBcUpwVtHtbnM6qBYee1ovn2y8rnr6SD+h3BschOLCHC3di04pbX1cXJB6Fh5bm4iSfdqHliF0//XvHOV41sbrpjZDD+kFgFLuvHn9tmxq/tQRCEA+gHgKiitIC7N+jNVXykqCBqQ7kP6QlKJ5G9uXl5e8F2mPUfw2xuJTcwMHyBwQ5SveHE/auCXu87v67yXPeOFds8XG+fK2E2STQp7HPoRo6tS/sX08r8t/Rx9moO3D1BmN2/ccoK0H3pkAqnbe3r9Jh7Lmr3G19I7+fj9jtXg5APoflMTv54qA9+rLtnRTvpbeDMDljq89qQDA/PoCclurjJTlQsQ3R9jBixMMPZtxpBWhx0LuL7kW6QpnmQgbua5Al3fWw7Y8ZZ2BBXDLI4QnLUT5vJ8FyzNmdq3DPJstrOaVxZzX8M/DpNWjYgeInvjpOpmyWvAYAsPiZq61g3P6J63bsoG1/Axi+d5p3uhhsohFC+aA0IanQbSDJrf8imvrPGSbZyP7+74yMQAaKb8tXA5TZxYdbiiumapzAQAIx8WuYiDqBlpqb8vRAoClFwYApSg256BYHwCZUOSkAJC/DAAFzcPO4u6Go5BtKRQ/BwPIYADQ8qyZXTMZZCcW+4UXF6OsyZDWFQ+8DqKKWTgAMhcI4wHAKLatE+wuCoC6LK5cDwCoACbKdxd9FgrGncUrnNtHv9M7h1I6l/8FAVO2ym5DPSIAAAAASUVORK5CYII=`,e.metaId=`d_2hxd99brRo`})),bh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=`ffffffff-ffff-ffff-ffff-ffffffffffff`})),xh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=`00000000-0000-0000-0000-000000000000`})),Sh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i})),Ch=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Sh();function n(e){return typeof e==`string`&&t.default.test(e)}e.default=n})),wh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ch();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);let n;return Uint8Array.of((n=parseInt(e.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(e.slice(9,13),16))>>>8,n&255,(n=parseInt(e.slice(14,18),16))>>>8,n&255,(n=parseInt(e.slice(19,23),16))>>>8,n&255,(n=parseInt(e.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}e.default=n})),Th=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unsafeStringify=void 0;var t=Ch(),n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));function r(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+`-`+n[e[t+4]]+n[e[t+5]]+`-`+n[e[t+6]]+n[e[t+7]]+`-`+n[e[t+8]]+n[e[t+9]]+`-`+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}e.unsafeStringify=r;function i(e,n=0){let i=r(e,n);if(!(0,t.default)(i))throw TypeError(`Stringified UUID is invalid`);return i}e.default=i})),Eh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t,n=new Uint8Array(16);function r(){if(!t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);t=crypto.getRandomValues.bind(crypto)}return t(n)}e.default=r})),Dh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.updateV1State=void 0;var t=Eh(),n=Th(),r={};function i(e,i,s){let c,l=e?._v6??!1;if(e){let t=Object.keys(e);t.length===1&&t[0]===`_v6`&&(e=void 0)}if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.nsecs,e.clockseq,e.node,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.nsecs,l?void 0:r.clockseq,l?void 0:r.node,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=(n[8]<<8|n[9])&16383),e.msecs=t,e}e.updateV1State=a;function o(e,t,n,r,i,a,o=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),n??=0,r??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=0xb1d069b5400;let s=((t&268435455)*1e4+n)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let c=t/4294967296*1e4&268435455;a[o++]=c>>>8&255,a[o++]=c&255,a[o++]=c>>>24&15|16,a[o++]=c>>>16&255,a[o++]=r>>>8|128,a[o++]=r&255;for(let e=0;e<6;++e)a[o++]=i[e];return a}e.default=i})),Oh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wh(),n=Th();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),kh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return n(i(a(e),e.length*8))}function n(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length*4;n++)t[n]=e[n>>2]>>>n%4*8&255;return t}function r(e){return(e+64>>>9<<4)+14+1}function i(e,t){let n=new Uint32Array(r(t)).fill(0);n.set(e),n[t>>5]|=128<<t%32,n[n.length-1]=t,e=n;let i=1732584193,a=-271733879,s=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){let n=i,r=a,p=s,m=c;i=l(i,a,s,c,e[t],7,-680876936),c=l(c,i,a,s,e[t+1],12,-389564586),s=l(s,c,i,a,e[t+2],17,606105819),a=l(a,s,c,i,e[t+3],22,-1044525330),i=l(i,a,s,c,e[t+4],7,-176418897),c=l(c,i,a,s,e[t+5],12,1200080426),s=l(s,c,i,a,e[t+6],17,-1473231341),a=l(a,s,c,i,e[t+7],22,-45705983),i=l(i,a,s,c,e[t+8],7,1770035416),c=l(c,i,a,s,e[t+9],12,-1958414417),s=l(s,c,i,a,e[t+10],17,-42063),a=l(a,s,c,i,e[t+11],22,-1990404162),i=l(i,a,s,c,e[t+12],7,1804603682),c=l(c,i,a,s,e[t+13],12,-40341101),s=l(s,c,i,a,e[t+14],17,-1502002290),a=l(a,s,c,i,e[t+15],22,1236535329),i=u(i,a,s,c,e[t+1],5,-165796510),c=u(c,i,a,s,e[t+6],9,-1069501632),s=u(s,c,i,a,e[t+11],14,643717713),a=u(a,s,c,i,e[t],20,-373897302),i=u(i,a,s,c,e[t+5],5,-701558691),c=u(c,i,a,s,e[t+10],9,38016083),s=u(s,c,i,a,e[t+15],14,-660478335),a=u(a,s,c,i,e[t+4],20,-405537848),i=u(i,a,s,c,e[t+9],5,568446438),c=u(c,i,a,s,e[t+14],9,-1019803690),s=u(s,c,i,a,e[t+3],14,-187363961),a=u(a,s,c,i,e[t+8],20,1163531501),i=u(i,a,s,c,e[t+13],5,-1444681467),c=u(c,i,a,s,e[t+2],9,-51403784),s=u(s,c,i,a,e[t+7],14,1735328473),a=u(a,s,c,i,e[t+12],20,-1926607734),i=d(i,a,s,c,e[t+5],4,-378558),c=d(c,i,a,s,e[t+8],11,-2022574463),s=d(s,c,i,a,e[t+11],16,1839030562),a=d(a,s,c,i,e[t+14],23,-35309556),i=d(i,a,s,c,e[t+1],4,-1530992060),c=d(c,i,a,s,e[t+4],11,1272893353),s=d(s,c,i,a,e[t+7],16,-155497632),a=d(a,s,c,i,e[t+10],23,-1094730640),i=d(i,a,s,c,e[t+13],4,681279174),c=d(c,i,a,s,e[t],11,-358537222),s=d(s,c,i,a,e[t+3],16,-722521979),a=d(a,s,c,i,e[t+6],23,76029189),i=d(i,a,s,c,e[t+9],4,-640364487),c=d(c,i,a,s,e[t+12],11,-421815835),s=d(s,c,i,a,e[t+15],16,530742520),a=d(a,s,c,i,e[t+2],23,-995338651),i=f(i,a,s,c,e[t],6,-198630844),c=f(c,i,a,s,e[t+7],10,1126891415),s=f(s,c,i,a,e[t+14],15,-1416354905),a=f(a,s,c,i,e[t+5],21,-57434055),i=f(i,a,s,c,e[t+12],6,1700485571),c=f(c,i,a,s,e[t+3],10,-1894986606),s=f(s,c,i,a,e[t+10],15,-1051523),a=f(a,s,c,i,e[t+1],21,-2054922799),i=f(i,a,s,c,e[t+8],6,1873313359),c=f(c,i,a,s,e[t+15],10,-30611744),s=f(s,c,i,a,e[t+6],15,-1560198380),a=f(a,s,c,i,e[t+13],21,1309151649),i=f(i,a,s,c,e[t+4],6,-145523070),c=f(c,i,a,s,e[t+11],10,-1120210379),s=f(s,c,i,a,e[t+2],15,718787259),a=f(a,s,c,i,e[t+9],21,-343485551),i=o(i,n),a=o(a,r),s=o(s,p),c=o(c,m)}return Uint32Array.of(i,a,s,c)}function a(e){if(e.length===0)return new Uint32Array;let t=new Uint32Array(r(e.length*8)).fill(0);for(let n=0;n<e.length;n++)t[n>>2]|=(e[n]&255)<<n%4*8;return t}function o(e,t){let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function s(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,i,a){return o(s(o(o(t,e),o(r,a)),i),n)}function l(e,t,n,r,i,a,o){return c(t&n|~t&r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return c(t&r|n&~r,e,t,i,a,o)}function d(e,t,n,r,i,a,o){return c(t^n^r,e,t,i,a,o)}function f(e,t,n,r,i,a,o){return c(n^(t|~r),e,t,i,a,o)}e.default=t})),Ah=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=e.stringToBytes=void 0;var t=wh(),n=Th();function r(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}e.stringToBytes=r,e.DNS=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,e.URL=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function i(e,i,a,o,s,c){let l=typeof a==`string`?r(a):a,u=typeof o==`string`?(0,t.default)(o):o;if(typeof o==`string`&&(o=(0,t.default)(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=i(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return(0,n.unsafeStringify)(d)}e.default=i})),jh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0;var t=kh(),n=Ah(),r=Ah();Object.defineProperty(e,"DNS",{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,"URL",{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(48,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Mh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}})),Nh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Mh(),n=Eh(),r=Th();function i(e,i,a){if(t.default.randomUUID&&!i&&!e)return t.default.randomUUID();e||={};let o=e.random??e.rng?.()??(0,n.default)();if(o.length<16)throw Error(`Random bytes length must be >= 16`);if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=o[e];return i}return(0,r.unsafeStringify)(o)}e.default=i})),Ph=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function n(e,t){return e<<t|e>>>32-t}function r(e){let r=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],a=new Uint8Array(e.length+1);a.set(e),a[e.length]=128,e=a;let o=e.length/4+2,s=Math.ceil(o/16),c=Array(s);for(let t=0;t<s;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];c[t]=n}c[s-1][14]=(e.length-1)*8/2**32,c[s-1][14]=Math.floor(c[s-1][14]),c[s-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<s;++e){let a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=c[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=i[0],s=i[1],l=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){let i=Math.floor(e/20),c=n(o,5)+t(i,s,l,u)+d+r[i]+a[e]>>>0;d=u,u=l,l=n(s,30)>>>0,s=o,o=c}i[0]=i[0]+o>>>0,i[1]=i[1]+s>>>0,i[2]=i[2]+l>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}e.default=r})),Fh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0;var t=Ph(),n=Ah(),r=Ah();Object.defineProperty(e,"DNS",{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,"URL",{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(80,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Ih=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Th(),n=Dh(),r=Oh();function i(e,i,a){e??={},a??=0;let o=(0,n.default)({...e,_v6:!0},new Uint8Array(16));if(o=(0,r.default)(o),i){if(a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;e++)i[a+e]=o[e];return i}return(0,t.unsafeStringify)(o)}e.default=i})),Lh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=wh(),n=Th();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),Rh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.updateV7State=void 0;var t=Eh(),n=Th(),r={};function i(e,i,s){let c;if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.seq,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.seq,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}e.updateV7State=a;function o(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}e.default=i})),zh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ch();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}e.default=n})),Bh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.validate=e.v7=e.v6ToV1=e.v6=e.v5=e.v4=e.v3=e.v1ToV6=e.v1=e.stringify=e.parse=e.NIL=e.MAX=void 0;var t=bh();Object.defineProperty(e,"MAX",{enumerable:!0,get:function(){return t.default}});var n=xh();Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return n.default}});var r=wh();Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.default}});var i=Th();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.default}});var a=Dh();Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return a.default}});var o=Oh();Object.defineProperty(e,"v1ToV6",{enumerable:!0,get:function(){return o.default}});var s=jh();Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return s.default}});var c=Nh();Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return c.default}});var l=Fh();Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return l.default}});var u=Ih();Object.defineProperty(e,"v6",{enumerable:!0,get:function(){return u.default}});var d=Lh();Object.defineProperty(e,"v6ToV1",{enumerable:!0,get:function(){return d.default}});var f=Rh();Object.defineProperty(e,"v7",{enumerable:!0,get:function(){return f.default}});var p=Ch();Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return p.default}});var m=zh();Object.defineProperty(e,"version",{enumerable:!0,get:function(){return m.default}})})),Vh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.BitcoinProvider=e.Keplr=e.EthereumProviderRpcError=void 0;var r=ph(),i=hh(),a=n(at()),o=n(J()),s=gh(),c=_h(),l=vh(),u=n(ee()),d=yh(),f=Bh(),p=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}};e.EthereumProviderRpcError=p,e.Keplr=class e{constructor(){this.enigmaUtils=new Map,this.version=l.BUILD_VERSION,this.mode=`extension`,this.defaultOptions={},this.ethereum=new h(this),this.starknet=void 0,this.bitcoin=new g(this)}static staticRequestMethod(e,t){let n=`ReactNativeWebView`in window,r=n?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=n?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:e,args:i.JSONUint8Array.wrap(t)};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})}requestMethod(t,n){return e.staticRequestMethod(t,n)}static getKeplr(n=1500){return t(this,void 0,void 0,function*(){yield m();let t=`ReactNativeWebView`in window,r=typeof navigator<`u`&&`userAgent`in navigator?navigator.userAgent.includes(`Firefox`):!1;if(!(!t&&!r&&window.keplrRequestMetaIdSupport==null))return new Promise((t,r)=>{let i=setTimeout(()=>{t(void 0)},n);e.staticRequestMethod(`ping`,[]).then(()=>{clearTimeout(i),t(new e)}).catch(n=>{(n?.message)?.includes(`Invalid method: ping`)?(clearTimeout(i),t(new e)):r(n)})})})}ping(){return t(this,void 0,void 0,function*(){yield this.requestMethod(`ping`,[])})}enable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`enable`,[e])})}disable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`disable`,[e])})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);e.features?.includes(`stargate`)||e.features?.includes(`no-legacy-stdTx`),yield this.requestMethod(`experimentalSuggestChain`,[e])})}getKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKey`,[e])})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKeysSettled`,[e])})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return`length`in n,yield this.requestMethod(`sendTx`,[e,n,r])})}signAmino(e,n,r,i={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signAmino`,[e,n,r,(0,a.default)(this.defaultOptions.sign??{},i)])})}signDirect(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirect`,[e,n,{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},(0,a.default)(this.defaultOptions.sign??{},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,authInfoBytes:s.authInfoBytes,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber)},signature:t.signature}})}signDirectAux(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirectAux`,[e,n,{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},(0,a.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,publicKey:s.publicKey||void 0,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber),sequence:o.default.fromString(s.sequence)},signature:t.signature}})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signArbitrary`,[e,n,r])})}signICNSAdr36(e,t,n,r,i){return this.requestMethod(`signICNSAdr36`,[e,t,n,r,i])}verifyArbitrary(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`verifyArbitrary`,[e,n,r,i])})}signEthereum(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signEthereum`,[e,n,r,i])})}getOfflineSigner(e,t){return new s.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new s.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new s.CosmJSOfflineSignerOnlyAmino(e,this,n):new s.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestToken`,[e,n,r])})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getSecret20ViewingKey`,[e,n])})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaPubKey`,[e])})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaTxEncryptionKey`,[e,n])})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaEncrypt`,[e,n,r])})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaDecrypt`,[e,n,r])})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new c.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,i,o={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`experimentalSignEIP712CosmosTx_v0`,[e,n,r,i,(0,a.default)(this.defaultOptions.sign??{},o)])})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfosWithoutEndpoints`,[])})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`changeKeyRingName`,[{defaultName:e,editable:n}])})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`sendEthereumTx`,[e,n])})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestERC20`,[e,n])})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfoWithoutEndpoints`,[e])})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKey`,[e])})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKeysSettled`,[e])})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetTx`,[e,n,r])})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetDeployAccountTransaction`,[e,n])})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKey`,[e])})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKeysSettled`,[e])})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbt`,[e,n,r])})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbts`,[e,n,r])})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__getAnalyticsId`,[])})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoWithdrawRewards`,[e,n,r])})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoDelegate`,[e,n,r])})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoExecuteCosmWasm`,[e,n,r])})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__webpageClosed`,[])})}};var m=()=>document.readyState===`complete`?Promise.resolve():new Promise(e=>{let t=n=>{n.target&&n.target.readyState===`complete`&&(e(),document.removeEventListener(`readystatechange`,t))};document.addEventListener(`readystatechange`,t)}),h=class e extends u.default{constructor(n){if(super(),this.keplr=n,this.eip6963ProviderInfo={uuid:(0,f.v4)(),name:`Keplr`,rdns:`app.keplr`,icon:`data:image/png;base64,${d.KeplrLogoBase64}`},this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.isKeplr=!0,this.isMetaMask=!0,this._isConnected=!1,this._currentChainId=null,this._initProviderState=()=>t(this,void 0,void 0,function*(){let t=yield e.requestMethod(`request`,{method:`keplr_initProviderState`});if(t){let{currentEvmChainId:e,currentChainId:n,selectedAddress:r}=t;n!=null&&e!=null&&r!=null&&(this._handleConnect(e),this._handleChainChanged(e),this._currentChainId=n,this._handleAccountsChanged(r))}}),this._initProviderState(),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){if(this._currentChainId&&(yield n.getChainInfoWithoutEndpoints(this._currentChainId))){let e=null;try{e=(yield n.getKey(this._currentChainId)).ethereumHexAddress}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}})),window.addEventListener(`keplr_chainChanged`,e=>{if(e.detail.origin===window.location.origin){let t=e.detail.evmChainId;this._handleChainChanged(t)}}),window.addEventListener(`keplr_ethSubscription`,e=>{let t=e.detail.origin,n=e.detail.providerId;if(t===window.location.origin&&n===this.eip6963ProviderInfo?.uuid){let t=e.detail.data;this.emit(`message`,{type:`eth_subscription`,data:t})}}),this.eip6963ProviderInfo){let e=new CustomEvent(r.EIP6963EventNames.Announce,{detail:Object.freeze({info:this.eip6963ProviderInfo,provider:this})});window.addEventListener(r.EIP6963EventNames.Request,()=>window.dispatchEvent(e)),window.dispatchEvent(e)}}static requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`ethereum`,args:i.JSONUint8Array.wrap(n),ethereumProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){let e=c.error;t(e.code&&!e.module?new p(e.code,e.message,e.data):Error(e));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}_handleConnect(e){return t(this,void 0,void 0,function*(){if(!this._isConnected){this._isConnected=!0;let t=`0x${e.toString(16)}`;this.emit(`connect`,{chainId:t})}})}_handleDisconnect(){return t(this,void 0,void 0,function*(){this._isConnected&&(yield e.requestMethod(`request`,{method:`keplr_disconnect`}),this._isConnected=!1,this.chainId=null,this.selectedAddress=null,this.networkVersion=null,this.emit(`disconnect`))})}_handleChainChanged(e){return t(this,void 0,void 0,function*(){let t=`0x${e.toString(16)}`;t!==this.chainId&&(this.chainId=t,this.networkVersion=e.toString(10),this.emit(`chainChanged`,t))})}_handleAccountsChanged(e){return t(this,void 0,void 0,function*(){this.selectedAddress!==e&&(this.selectedAddress=e,e?this.emit(`accountsChanged`,[e]):this.emit(`accountsChanged`,[]))})}isConnected(){return this._isConnected}request({method:n,params:r,chainId:i}){return t(this,void 0,void 0,function*(){if(typeof n!=`string`)throw Error("Invalid paramater: `method` must be a string");return this._isConnected||(yield this._initProviderState()),yield e.requestMethod(`request`,{method:n,params:r,providerId:this.eip6963ProviderInfo?.uuid,chainId:i})})}enable(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`eth_requestAccounts`})})}net_version(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`net_version`})})}},g=class e extends u.default{constructor(e){super(),this.keplr=e,this._handleNetworkChanged=e=>t(this,void 0,void 0,function*(){this.emit(`networkChanged`,e)}),this._handleAccountsChanged=e=>t(this,void 0,void 0,function*(){e&&e.length>0?(this.emit(`accountChanged`,e),this.emit(`accountsChanged`,e)):(this.emit(`accountChanged`,[``]),this.emit(`accountsChanged`,[``]))}),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)})),window.addEventListener(`keplr_bitcoinChainChanged`,e=>t(this,void 0,void 0,function*(){if(e.detail.origin===window.location.origin){let t=e.detail.network,n=null;try{n=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleNetworkChanged(t),this._handleAccountsChanged(n)}})),window.addEventListener(`keplr_bitcoinAccountsChanged`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}))}static _requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`bitcoin`,args:i.JSONUint8Array.wrap(n),bitcoinProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}getAccounts(){return e._requestMethod(`getAccounts`,[])}requestAccounts(){return t(this,void 0,void 0,function*(){return e._requestMethod(`requestAccounts`,[])})}disconnect(){return t(this,void 0,void 0,function*(){return e._requestMethod(`disconnect`,[])})}getNetwork(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getNetwork`,[])})}switchNetwork(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchNetwork`,[n])})}getChain(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getChain`,[])})}switchChain(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchChain`,[n])})}getPublicKey(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getPublicKey`,[])})}getBalance(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getBalance`,[])})}getInscriptions(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`getInscriptions`,[n,r])})}signMessage(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signMessage`,[n,r])})}sendBitcoin(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`sendBitcoin`,[n,r])})}pushTx(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushTx`,[n])})}pushPsbt(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushPsbt`,[n])})}signPsbt(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbt`,[n,r])})}signPsbts(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbts`,[n,r])})}getAddress(){return t(this,void 0,void 0,function*(){return(yield this.getAccounts())[0]})}connectWallet(){return t(this,void 0,void 0,function*(){return this.requestAccounts()})}};e.BitcoinProvider=g})),Hh=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrFallback=void 0;var n=Vh();e.KeplrFallback=class extends n.Keplr{constructor(e){super(),this.onKeplrNotDetected=e,this.isKeplrDetected=null,this.onKeplrNotDetected&&n.Keplr.getKeplr(500).then(e=>{var t;e||(t=this.onKeplrNotDetected)==null||t.call(this)})}requestMethod(e,r){return t(this,void 0,void 0,function*(){if(this.isKeplrDetected??((yield n.Keplr.getKeplr(500))?this.isKeplrDetected=!0:this.isKeplrDetected=!1),this.isKeplrDetected)return n.Keplr.staticRequestMethod(e,r);{let t=window.keplr;if(t)return t[e](...r);throw Error(`Can't detect keplr fallback`)}})}}})),Uh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Vh(),e),n(Hh(),e)})),Wh=a(((e,t)=>{var n=(function(e){var t=1e7,r=7,i=9007199254740992,a=p(i),o=`0123456789abcdefghijklmnopqrstuvwxyz`,s=typeof BigInt==`function`;function c(e,t,n,r){return e===void 0?c[0]:t===void 0||+t==10&&!n?z(e):pe(e,t,n,r)}function l(e,t){this.value=e,this.sign=t,this.isSmall=!1}l.prototype=Object.create(c.prototype);function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}u.prototype=Object.create(c.prototype);function d(e){this.value=e}d.prototype=Object.create(c.prototype);function f(e){return-i<e&&e<i}function p(e){return e<1e7?[e]:e<0x5af3107a4000?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/0x5af3107a4000)]}function m(e){h(e);var n=e.length;if(n<4&&F(e,a)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){for(var t=e.length;e[--t]===0;);e.length=t+1}function g(e){for(var t=Array(e),n=-1;++n<e;)t[n]=0;return t}function _(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(l=0;l<i;l++)c=e[l]+n[l]+o,o=+(c>=s),a[l]=c-o*s;for(;l<r;)c=e[l]+o,o=+(c===s),a[l++]=c-o*s;return o>0&&a.push(o),a}function y(e,t){return e.length>=t.length?v(e,t):v(t,e)}function b(e,n){var r=e.length,i=Array(r),a=t,o,s;for(s=0;s<r;s++)o=e[s]-a+n,n=Math.floor(o/a),i[s]=o-n*a,n+=1;for(;n>0;)i[s++]=n%a,n=Math.floor(n/a);return i}l.prototype.add=function(e){var t=z(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new l(b(n,Math.abs(r)),this.sign):new l(y(n,r),this.sign)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){var t=z(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new u(n+r);r=p(Math.abs(r))}return new l(b(r,Math.abs(n)),n<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(e){return new d(this.value+z(e).value)},d.prototype.plus=d.prototype.add;function x(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(c=0;c<i;c++)l=e[c]-o-n[c],l<0?(l+=s,o=1):o=0,a[c]=l;for(c=i;c<r;c++){if(l=e[c]-o,l<0)l+=s;else{a[c++]=l;break}a[c]=l}for(;c<r;c++)a[c]=e[c];return h(a),a}function S(e,t,n){var r;return F(e,t)>=0?r=x(e,t):(r=x(t,e),n=!n),r=m(r),typeof r==`number`?(n&&(r=-r),new u(r)):new l(r,n)}function C(e,n,r){var i=e.length,a=Array(i),o=-n,s=t,c,d;for(c=0;c<i;c++)d=e[c]+o,o=Math.floor(d/s),d%=s,a[c]=d<0?d+s:d;return a=m(a),typeof a==`number`?(r&&(a=-a),new u(a)):new l(a,r)}l.prototype.subtract=function(e){var t=z(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?C(n,Math.abs(r),this.sign):S(n,r,this.sign)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){var t=z(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new u(n-r):C(r,Math.abs(n),n>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(e){return new d(this.value-z(e).value)},d.prototype.minus=d.prototype.subtract,l.prototype.negate=function(){return new l(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},d.prototype.negate=function(){return new d(-this.value)},l.prototype.abs=function(){return new l(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function w(e,n){var r=e.length,i=n.length,a=g(r+i),o=t,s,c,l,u,d;for(l=0;l<r;++l){u=e[l];for(var f=0;f<i;++f)d=n[f],s=u*d+a[l+f],c=Math.floor(s/o),a[l+f]=s-c*o,a[l+f+1]+=c}return h(a),a}function T(e,n){var r=e.length,i=Array(r),a=t,o=0,s,c;for(c=0;c<r;c++)s=e[c]*n+o,o=Math.floor(s/a),i[c]=s-o*a;for(;o>0;)i[c++]=o%a,o=Math.floor(o/a);return i}function E(e,t){for(var n=[];t-- >0;)n.push(0);return n.concat(e)}function D(e,t){var n=Math.max(e.length,t.length);if(n<=30)return w(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),a=t.slice(n),o=t.slice(0,n),s=D(i,o),c=D(r,a),l=y(y(s,E(x(x(D(y(i,r),y(o,a)),s),c),n)),E(c,2*n));return h(l),l}function O(e,t){return-.012*e-.012*t+15e-6*e*t>0}l.prototype.multiply=function(e){var n=z(e),r=this.value,i=n.value,a=this.sign!==n.sign,o;if(n.isSmall){if(i===0)return c[0];if(i===1)return this;if(i===-1)return this.negate();if(o=Math.abs(i),o<t)return new l(T(r,o),a);i=p(o)}return O(r.length,i.length)?new l(D(r,i),a):new l(w(r,i),a)},l.prototype.times=l.prototype.multiply;function k(e,n,r){return e<t?new l(T(n,e),r):new l(w(n,p(e)),r)}u.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new u(e.value*this.value):k(Math.abs(e.value),p(Math.abs(this.value)),this.sign!==e.sign)},l.prototype._multiplyBySmall=function(e){return e.value===0?c[0]:e.value===1?this:e.value===-1?this.negate():k(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return z(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(e){return new d(this.value*z(e).value)},d.prototype.times=d.prototype.multiply;function A(e){var n=e.length,r=g(n+n),i=t,a,o,s,c,l;for(s=0;s<n;s++){c=e[s],o=0-c*c;for(var u=s;u<n;u++)l=e[u],a=c*l*2+r[s+u]+o,o=Math.floor(a/i),r[s+u]=a-o*i;r[s+n]=o}return h(r),r}l.prototype.square=function(){return new l(A(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return f(e)?new u(e):new l(A(p(Math.abs(this.value))),!1)},d.prototype.square=function(e){return new d(this.value*this.value)};function j(e,n){var r=e.length,i=n.length,a=t,o=g(n.length),s=n[i-1],c=Math.ceil(a/(2*s)),l=T(e,c),u=T(n,c),d,f,p,h,_,v,y;for(l.length<=r&&l.push(0),u.push(0),s=u[i-1],f=r-i;f>=0;f--){for(d=a-1,l[f+i]!==s&&(d=Math.floor((l[f+i]*a+l[f+i-1])/s)),p=0,h=0,v=u.length,_=0;_<v;_++)p+=d*u[_],y=Math.floor(p/a),h+=l[f+_]-(p-y*a),p=y,h<0?(l[f+_]=h+a,h=-1):(l[f+_]=h,h=0);for(;h!==0;){for(--d,p=0,_=0;_<v;_++)p+=l[f+_]-a+u[_],p<0?(l[f+_]=p+a,p=0):(l[f+_]=p,p=1);h+=p}o[f]=d}return l=N(l,c)[0],[m(o),m(l)]}function M(e,n){for(var r=e.length,i=n.length,a=[],o=[],s=t,c,l,u,d,f;r;){if(o.unshift(e[--r]),h(o),F(o,n)<0){a.push(0);continue}l=o.length,u=o[l-1]*s+o[l-2],d=n[i-1]*s+n[i-2],l>i&&(u=(u+1)*s),c=Math.ceil(u/d);do{if(f=T(n,c),F(f,o)<=0)break;c--}while(c);a.push(c),o=x(o,f)}return a.reverse(),[m(a),m(o)]}function N(e,n){var r=e.length,i=g(r),a=t,o,s,c=0,l;for(o=r-1;o>=0;--o)l=c*a+e[o],s=_(l/n),c=l-s*n,i[o]=s|0;return[i,c|0]}function P(e,n){var r,i=z(n);if(s)return[new d(e.value/i.value),new d(e.value%i.value)];var a=e.value,o=i.value,f;if(o===0)throw Error(`Cannot divide by zero`);if(e.isSmall)return i.isSmall?[new u(_(a/o)),new u(a%o)]:[c[0],e];if(i.isSmall){if(o===1)return[e,c[0]];if(o==-1)return[e.negate(),c[0]];var h=Math.abs(o);if(h<t){r=N(a,h),f=m(r[0]);var g=r[1];return e.sign&&(g=-g),typeof f==`number`?(e.sign!==i.sign&&(f=-f),[new u(f),new u(g)]):[new l(f,e.sign!==i.sign),new u(g)]}o=p(h)}var v=F(a,o);if(v===-1)return[c[0],e];if(v===0)return[c[e.sign===i.sign?1:-1],c[0]];r=a.length+o.length<=200?j(a,o):M(a,o),f=r[0];var y=e.sign!==i.sign,b=r[1],x=e.sign;return typeof f==`number`?(y&&(f=-f),f=new u(f)):f=new l(f,y),typeof b==`number`?(x&&(b=-b),b=new u(b)):b=new l(b,x),[f,b]}l.prototype.divmod=function(e){var t=P(this,e);return{quotient:t[0],remainder:t[1]}},d.prototype.divmod=u.prototype.divmod=l.prototype.divmod,l.prototype.divide=function(e){return P(this,e)[0]},d.prototype.over=d.prototype.divide=function(e){return new d(this.value/z(e).value)},u.prototype.over=u.prototype.divide=l.prototype.over=l.prototype.divide,l.prototype.mod=function(e){return P(this,e)[1]},d.prototype.mod=d.prototype.remainder=function(e){return new d(this.value%z(e).value)},u.prototype.remainder=u.prototype.mod=l.prototype.remainder=l.prototype.mod,l.prototype.pow=function(e){var t=z(e),n=this.value,r=t.value,i,a,o;if(r===0)return c[1];if(n===0)return c[0];if(n===1)return c[1];if(n===-1)return t.isEven()?c[1]:c[-1];if(t.sign)return c[0];if(!t.isSmall)throw Error(`The exponent `+t.toString()+` is too large.`);if(this.isSmall&&f(i=n**+r))return new u(_(i));for(a=this,o=c[1];r&!0&&(o=o.times(a),--r),r!==0;)r/=2,a=a.square();return o},u.prototype.pow=l.prototype.pow,d.prototype.pow=function(e){var t=z(e),n=this.value,r=t.value,i=BigInt(0),a=BigInt(1),o=BigInt(2);if(r===i)return c[1];if(n===i)return c[0];if(n===a)return c[1];if(n===BigInt(-1))return t.isEven()?c[1]:c[-1];if(t.isNegative())return new d(i);for(var s=this,l=c[1];(r&a)===a&&(l=l.times(s),--r),r!==i;)r/=o,s=s.square();return l},l.prototype.modPow=function(e,t){if(e=z(e),t=z(t),t.isZero())throw Error(`Cannot take modPow with modulus 0`);var n=c[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(c[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return c[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},d.prototype.modPow=u.prototype.modPow=l.prototype.modPow;function F(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}l.prototype.compareAbs=function(e){var t=z(e),n=this.value,r=t.value;return t.isSmall?1:F(n,r)},u.prototype.compareAbs=function(e){var t=z(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},d.prototype.compareAbs=function(e){var t=this.value,n=z(e).value;return t=t>=0?t:-t,n=n>=0?n:-n,t===n?0:t>n?1:-1},l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=z(e),n=this.value,r=t.value;return this.sign===t.sign?t.isSmall?this.sign?-1:1:F(n,r)*(this.sign?-1:1):t.sign?1:-1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=z(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0===t.sign?n<0?1:-1:n<0?-1:1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=z(e).value;return t===n?0:t>n?1:-1},d.prototype.compareTo=d.prototype.compare,l.prototype.equals=function(e){return this.compare(e)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals,l.prototype.notEquals=function(e){return this.compare(e)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals,l.prototype.greater=function(e){return this.compare(e)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater,l.prototype.lesser=function(e){return this.compare(e)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser,l.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals,l.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals,l.prototype.isEven=function(){return(this.value[0]&1)==0},u.prototype.isEven=function(){return(this.value&1)==0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},l.prototype.isOdd=function(){return(this.value[0]&1)==1},u.prototype.isOdd=function(){return(this.value&1)==1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},l.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,l.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,l.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},l.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},l.prototype.isDivisibleBy=function(e){var t=z(e);return t.isZero()?!1:t.isUnit()?!0:t.compareAbs(2)===0?this.isEven():this.mod(t).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=l.prototype.isDivisibleBy;function I(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(49))return!0}function L(e,t){for(var r=e.prev(),i=r,a=0,o,s,c;i.isEven();)i=i.divide(2),a++;next:for(s=0;s<t.length;s++)if(!e.lesser(t[s])&&(c=n(t[s]).modPow(i,e),!(c.isUnit()||c.equals(r)))){for(o=a-1;o!=0;o--){if(c=c.square().mod(e),c.isUnit())return!1;if(c.equals(r))continue next}return!1}return!0}l.prototype.isPrime=function(t){var r=I(this);if(r!==e)return r;var i=this.abs(),a=i.bitLength();if(a<=64)return L(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*a.toJSNumber(),s=Math.ceil(t===!0?2*o**2:o),c=[],l=0;l<s;l++)c.push(n(l+2));return L(i,c)},d.prototype.isPrime=u.prototype.isPrime=l.prototype.isPrime,l.prototype.isProbablePrime=function(t,r){var i=I(this);if(i!==e)return i;for(var a=this.abs(),o=t===e?5:t,s=[],c=0;c<o;c++)s.push(n.randBetween(2,a.minus(2),r));return L(a,s)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=l.prototype.isProbablePrime,l.prototype.modInv=function(e){for(var t=n.zero,r=n.one,i=z(e),a=this.abs(),o,s,c;!a.isZero();)o=i.divide(a),s=t,c=i,t=r,i=a,r=s.subtract(o.multiply(r)),a=c.subtract(o.multiply(a));if(!i.isUnit())throw Error(this.toString()+` and `+e.toString()+` are not co-prime`);return t.compare(0)===-1&&(t=t.add(e)),this.isNegative()?t.negate():t},d.prototype.modInv=u.prototype.modInv=l.prototype.modInv,l.prototype.next=function(){var e=this.value;return this.sign?C(e,1,this.sign):new l(b(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<i?new u(e+1):new l(a,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},l.prototype.prev=function(){var e=this.value;return this.sign?new l(b(e,1),!0):C(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-i?new u(e-1):new l(a,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var ee=R.length,te=R[ee-1];function ne(e){return Math.abs(e)<=t}l.prototype.shiftLeft=function(e){var t=z(e).toJSNumber();if(!ne(t))throw Error(String(t)+` is too large for shifting.`);if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=ee;)n=n.multiply(te),t-=ee-1;return n.multiply(R[t])},d.prototype.shiftLeft=u.prototype.shiftLeft=l.prototype.shiftLeft,l.prototype.shiftRight=function(e){var t,n=z(e).toJSNumber();if(!ne(n))throw Error(String(n)+` is too large for shifting.`);if(n<0)return this.shiftLeft(-n);for(var r=this;n>=ee;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;t=P(r,te),r=t[1].isNegative()?t[0].prev():t[0],n-=ee-1}return t=P(r,R[n]),t[1].isNegative()?t[0].prev():t[0]},d.prototype.shiftRight=u.prototype.shiftRight=l.prototype.shiftRight;function re(e,t,r){t=z(t);for(var i=e.isNegative(),a=t.isNegative(),o=i?e.not():e,s=a?t.not():t,c=0,l=0,u=null,d=null,f=[];!o.isZero()||!s.isZero();)u=P(o,te),c=u[1].toJSNumber(),i&&(c=te-1-c),d=P(s,te),l=d[1].toJSNumber(),a&&(l=te-1-l),o=u[0],s=d[0],f.push(r(c,l));for(var p=r(+!!i,+!!a)===0?n(0):n(-1),m=f.length-1;m>=0;--m)p=p.multiply(te).add(n(f[m]));return p}l.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=l.prototype.not,l.prototype.and=function(e){return re(this,e,function(e,t){return e&t})},d.prototype.and=u.prototype.and=l.prototype.and,l.prototype.or=function(e){return re(this,e,function(e,t){return e|t})},d.prototype.or=u.prototype.or=l.prototype.or,l.prototype.xor=function(e){return re(this,e,function(e,t){return e^t})},d.prototype.xor=u.prototype.xor=l.prototype.xor;var ie=1<<30,ae=(t&-t)*(t&-t)|ie;function oe(e){var n=e.value,r=typeof n==`number`?n|ie:typeof n==`bigint`?n|BigInt(ie):n[0]+n[1]*t|ae;return r&-r}function se(e,t){if(t.compareTo(e)<=0){var r=se(e,t.square(t)),i=r.p,a=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:a*2+1}:{p:i,e:a*2}}return{p:n(1),e:0}}l.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),e.compareTo(n(0))===0?n(0):n(se(e,n(2)).e).add(n(1))},d.prototype.bitLength=u.prototype.bitLength=l.prototype.bitLength;function ce(e,t){return e=z(e),t=z(t),e.greater(t)?e:t}function le(e,t){return e=z(e),t=z(t),e.lesser(t)?e:t}function ue(e,t){if(e=z(e).abs(),t=z(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n=c[1],r,i;e.isEven()&&t.isEven();)r=le(oe(e),oe(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(oe(e));do{for(;t.isEven();)t=t.divide(oe(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function de(e,t){return e=z(e).abs(),t=z(t).abs(),e.divide(ue(e,t)).multiply(t)}function fe(e,n,r){e=z(e),n=z(n);var i=r||Math.random,a=le(e,n),o=ce(e,n).subtract(a).add(1);if(o.isSmall)return a.add(Math.floor(i()*o));for(var s=ge(o,t).value,l=[],u=!0,d=0;d<s.length;d++){var f=u?s[d]+(d+1<s.length?s[d+1]/t:0):t,p=_(i()*f);l.push(p),p<s[d]&&(u=!1)}return a.add(c.fromArray(l,t,!1))}var pe=function(e,t,n,r){n||=o,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var i=e.length,a,s=Math.abs(t),c={};for(a=0;a<n.length;a++)c[n[a]]=a;for(a=0;a<i;a++){var l=e[a];if(l!==`-`&&l in c&&c[l]>=s){if(l===`1`&&s===1)continue;throw Error(l+` is not a valid digit in base `+t+`.`)}}t=z(t);var u=[],d=e[0]===`-`;for(a=+!!d;a<e.length;a++){var l=e[a];if(l in c)u.push(z(c[l]));else if(l===`<`){var f=a;do a++;while(e[a]!==`>`&&a<e.length);u.push(z(e.slice(f+1,a)))}else throw Error(l+` is not a valid character`)}return me(u,t,d)};function me(e,t,n){var r=c[0],i=c[1],a;for(a=e.length-1;a>=0;a--)r=r.add(e[a].times(i)),i=i.times(t);return n?r.negate():r}function he(e,t){return t||=o,e<t.length?t[e]:`<`+e+`>`}function ge(e,t){if(t=n(t),t.isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw Error(`Cannot convert nonzero numbers to base 0.`)}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var a=[],o=e,s;o.isNegative()||o.compareAbs(t)>=0;){s=o.divmod(t),o=s.quotient;var c=s.remainder;c.isNegative()&&(c=t.minus(c).abs(),o=o.next()),a.push(c.toJSNumber())}return a.push(o.toJSNumber()),{value:a.reverse(),isNegative:i}}function _e(e,t,n){var r=ge(e,t);return(r.isNegative?`-`:``)+r.value.map(function(e){return he(e,n)}).join(``)}l.prototype.toArray=function(e){return ge(this,e)},u.prototype.toArray=function(e){return ge(this,e)},d.prototype.toArray=function(e){return ge(this,e)},l.prototype.toString=function(t,n){if(t===e&&(t=10),t!==10||n)return _e(this,t,n);for(var r=this.value,i=r.length,a=String(r[--i]),o=`0000000`,s;--i>=0;)s=String(r[i]),a+=o.slice(s.length)+s;return(this.sign?`-`:``)+a},u.prototype.toString=function(t,n){return t===e&&(t=10),t!=10||n?_e(this,t,n):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=l.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},l.prototype.valueOf=function(){return parseInt(this.toString(),10)},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function ve(e){if(f(+e)){var t=+e;if(t===_(t))return s?new d(BigInt(t)):new u(t);throw Error(`Invalid integer: `+e)}var n=e[0]===`-`;n&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw Error(`Invalid integer: `+i.join(`e`));if(i.length===2){var a=i[1];if(a[0]===`+`&&(a=a.slice(1)),a=+a,a!==_(a)||!f(a))throw Error(`Invalid integer: `+a+` is not a valid exponent.`);var o=i[0],c=o.indexOf(`.`);if(c>=0&&(a-=o.length-c-1,o=o.slice(0,c)+o.slice(c+1)),a<0)throw Error(`Cannot include negative exponent part for integers`);o+=Array(a+1).join(`0`),e=o}if(!/^([0-9][0-9]*)$/.test(e))throw Error(`Invalid integer: `+e);if(s)return new d(BigInt(n?`-`+e:e));for(var p=[],m=e.length,g=r,v=m-g;m>0;)p.push(+e.slice(v,m)),v-=g,v<0&&(v=0),m-=g;return h(p),new l(p,n)}function ye(e){if(s)return new d(BigInt(e));if(f(e)){if(e!==_(e))throw Error(e+` is not an integer.`);return new u(e)}return ve(e.toString())}function z(e){return typeof e==`number`?ye(e):typeof e==`string`?ve(e):typeof e==`bigint`?new d(e):e}for(var be=0;be<1e3;be++)c[be]=z(be),be>0&&(c[-be]=z(-be));return c.one=c[1],c.zero=c[0],c.minusOne=c[-1],c.max=ce,c.min=le,c.gcd=ue,c.lcm=de,c.isInstance=function(e){return e instanceof l||e instanceof u||e instanceof d},c.randBetween=fe,c.fromArray=function(e,t,n){return me(e.map(z),z(t||10),n)},c})();t!==void 0&&t.hasOwnProperty(`exports`)&&(t.exports=n),typeof define==`function`&&define.amd&&define(function(){return n})})),Gh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.exponentDecStringToDecString=e.isExponentDecString=e.isValidDecimalString=e.isValidIntegerString=void 0;var t=/^-?\d+$/,n=/^-?\d+.?\d*$/,r=/^(-?)([\d.]+)e([-+])([\d]+)$/;function i(e){return t.test(e)}e.isValidIntegerString=i;function a(e){return n.test(e)}e.isValidDecimalString=a;function o(e){return r.test(e)}e.isExponentDecString=o;function s(e){let t=``;for(let n=0;n<e;n++)t+=`0`;return t}function c(e){for(;e.length>0&&e[0]===`0`;)e=e.slice(1);return e.length===0||e[0]===`.`?`0`+e:e}function l(e){let t=e.split(r);if(t.length!==6)return e;let n=t[1]===`-`,i=t[2],a=i.indexOf(`.`),o=t[4],l=parseInt(o)*(t[3]===`-`?-1:1);if(a>=0){let e=i.length-a-1;l-=e,i=c(i.replace(`.`,``))}let u=n?`-`:``;if(l<0){if(i.length>-l){let e=i.length+l;return u+(i.slice(0,e)+`.`+i.slice(e))}return u+`0.`+s(-(i.length+l))+i}else return u+i+s(l)}e.exponentDecStringToDecString=l})),Kh=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uint=e.Int=void 0;var n=t(Wh()),r=Gh(),i=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.int=(0,n.default)(e)}else this.int=(0,n.default)(e);this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxInt))throw Error(`Integer out of range ${this.int.toString()}`)}toString(){return this.int.toString(10)}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}isZero(){return this.int.eq((0,n.default)(0))}equals(e){return this.int.equals(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.greaterOrEquals(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.lesserOrEquals(e.int)}abs(){return new e(this.int.abs())}absUInt(){return new a(this.int.abs())}add(t){return new e(this.int.add(t.int))}sub(t){return new e(this.int.subtract(t.int))}mul(t){return new e(this.int.multiply(t.int))}div(t){return new e(this.int.divide(t.int))}mod(t){return new e(this.int.mod(t.int))}neg(){return new e(this.int.negate())}pow(t){return new e(this.int.pow(t.toBigNumber()))}toBigNumber(){return this.int}};e.Int=i,i.maxInt=(0,n.default)(`115792089237316195423570985008687907853269984665640564039457584007913129639935`);var a=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.uint=(0,n.default)(e)}else this.uint=(0,n.default)(e);if(this.uint.isNegative())throw TypeError(`Uint should not be negative`);this.checkBitLen()}checkBitLen(){if(this.uint.abs().bitLength().gt(256))throw Error(`Integer out of range ${this.uint.toString()}`)}toString(){return this.uint.toString(10)}isZero(){return this.uint.eq((0,n.default)(0))}equals(e){return this.uint.equals(e.uint)}gt(e){return this.uint.gt(e.uint)}gte(e){return this.uint.greaterOrEquals(e.uint)}lt(e){return this.uint.lt(e.uint)}lte(e){return this.uint.lesserOrEquals(e.uint)}add(t){return new e(this.uint.add(t.uint))}sub(t){return new e(this.uint.subtract(t.uint))}mul(t){return new e(this.uint.multiply(t.uint))}div(t){return new e(this.uint.divide(t.uint))}mod(t){return new e(this.uint.mod(t.uint))}pow(t){return new e(this.uint.pow(t.toBigNumber()))}toBigNumber(){return this.uint}};e.Uint=a})),qh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integerStringToUSLocaleString=void 0;function t(e){if(e.indexOf(`.`)>=0)throw Error(`${e} is not integer`);if(typeof BigInt<`u`)return BigInt(e).toLocaleString(`en-US`);let t=e,n=[];for(let e=t.length;e>0;e-=3)n.push(t.slice(Math.max(0,e-3),e));return n.reverse().join(`,`)}e.integerStringToUSLocaleString=t})),Jh=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Dec=void 0;var n=t(Wh()),r=Kh(),i=Gh(),a=qh(),o=class e{static calcPrecisionMultiplier(t){if(t<0)throw Error(`Invalid prec`);if(t>e.precision)throw Error(`Too much precision`);let r=t.toString(),i=e.precisionMultipliers.get(r);if(i)return i;let a=e.precision-t,o=(0,n.default)(10).pow(a);return e.precisionMultipliers.set(r,o),o}static reduceDecimalsFromString(t){let n=t.indexOf(`.`);if(n<0)return{res:t,isDownToZero:!1};let r=t.length-1-n-e.precision;if(r<=0)return{res:t,isDownToZero:!1};let i=t.slice(0,t.length-r);return{res:i,isDownToZero:/^[0.]*$/.test(i)}}constructor(t,a=0){if(typeof t==`number`&&(t=t.toString()),typeof t==`string`){if(t.length===0)throw Error(`empty string`);if(!(0,i.isValidDecimalString)(t))if((0,i.isExponentDecString)(t))t=(0,i.exponentDecStringToDecString)(t);else throw Error(`invalid decimal: ${t}`);let r=e.reduceDecimalsFromString(t);r.isDownToZero,t=r.res,t.indexOf(`.`)>=0&&(a=t.length-t.indexOf(`.`)-1,t=t.replace(`.`,``)),this.int=(0,n.default)(t)}else t instanceof r.Int||t instanceof r.Uint?this.int=(0,n.default)(t.toString()):this.int=(0,n.default)(t);this.int=this.int.multiply(e.calcPrecisionMultiplier(a)),this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxDec))throw Error(`Integer out of range ${this.int.toString()}`)}isZero(){return this.int.eq((0,n.default)(0))}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}equals(e){return this.int.eq(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.geq(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.leq(e.int)}neg(){return new e(this.int.negate(),e.precision)}abs(){return new e(this.int.abs(),e.precision)}add(t){return new e(this.int.add(t.int),e.precision)}sub(t){return new e(this.int.subtract(t.int),e.precision)}pow(t){if(t.isZero())return new e(1);if(t.isNegative())return new e(1).quo(this.pow(t.abs()));let n=new e(this.int,e.precision),i=new e(1);for(let e=t;e.gt(new r.Int(1));e=e.div(new r.Int(2)))e.mod(new r.Int(2)).isZero()||(i=i.mul(n)),n=n.mul(n);return n.mul(i)}approxSqrt(){return this.approxRoot(2)}approxRoot(t,n=300){if(this.isNegative())return this.neg().approxRoot(t).neg();if(t===1||this.isZero()||this.equals(e.one))return this;if(t===0)return e.one;let[i,a]=[e.one,e.one];for(let o=0;a.abs().gt(e.smallestDec)&&o<n;o++){let n=i.pow(new r.Int(t-1));n.isZero()&&(n=e.smallestDec),a=this.quo(n),a=a.sub(i),a=a.quoTruncate(new e(t)),i=i.add(a)}return i}mul(t){return new e(this.mulRaw(t).chopPrecisionAndRound(),e.precision)}mulTruncate(t){return new e(this.mulRaw(t).chopPrecisionAndTruncate(),e.precision)}mulRoundUp(t){return new e(this.mulRaw(t).chopPrecisionAndRoundUp(),e.precision)}mulRaw(t){return new e(this.int.multiply(t.int),e.precision)}quo(t){return new e(this.quoRaw(t).chopPrecisionAndRound(),e.precision)}quoTruncate(t){return new e(this.quoRaw(t).chopPrecisionAndTruncate(),e.precision)}quoRoundUp(t){return new e(this.quoRaw(t).chopPrecisionAndRoundUp(),e.precision)}quoRaw(t){let n=e.calcPrecisionMultiplier(0);return new e(this.int.multiply(n).multiply(n).divide(t.int),e.precision)}isInteger(){let t=e.calcPrecisionMultiplier(0);return this.int.remainder(t).equals((0,n.default)(0))}chopPrecisionAndRound(){if(this.isNegative())return this.abs().chopPrecisionAndRound().negate();let t=e.calcPrecisionMultiplier(0),r=t.divide((0,n.default)(2)),{quotient:i,remainder:a}=this.int.divmod(t);return a.equals((0,n.default)(0))||a.lt(r)?i:a.gt(r)?i.add((0,n.default)(1)):i.divide((0,n.default)(2)).equals((0,n.default)(0))?i:i.add((0,n.default)(1))}chopPrecisionAndRoundUp(){if(this.isNegative())return this.abs().chopPrecisionAndTruncate().negate();let t=e.calcPrecisionMultiplier(0),{quotient:r,remainder:i}=this.int.divmod(t);return i.equals((0,n.default)(0))?r:r.add((0,n.default)(1))}chopPrecisionAndTruncate(){let t=e.calcPrecisionMultiplier(0);return this.int.divide(t)}toString(t=e.precision,r=!1){let i=e.calcPrecisionMultiplier(0),{quotient:o,remainder:s}=this.int.abs().divmod(i),c=s.toString(10);for(let t=0,n=c.length;t<e.precision-n;t++)c=`0`+c;c=c.substring(0,t);let l=this.isNegative()&&!(o.eq((0,n.default)(0))&&c.length===0),u=r?(0,a.integerStringToUSLocaleString)(o.toString()):o.toString();return`${l?`-`:``}${u}${c.length>0?`.`+c:``}`}round(){return new r.Int(this.chopPrecisionAndRound())}roundUp(){return new r.Int(this.chopPrecisionAndRoundUp())}truncate(){return new r.Int(this.chopPrecisionAndTruncate())}roundDec(){return new e(this.chopPrecisionAndRound(),0)}roundUpDec(){return new e(this.chopPrecisionAndRoundUp(),0)}truncateDec(){return new e(this.chopPrecisionAndTruncate(),0)}};e.Dec=o,o.precision=18,o.decimalPrecisionBits=60,o.maxDec=(0,n.default)(`133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535`),o.precisionMultipliers=new Map,o.zero=new o(0),o.smallestDec=new o(`1`,o.precision),o.one=new o(1),r.Int.prototype.toDec=function(){return new o(this)},r.Uint.prototype.toDec=function(){return new o(this)}})),Yh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DecUtils=void 0;var t=Jh(),n=Kh(),r=class e{static trim(e){let t=typeof e==`string`?e:e.toString();if(t.indexOf(`.`)<0)return t;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)t=t.slice(0,e);return t.length>0&&t[t.length-1]===`.`&&(t=t.slice(0,t.length-1)),t}static getTenExponentN(r){if(r<-t.Dec.precision)throw Error(`Too little precision`);if(e.tenExponentNs[r.toString()])return e.tenExponentNs[r.toString()];let i=new t.Dec(10).pow(new n.Int(r));return e.tenExponentNs[r.toString()]=i,i}static getTenExponentNInPrecisionRange(n){if(n>t.Dec.precision)throw Error(`Too much precision`);return e.getTenExponentN(n)}static getPrecisionDec(t){return e.getTenExponentNInPrecisionRange(t)}};e.DecUtils=r,r.tenExponentNs={}})),Xh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Coin=void 0;var t=Kh();e.Coin=class e{static parse(t){let n=RegExp(`([0-9]+)[ ]*([a-zA-Z]+)$`).exec(t);if(!n||n.length!==3)throw Error(`Invalid coin str`);let r=n[2],i=n[1];return new e(r,i)}constructor(e,n){this.denom=e,this.amount=n instanceof t.Int?n:new t.Int(n)}toString(){return`${this.amount.toString()}${this.denom}`}}})),Zh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoinUtils=void 0;var t=Xh(),n=Kh(),r=Jh(),i=Yh(),a=qh(),o=class e{static createCoinsFromPrimitives(e){return e.map(e=>new t.Coin(e.denom,e.amount))}static amountOf(e,t){let r=e.find(e=>e.denom===t);return r?r.amount:new n.Int(0)}static exclude(e,t){return e.filter(e=>t.indexOf(e.denom)===0)}static concat(...e){return e.length===0?[]:e.slice().reduce((e,n)=>{let r=e.find(e=>e.denom===n.denom);if(r){let i=new t.Coin(r.denom,r.amount.add(n.amount));e.push(i)}else{let r=new t.Coin(n.denom,n.amount);e.push(r)}return e},[])}static getCoinFromDecimals(e,n,i){let a=e.find(e=>e.coinDenom===i);if(!a)throw Error(`Invalid currency`);let o=new r.Dec(1);for(let e=0;e<a.coinDecimals;e++)o=o.mul(new r.Dec(10));let s=new r.Dec(n);if(s=s.mul(o),!new r.Dec(s.truncate()).equals(s))throw Error(`Can't divide anymore`);return new t.Coin(a.coinMinimalDenom,s.truncate())}static parseDecAndDenomFromCoin(e,t){let n=e.find(e=>e.coinMinimalDenom===t.denom);n||={coinDecimals:0,coinDenom:t.denom,coinMinimalDenom:t.denom};let i=new r.Dec(1);for(let e=0;e<n.coinDecimals;e++)i=i.mul(new r.Dec(10));return{amount:new r.Dec(t.amount).quoTruncate(i).toString(n.coinDecimals),denom:n.coinDenom}}static shrinkDecimals(t,n,i,a=!1){if(t.equals(new r.Dec(0)))return`0`;let o=t.isNegative(),s=t.abs().truncate(),c=t.abs().sub(new r.Dec(s)),l=Math.max(i-s.toString().length+1,n),u=l===0?``:c.toString(l).replace(`0.`,``),d=a?e.integerStringToUSLocaleString(s.toString()):s.toString();return(o?`-`:``)+d+(u.length>0?`.`:``)+u}static coinToTrimmedString(e,t,n=` `){let a=new r.Dec(e.amount).quoTruncate(i.DecUtils.getPrecisionDec(t.coinDecimals));return`${i.DecUtils.trim(a)}${n}${t.coinDenom}`}};e.CoinUtils=o,o.integerStringToUSLocaleString=a.integerStringToUSLocaleString})),Qh=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntPretty=void 0;var t=Kh(),n=Jh(),r=Yh(),i=Zh();e.IntPretty=class e{constructor(e){if(this.floatingDecimalPointRight=0,this._options={maxDecimals:0,trim:!1,shrink:!1,ready:!0,locale:!0,inequalitySymbol:!1,inequalitySymbolSeparator:` `},typeof e==`object`&&`toDec`in e?e=e.toDec():e instanceof n.Dec||(e=new n.Dec(e)),e.isZero()){this.dec=e;return}let r=e,i=0;for(let e=0;e<18&&!(!r.truncate().equals(new t.Int(0))&&r.equals(new n.Dec(r.truncate())));e++)r=r.mul(new n.Dec(10)),i++;this.dec=e,this._options.maxDecimals=i}get options(){return this._options}moveDecimalPointLeft(e){let t=this.clone();return t.floatingDecimalPointRight+=-e,t}moveDecimalPointRight(e){let t=this.clone();return t.floatingDecimalPointRight+=e,t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t._options.maxDecimals=e,t}inequalitySymbol(e){let t=this.clone();return t._options.inequalitySymbol=e,t}inequalitySymbolSeparator(e){let t=this.clone();return t._options.inequalitySymbolSeparator=e,t}trim(e){let t=this.clone();return t._options.trim=e,t}shrink(e){let t=this.clone();return t._options.shrink=e,t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t._options.ready=e,t}get isReady(){return this._options.ready}add(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().add(t));return r._options=Object.assign({},this._options),r}sub(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().sub(t));return r._options=Object.assign({},this._options),r}mul(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().mul(t));return r._options=Object.assign({},this._options),r}quo(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().quo(t));return r._options=Object.assign({},this._options),r}toDec(){if(this.floatingDecimalPointRight===0)return this.dec;if(this.floatingDecimalPointRight>0)return this.dec.mulTruncate(r.DecUtils.getTenExponentN(this.floatingDecimalPointRight));{let e=-this.floatingDecimalPointRight,t=this.dec;for(;e>0;)if(e>=n.Dec.precision)t=t.mulTruncate(r.DecUtils.getTenExponentN(-n.Dec.precision)),e-=n.Dec.precision;else{t=t.mulTruncate(r.DecUtils.getTenExponentN(-(e%n.Dec.precision)));break}return t}}toString(){return this.toStringWithSymbols(``,``)}toStringWithSymbols(e,t){let n=this.toDec();if(this._options.inequalitySymbol&&!n.isZero()&&n.abs().lt(r.DecUtils.getTenExponentN(-this._options.maxDecimals))){let i=n.isNegative();return`${i?`>`:`<`}${this._options.inequalitySymbolSeparator}${i?`-`:``}${e}${r.DecUtils.getTenExponentN(-this._options.maxDecimals).toString(this._options.maxDecimals,this._options.locale)}${t}`}let a;a=this._options.shrink?i.CoinUtils.shrinkDecimals(n,0,this._options.maxDecimals,this._options.locale):n.toString(this._options.maxDecimals,this._options.locale),this._options.trim&&(a=r.DecUtils.trim(a));let o=a.charAt(0)===`-`;return o&&(a=a.slice(1)),`${o?`-`:``}${e}${a}${t}`}clone(){let t=new e(this.dec);return t.dec=this.dec,t.floatingDecimalPointRight=this.floatingDecimalPointRight,t._options=Object.assign({},this._options),t}}})),$h=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CoinPretty=void 0;var t=Qh(),n=Jh(),r=Yh();e.CoinPretty=class e{constructor(e,i){this._currency=e,this._options={separator:` `,upperCase:!1,lowerCase:!1,hideDenom:!1,hideIBCMetadata:!1},typeof i==`object`&&`toDec`in i?i=i.toDec():i instanceof n.Dec||(i=new n.Dec(i)),this.intPretty=new t.IntPretty(i.quoTruncate(r.DecUtils.getTenExponentNInPrecisionRange(e.coinDecimals))).maxDecimals(e.coinDecimals)}get options(){return Object.assign(Object.assign({},this._options),this.intPretty.options)}get denom(){return this.currency.coinDenom}get currency(){return this._currency}setCurrency(e){let t=this.clone();return t.intPretty=this.intPretty.moveDecimalPointRight(this._currency.coinDecimals-e.coinDecimals),t._currency=e,t}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}hideDenom(e){let t=this.clone();return t._options.hideDenom=e,t}hideIBCMetadata(e){let t=this.clone();return t._options.hideIBCMetadata=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.add(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}sub(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.sub(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toCoin(){let e=this.toDec().mulTruncate(r.DecUtils.getTenExponentNInPrecisionRange(this.currency.coinDecimals)).truncate();return{denom:this.currency.coinMinimalDenom,amount:e.toString()}}toString(){let e=this.denom;this._options.hideIBCMetadata&&`originCurrency`in this.currency&&this.currency.originCurrency&&(e=this.currency.originCurrency.coinDenom),this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this._options.separator;return this._options.hideDenom&&(e=``,t=``),this.intPretty.toStringWithSymbols(``,`${t}${e}`)}clone(){let t=new e(this._currency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),eg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PricePretty=void 0;var t=Qh(),n=Yh();e.PricePretty=class e{constructor(e,n){this._fiatCurrency=e,this._options={separator:``,upperCase:!1,lowerCase:!1,locale:`en-US`},this.intPretty=new t.IntPretty(n).maxDecimals(e.maxDecimals).shrink(!0).trim(!0).locale(!1).inequalitySymbol(!0),this._options.locale=e.locale}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}get symbol(){return this._fiatCurrency.symbol}get fiatCurrency(){return this._fiatCurrency}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){let e=this.symbol;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this.toDec(),r=this.options;if(r.inequalitySymbol&&!t.isZero()&&t.abs().lt(n.DecUtils.getTenExponentN(-r.maxDecimals)))return this.intPretty.toStringWithSymbols(`${e}${this._options.separator}`,``);let i=parseFloat(this.intPretty.toString()).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals}),a=i.charAt(0)===`-`;return a&&(i=i.slice(1)),`${a?`-`:``}${e}${this._options.separator}${i}`}clone(){let t=new e(this._fiatCurrency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),tg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RatePretty=void 0;var t=Qh();e.RatePretty=class e{constructor(e){this._options={separator:``,symbol:`%`},this.intPretty=new t.IntPretty(e),this.intPretty=this.intPretty.maxDecimals(3).shrink(!1).trim(!0).locale(!0).inequalitySymbol(!0)}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}separator(e){let t=this.clone();return t._options.separator=e,t}symbol(e){let t=this.clone();return t._options.symbol=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){return this.intPretty.moveDecimalPointRight(2).toStringWithSymbols(``,`${this._options.separator}${this._options.symbol}`)}clone(){let t=new e(0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),ng=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Qh(),e),n($h(),e),n(Xh(),e),n(Kh(),e),n(Jh(),e),n(Zh(),e),n(Yh(),e),n(eg(),e),n(tg(),e)})),rg=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSimpleFetchError=e.SimpleFetchError=void 0;var t=class e extends Error{constructor(t,n,r){super(`Failed to get response from ${new URL(n,t).toString()}`),this.baseURL=t,this.url=n,this.response=r,Object.setPrototypeOf(this,e.prototype)}};e.SimpleFetchError=t;function n(e){return e instanceof t}e.isSimpleFetchError=n})),ig=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.simpleFetch=e.makeURL=void 0;var r=rg();function i(e,t){let n=new URL(e);return e=o(n.origin),t=o(n.pathname)+`/`+a(t),o(e+`/`+a(t))}e.makeURL=i;function a(e){return e.length>0&&e[0]===`/`?e.slice(1):e}function o(e){return e.length>0&&e[e.length-1]===`/`?e.slice(0,e.length-1):e}function s(e,a,o){return t(this,void 0,void 0,function*(){typeof a!=`string`&&(a&&(o=a),a=``),a===`/`&&(a=``);let t=i(e,a),s=o||{},{headers:l}=s,u=n(s,[`headers`]),d=yield fetch(t,Object.assign({headers:Object.assign({accept:`application/json, text/plain, */*`},l)},u)),f;if((d.headers.get(`content-type`)||``).startsWith(`application/json`))f=yield d.json();else{let e=yield d.text(),t=e.trim();f=t.startsWith(`{`)&&t.endsWith(`}`)?JSON.parse(t):e}let p={url:t,data:f,headers:d.headers,status:d.status,statusText:d.statusText};if(!(o?.validateStatus||c)(d.status))throw new r.SimpleFetchError(e,a,p);return p})}e.simpleFetch=s;function c(e){return e===200}})),ag=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),og=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(ig(),e),n(rg(),e),n(ag(),e)})),sg=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseAccount=void 0;var n=ng(),r=og();e.BaseAccount=class e{static fetchFromRest(n,i,a=!1){return t(this,void 0,void 0,function*(){let t=yield(0,r.simpleFetch)(n,`/cosmos/auth/v1beta1/accounts/${i}`,{validateStatus:function(e){return e>=200&&e<300||e===404}});return e.fromProtoJSON(t.data,a?i:``)})}static fromProtoJSON(t,r=``){if(!t.account){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);return new e(``,r,new n.Int(0),new n.Int(0))}let i=t.account,a=i[`@type`]||``,o=i.BaseAccount||i.baseAccount||i.base_account;o&&(i=o);let s=i.account;s&&(i=s);let c=i.BaseVestingAccount||i.baseVestingAccount||i.base_vesting_account;if(c){i=c;let e=i.BaseAccount||i.baseAccount||i.base_account;e&&(i=e)}let l=i.address;if(!l){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);l=r}let u=i.account_number,d=i.sequence;return new e(a,l,new n.Int(u||`0`),new n.Int(d||`0`))}constructor(e,t,n,r){this.type=e,this.address=t,this.accountNumber=n,this.sequence=r}getType(){return this.type}getAddress(){return this.address}getAccountNumber(){return this.accountNumber}getSequence(){return this.sequence}}})),cg,lg=t((()=>{cg=`logger/5.8.0`}));function ug(){try{let e=[];if([`NFD`,`NFC`,`NFKD`,`NFKC`].forEach(t=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad normalize`)}catch{e.push(t)}}),e.length)throw Error(`missing `+e.join(`, `));if(`é`.normalize(`NFD`)!==`é`)throw Error(`broken implementation`)}catch(e){return e.message}return null}var dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg=t((()=>{lg(),dg=!1,fg=!1,pg={debug:1,default:2,info:2,warning:3,error:4,off:5},mg=pg.default,hg=null,gg=ug(),(function(e){e.DEBUG=`DEBUG`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.OFF=`OFF`})(_g||={}),(function(e){e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e.NOT_IMPLEMENTED=`NOT_IMPLEMENTED`,e.UNSUPPORTED_OPERATION=`UNSUPPORTED_OPERATION`,e.NETWORK_ERROR=`NETWORK_ERROR`,e.SERVER_ERROR=`SERVER_ERROR`,e.TIMEOUT=`TIMEOUT`,e.BUFFER_OVERRUN=`BUFFER_OVERRUN`,e.NUMERIC_FAULT=`NUMERIC_FAULT`,e.MISSING_NEW=`MISSING_NEW`,e.INVALID_ARGUMENT=`INVALID_ARGUMENT`,e.MISSING_ARGUMENT=`MISSING_ARGUMENT`,e.UNEXPECTED_ARGUMENT=`UNEXPECTED_ARGUMENT`,e.CALL_EXCEPTION=`CALL_EXCEPTION`,e.INSUFFICIENT_FUNDS=`INSUFFICIENT_FUNDS`,e.NONCE_EXPIRED=`NONCE_EXPIRED`,e.REPLACEMENT_UNDERPRICED=`REPLACEMENT_UNDERPRICED`,e.UNPREDICTABLE_GAS_LIMIT=`UNPREDICTABLE_GAS_LIMIT`,e.TRANSACTION_REPLACED=`TRANSACTION_REPLACED`,e.ACTION_REJECTED=`ACTION_REJECTED`})(vg||={}),yg=`0123456789abcdef`,bg=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();pg[n]??this.throwArgumentError(`invalid log level name`,`logLevel`,e),!(mg>pg[n])&&console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(fg)return this.makeError(`censored error`,n,{});n||=e.errors.UNKNOWN_ERROR,r||={};let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let n=``;for(let e=0;e<t.length;e++)n+=yg[t[e]>>4],n+=yg[t[e]&15];i.push(e+`=Uint8Array(0x`+n+`)`)}else i.push(e+`=`+JSON.stringify(t))}catch{i.push(e+`=`+JSON.stringify(r[e].toString()))}}),i.push(`code=${n}`),i.push(`version=${this.version}`);let a=t,o=``;switch(n){case vg.NUMERIC_FAULT:{o=`NUMERIC_FAULT`;let e=t;switch(e){case`overflow`:case`underflow`:case`division-by-zero`:o+=`-`+e;break;case`negative-power`:case`negative-width`:o+=`-unsupported`;break;case`unbound-bitwise-result`:o+=`-unbound-result`;break}break}case vg.CALL_EXCEPTION:case vg.INSUFFICIENT_FUNDS:case vg.MISSING_NEW:case vg.NONCE_EXPIRED:case vg.REPLACEMENT_UNDERPRICED:case vg.TRANSACTION_REPLACED:case vg.UNPREDICTABLE_GAS_LIMIT:o=n;break}o&&(t+=` [ See: https://links.ethers.org/v5-errors-`+o+` ]`),i.length&&(t+=` (`+i.join(`, `)+`)`);let s=Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){t??=`platform missing String.prototype.normalize`,gg&&this.throwError(`platform missing String.prototype.normalize`,e.errors.UNSUPPORTED_OPERATION,{operation:`String.prototype.normalize`,form:gg})}checkSafeUint53(t,n){typeof t==`number`&&(n??=`value not safe`,(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`out-of-safe-range`,value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`non-integer`,value:t}))}checkArgumentCount(t,n,r){r=r?`: `+r:``,t<n&&this.throwError(`missing argument`+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError(`too many arguments`+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError(`cannot instantiate abstract class `+JSON.stringify(n.name)+` directly; use a sub-class`,e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:`new`}):(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return hg||=new e(cg),hg}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError(`cannot permanently disable censorship`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`}),dg){if(!t)return;this.globalLogger().throwError(`error censorship permanent`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`})}fg=!!t,dg=!!n}static setLogLevel(t){let n=pg[t.toLowerCase()];if(n==null){e.globalLogger().warn(`invalid log level - `+t);return}mg=n}static from(t){return new e(t)}},bg.errors=vg,bg.levels=_g})),Sg,Cg=t((()=>{Sg=`bytes/5.8.0`}));function wg(e){return!!e.toHexString}function Tg(e){return e.slice||=function(){let t=Array.prototype.slice.call(arguments);return Tg(new Uint8Array(Array.prototype.slice.apply(e,t)))},e}function Eg(e){return Mg(e)&&!(e.length%2)||Og(e)}function Dg(e){return typeof e==`number`&&e==e&&e%1==0}function Og(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==`string`||!Dg(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let n=e[t];if(!Dg(n)||n<0||n>=256)return!1}return!0}function kg(e,t){if(t||={},typeof e==`number`){Ig.checkSafeUint53(e,`invalid arrayify value`);let t=[];for(;e;)t.unshift(e&255),e=parseInt(String(e/256));return t.length===0&&t.push(0),Tg(new Uint8Array(t))}if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wg(e)&&(e=e.toHexString()),Mg(e)){let n=e.substring(2);n.length%2&&(t.hexPad===`left`?n=`0`+n:t.hexPad===`right`?n+=`0`:Ig.throwArgumentError(`hex data is odd-length`,`value`,e));let r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return Tg(new Uint8Array(r))}return Og(e)?Tg(new Uint8Array(e)):Ig.throwArgumentError(`invalid arrayify value`,`value`,e)}function Ag(e){let t=e.map(e=>kg(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),Tg(r)}function jg(e){let t=kg(e);if(t.length===0)return t;let n=0;for(;n<t.length&&t[n]===0;)n++;return n&&(t=t.slice(n)),t}function Mg(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function Ng(e,t){if(t||={},typeof e==`number`){Ig.checkSafeUint53(e,`invalid hexlify value`);let t=``;for(;e;)t=Lg[e&15]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t=`0`+t),`0x`+t):`0x00`}if(typeof e==`bigint`)return e=e.toString(16),e.length%2?`0x0`+e:`0x`+e;if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wg(e))return e.toHexString();if(Mg(e))return e.length%2&&(t.hexPad===`left`?e=`0x0`+e.substring(2):t.hexPad===`right`?e+=`0`:Ig.throwArgumentError(`hex data is odd-length`,`value`,e)),e.toLowerCase();if(Og(e)){let t=`0x`;for(let n=0;n<e.length;n++){let r=e[n];t+=Lg[(r&240)>>4]+Lg[r&15]}return t}return Ig.throwArgumentError(`invalid hexlify value`,`value`,e)}function Pg(e){if(typeof e!=`string`)e=Ng(e);else if(!Mg(e)||e.length%2)return null;return(e.length-2)/2}function Fg(e,t,n){return typeof e==`string`?(!Mg(e)||e.length%2)&&Ig.throwArgumentError(`invalid hexData`,`value`,e):e=Ng(e),t=2+2*t,n==null?`0x`+e.substring(t):`0x`+e.substring(t,2+2*n)}var Ig,Lg,Rg=t((()=>{xg(),Cg(),Ig=new bg(Sg),Lg=`0123456789abcdef`})),zg,Bg=t((()=>{zg=`bignumber/5.8.0`}));function Vg(e){if(typeof e!=`string`)return Vg(e.toString(16));if(e[0]===`-`)return e=e.substring(1),e[0]===`-`&&Jg.throwArgumentError(`invalid hex`,`value`,e),e=Vg(e),e===`0x00`?e:`-`+e;if(e.substring(0,2)!==`0x`&&(e=`0x`+e),e===`0x`)return`0x00`;for(e.length%2&&(e=`0x0`+e.substring(2));e.length>4&&e.substring(0,4)===`0x00`;)e=`0x`+e.substring(4);return e}function Hg(e){return Qg.from(Vg(e))}function Y(e){let t=Qg.from(e).toHexString();return t[0]===`-`?new qg(`-`+t.substring(3),16):new qg(t.substring(2),16)}function Ug(e,t,n){let r={fault:e,operation:t};return n!=null&&(r.value=n),Jg.throwError(e,bg.errors.NUMERIC_FAULT,r)}function Wg(e){return new qg(e,36).toString(16)}function Gg(e){return new qg(e,16).toString(36)}var Kg,qg,Jg,Yg,Xg,Zg,Qg,$g=t((()=>{Kg=i(j()),Rg(),xg(),Bg(),qg=Kg.default.BN,Jg=new bg(zg),Yg={},Xg=9007199254740991,Zg=!1,Qg=class e{constructor(e,t){e!==Yg&&Jg.throwError(`cannot call constructor directly; use BigNumber.from`,bg.errors.UNSUPPORTED_OPERATION,{operation:`new (BigNumber)`}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Hg(Y(this).fromTwos(e))}toTwos(e){return Hg(Y(this).toTwos(e))}abs(){return this._hex[0]===`-`?e.from(this._hex.substring(1)):this}add(e){return Hg(Y(this).add(Y(e)))}sub(e){return Hg(Y(this).sub(Y(e)))}div(t){return e.from(t).isZero()&&Ug(`division-by-zero`,`div`),Hg(Y(this).div(Y(t)))}mul(e){return Hg(Y(this).mul(Y(e)))}mod(e){let t=Y(e);return t.isNeg()&&Ug(`division-by-zero`,`mod`),Hg(Y(this).umod(t))}pow(e){let t=Y(e);return t.isNeg()&&Ug(`negative-power`,`pow`),Hg(Y(this).pow(t))}and(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`and`),Hg(Y(this).and(t))}or(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`or`),Hg(Y(this).or(t))}xor(e){let t=Y(e);return(this.isNegative()||t.isNeg())&&Ug(`unbound-bitwise-result`,`xor`),Hg(Y(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`mask`),Hg(Y(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`shl`),Hg(Y(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ug(`negative-width`,`shr`),Hg(Y(this).shrn(e))}eq(e){return Y(this).eq(Y(e))}lt(e){return Y(this).lt(Y(e))}lte(e){return Y(this).lte(Y(e))}gt(e){return Y(this).gt(Y(e))}gte(e){return Y(this).gte(Y(e))}isNegative(){return this._hex[0]===`-`}isZero(){return Y(this).isZero()}toNumber(){try{return Y(this).toNumber()}catch{Ug(`overflow`,`toNumber`,this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Jg.throwError(`this platform does not support BigInt`,bg.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Zg||(Zg=!0,Jg.warn(`BigNumber.toString does not accept any parameters; base-10 is assumed`)):arguments[0]===16?Jg.throwError(`BigNumber.toString does not accept any parameters; use bigNumber.toHexString()`,bg.errors.UNEXPECTED_ARGUMENT,{}):Jg.throwError(`BigNumber.toString does not accept parameters`,bg.errors.UNEXPECTED_ARGUMENT,{})),Y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:`BigNumber`,hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if(typeof t==`string`)return t.match(/^-?0x[0-9a-f]+$/i)?new e(Yg,Vg(t)):t.match(/^-?[0-9]+$/)?new e(Yg,Vg(new qg(t))):Jg.throwArgumentError(`invalid BigNumber string`,`value`,t);if(typeof t==`number`)return t%1&&Ug(`underflow`,`BigNumber.from`,t),(t>=Xg||t<=-9007199254740991)&&Ug(`overflow`,`BigNumber.from`,t),e.from(String(t));let n=t;if(typeof n==`bigint`)return e.from(n.toString());if(Og(n))return e.from(Ng(n));if(n)if(n.toHexString){let t=n.toHexString();if(typeof t==`string`)return e.from(t)}else{let t=n._hex;if(t==null&&n.type===`BigNumber`&&(t=n.hex),typeof t==`string`&&(Mg(t)||t[0]===`-`&&Mg(t.substring(1))))return e.from(t)}return Jg.throwArgumentError(`invalid BigNumber value`,`value`,t)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}})),e_=t((()=>{$g(),Rg(),xg(),Bg()})),t_=a(((e,t)=>{m(),s(),(function(){var e=`input is invalid type`,n=`finalize already called`,r=typeof window==`object`,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`;!i.JS_SHA3_NO_NODE_JS&&typeof o==`object`&&o.versions&&o.versions.node?i=h:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&typeof t==`object`&&t.exports,c=typeof define==`function`&&define.amd,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,u=`0123456789abcdef`.split(``),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],p=[1,256,65536,16777216],m=[6,1536,393216,100663296],g=[0,8,16,24],_=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=[`hex`,`buffer`,`arrayBuffer`,`array`,`digest`],x={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var S=function(e,t,n){return function(r){return new L(e,t,e).update(r)[n]()}},C=function(e,t,n){return function(r,i){return new L(e,t,i).update(r)[n]()}},w=function(e,t,n){return function(t,r,i,a){return k[`cshake`+e].update(t,r,i,a)[n]()}},T=function(e,t,n){return function(t,r,i,a){return k[`kmac`+e].update(t,r,i,a)[n]()}},E=function(e,t,n,r){for(var i=0;i<b.length;++i){var a=b[i];e[a]=t(n,r,a)}return e},D=function(e,t){var n=S(e,t,`hex`);return n.create=function(){return new L(e,t,e)},n.update=function(e){return n.create().update(e)},E(n,S,e,t)},O=[{name:`keccak`,padding:p,bits:v,createMethod:D},{name:`sha3`,padding:m,bits:v,createMethod:D},{name:`shake`,padding:d,bits:y,createMethod:function(e,t){var n=C(e,t,`hex`);return n.create=function(n){return new L(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},E(n,C,e,t)}},{name:`cshake`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=w(e,t,`hex`);return r.create=function(r,i,a){return!i&&!a?k[`shake`+e].create(r):new L(e,t,r).bytepad([i,a],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},E(r,w,e,t)}},{name:`kmac`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=T(e,t,`hex`);return r.create=function(r,i,a){return new R(e,t,i).bytepad([`KMAC`,a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},E(r,T,e,t)}}],k={},A=[],j=0;j<O.length;++j)for(var M=O[j],N=M.bits,P=0;P<N.length;++P){var F=M.name+`_`+N[P];if(A.push(F),k[F]=M.createMethod(N[P],M.padding),M.name!==`sha3`){var I=M.name+N[P];A.push(I),k[I]=k[F]}}function L(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(n&31)>>3;for(var r=0;r<50;++r)this.s[r]=0}L.prototype.update=function(t){if(this.finalized)throw Error(n);var r,i=typeof t;if(i!==`string`){if(i===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);r=!0}for(var a=this.blocks,o=this.byteCount,s=t.length,c=this.blockCount,u=0,d=this.s,f,p;u<s;){if(this.reset)for(this.reset=!1,a[0]=this.block,f=1;f<c+1;++f)a[f]=0;if(r)for(f=this.start;u<s&&f<o;++u)a[f>>2]|=t[u]<<g[f++&3];else for(f=this.start;u<s&&f<o;++u)p=t.charCodeAt(u),p<128?a[f>>2]|=p<<g[f++&3]:p<2048?(a[f>>2]|=(192|p>>6)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):p<55296||p>=57344?(a[f>>2]|=(224|p>>12)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):(p=65536+((p&1023)<<10|t.charCodeAt(++u)&1023),a[f>>2]|=(240|p>>18)<<g[f++&3],a[f>>2]|=(128|p>>12&63)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]);if(this.lastByteIndex=f,f>=o){for(this.start=f-o,this.block=a[c],f=0;f<c;++f)d[f]^=a[f];ee(d),this.reset=!0}else this.start=f}return this},L.prototype.encode=function(e,t){var n=e&255,r=1,i=[n];for(e>>=8,n=e&255;n>0;)i.unshift(n),e>>=8,n=e&255,++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},L.prototype.encodeString=function(t){var n,r=typeof t;if(r!==`string`){if(r===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);n=!0}var i=0,a=t.length;if(n)i=a;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((s&1023)<<10|t.charCodeAt(++o)&1023),i+=4)}return i+=this.encode(i*8),this.update(t),i},L.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[t&3],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];ee(r)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=``,s;a<n;){for(i=0;i<e&&a<n;++i,++a)s=t[i],o+=u[s>>4&15]+u[s&15]+u[s>>12&15]+u[s>>8&15]+u[s>>20&15]+u[s>>16&15]+u[s>>28&15]+u[s>>24&15];a%e===0&&(ee(t),i=0)}return r&&(s=t[i],o+=u[s>>4&15]+u[s&15],r>1&&(o+=u[s>>12&15]+u[s>>8&15]),r>2&&(o+=u[s>>20&15]+u[s>>16&15])),o},L.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a<n;){for(i=0;i<e&&a<n;++i,++a)c[a]=t[i];a%e===0&&ee(t)}return r&&(c[i]=t[i],s=s.slice(0,o)),s},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=[],s,c;a<n;){for(i=0;i<e&&a<n;++i,++a)s=a<<2,c=t[i],o[s]=c&255,o[s+1]=c>>8&255,o[s+2]=c>>16&255,o[s+3]=c>>24&255;a%e===0&&ee(t)}return r&&(s=a<<2,c=t[i],o[s]=c&255,r>1&&(o[s+1]=c>>8&255),r>2&&(o[s+2]=c>>16&255)),o};function R(e,t,n){L.call(this,e,t,n)}R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var ee=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,ye,z,be,xe,Se,Ce,we;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(o<<1|s>>>31),n=p^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|l>>>31),n=a^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(u<<1|d>>>31),n=s^(d<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=l^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],h=e[1],ce=e[11]<<4|e[10]>>>28,le=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,A=e[21]<<3|e[20]>>>29,xe=e[31]<<9|e[30]>>>23,Se=e[30]<<9|e[31]>>>23,ie=e[40]<<18|e[41]>>>14,ae=e[41]<<18|e[40]>>>14,F=e[2]<<1|e[3]>>>31,I=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,ue=e[22]<<10|e[23]>>>22,de=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,Ce=e[42]<<2|e[43]>>>30,we=e[43]<<2|e[42]>>>30,ge=e[5]<<30|e[4]>>>2,_e=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,fe=e[34]<<15|e[35]>>>17,pe=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ve=e[17]<<23|e[16]>>>9,ye=e[16]<<23|e[17]>>>9,ee=e[26]<<25|e[27]>>>7,te=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,me=e[47]<<24|e[46]>>>8,he=e[46]<<24|e[47]>>>8,oe=e[8]<<27|e[9]>>>5,se=e[9]<<27|e[8]>>>5,D=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,z=e[29]<<7|e[28]>>>25,be=e[28]<<7|e[29]>>>25,ne=e[38]<<8|e[39]>>>24,re=e[39]<<8|e[38]>>>24,C=e[48]<<14|e[49]>>>18,w=e[49]<<14|e[48]>>>18,e[0]=m^~g&y,e[1]=h^~v&b,e[10]=T^~D&k,e[11]=E^~O&A,e[20]=F^~L&ee,e[21]=I^~R&te,e[30]=oe^~ce&ue,e[31]=se^~le&de,e[40]=ge^~ve&z,e[41]=_e^~ye&be,e[2]=g^~y&x,e[3]=v^~b&S,e[12]=D^~k&j,e[13]=O^~A&M,e[22]=L^~ee&ne,e[23]=R^~te&re,e[32]=ce^~ue&fe,e[33]=le^~de&pe,e[42]=ve^~z&xe,e[43]=ye^~be&Se,e[4]=y^~x&C,e[5]=b^~S&w,e[14]=k^~j&N,e[15]=A^~M&P,e[24]=ee^~ne&ie,e[25]=te^~re&ae,e[34]=ue^~fe&me,e[35]=de^~pe&he,e[44]=z^~xe&Ce,e[45]=be^~Se&we,e[6]=x^~C&m,e[7]=S^~w&h,e[16]=j^~N&T,e[17]=M^~P&E,e[26]=ne^~ie&F,e[27]=re^~ae&I,e[36]=fe^~me&oe,e[37]=pe^~he&se,e[46]=xe^~Ce&ge,e[47]=Se^~we&_e,e[8]=C^~m&g,e[9]=w^~h&v,e[18]=N^~T&D,e[19]=P^~E&O,e[28]=ie^~F&L,e[29]=ae^~I&R,e[38]=me^~oe&ce,e[39]=he^~se&le,e[48]=Ce^~ge&ve,e[49]=we^~_e&ye,e[0]^=_[r],e[1]^=_[r+1]};if(s)t.exports=k;else{for(j=0;j<A.length;++j)i[A[j]]=k[A[j]];c&&define(function(){return k})}})()})),n_=r({keccak256:()=>r_});function r_(e){return`0x`+i_.default.keccak_256(kg(e))}var i_,a_=t((()=>{i_=i(t_()),Rg()})),o_,s_=t((()=>{o_=`rlp/5.8.0`}));function c_(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function l_(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(l_(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=c_(t.length);return n.unshift(247+n.length),n.concat(t)}Eg(e)||d_.throwArgumentError(`RLP object must be BytesLike`,`object`,e);let t=Array.prototype.slice.call(kg(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=c_(t.length);return n.unshift(183+n.length),n.concat(t)}function u_(e){return Ng(l_(e))}var d_,f_=t((()=>{Rg(),xg(),s_(),d_=new bg(o_)})),p_,m_=t((()=>{p_=`address/5.8.0`})),h_=r({getAddress:()=>y_,getContractAddress:()=>S_,getCreate2Address:()=>C_,getIcapAddress:()=>x_,isAddress:()=>b_});function g_(e){Mg(e,20)||w_.throwArgumentError(`invalid address`,`address`,e),e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=kg(r_(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}function __(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}function v_(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>E_[e]).join(``);for(;t.length>=D_;){let e=t.substring(0,D_);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}function y_(e){let t=null;if(typeof e!=`string`&&w_.throwArgumentError(`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==`0x`&&(e=`0x`+e),t=g_(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&w_.throwArgumentError(`bad address checksum`,`address`,e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==v_(e)&&w_.throwArgumentError(`bad icap checksum`,`address`,e),t=Wg(e.substring(4));t.length<40;)t=`0`+t;t=g_(`0x`+t)}else w_.throwArgumentError(`invalid address`,`address`,e);return t}function b_(e){try{return y_(e),!0}catch{}return!1}function x_(e){let t=Gg(y_(e).substring(2)).toUpperCase();for(;t.length<30;)t=`0`+t;return`XE`+v_(`XE00`+t)+t}function S_(e){let t=null;try{t=y_(e.from)}catch{w_.throwArgumentError(`missing from address`,`transaction`,e)}let n=jg(kg(Qg.from(e.nonce).toHexString()));return y_(Fg(r_(u_([t,n])),12))}function C_(e,t,n){return Pg(t)!==32&&w_.throwArgumentError(`salt must be 32 bytes`,`salt`,t),Pg(n)!==32&&w_.throwArgumentError(`initCodeHash must be 32 bytes`,`initCodeHash`,n),y_(Fg(r_(Ag([`0xff`,y_(e),t,n])),12))}var w_,T_,E_,D_,O_=t((()=>{Rg(),e_(),a_(),f_(),xg(),m_(),w_=new bg(p_),T_=9007199254740991,E_={};for(let e=0;e<10;e++)E_[String(e)]=String(e);for(let e=0;e<26;e++)E_[String.fromCharCode(65+e)]=String(10+e);D_=Math.floor(__(T_))})),k_=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.Bech32Address=void 0;var a=i(Je()),o=A(),s=(O_(),n(h_));e.Bech32Address=class e{static shortenAddress(e,t){if(t>=e.length)return e;let n=e.indexOf(`1`),r=e.slice(0,n),i=e.slice(n+1);if(t-=r.length,t-=3,--t,t<=0)return``;let a=Math.floor(i.length/2),o=i.slice(0,a),s=i.slice(a);for(;t<o.length+s.length;)(o.length+s.length)%2==1&&o.length>0?o=o.slice(0,o.length-1):s=s.slice(1);return r+`1`+o+`...`+s}static fromBech32(t,n){let r=a.default.decode(t);if(n&&r.prefix!==n)throw Error(`Unmatched prefix`);return new e(new Uint8Array((0,a.fromWords)(r.words)))}static validate(e,t){let{prefix:n}=a.default.decode(e);if(t&&t!==n)throw Error(`Unexpected prefix (expected: ${t}, actual: ${n})`)}static defaultBech32Config(e,t=`val`,n=`cons`,r=`pub`,i=`oper`){return{bech32PrefixAccAddr:e,bech32PrefixAccPub:e+r,bech32PrefixValAddr:e+t+i,bech32PrefixValPub:e+t+i+r,bech32PrefixConsAddr:e+t+n,bech32PrefixConsPub:e+t+n+r}}constructor(e){this.address=e}toBech32(e){let t=a.default.toWords(this.address);return a.default.encode(e,t)}toHex(e=!0){let t=o.Buffer.from(this.address).toString(`hex`);if(t.length===0)throw Error(`Empty address`);return e?(0,s.getAddress)(`0x`+t):`0x`+t}}})),A_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChainIdHelper=void 0;var t=class e{static parse(t){if(t===`injective-777`||t===`injective-888`)return{identifier:t,version:0};let n=t.split(e.VersionFormatRegExp).filter(Boolean);return n.length===2?{identifier:n[0],version:parseInt(n[1])}:{identifier:t,version:0}}static hasChainVersion(t){return e.parse(t).identifier!==t}};e.ChainIdHelper=t,t.VersionFormatRegExp=/(.+)-([\d]+)/})),j_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthermintChainIdHelper=void 0;var t=A_();e.EthermintChainIdHelper=class{static parse(e){let n=t.ChainIdHelper.parse(e);if(e.startsWith(`injective`))return[`injective-777`,`injective-888`].includes(e)?Object.assign({ethChainId:5},n):Object.assign({ethChainId:1},n);let r=e.match(`^([a-z]{1,})_{1}([1-9][0-9]*)-{1}([1-9][0-9]*)$`);if(!r||r.length!==4||r[1]===``||Number.isNaN(parseFloat(r[2]))||!Number.isInteger(parseFloat(r[2])))throw Error(`Invalid chainId for ethermint: ${e}`);return Object.assign(Object.assign({},n),{ethChainId:parseFloat(r[2])})}}})),M_=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(A_(),e),n(j_(),e)})),N_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WsReadyState=void 0,(function(e){e[e.CONNECTING=0]=`CONNECTING`,e[e.OPEN=1]=`OPEN`,e[e.CLOSING=2]=`CLOSING`,e[e.CLOSED=3]=`CLOSED`,e[e.NONE=4]=`NONE`})(e.WsReadyState||={})})),P_=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TendermintTxTracer=void 0;var t=N_(),n=A();e.TendermintTxTracer=class{constructor(e,t,n={}){this.url=e,this.wsEndpoint=t,this.options=n,this.newBlockSubscribes=[],this.txSubscribes=new Map,this.pendingQueries=new Map,this.listeners={},this.onOpen=e=>{this.newBlockSubscribes.length>0&&this.sendSubscribeBlockRpc();for(let[e,t]of this.txSubscribes)this.sendSubscribeTxRpc(e,t.params);for(let[e,t]of this.pendingQueries)this.sendQueryRpc(e,t.method,t.params);for(let t of this.listeners.open??[])t(e)},this.onMessage=e=>{for(let t of this.listeners.message??[])t(e);if(e.data)try{let t=JSON.parse(e.data);if(t?.id&&this.pendingQueries.has(t.id)&&(t.error?this.pendingQueries.get(t.id).rejector(Error(t.error.data||t.error.message)):t.result?.tx_result?this.pendingQueries.get(t.id).resolver(t.result.tx_result):this.pendingQueries.get(t.id).resolver(t.result),this.pendingQueries.delete(t.id)),t?.result?.data?.type===`tendermint/event/NewBlock`)for(let e of this.newBlockSubscribes)e.handler(t.result.data.value);t?.result?.data?.type===`tendermint/event/Tx`&&t?.id&&this.txSubscribes.has(t.id)&&(t.error?this.txSubscribes.get(t.id).rejector(Error(t.error.data||t.error.message)):this.txSubscribes.get(t.id).resolver(t.result.data.value.TxResult.result),this.txSubscribes.delete(t.id))}catch{}},this.onClose=e=>{for(let t of this.listeners.close??[])t(e)},this.ws=this.options.wsObject?new this.options.wsObject(this.getWsEndpoint()):new WebSocket(this.getWsEndpoint()),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose}getWsEndpoint(){let e=this.url;if(e.startsWith(`http`)&&(e=e.replace(`http`,`ws`)),!e.endsWith(this.wsEndpoint)){let t=this.wsEndpoint.startsWith(`/`)?this.wsEndpoint:`/`+this.wsEndpoint;e=e.endsWith(`/`)?e+t.slice(1):e+t}return e}close(){this.ws.close()}get readyState(){switch(this.ws.readyState){case 0:return t.WsReadyState.CONNECTING;case 1:return t.WsReadyState.OPEN;case 2:return t.WsReadyState.CLOSING;case 3:return t.WsReadyState.CLOSED;default:return t.WsReadyState.NONE}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}subscribeBlock(e){return this.newBlockSubscribes.push({handler:e}),this.newBlockSubscribes.length===1&&this.sendSubscribeBlockRpc(),()=>{this.newBlockSubscribes=this.newBlockSubscribes.filter(t=>t.handler!==e)}}sendSubscribeBlockRpc(){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:[`tm.event='NewBlock'`],id:1}))}traceTx(e){return new Promise(t=>{this.queryTx(e).then(n=>{if(e instanceof Uint8Array){t(n);return}if(n?.total_count!==`0`){t(n);return}}).catch(()=>{}),this.subscribeTx(e).then(t)}).then(e=>new Promise(t=>{setTimeout(()=>t(e),100)}))}subscribeTx(e){if(e instanceof Uint8Array){let t=this.createRandomId(),r={query:`tm.event='Tx' AND tx.hash='${n.Buffer.from(e).toString(`hex`).toUpperCase()}'`};return new Promise((e,n)=>{this.txSubscribes.set(t,{params:r,resolver:e,rejector:n}),this.sendSubscribeTxRpc(t,r)})}else{let t=this.createRandomId(),n={query:`tm.event='Tx' and `+Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}}sendSubscribeTxRpc(e,n){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:n,id:e}))}queryTx(e){if(e instanceof Uint8Array)return this.query(`tx`,{hash:n.Buffer.from(e).toString(`base64`),prove:!1});{let t={query:Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return this.query(`tx_search`,t)}}query(e,t){let n=this.createRandomId();return new Promise((r,i)=>{this.pendingQueries.set(n,{method:e,params:t,resolver:r,rejector:i}),this.sendQueryRpc(n,e,t)})}sendQueryRpc(e,n,r){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:n,params:r,id:e}))}createRandomId(){return parseInt(Array.from({length:6}).map(()=>Math.floor(Math.random()*100)).join(``))}}})),F_=a(((e,t)=>{t.exports=r;var n=I_();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),I_=a((e=>{m();var t=e;t.asPromise=$a(),t.base64=eo(),t.EventEmitter=to(),t.float=no(),t.inquire=ro(),t.utf8=io(),t.pool=ao(),t.LongBits=F_(),t.isNode=!!(h!==void 0&&h&&h.process&&h.process.versions&&h.process.versions.node),t.global=t.isNode&&h||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||``}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+`: `+this.message},t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),L_=a(((e,t)=>{t.exports=u;var n=I_(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),R_=a(((e,t)=>{t.exports=i;var n=L_();(i.prototype=Object.create(n.prototype)).constructor=i;var r=I_();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),z_=a(((e,t)=>{t.exports=s;var n=I_(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),B_=a(((e,t)=>{t.exports=i;var n=z_();(i.prototype=Object.create(n.prototype)).constructor=i;var r=I_();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),V_=a(((e,t)=>{t.exports=r;var n=I_();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),H_=a((e=>{var t=e;t.Service=V_()})),U_=a(((e,t)=>{t.exports={}})),W_=a((e=>{var t=e;t.build=`minimal`,t.Writer=L_(),t.BufferWriter=R_(),t.Reader=z_(),t.BufferReader=B_(),t.util=I_(),t.rpc=H_(),t.roots=U_(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),G_=a(((e,t)=>{t.exports=W_()})),K_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgInstallBundleResponse=e.MsgInstallBundle=e.MsgProvisionResponse=e.MsgProvision=e.MsgWalletSpendActionResponse=e.MsgWalletSpendAction=e.MsgWalletActionResponse=e.MsgWalletAction=e.MsgDeliverInboundResponse=e.MsgDeliverInbound=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`agoric.swingset`;function i(){return{messages:[],nums:[],ack:`0`,submitter:new Uint8Array}}e.MsgDeliverInbound={encode(e,t=r.default.Writer.create()){for(let n of e.messages)t.uint32(10).string(n);t.uint32(18).fork();for(let n of e.nums)t.uint64(n);return t.ldelim(),e.ack!==`0`&&t.uint32(24).uint64(e.ack),e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(n.string());break;case 2:if((e&7)==2){let e=n.uint32()+n.pos;for(;n.pos<e;)o.nums.push(x(n.uint64()))}else o.nums.push(x(n.uint64()));break;case 3:o.ack=x(n.uint64());break;case 4:o.submitter=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>String(e)):[],nums:Array.isArray(e?.nums)?e.nums.map(e=>String(e)):[],ack:S(e.ack)?String(e.ack):`0`,submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e):t.messages=[],e.nums?t.nums=e.nums.map(e=>e):t.nums=[],e.ack!==void 0&&(t.ack=e.ack),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=i();return t.messages=e.messages?.map(e=>e)||[],t.nums=e.nums?.map(e=>e)||[],t.ack=e.ack??`0`,t.submitter=e.submitter??new Uint8Array,t}};function a(){return{}}e.MsgDeliverInboundResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return o},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return a()}};function o(){return{owner:new Uint8Array,action:``}}e.MsgWalletAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.action!==``&&t.uint32(18).string(e.action),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.action=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,action:S(e.action)?String(e.action):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.action!==void 0&&(t.action=e.action),t},fromPartial(e){let t=o();return t.owner=e.owner??new Uint8Array,t.action=e.action??``,t}};function s(){return{}}e.MsgWalletActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{owner:new Uint8Array,spendAction:``}}e.MsgWalletSpendAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.spendAction!==``&&t.uint32(18).string(e.spendAction),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.spendAction=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,spendAction:S(e.spendAction)?String(e.spendAction):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.spendAction!==void 0&&(t.spendAction=e.spendAction),t},fromPartial(e){let t=c();return t.owner=e.owner??new Uint8Array,t.spendAction=e.spendAction??``,t}};function l(){return{}}e.MsgWalletSpendActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{nickname:``,address:new Uint8Array,powerFlags:[],submitter:new Uint8Array}}e.MsgProvision={encode(e,t=r.default.Writer.create()){e.nickname!==``&&t.uint32(10).string(e.nickname),e.address.length!==0&&t.uint32(18).bytes(e.address);for(let n of e.powerFlags)t.uint32(26).string(n);return e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.nickname=n.string();break;case 2:a.address=n.bytes();break;case 3:a.powerFlags.push(n.string());break;case 4:a.submitter=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{nickname:S(e.nickname)?String(e.nickname):``,address:S(e.address)?v(e.address):new Uint8Array,powerFlags:Array.isArray(e?.powerFlags)?e.powerFlags.map(e=>String(e)):[],submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.nickname!==void 0&&(t.nickname=e.nickname),e.address!==void 0&&(t.address=b(e.address===void 0?new Uint8Array:e.address)),e.powerFlags?t.powerFlags=e.powerFlags.map(e=>e):t.powerFlags=[],e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=u();return t.nickname=e.nickname??``,t.address=e.address??new Uint8Array,t.powerFlags=e.powerFlags?.map(e=>e)||[],t.submitter=e.submitter??new Uint8Array,t}};function d(){return{}}e.MsgProvisionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{bundle:``,submitter:new Uint8Array,compressedBundle:new Uint8Array,uncompressedSize:`0`}}e.MsgInstallBundle={encode(e,t=r.default.Writer.create()){return e.bundle!==``&&t.uint32(10).string(e.bundle),e.submitter.length!==0&&t.uint32(18).bytes(e.submitter),e.compressedBundle.length!==0&&t.uint32(26).bytes(e.compressedBundle),e.uncompressedSize!==`0`&&t.uint32(32).int64(e.uncompressedSize),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bundle=n.string();break;case 2:a.submitter=n.bytes();break;case 3:a.compressedBundle=n.bytes();break;case 4:a.uncompressedSize=x(n.int64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bundle:S(e.bundle)?String(e.bundle):``,submitter:S(e.submitter)?v(e.submitter):new Uint8Array,compressedBundle:S(e.compressedBundle)?v(e.compressedBundle):new Uint8Array,uncompressedSize:S(e.uncompressedSize)?String(e.uncompressedSize):`0`}},toJSON(e){let t={};return e.bundle!==void 0&&(t.bundle=e.bundle),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),e.compressedBundle!==void 0&&(t.compressedBundle=b(e.compressedBundle===void 0?new Uint8Array:e.compressedBundle)),e.uncompressedSize!==void 0&&(t.uncompressedSize=e.uncompressedSize),t},fromPartial(e){let t=f();return t.bundle=e.bundle??``,t.submitter=e.submitter??new Uint8Array,t.compressedBundle=e.compressedBundle??new Uint8Array,t.uncompressedSize=e.uncompressedSize??`0`,t}};function p(){return{}}e.MsgInstallBundleResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),q_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`cosmos.base.v1beta1`;function i(){return{denom:``,amount:``}}e.Coin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{denom:``,amount:``}}e.DecCoin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=a();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function o(){return{int:``}}e.IntProto={encode(e,t=r.default.Writer.create()){return e.int!==``&&t.uint32(10).string(e.int),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.int=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{int:c(e.int)?String(e.int):``}},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=o();return t.int=e.int??``,t}};function s(){return{dec:``}}e.DecProto={encode(e,t=r.default.Writer.create()){return e.dec!==``&&t.uint32(10).string(e.dec),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.dec=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{dec:c(e.dec)?String(e.dec):``}},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=s();return t.dec=e.dec??``,t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function c(e){return e!=null}})),J_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={encode(t,n=r.default.Writer.create()){for(let r of t.sendEnabled)e.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return t.defaultSendEnabled===!0&&n.uint32(16).bool(t.defaultSendEnabled),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.sendEnabled.push(e.SendEnabled.decode(i,i.uint32()));break;case 2:s.defaultSendEnabled=i.bool();break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{sendEnabled:Array.isArray(t?.sendEnabled)?t.sendEnabled.map(t=>e.SendEnabled.fromJSON(t)):[],defaultSendEnabled:f(t.defaultSendEnabled)?!!t.defaultSendEnabled:!1}},toJSON(t){let n={};return t.sendEnabled?n.sendEnabled=t.sendEnabled.map(t=>t?e.SendEnabled.toJSON(t):void 0):n.sendEnabled=[],t.defaultSendEnabled!==void 0&&(n.defaultSendEnabled=t.defaultSendEnabled),n},fromPartial(t){let n=a();return n.sendEnabled=t.sendEnabled?.map(t=>e.SendEnabled.fromPartial(t))||[],n.defaultSendEnabled=t.defaultSendEnabled??!1,n}};function o(){return{denom:``,enabled:!1}}e.SendEnabled={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.enabled=n.bool();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,enabled:f(e.enabled)?!!e.enabled:!1}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){let t=o();return t.denom=e.denom??``,t.enabled=e.enabled??!1,t}};function s(){return{address:``,coins:[]}}e.Input={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=s();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function c(){return{address:``,coins:[]}}e.Output={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=c();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function l(){return{total:[]}}e.Supply={encode(e,t=r.default.Writer.create()){for(let n of e.total)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=l();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:Array.isArray(e?.total)?e.total.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.total?t.total=e.total.map(e=>e?i.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){let t=l();return t.total=e.total?.map(e=>i.Coin.fromPartial(e))||[],t}};function u(){return{denom:``,exponent:0,aliases:[]}}e.DenomUnit={encode(e,t=r.default.Writer.create()){e.denom!==``&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(let n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.exponent=n.uint32();break;case 3:a.aliases.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,exponent:f(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e?.aliases)?e.aliases.map(e=>String(e)):[]}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){let t=u();return t.denom=e.denom??``,t.exponent=e.exponent??0,t.aliases=e.aliases?.map(e=>e)||[],t}};function d(){return{description:``,denomUnits:[],base:``,display:``,name:``,symbol:``}}e.Metadata={encode(t,n=r.default.Writer.create()){t.description!==``&&n.uint32(10).string(t.description);for(let r of t.denomUnits)e.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return t.base!==``&&n.uint32(26).string(t.base),t.display!==``&&n.uint32(34).string(t.display),t.name!==``&&n.uint32(42).string(t.name),t.symbol!==``&&n.uint32(50).string(t.symbol),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.description=i.string();break;case 2:o.denomUnits.push(e.DenomUnit.decode(i,i.uint32()));break;case 3:o.base=i.string();break;case 4:o.display=i.string();break;case 5:o.name=i.string();break;case 6:o.symbol=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{description:f(t.description)?String(t.description):``,denomUnits:Array.isArray(t?.denomUnits)?t.denomUnits.map(t=>e.DenomUnit.fromJSON(t)):[],base:f(t.base)?String(t.base):``,display:f(t.display)?String(t.display):``,name:f(t.name)?String(t.name):``,symbol:f(t.symbol)?String(t.symbol):``}},toJSON(t){let n={};return t.description!==void 0&&(n.description=t.description),t.denomUnits?n.denomUnits=t.denomUnits.map(t=>t?e.DenomUnit.toJSON(t):void 0):n.denomUnits=[],t.base!==void 0&&(n.base=t.base),t.display!==void 0&&(n.display=t.display),t.name!==void 0&&(n.name=t.name),t.symbol!==void 0&&(n.symbol=t.symbol),n},fromPartial(t){let n=d();return n.description=t.description??``,n.denomUnits=t.denomUnits?.map(t=>e.DenomUnit.fromPartial(t))||[],n.base=t.base??``,n.display=t.display??``,n.name=t.name??``,n.symbol=t.symbol??``,n}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function f(e){return e!=null}})),Y_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_(),a=J_();e.protobufPackage=`cosmos.bank.v1beta1`;function o(){return{fromAddress:``,toAddress:``,amount:[]}}e.MsgSend={encode(e,t=r.default.Writer.create()){e.fromAddress!==``&&t.uint32(10).string(e.fromAddress),e.toAddress!==``&&t.uint32(18).string(e.toAddress);for(let n of e.amount)i.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.fromAddress=n.string();break;case 2:s.toAddress=n.string();break;case 3:s.amount.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{fromAddress:u(e.fromAddress)?String(e.fromAddress):``,toAddress:u(e.toAddress)?String(e.toAddress):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=o();return t.fromAddress=e.fromAddress??``,t.toAddress=e.toAddress??``,t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t}};function s(){return{}}e.MsgSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{inputs:[],outputs:[]}}e.MsgMultiSend={encode(e,t=r.default.Writer.create()){for(let n of e.inputs)a.Input.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.outputs)a.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.inputs.push(a.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(a.Output.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{inputs:Array.isArray(e?.inputs)?e.inputs.map(e=>a.Input.fromJSON(e)):[],outputs:Array.isArray(e?.outputs)?e.outputs.map(e=>a.Output.fromJSON(e)):[]}},toJSON(e){let t={};return e.inputs?t.inputs=e.inputs.map(e=>e?a.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?a.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){let t=c();return t.inputs=e.inputs?.map(e=>a.Input.fromPartial(e))||[],t.outputs=e.outputs?.map(e=>a.Output.fromPartial(e))||[],t}};function l(){return{}}e.MsgMultiSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),X_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Timestamp={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),Z_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.crypto`;function i(){return{total:`0`,index:`0`,leafHash:new Uint8Array,aunts:[]}}e.Proof={encode(e,t=r.default.Writer.create()){e.total!==`0`&&t.uint32(8).int64(e.total),e.index!==`0`&&t.uint32(16).int64(e.index),e.leafHash.length!==0&&t.uint32(26).bytes(e.leafHash);for(let n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total=g(n.int64());break;case 2:o.index=g(n.int64());break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:_(e.total)?String(e.total):`0`,index:_(e.index)?String(e.index):`0`,leafHash:_(e.leafHash)?d(e.leafHash):new Uint8Array,aunts:Array.isArray(e?.aunts)?e.aunts.map(e=>d(e)):[]}},toJSON(e){let t={};return e.total!==void 0&&(t.total=e.total),e.index!==void 0&&(t.index=e.index),e.leafHash!==void 0&&(t.leafHash=p(e.leafHash===void 0?new Uint8Array:e.leafHash)),e.aunts?t.aunts=e.aunts.map(e=>p(e===void 0?new Uint8Array:e)):t.aunts=[],t},fromPartial(e){let t=i();return t.total=e.total??`0`,t.index=e.index??`0`,t.leafHash=e.leafHash??new Uint8Array,t.aunts=e.aunts?.map(e=>e)||[],t}};function a(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={encode(t,n=r.default.Writer.create()){return t.key.length!==0&&n.uint32(10).bytes(t.key),t.proof!==void 0&&e.Proof.encode(t.proof,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.key=i.bytes();break;case 2:s.proof=e.Proof.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{key:_(t.key)?d(t.key):new Uint8Array,proof:_(t.proof)?e.Proof.fromJSON(t.proof):void 0}},toJSON(t){let n={};return t.key!==void 0&&(n.key=p(t.key===void 0?new Uint8Array:t.key)),t.proof!==void 0&&(n.proof=t.proof?e.Proof.toJSON(t.proof):void 0),n},fromPartial(t){let n=a();return n.key=t.key??new Uint8Array,n.proof=t.proof!==void 0&&t.proof!==null?e.Proof.fromPartial(t.proof):void 0,n}};function o(){return{key:``,input:``,output:``}}e.DominoOp={encode(e,t=r.default.Writer.create()){return e.key!==``&&t.uint32(10).string(e.key),e.input!==``&&t.uint32(18).string(e.input),e.output!==``&&t.uint32(26).string(e.output),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.string();break;case 2:a.input=n.string();break;case 3:a.output=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:_(e.key)?String(e.key):``,input:_(e.input)?String(e.input):``,output:_(e.output)?String(e.output):``}},toJSON(e){let t={};return e.key!==void 0&&(t.key=e.key),e.input!==void 0&&(t.input=e.input),e.output!==void 0&&(t.output=e.output),t},fromPartial(e){let t=o();return t.key=e.key??``,t.input=e.input??``,t.output=e.output??``,t}};function s(){return{type:``,key:new Uint8Array,data:new Uint8Array}}e.ProofOp={encode(e,t=r.default.Writer.create()){return e.type!==``&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.type=n.string();break;case 2:a.key=n.bytes();break;case 3:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{type:_(e.type)?String(e.type):``,key:_(e.key)?d(e.key):new Uint8Array,data:_(e.data)?d(e.data):new Uint8Array}},toJSON(e){let t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=p(e.key===void 0?new Uint8Array:e.key)),e.data!==void 0&&(t.data=p(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=s();return t.type=e.type??``,t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function c(){return{ops:[]}}e.ProofOps={encode(t,n=r.default.Writer.create()){for(let r of t.ops)e.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.ops.push(e.ProofOp.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{ops:Array.isArray(t?.ops)?t.ops.map(t=>e.ProofOp.fromJSON(t)):[]}},toJSON(t){let n={};return t.ops?n.ops=t.ops.map(t=>t?e.ProofOp.toJSON(t):void 0):n.ops=[],n},fromPartial(t){let n=c();return n.ops=t.ops?.map(t=>e.ProofOp.fromPartial(t))||[],n}};var l=(()=>{if(l!==void 0)return l;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),u=l.atob||(e=>l.Buffer.from(e,`base64`).toString(`binary`));function d(e){let t=u(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var f=l.btoa||(e=>l.Buffer.from(e,`binary`).toString(`base64`));function p(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return f(t.join(``))}function g(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function _(e){return e!=null}})),Q_=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Consensus=e.App=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.version`;function i(){return{protocol:`0`,software:``}}e.App={encode(e,t=r.default.Writer.create()){return e.protocol!==`0`&&t.uint32(8).uint64(e.protocol),e.software!==``&&t.uint32(18).string(e.software),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.protocol=o(n.uint64());break;case 2:s.software=n.string();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{protocol:s(e.protocol)?String(e.protocol):`0`,software:s(e.software)?String(e.software):``}},toJSON(e){let t={};return e.protocol!==void 0&&(t.protocol=e.protocol),e.software!==void 0&&(t.software=e.software),t},fromPartial(e){let t=i();return t.protocol=e.protocol??`0`,t.software=e.software??``,t}};function a(){return{block:`0`,app:`0`}}e.Consensus={encode(e,t=r.default.Writer.create()){return e.block!==`0`&&t.uint32(8).uint64(e.block),e.app!==`0`&&t.uint32(16).uint64(e.app),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:s.block=o(n.uint64());break;case 2:s.app=o(n.uint64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{block:s(e.block)?String(e.block):`0`,app:s(e.app)?String(e.app):`0`}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.app!==void 0&&(t.app=e.app),t},fromPartial(e){let t=a();return t.block=e.block??`0`,t.app=e.app??`0`,t}};function o(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function s(e){return e!=null}})),$_=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`tendermint.crypto`;function i(){return{ed25519:void 0,secp256k1:void 0}}e.PublicKey={encode(e,t=r.default.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{ed25519:u(e.ed25519)?s(e.ed25519):void 0,secp256k1:u(e.secp256k1)?s(e.secp256k1):void 0}},toJSON(e){let t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519===void 0?void 0:l(e.ed25519)),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1===void 0?void 0:l(e.secp256k1)),t},fromPartial(e){let t=i();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),ev=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=$_();e.protobufPackage=`tendermint.types`;function a(){return{validators:[],proposer:void 0,totalVotingPower:`0`}}e.ValidatorSet={encode(t,n=r.default.Writer.create()){for(let r of t.validators)e.Validator.encode(r,n.uint32(10).fork()).ldelim();return t.proposer!==void 0&&e.Validator.encode(t.proposer,n.uint32(18).fork()).ldelim(),t.totalVotingPower!==`0`&&n.uint32(24).int64(t.totalVotingPower),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.validators.push(e.Validator.decode(i,i.uint32()));break;case 2:s.proposer=e.Validator.decode(i,i.uint32());break;case 3:s.totalVotingPower=p(i.int64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{validators:Array.isArray(t?.validators)?t.validators.map(t=>e.Validator.fromJSON(t)):[],proposer:g(t.proposer)?e.Validator.fromJSON(t.proposer):void 0,totalVotingPower:g(t.totalVotingPower)?String(t.totalVotingPower):`0`}},toJSON(t){let n={};return t.validators?n.validators=t.validators.map(t=>t?e.Validator.toJSON(t):void 0):n.validators=[],t.proposer!==void 0&&(n.proposer=t.proposer?e.Validator.toJSON(t.proposer):void 0),t.totalVotingPower!==void 0&&(n.totalVotingPower=t.totalVotingPower),n},fromPartial(t){let n=a();return n.validators=t.validators?.map(t=>e.Validator.fromPartial(t))||[],n.proposer=t.proposer!==void 0&&t.proposer!==null?e.Validator.fromPartial(t.proposer):void 0,n.totalVotingPower=t.totalVotingPower??`0`,n}};function o(){return{address:new Uint8Array,pubKey:void 0,votingPower:`0`,proposerPriority:`0`}}e.Validator={encode(e,t=r.default.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==`0`&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.address=n.bytes();break;case 2:s.pubKey=i.PublicKey.decode(n,n.uint32());break;case 3:s.votingPower=p(n.int64());break;case 4:s.proposerPriority=p(n.int64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{address:g(e.address)?u(e.address):new Uint8Array,pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`,proposerPriority:g(e.proposerPriority)?String(e.proposerPriority):`0`}},toJSON(e){let t={};return e.address!==void 0&&(t.address=f(e.address===void 0?new Uint8Array:e.address)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),e.proposerPriority!==void 0&&(t.proposerPriority=e.proposerPriority),t},fromPartial(e){let t=o();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t.proposerPriority=e.proposerPriority??`0`,t}};function s(){return{pubKey:void 0,votingPower:`0`}}e.SimpleValidator={encode(e,t=r.default.Writer.create()){return e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(16).int64(e.votingPower),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.pubKey=i.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=p(n.int64());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`}},toJSON(e){let t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),t},fromPartial(e){let t=s();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t}};var c=(()=>{if(c!==void 0)return c;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),l=c.atob||(e=>c.Buffer.from(e,`base64`).toString(`binary`));function u(e){let t=l(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var d=c.btoa||(e=>c.Buffer.from(e,`binary`).toString(`base64`));function f(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return d(t.join(``))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),tv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=Z_(),o=Q_(),s=ev();e.protobufPackage=`tendermint.types`;var c;(function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]=`BLOCK_ID_FLAG_UNKNOWN`,e[e.BLOCK_ID_FLAG_ABSENT=1]=`BLOCK_ID_FLAG_ABSENT`,e[e.BLOCK_ID_FLAG_COMMIT=2]=`BLOCK_ID_FLAG_COMMIT`,e[e.BLOCK_ID_FLAG_NIL=3]=`BLOCK_ID_FLAG_NIL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.BlockIDFlag||={});function l(e){switch(e){case 0:case`BLOCK_ID_FLAG_UNKNOWN`:return c.BLOCK_ID_FLAG_UNKNOWN;case 1:case`BLOCK_ID_FLAG_ABSENT`:return c.BLOCK_ID_FLAG_ABSENT;case 2:case`BLOCK_ID_FLAG_COMMIT`:return c.BLOCK_ID_FLAG_COMMIT;case 3:case`BLOCK_ID_FLAG_NIL`:return c.BLOCK_ID_FLAG_NIL;default:return c.UNRECOGNIZED}}e.blockIDFlagFromJSON=l;function u(e){switch(e){case c.BLOCK_ID_FLAG_UNKNOWN:return`BLOCK_ID_FLAG_UNKNOWN`;case c.BLOCK_ID_FLAG_ABSENT:return`BLOCK_ID_FLAG_ABSENT`;case c.BLOCK_ID_FLAG_COMMIT:return`BLOCK_ID_FLAG_COMMIT`;case c.BLOCK_ID_FLAG_NIL:return`BLOCK_ID_FLAG_NIL`;default:return`UNKNOWN`}}e.blockIDFlagToJSON=u;var d;(function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]=`SIGNED_MSG_TYPE_UNKNOWN`,e[e.SIGNED_MSG_TYPE_PREVOTE=1]=`SIGNED_MSG_TYPE_PREVOTE`,e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]=`SIGNED_MSG_TYPE_PRECOMMIT`,e[e.SIGNED_MSG_TYPE_PROPOSAL=32]=`SIGNED_MSG_TYPE_PROPOSAL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.SignedMsgType||={});function f(e){switch(e){case 0:case`SIGNED_MSG_TYPE_UNKNOWN`:return d.SIGNED_MSG_TYPE_UNKNOWN;case 1:case`SIGNED_MSG_TYPE_PREVOTE`:return d.SIGNED_MSG_TYPE_PREVOTE;case 2:case`SIGNED_MSG_TYPE_PRECOMMIT`:return d.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case`SIGNED_MSG_TYPE_PROPOSAL`:return d.SIGNED_MSG_TYPE_PROPOSAL;default:return d.UNRECOGNIZED}}e.signedMsgTypeFromJSON=f;function p(e){switch(e){case d.SIGNED_MSG_TYPE_UNKNOWN:return`SIGNED_MSG_TYPE_UNKNOWN`;case d.SIGNED_MSG_TYPE_PREVOTE:return`SIGNED_MSG_TYPE_PREVOTE`;case d.SIGNED_MSG_TYPE_PRECOMMIT:return`SIGNED_MSG_TYPE_PRECOMMIT`;case d.SIGNED_MSG_TYPE_PROPOSAL:return`SIGNED_MSG_TYPE_PROPOSAL`;default:return`UNKNOWN`}}e.signedMsgTypeToJSON=p;function g(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={encode(e,t=r.default.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.total=n.uint32();break;case 2:a.hash=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{total:R(e.total)?Number(e.total):0,hash:R(e.hash)?j(e.hash):new Uint8Array}},toJSON(e){let t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=N(e.hash===void 0?new Uint8Array:e.hash)),t},fromPartial(e){let t=g();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function _(){return{index:0,bytes:new Uint8Array,proof:void 0}}e.Part={encode(e,t=r.default.Writer.create()){return e.index!==0&&t.uint32(8).uint32(e.index),e.bytes.length!==0&&t.uint32(18).bytes(e.bytes),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{index:R(e.index)?Number(e.index):0,bytes:R(e.bytes)?j(e.bytes):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.bytes!==void 0&&(t.bytes=N(e.bytes===void 0?new Uint8Array:e.bytes)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=_();return t.index=e.index??0,t.bytes=e.bytes??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};function v(){return{hash:new Uint8Array,partSetHeader:void 0}}e.BlockID={encode(t,n=r.default.Writer.create()){return t.hash.length!==0&&n.uint32(10).bytes(t.hash),t.partSetHeader!==void 0&&e.PartSetHeader.encode(t.partSetHeader,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.hash=i.bytes();break;case 2:o.partSetHeader=e.PartSetHeader.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{hash:R(t.hash)?j(t.hash):new Uint8Array,partSetHeader:R(t.partSetHeader)?e.PartSetHeader.fromJSON(t.partSetHeader):void 0}},toJSON(t){let n={};return t.hash!==void 0&&(n.hash=N(t.hash===void 0?new Uint8Array:t.hash)),t.partSetHeader!==void 0&&(n.partSetHeader=t.partSetHeader?e.PartSetHeader.toJSON(t.partSetHeader):void 0),n},fromPartial(t){let n=v();return n.hash=t.hash??new Uint8Array,n.partSetHeader=t.partSetHeader!==void 0&&t.partSetHeader!==null?e.PartSetHeader.fromPartial(t.partSetHeader):void 0,n}};function y(){return{version:void 0,chainId:``,height:`0`,time:void 0,lastBlockId:void 0,lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={encode(t,n=r.default.Writer.create()){return t.version!==void 0&&o.Consensus.encode(t.version,n.uint32(10).fork()).ldelim(),t.chainId!==``&&n.uint32(18).string(t.chainId),t.height!==`0`&&n.uint32(24).int64(t.height),t.time!==void 0&&i.Timestamp.encode(P(t.time),n.uint32(34).fork()).ldelim(),t.lastBlockId!==void 0&&e.BlockID.encode(t.lastBlockId,n.uint32(42).fork()).ldelim(),t.lastCommitHash.length!==0&&n.uint32(50).bytes(t.lastCommitHash),t.dataHash.length!==0&&n.uint32(58).bytes(t.dataHash),t.validatorsHash.length!==0&&n.uint32(66).bytes(t.validatorsHash),t.nextValidatorsHash.length!==0&&n.uint32(74).bytes(t.nextValidatorsHash),t.consensusHash.length!==0&&n.uint32(82).bytes(t.consensusHash),t.appHash.length!==0&&n.uint32(90).bytes(t.appHash),t.lastResultsHash.length!==0&&n.uint32(98).bytes(t.lastResultsHash),t.evidenceHash.length!==0&&n.uint32(106).bytes(t.evidenceHash),t.proposerAddress.length!==0&&n.uint32(114).bytes(t.proposerAddress),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=y();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.version=o.Consensus.decode(a,a.uint32());break;case 2:c.chainId=a.string();break;case 3:c.height=L(a.int64());break;case 4:c.time=F(i.Timestamp.decode(a,a.uint32()));break;case 5:c.lastBlockId=e.BlockID.decode(a,a.uint32());break;case 6:c.lastCommitHash=a.bytes();break;case 7:c.dataHash=a.bytes();break;case 8:c.validatorsHash=a.bytes();break;case 9:c.nextValidatorsHash=a.bytes();break;case 10:c.consensusHash=a.bytes();break;case 11:c.appHash=a.bytes();break;case 12:c.lastResultsHash=a.bytes();break;case 13:c.evidenceHash=a.bytes();break;case 14:c.proposerAddress=a.bytes();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{version:R(t.version)?o.Consensus.fromJSON(t.version):void 0,chainId:R(t.chainId)?String(t.chainId):``,height:R(t.height)?String(t.height):`0`,time:R(t.time)?I(t.time):void 0,lastBlockId:R(t.lastBlockId)?e.BlockID.fromJSON(t.lastBlockId):void 0,lastCommitHash:R(t.lastCommitHash)?j(t.lastCommitHash):new Uint8Array,dataHash:R(t.dataHash)?j(t.dataHash):new Uint8Array,validatorsHash:R(t.validatorsHash)?j(t.validatorsHash):new Uint8Array,nextValidatorsHash:R(t.nextValidatorsHash)?j(t.nextValidatorsHash):new Uint8Array,consensusHash:R(t.consensusHash)?j(t.consensusHash):new Uint8Array,appHash:R(t.appHash)?j(t.appHash):new Uint8Array,lastResultsHash:R(t.lastResultsHash)?j(t.lastResultsHash):new Uint8Array,evidenceHash:R(t.evidenceHash)?j(t.evidenceHash):new Uint8Array,proposerAddress:R(t.proposerAddress)?j(t.proposerAddress):new Uint8Array}},toJSON(t){let n={};return t.version!==void 0&&(n.version=t.version?o.Consensus.toJSON(t.version):void 0),t.chainId!==void 0&&(n.chainId=t.chainId),t.height!==void 0&&(n.height=t.height),t.time!==void 0&&(n.time=t.time.toISOString()),t.lastBlockId!==void 0&&(n.lastBlockId=t.lastBlockId?e.BlockID.toJSON(t.lastBlockId):void 0),t.lastCommitHash!==void 0&&(n.lastCommitHash=N(t.lastCommitHash===void 0?new Uint8Array:t.lastCommitHash)),t.dataHash!==void 0&&(n.dataHash=N(t.dataHash===void 0?new Uint8Array:t.dataHash)),t.validatorsHash!==void 0&&(n.validatorsHash=N(t.validatorsHash===void 0?new Uint8Array:t.validatorsHash)),t.nextValidatorsHash!==void 0&&(n.nextValidatorsHash=N(t.nextValidatorsHash===void 0?new Uint8Array:t.nextValidatorsHash)),t.consensusHash!==void 0&&(n.consensusHash=N(t.consensusHash===void 0?new Uint8Array:t.consensusHash)),t.appHash!==void 0&&(n.appHash=N(t.appHash===void 0?new Uint8Array:t.appHash)),t.lastResultsHash!==void 0&&(n.lastResultsHash=N(t.lastResultsHash===void 0?new Uint8Array:t.lastResultsHash)),t.evidenceHash!==void 0&&(n.evidenceHash=N(t.evidenceHash===void 0?new Uint8Array:t.evidenceHash)),t.proposerAddress!==void 0&&(n.proposerAddress=N(t.proposerAddress===void 0?new Uint8Array:t.proposerAddress)),n},fromPartial(t){let n=y();return n.version=t.version!==void 0&&t.version!==null?o.Consensus.fromPartial(t.version):void 0,n.chainId=t.chainId??``,n.height=t.height??`0`,n.time=t.time??void 0,n.lastBlockId=t.lastBlockId!==void 0&&t.lastBlockId!==null?e.BlockID.fromPartial(t.lastBlockId):void 0,n.lastCommitHash=t.lastCommitHash??new Uint8Array,n.dataHash=t.dataHash??new Uint8Array,n.validatorsHash=t.validatorsHash??new Uint8Array,n.nextValidatorsHash=t.nextValidatorsHash??new Uint8Array,n.consensusHash=t.consensusHash??new Uint8Array,n.appHash=t.appHash??new Uint8Array,n.lastResultsHash=t.lastResultsHash??new Uint8Array,n.evidenceHash=t.evidenceHash??new Uint8Array,n.proposerAddress=t.proposerAddress??new Uint8Array,n}};function b(){return{txs:[]}}e.Data={encode(e,t=r.default.Writer.create()){for(let n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.txs.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{txs:Array.isArray(e?.txs)?e.txs.map(e=>j(e)):[]}},toJSON(e){let t={};return e.txs?t.txs=e.txs.map(e=>N(e===void 0?new Uint8Array:e)):t.txs=[],t},fromPartial(e){let t=b();return t.txs=e.txs?.map(e=>e)||[],t}};function x(){return{type:0,height:`0`,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(34).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(42).fork()).ldelim(),t.validatorAddress.length!==0&&n.uint32(50).bytes(t.validatorAddress),t.validatorIndex!==0&&n.uint32(56).int32(t.validatorIndex),t.signature.length!==0&&n.uint32(66).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=x();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.blockId=e.BlockID.decode(a,a.uint32());break;case 5:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 6:s.validatorAddress=a.bytes();break;case 7:s.validatorIndex=a.int32();break;case 8:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,validatorAddress:R(t.validatorAddress)?j(t.validatorAddress):new Uint8Array,validatorIndex:R(t.validatorIndex)?Number(t.validatorIndex):0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.validatorAddress!==void 0&&(n.validatorAddress=N(t.validatorAddress===void 0?new Uint8Array:t.validatorAddress)),t.validatorIndex!==void 0&&(n.validatorIndex=Math.round(t.validatorIndex)),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=x();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.validatorAddress=t.validatorAddress??new Uint8Array,n.validatorIndex=t.validatorIndex??0,n.signature=t.signature??new Uint8Array,n}};function S(){return{height:`0`,round:0,blockId:void 0,signatures:[]}}e.Commit={encode(t,n=r.default.Writer.create()){t.height!==`0`&&n.uint32(8).int64(t.height),t.round!==0&&n.uint32(16).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(26).fork()).ldelim();for(let r of t.signatures)e.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=S();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.height=L(i.int64());break;case 2:o.round=i.int32();break;case 3:o.blockId=e.BlockID.decode(i,i.uint32());break;case 4:o.signatures.push(e.CommitSig.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.CommitSig.fromJSON(t)):[]}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.CommitSig.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=S();return n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.signatures=t.signatures?.map(t=>e.CommitSig.fromPartial(t))||[],n}};function C(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}e.CommitSig={encode(e,t=r.default.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&i.Timestamp.encode(P(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=C();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=F(i.Timestamp.decode(n,n.uint32()));break;case 4:o.signature=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{blockIdFlag:R(e.blockIdFlag)?l(e.blockIdFlag):0,validatorAddress:R(e.validatorAddress)?j(e.validatorAddress):new Uint8Array,timestamp:R(e.timestamp)?I(e.timestamp):void 0,signature:R(e.signature)?j(e.signature):new Uint8Array}},toJSON(e){let t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=u(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=N(e.validatorAddress===void 0?new Uint8Array:e.validatorAddress)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=N(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=C();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function w(){return{type:0,height:`0`,round:0,polRound:0,blockId:void 0,timestamp:void 0,signature:new Uint8Array}}e.Proposal={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.polRound!==0&&n.uint32(32).int32(t.polRound),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(42).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(50).fork()).ldelim(),t.signature.length!==0&&n.uint32(58).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=w();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.polRound=a.int32();break;case 5:s.blockId=e.BlockID.decode(a,a.uint32());break;case 6:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 7:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,polRound:R(t.polRound)?Number(t.polRound):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.polRound!==void 0&&(n.polRound=Math.round(t.polRound)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=w();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.polRound=t.polRound??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.signature=t.signature??new Uint8Array,n}};function T(){return{header:void 0,commit:void 0}}e.SignedHeader={encode(t,n=r.default.Writer.create()){return t.header!==void 0&&e.Header.encode(t.header,n.uint32(10).fork()).ldelim(),t.commit!==void 0&&e.Commit.encode(t.commit,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=T();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.header=e.Header.decode(i,i.uint32());break;case 2:o.commit=e.Commit.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{header:R(t.header)?e.Header.fromJSON(t.header):void 0,commit:R(t.commit)?e.Commit.fromJSON(t.commit):void 0}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.commit!==void 0&&(n.commit=t.commit?e.Commit.toJSON(t.commit):void 0),n},fromPartial(t){let n=T();return n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.commit=t.commit!==void 0&&t.commit!==null?e.Commit.fromPartial(t.commit):void 0,n}};function E(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={encode(t,n=r.default.Writer.create()){return t.signedHeader!==void 0&&e.SignedHeader.encode(t.signedHeader,n.uint32(10).fork()).ldelim(),t.validatorSet!==void 0&&s.ValidatorSet.encode(t.validatorSet,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signedHeader=e.SignedHeader.decode(i,i.uint32());break;case 2:o.validatorSet=s.ValidatorSet.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signedHeader:R(t.signedHeader)?e.SignedHeader.fromJSON(t.signedHeader):void 0,validatorSet:R(t.validatorSet)?s.ValidatorSet.fromJSON(t.validatorSet):void 0}},toJSON(t){let n={};return t.signedHeader!==void 0&&(n.signedHeader=t.signedHeader?e.SignedHeader.toJSON(t.signedHeader):void 0),t.validatorSet!==void 0&&(n.validatorSet=t.validatorSet?s.ValidatorSet.toJSON(t.validatorSet):void 0),n},fromPartial(t){let n=E();return n.signedHeader=t.signedHeader!==void 0&&t.signedHeader!==null?e.SignedHeader.fromPartial(t.signedHeader):void 0,n.validatorSet=t.validatorSet!==void 0&&t.validatorSet!==null?s.ValidatorSet.fromPartial(t.validatorSet):void 0,n}};function D(){return{blockId:void 0,blockSize:`0`,header:void 0,numTxs:`0`}}e.BlockMeta={encode(t,n=r.default.Writer.create()){return t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(10).fork()).ldelim(),t.blockSize!==`0`&&n.uint32(16).int64(t.blockSize),t.header!==void 0&&e.Header.encode(t.header,n.uint32(26).fork()).ldelim(),t.numTxs!==`0`&&n.uint32(32).int64(t.numTxs),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=D();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.blockId=e.BlockID.decode(i,i.uint32());break;case 2:o.blockSize=L(i.int64());break;case 3:o.header=e.Header.decode(i,i.uint32());break;case 4:o.numTxs=L(i.int64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,blockSize:R(t.blockSize)?String(t.blockSize):`0`,header:R(t.header)?e.Header.fromJSON(t.header):void 0,numTxs:R(t.numTxs)?String(t.numTxs):`0`}},toJSON(t){let n={};return t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.blockSize!==void 0&&(n.blockSize=t.blockSize),t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.numTxs!==void 0&&(n.numTxs=t.numTxs),n},fromPartial(t){let n=D();return n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.blockSize=t.blockSize??`0`,n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.numTxs=t.numTxs??`0`,n}};function O(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={encode(e,t=r.default.Writer.create()){return e.rootHash.length!==0&&t.uint32(10).bytes(e.rootHash),e.data.length!==0&&t.uint32(18).bytes(e.data),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=O();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{rootHash:R(e.rootHash)?j(e.rootHash):new Uint8Array,data:R(e.data)?j(e.data):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.rootHash!==void 0&&(t.rootHash=N(e.rootHash===void 0?new Uint8Array:e.rootHash)),e.data!==void 0&&(t.data=N(e.data===void 0?new Uint8Array:e.data)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=O();return t.rootHash=e.rootHash??new Uint8Array,t.data=e.data??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};var k=(()=>{if(k!==void 0)return k;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),A=k.atob||(e=>k.Buffer.from(e,`base64`).toString(`binary`));function j(e){let t=A(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var M=k.btoa||(e=>k.Buffer.from(e,`binary`).toString(`base64`));function N(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return M(t.join(``))}function P(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function F(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function I(e){return e instanceof Date?e:typeof e==`string`?new Date(e):F(i.Timestamp.fromJSON(e))}function L(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function R(e){return e!=null}})),nv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Any=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{typeUrl:``,value:new Uint8Array}}e.Any={encode(e,t=r.default.Writer.create()){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{typeUrl:u(e.typeUrl)?String(e.typeUrl):``,value:u(e.value)?s(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=l(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=i();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),rv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Duration=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Duration={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),iv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=tv(),o=nv(),s=rv(),c=q_();e.protobufPackage=`cosmos.staking.v1beta1`;var l;(function(e){e[e.BOND_STATUS_UNSPECIFIED=0]=`BOND_STATUS_UNSPECIFIED`,e[e.BOND_STATUS_UNBONDED=1]=`BOND_STATUS_UNBONDED`,e[e.BOND_STATUS_UNBONDING=2]=`BOND_STATUS_UNBONDING`,e[e.BOND_STATUS_BONDED=3]=`BOND_STATUS_BONDED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(l=e.BondStatus||={});function u(e){switch(e){case 0:case`BOND_STATUS_UNSPECIFIED`:return l.BOND_STATUS_UNSPECIFIED;case 1:case`BOND_STATUS_UNBONDED`:return l.BOND_STATUS_UNBONDED;case 2:case`BOND_STATUS_UNBONDING`:return l.BOND_STATUS_UNBONDING;case 3:case`BOND_STATUS_BONDED`:return l.BOND_STATUS_BONDED;default:return l.UNRECOGNIZED}}e.bondStatusFromJSON=u;function d(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return`BOND_STATUS_UNSPECIFIED`;case l.BOND_STATUS_UNBONDED:return`BOND_STATUS_UNBONDED`;case l.BOND_STATUS_UNBONDING:return`BOND_STATUS_UNBONDING`;case l.BOND_STATUS_BONDED:return`BOND_STATUS_BONDED`;default:return`UNKNOWN`}}e.bondStatusToJSON=d;function f(){return{header:void 0,valset:[]}}e.HistoricalInfo={encode(t,n=r.default.Writer.create()){t.header!==void 0&&a.Header.encode(t.header,n.uint32(10).fork()).ldelim();for(let r of t.valset)e.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=f();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.header=a.Header.decode(i,i.uint32());break;case 2:s.valset.push(e.Validator.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{header:I(t.header)?a.Header.fromJSON(t.header):void 0,valset:Array.isArray(t?.valset)?t.valset.map(t=>e.Validator.fromJSON(t)):[]}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?a.Header.toJSON(t.header):void 0),t.valset?n.valset=t.valset.map(t=>t?e.Validator.toJSON(t):void 0):n.valset=[],n},fromPartial(t){let n=f();return n.header=t.header!==void 0&&t.header!==null?a.Header.fromPartial(t.header):void 0,n.valset=t.valset?.map(t=>e.Validator.fromPartial(t))||[],n}};function p(){return{rate:``,maxRate:``,maxChangeRate:``}}e.CommissionRates={encode(e,t=r.default.Writer.create()){return e.rate!==``&&t.uint32(10).string(e.rate),e.maxRate!==``&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==``&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.rate=n.string();break;case 2:a.maxRate=n.string();break;case 3:a.maxChangeRate=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{rate:I(e.rate)?String(e.rate):``,maxRate:I(e.maxRate)?String(e.maxRate):``,maxChangeRate:I(e.maxChangeRate)?String(e.maxChangeRate):``}},toJSON(e){let t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){let t=p();return t.rate=e.rate??``,t.maxRate=e.maxRate??``,t.maxChangeRate=e.maxChangeRate??``,t}};function m(){return{commissionRates:void 0,updateTime:void 0}}e.Commission={encode(t,n=r.default.Writer.create()){return t.commissionRates!==void 0&&e.CommissionRates.encode(t.commissionRates,n.uint32(10).fork()).ldelim(),t.updateTime!==void 0&&i.Timestamp.encode(M(t.updateTime),n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=m();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.commissionRates=e.CommissionRates.decode(a,a.uint32());break;case 2:s.updateTime=N(i.Timestamp.decode(a,a.uint32()));break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{commissionRates:I(t.commissionRates)?e.CommissionRates.fromJSON(t.commissionRates):void 0,updateTime:I(t.updateTime)?P(t.updateTime):void 0}},toJSON(t){let n={};return t.commissionRates!==void 0&&(n.commissionRates=t.commissionRates?e.CommissionRates.toJSON(t.commissionRates):void 0),t.updateTime!==void 0&&(n.updateTime=t.updateTime.toISOString()),n},fromPartial(t){let n=m();return n.commissionRates=t.commissionRates!==void 0&&t.commissionRates!==null?e.CommissionRates.fromPartial(t.commissionRates):void 0,n.updateTime=t.updateTime??void 0,n}};function h(){return{moniker:``,identity:``,website:``,securityContact:``,details:``}}e.Description={encode(e,t=r.default.Writer.create()){return e.moniker!==``&&t.uint32(10).string(e.moniker),e.identity!==``&&t.uint32(18).string(e.identity),e.website!==``&&t.uint32(26).string(e.website),e.securityContact!==``&&t.uint32(34).string(e.securityContact),e.details!==``&&t.uint32(42).string(e.details),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=h();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.moniker=n.string();break;case 2:a.identity=n.string();break;case 3:a.website=n.string();break;case 4:a.securityContact=n.string();break;case 5:a.details=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{moniker:I(e.moniker)?String(e.moniker):``,identity:I(e.identity)?String(e.identity):``,website:I(e.website)?String(e.website):``,securityContact:I(e.securityContact)?String(e.securityContact):``,details:I(e.details)?String(e.details):``}},toJSON(e){let t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){let t=h();return t.moniker=e.moniker??``,t.identity=e.identity??``,t.website=e.website??``,t.securityContact=e.securityContact??``,t.details=e.details??``,t}};function g(){return{operatorAddress:``,consensusPubkey:void 0,jailed:!1,status:0,tokens:``,delegatorShares:``,description:void 0,unbondingHeight:`0`,unbondingTime:void 0,commission:void 0,minSelfDelegation:``}}e.Validator={encode(t,n=r.default.Writer.create()){return t.operatorAddress!==``&&n.uint32(10).string(t.operatorAddress),t.consensusPubkey!==void 0&&o.Any.encode(t.consensusPubkey,n.uint32(18).fork()).ldelim(),t.jailed===!0&&n.uint32(24).bool(t.jailed),t.status!==0&&n.uint32(32).int32(t.status),t.tokens!==``&&n.uint32(42).string(t.tokens),t.delegatorShares!==``&&n.uint32(50).string(t.delegatorShares),t.description!==void 0&&e.Description.encode(t.description,n.uint32(58).fork()).ldelim(),t.unbondingHeight!==`0`&&n.uint32(64).int64(t.unbondingHeight),t.unbondingTime!==void 0&&i.Timestamp.encode(M(t.unbondingTime),n.uint32(74).fork()).ldelim(),t.commission!==void 0&&e.Commission.encode(t.commission,n.uint32(82).fork()).ldelim(),t.minSelfDelegation!==``&&n.uint32(90).string(t.minSelfDelegation),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=g();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.operatorAddress=a.string();break;case 2:c.consensusPubkey=o.Any.decode(a,a.uint32());break;case 3:c.jailed=a.bool();break;case 4:c.status=a.int32();break;case 5:c.tokens=a.string();break;case 6:c.delegatorShares=a.string();break;case 7:c.description=e.Description.decode(a,a.uint32());break;case 8:c.unbondingHeight=F(a.int64());break;case 9:c.unbondingTime=N(i.Timestamp.decode(a,a.uint32()));break;case 10:c.commission=e.Commission.decode(a,a.uint32());break;case 11:c.minSelfDelegation=a.string();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{operatorAddress:I(t.operatorAddress)?String(t.operatorAddress):``,consensusPubkey:I(t.consensusPubkey)?o.Any.fromJSON(t.consensusPubkey):void 0,jailed:I(t.jailed)?!!t.jailed:!1,status:I(t.status)?u(t.status):0,tokens:I(t.tokens)?String(t.tokens):``,delegatorShares:I(t.delegatorShares)?String(t.delegatorShares):``,description:I(t.description)?e.Description.fromJSON(t.description):void 0,unbondingHeight:I(t.unbondingHeight)?String(t.unbondingHeight):`0`,unbondingTime:I(t.unbondingTime)?P(t.unbondingTime):void 0,commission:I(t.commission)?e.Commission.fromJSON(t.commission):void 0,minSelfDelegation:I(t.minSelfDelegation)?String(t.minSelfDelegation):``}},toJSON(t){let n={};return t.operatorAddress!==void 0&&(n.operatorAddress=t.operatorAddress),t.consensusPubkey!==void 0&&(n.consensusPubkey=t.consensusPubkey?o.Any.toJSON(t.consensusPubkey):void 0),t.jailed!==void 0&&(n.jailed=t.jailed),t.status!==void 0&&(n.status=d(t.status)),t.tokens!==void 0&&(n.tokens=t.tokens),t.delegatorShares!==void 0&&(n.delegatorShares=t.delegatorShares),t.description!==void 0&&(n.description=t.description?e.Description.toJSON(t.description):void 0),t.unbondingHeight!==void 0&&(n.unbondingHeight=t.unbondingHeight),t.unbondingTime!==void 0&&(n.unbondingTime=t.unbondingTime.toISOString()),t.commission!==void 0&&(n.commission=t.commission?e.Commission.toJSON(t.commission):void 0),t.minSelfDelegation!==void 0&&(n.minSelfDelegation=t.minSelfDelegation),n},fromPartial(t){let n=g();return n.operatorAddress=t.operatorAddress??``,n.consensusPubkey=t.consensusPubkey!==void 0&&t.consensusPubkey!==null?o.Any.fromPartial(t.consensusPubkey):void 0,n.jailed=t.jailed??!1,n.status=t.status??0,n.tokens=t.tokens??``,n.delegatorShares=t.delegatorShares??``,n.description=t.description!==void 0&&t.description!==null?e.Description.fromPartial(t.description):void 0,n.unbondingHeight=t.unbondingHeight??`0`,n.unbondingTime=t.unbondingTime??void 0,n.commission=t.commission!==void 0&&t.commission!==null?e.Commission.fromPartial(t.commission):void 0,n.minSelfDelegation=t.minSelfDelegation??``,n}};function _(){return{addresses:[]}}e.ValAddresses={encode(e,t=r.default.Writer.create()){for(let n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.addresses.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{addresses:Array.isArray(e?.addresses)?e.addresses.map(e=>String(e)):[]}},toJSON(e){let t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){let t=_();return t.addresses=e.addresses?.map(e=>e)||[],t}};function v(){return{delegatorAddress:``,validatorAddress:``}}e.DVPair={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=v();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function y(){return{pairs:[]}}e.DVPairs={encode(t,n=r.default.Writer.create()){for(let r of t.pairs)e.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=y();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.pairs.push(e.DVPair.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{pairs:Array.isArray(t?.pairs)?t.pairs.map(t=>e.DVPair.fromJSON(t)):[]}},toJSON(t){let n={};return t.pairs?n.pairs=t.pairs.map(t=>t?e.DVPair.toJSON(t):void 0):n.pairs=[],n},fromPartial(t){let n=y();return n.pairs=t.pairs?.map(t=>e.DVPair.fromPartial(t))||[],n}};function b(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``}}e.DVVTriplet={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:I(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:I(e.validatorDstAddress)?String(e.validatorDstAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){let t=b();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t}};function x(){return{triplets:[]}}e.DVVTriplets={encode(t,n=r.default.Writer.create()){for(let r of t.triplets)e.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.triplets.push(e.DVVTriplet.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{triplets:Array.isArray(t?.triplets)?t.triplets.map(t=>e.DVVTriplet.fromJSON(t)):[]}},toJSON(t){let n={};return t.triplets?n.triplets=t.triplets.map(t=>t?e.DVVTriplet.toJSON(t):void 0):n.triplets=[],n},fromPartial(t){let n=x();return n.triplets=t.triplets?.map(t=>e.DVVTriplet.fromPartial(t))||[],n}};function S(){return{delegatorAddress:``,validatorAddress:``,shares:``}}e.Delegation={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.shares!==``&&t.uint32(26).string(e.shares),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.shares=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``,shares:I(e.shares)?String(e.shares):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){let t=S();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.shares=e.shares??``,t}};function C(){return{delegatorAddress:``,validatorAddress:``,entries:[]}}e.UnbondingDelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorAddress!==``&&n.uint32(18).string(t.validatorAddress);for(let r of t.entries)e.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=C();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorAddress=i.string();break;case 3:o.entries.push(e.UnbondingDelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorAddress:I(t.validatorAddress)?String(t.validatorAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorAddress!==void 0&&(n.validatorAddress=t.validatorAddress),t.entries?n.entries=t.entries.map(t=>t?e.UnbondingDelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=C();return n.delegatorAddress=t.delegatorAddress??``,n.validatorAddress=t.validatorAddress??``,n.entries=t.entries?.map(t=>e.UnbondingDelegationEntry.fromPartial(t))||[],n}};function w(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,balance:``}}e.UnbondingDelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.balance!==``&&t.uint32(34).string(e.balance),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=w();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,balance:I(e.balance)?String(e.balance):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){let t=w();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.balance=e.balance??``,t}};function T(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,sharesDst:``}}e.RedelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.sharesDst!==``&&t.uint32(34).string(e.sharesDst),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=T();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,sharesDst:I(e.sharesDst)?String(e.sharesDst):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),t},fromPartial(e){let t=T();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.sharesDst=e.sharesDst??``,t}};function E(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,entries:[]}}e.Redelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorSrcAddress!==``&&n.uint32(18).string(t.validatorSrcAddress),t.validatorDstAddress!==``&&n.uint32(26).string(t.validatorDstAddress);for(let r of t.entries)e.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorSrcAddress=i.string();break;case 3:o.validatorDstAddress=i.string();break;case 4:o.entries.push(e.RedelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorSrcAddress:I(t.validatorSrcAddress)?String(t.validatorSrcAddress):``,validatorDstAddress:I(t.validatorDstAddress)?String(t.validatorDstAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorSrcAddress!==void 0&&(n.validatorSrcAddress=t.validatorSrcAddress),t.validatorDstAddress!==void 0&&(n.validatorDstAddress=t.validatorDstAddress),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=E();return n.delegatorAddress=t.delegatorAddress??``,n.validatorSrcAddress=t.validatorSrcAddress??``,n.validatorDstAddress=t.validatorDstAddress??``,n.entries=t.entries?.map(t=>e.RedelegationEntry.fromPartial(t))||[],n}};function D(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:``}}e.Params={encode(e,t=r.default.Writer.create()){return e.unbondingTime!==void 0&&s.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==``&&t.uint32(42).string(e.bondDenom),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=D();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.unbondingTime=s.Duration.decode(n,n.uint32());break;case 2:a.maxValidators=n.uint32();break;case 3:a.maxEntries=n.uint32();break;case 4:a.historicalEntries=n.uint32();break;case 5:a.bondDenom=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{unbondingTime:I(e.unbondingTime)?s.Duration.fromJSON(e.unbondingTime):void 0,maxValidators:I(e.maxValidators)?Number(e.maxValidators):0,maxEntries:I(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:I(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:I(e.bondDenom)?String(e.bondDenom):``}},toJSON(e){let t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?s.Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),t},fromPartial(e){let t=D();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?s.Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??``,t}};function O(){return{delegation:void 0,balance:void 0}}e.DelegationResponse={encode(t,n=r.default.Writer.create()){return t.delegation!==void 0&&e.Delegation.encode(t.delegation,n.uint32(10).fork()).ldelim(),t.balance!==void 0&&c.Coin.encode(t.balance,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=O();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegation=e.Delegation.decode(i,i.uint32());break;case 2:o.balance=c.Coin.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegation:I(t.delegation)?e.Delegation.fromJSON(t.delegation):void 0,balance:I(t.balance)?c.Coin.fromJSON(t.balance):void 0}},toJSON(t){let n={};return t.delegation!==void 0&&(n.delegation=t.delegation?e.Delegation.toJSON(t.delegation):void 0),t.balance!==void 0&&(n.balance=t.balance?c.Coin.toJSON(t.balance):void 0),n},fromPartial(t){let n=O();return n.delegation=t.delegation!==void 0&&t.delegation!==null?e.Delegation.fromPartial(t.delegation):void 0,n.balance=t.balance!==void 0&&t.balance!==null?c.Coin.fromPartial(t.balance):void 0,n}};function k(){return{redelegationEntry:void 0,balance:``}}e.RedelegationEntryResponse={encode(t,n=r.default.Writer.create()){return t.redelegationEntry!==void 0&&e.RedelegationEntry.encode(t.redelegationEntry,n.uint32(10).fork()).ldelim(),t.balance!==``&&n.uint32(34).string(t.balance),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=k();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegationEntry=e.RedelegationEntry.decode(i,i.uint32());break;case 4:o.balance=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegationEntry:I(t.redelegationEntry)?e.RedelegationEntry.fromJSON(t.redelegationEntry):void 0,balance:I(t.balance)?String(t.balance):``}},toJSON(t){let n={};return t.redelegationEntry!==void 0&&(n.redelegationEntry=t.redelegationEntry?e.RedelegationEntry.toJSON(t.redelegationEntry):void 0),t.balance!==void 0&&(n.balance=t.balance),n},fromPartial(t){let n=k();return n.redelegationEntry=t.redelegationEntry!==void 0&&t.redelegationEntry!==null?e.RedelegationEntry.fromPartial(t.redelegationEntry):void 0,n.balance=t.balance??``,n}};function A(){return{redelegation:void 0,entries:[]}}e.RedelegationResponse={encode(t,n=r.default.Writer.create()){t.redelegation!==void 0&&e.Redelegation.encode(t.redelegation,n.uint32(10).fork()).ldelim();for(let r of t.entries)e.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=A();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegation=e.Redelegation.decode(i,i.uint32());break;case 2:o.entries.push(e.RedelegationEntryResponse.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegation:I(t.redelegation)?e.Redelegation.fromJSON(t.redelegation):void 0,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(t){let n={};return t.redelegation!==void 0&&(n.redelegation=t.redelegation?e.Redelegation.toJSON(t.redelegation):void 0),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntryResponse.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=A();return n.redelegation=t.redelegation!==void 0&&t.redelegation!==null?e.Redelegation.fromPartial(t.redelegation):void 0,n.entries=t.entries?.map(t=>e.RedelegationEntryResponse.fromPartial(t))||[],n}};function j(){return{notBondedTokens:``,bondedTokens:``}}e.Pool={encode(e,t=r.default.Writer.create()){return e.notBondedTokens!==``&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==``&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=j();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.notBondedTokens=n.string();break;case 2:a.bondedTokens=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{notBondedTokens:I(e.notBondedTokens)?String(e.notBondedTokens):``,bondedTokens:I(e.bondedTokens)?String(e.bondedTokens):``}},toJSON(e){let t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){let t=j();return t.notBondedTokens=e.notBondedTokens??``,t.bondedTokens=e.bondedTokens??``,t}};function M(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function N(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function P(e){return e instanceof Date?e:typeof e==`string`?new Date(e):N(i.Timestamp.fromJSON(e))}function F(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function I(e){return e!=null}})),av=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=iv(),o=nv(),s=q_();e.protobufPackage=`cosmos.staking.v1beta1`;function c(){return{description:void 0,commission:void 0,minSelfDelegation:``,delegatorAddress:``,validatorAddress:``,pubkey:void 0,value:void 0}}e.MsgCreateValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==``&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==``&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&o.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&s.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,l=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:l.description=a.Description.decode(n,n.uint32());break;case 2:l.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:l.minSelfDelegation=n.string();break;case 4:l.delegatorAddress=n.string();break;case 5:l.validatorAddress=n.string();break;case 6:l.pubkey=o.Any.decode(n,n.uint32());break;case 7:l.value=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,commission:x(e.commission)?a.CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``,delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,pubkey:x(e.pubkey)?o.Any.fromJSON(e.pubkey):void 0,value:x(e.value)?s.Coin.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?o.Any.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?s.Coin.toJSON(e.value):void 0),t},fromPartial(e){let t=c();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?a.CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??``,t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?o.Any.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?s.Coin.fromPartial(e.value):void 0,t}};function l(){return{}}e.MsgCreateValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{description:void 0,validatorAddress:``,commissionRate:``,minSelfDelegation:``}}e.MsgEditValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==``&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==``&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,commissionRate:x(e.commissionRate)?String(e.commissionRate):``,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){let t=u();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??``,t.commissionRate=e.commissionRate??``,t.minSelfDelegation=e.minSelfDelegation??``,t}};function d(){return{}}e.MsgEditValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgDelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=f();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function p(){return{}}e.MsgDelegateResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};function m(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,amount:void 0}}e.MsgBeginRedelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;case 4:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:x(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:x(e.validatorDstAddress)?String(e.validatorDstAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=m();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function h(){return{completionTime:void 0}}e.MsgBeginRedelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=h();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=h();return t.completionTime=e.completionTime??void 0,t}};function g(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgUndelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=g();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function _(){return{completionTime:void 0}}e.MsgUndelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=_();return t.completionTime=e.completionTime??void 0,t}};function v(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function y(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function b(e){return e instanceof Date?e:typeof e==`string`?new Date(e):y(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function x(e){return e!=null}})),ov=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Grant=e.GenericAuthorization=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=nv();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{msg:``}}e.GenericAuthorization={encode(e,t=r.default.Writer.create()){return e.msg!==``&&t.uint32(10).string(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.msg=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{msg:d(e.msg)?String(e.msg):``}},toJSON(e){let t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){let t=o();return t.msg=e.msg??``,t}};function s(){return{authorization:void 0,expiration:void 0}}e.Grant={encode(e,t=r.default.Writer.create()){return e.authorization!==void 0&&a.Any.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&i.Timestamp.encode(c(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:c.authorization=a.Any.decode(n,n.uint32());break;case 2:c.expiration=l(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{authorization:d(e.authorization)?a.Any.fromJSON(e.authorization):void 0,expiration:d(e.expiration)?u(e.expiration):void 0}},toJSON(e){let t={};return e.authorization!==void 0&&(t.authorization=e.authorization?a.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){let t=s();return t.authorization=e.authorization!==void 0&&e.authorization!==null?a.Any.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function c(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function l(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function u(e){return e instanceof Date?e:typeof e==`string`?new Date(e):l(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),sv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=ov(),a=nv();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{granter:``,grantee:``,grant:void 0}}e.MsgGrant={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.grant!==void 0&&i.Grant.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.granter=n.string();break;case 2:s.grantee=n.string();break;case 3:s.grant=i.Grant.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,grant:y(e.grant)?i.Grant.fromJSON(e.grant):void 0}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?i.Grant.toJSON(e.grant):void 0),t},fromPartial(e){let t=o();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.grant=e.grant!==void 0&&e.grant!==null?i.Grant.fromPartial(e.grant):void 0,t}};function s(){return{results:[]}}e.MsgExecResponse={encode(e,t=r.default.Writer.create()){for(let n of e.results)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.results.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{results:Array.isArray(e?.results)?e.results.map(e=>g(e)):[]}},toJSON(e){let t={};return e.results?t.results=e.results.map(e=>v(e===void 0?new Uint8Array:e)):t.results=[],t},fromPartial(e){let t=s();return t.results=e.results?.map(e=>e)||[],t}};function c(){return{grantee:``,msgs:[]}}e.MsgExec={encode(e,t=r.default.Writer.create()){e.grantee!==``&&t.uint32(10).string(e.grantee);for(let n of e.msgs)a.Any.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.grantee=n.string();break;case 2:o.msgs.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{grantee:y(e.grantee)?String(e.grantee):``,msgs:Array.isArray(e?.msgs)?e.msgs.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(e=>e?a.Any.toJSON(e):void 0):t.msgs=[],t},fromPartial(e){let t=c();return t.grantee=e.grantee??``,t.msgs=e.msgs?.map(e=>a.Any.fromPartial(e))||[],t}};function l(){return{}}e.MsgGrantResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{granter:``,grantee:``,msgTypeUrl:``}}e.MsgRevoke={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==``&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.msgTypeUrl=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,msgTypeUrl:y(e.msgTypeUrl)?String(e.msgTypeUrl):``}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){let t=u();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.msgTypeUrl=e.msgTypeUrl??``,t}};function d(){return{}}e.MsgRevokeResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};var f=(()=>{if(f!==void 0)return f;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),p=f.atob||(e=>f.Buffer.from(e,`base64`).toString(`binary`));function g(e){let t=p(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var _=f.btoa||(e=>f.Buffer.from(e,`binary`).toString(`base64`));function v(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return _(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function y(e){return e!=null}})),cv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=q_(),o=nv(),s=rv();e.protobufPackage=`cosmos.gov.v1beta1`;var c;(function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]=`VOTE_OPTION_UNSPECIFIED`,e[e.VOTE_OPTION_YES=1]=`VOTE_OPTION_YES`,e[e.VOTE_OPTION_ABSTAIN=2]=`VOTE_OPTION_ABSTAIN`,e[e.VOTE_OPTION_NO=3]=`VOTE_OPTION_NO`,e[e.VOTE_OPTION_NO_WITH_VETO=4]=`VOTE_OPTION_NO_WITH_VETO`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.VoteOption||={});function l(e){switch(e){case 0:case`VOTE_OPTION_UNSPECIFIED`:return c.VOTE_OPTION_UNSPECIFIED;case 1:case`VOTE_OPTION_YES`:return c.VOTE_OPTION_YES;case 2:case`VOTE_OPTION_ABSTAIN`:return c.VOTE_OPTION_ABSTAIN;case 3:case`VOTE_OPTION_NO`:return c.VOTE_OPTION_NO;case 4:case`VOTE_OPTION_NO_WITH_VETO`:return c.VOTE_OPTION_NO_WITH_VETO;default:return c.UNRECOGNIZED}}e.voteOptionFromJSON=l;function u(e){switch(e){case c.VOTE_OPTION_UNSPECIFIED:return`VOTE_OPTION_UNSPECIFIED`;case c.VOTE_OPTION_YES:return`VOTE_OPTION_YES`;case c.VOTE_OPTION_ABSTAIN:return`VOTE_OPTION_ABSTAIN`;case c.VOTE_OPTION_NO:return`VOTE_OPTION_NO`;case c.VOTE_OPTION_NO_WITH_VETO:return`VOTE_OPTION_NO_WITH_VETO`;default:return`UNKNOWN`}}e.voteOptionToJSON=u;var d;(function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]=`PROPOSAL_STATUS_UNSPECIFIED`,e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]=`PROPOSAL_STATUS_DEPOSIT_PERIOD`,e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]=`PROPOSAL_STATUS_VOTING_PERIOD`,e[e.PROPOSAL_STATUS_PASSED=3]=`PROPOSAL_STATUS_PASSED`,e[e.PROPOSAL_STATUS_REJECTED=4]=`PROPOSAL_STATUS_REJECTED`,e[e.PROPOSAL_STATUS_FAILED=5]=`PROPOSAL_STATUS_FAILED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.ProposalStatus||={});function f(e){switch(e){case 0:case`PROPOSAL_STATUS_UNSPECIFIED`:return d.PROPOSAL_STATUS_UNSPECIFIED;case 1:case`PROPOSAL_STATUS_DEPOSIT_PERIOD`:return d.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case`PROPOSAL_STATUS_VOTING_PERIOD`:return d.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case`PROPOSAL_STATUS_PASSED`:return d.PROPOSAL_STATUS_PASSED;case 4:case`PROPOSAL_STATUS_REJECTED`:return d.PROPOSAL_STATUS_REJECTED;case 5:case`PROPOSAL_STATUS_FAILED`:return d.PROPOSAL_STATUS_FAILED;default:return d.UNRECOGNIZED}}e.proposalStatusFromJSON=f;function p(e){switch(e){case d.PROPOSAL_STATUS_UNSPECIFIED:return`PROPOSAL_STATUS_UNSPECIFIED`;case d.PROPOSAL_STATUS_DEPOSIT_PERIOD:return`PROPOSAL_STATUS_DEPOSIT_PERIOD`;case d.PROPOSAL_STATUS_VOTING_PERIOD:return`PROPOSAL_STATUS_VOTING_PERIOD`;case d.PROPOSAL_STATUS_PASSED:return`PROPOSAL_STATUS_PASSED`;case d.PROPOSAL_STATUS_REJECTED:return`PROPOSAL_STATUS_REJECTED`;case d.PROPOSAL_STATUS_FAILED:return`PROPOSAL_STATUS_FAILED`;default:return`UNKNOWN`}}e.proposalStatusToJSON=p;function g(){return{option:0,weight:``}}e.WeightedVoteOption={encode(e,t=r.default.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==``&&t.uint32(18).string(e.weight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.option=n.int32();break;case 2:a.weight=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{option:P(e.option)?l(e.option):0,weight:P(e.weight)?String(e.weight):``}},toJSON(e){let t={};return e.option!==void 0&&(t.option=u(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){let t=g();return t.option=e.option??0,t.weight=e.weight??``,t}};function _(){return{title:``,description:``}}e.TextProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:P(e.title)?String(e.title):``,description:P(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=_();return t.title=e.title??``,t.description=e.description??``,t}};function v(){return{proposalId:`0`,depositor:``,amount:[]}}e.Deposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=N(n.uint64());break;case 2:o.depositor=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:P(e.proposalId)?String(e.proposalId):`0`,depositor:P(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=v();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>a.Coin.fromPartial(e))||[],t}};function y(){return{proposalId:`0`,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}e.Proposal={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.content!==void 0&&o.Any.encode(t.content,n.uint32(18).fork()).ldelim(),t.status!==0&&n.uint32(24).int32(t.status),t.finalTallyResult!==void 0&&e.TallyResult.encode(t.finalTallyResult,n.uint32(34).fork()).ldelim(),t.submitTime!==void 0&&i.Timestamp.encode(A(t.submitTime),n.uint32(42).fork()).ldelim(),t.depositEndTime!==void 0&&i.Timestamp.encode(A(t.depositEndTime),n.uint32(50).fork()).ldelim();for(let e of t.totalDeposit)a.Coin.encode(e,n.uint32(58).fork()).ldelim();return t.votingStartTime!==void 0&&i.Timestamp.encode(A(t.votingStartTime),n.uint32(66).fork()).ldelim(),t.votingEndTime!==void 0&&i.Timestamp.encode(A(t.votingEndTime),n.uint32(74).fork()).ldelim(),n},decode(t,n){let s=t instanceof r.default.Reader?t:new r.default.Reader(t),c=n===void 0?s.len:s.pos+n,l=y();for(;s.pos<c;){let t=s.uint32();switch(t>>>3){case 1:l.proposalId=N(s.uint64());break;case 2:l.content=o.Any.decode(s,s.uint32());break;case 3:l.status=s.int32();break;case 4:l.finalTallyResult=e.TallyResult.decode(s,s.uint32());break;case 5:l.submitTime=j(i.Timestamp.decode(s,s.uint32()));break;case 6:l.depositEndTime=j(i.Timestamp.decode(s,s.uint32()));break;case 7:l.totalDeposit.push(a.Coin.decode(s,s.uint32()));break;case 8:l.votingStartTime=j(i.Timestamp.decode(s,s.uint32()));break;case 9:l.votingEndTime=j(i.Timestamp.decode(s,s.uint32()));break;default:s.skipType(t&7);break}}return l},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,content:P(t.content)?o.Any.fromJSON(t.content):void 0,status:P(t.status)?f(t.status):0,finalTallyResult:P(t.finalTallyResult)?e.TallyResult.fromJSON(t.finalTallyResult):void 0,submitTime:P(t.submitTime)?M(t.submitTime):void 0,depositEndTime:P(t.depositEndTime)?M(t.depositEndTime):void 0,totalDeposit:Array.isArray(t?.totalDeposit)?t.totalDeposit.map(e=>a.Coin.fromJSON(e)):[],votingStartTime:P(t.votingStartTime)?M(t.votingStartTime):void 0,votingEndTime:P(t.votingEndTime)?M(t.votingEndTime):void 0}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.content!==void 0&&(n.content=t.content?o.Any.toJSON(t.content):void 0),t.status!==void 0&&(n.status=p(t.status)),t.finalTallyResult!==void 0&&(n.finalTallyResult=t.finalTallyResult?e.TallyResult.toJSON(t.finalTallyResult):void 0),t.submitTime!==void 0&&(n.submitTime=t.submitTime.toISOString()),t.depositEndTime!==void 0&&(n.depositEndTime=t.depositEndTime.toISOString()),t.totalDeposit?n.totalDeposit=t.totalDeposit.map(e=>e?a.Coin.toJSON(e):void 0):n.totalDeposit=[],t.votingStartTime!==void 0&&(n.votingStartTime=t.votingStartTime.toISOString()),t.votingEndTime!==void 0&&(n.votingEndTime=t.votingEndTime.toISOString()),n},fromPartial(t){let n=y();return n.proposalId=t.proposalId??`0`,n.content=t.content!==void 0&&t.content!==null?o.Any.fromPartial(t.content):void 0,n.status=t.status??0,n.finalTallyResult=t.finalTallyResult!==void 0&&t.finalTallyResult!==null?e.TallyResult.fromPartial(t.finalTallyResult):void 0,n.submitTime=t.submitTime??void 0,n.depositEndTime=t.depositEndTime??void 0,n.totalDeposit=t.totalDeposit?.map(e=>a.Coin.fromPartial(e))||[],n.votingStartTime=t.votingStartTime??void 0,n.votingEndTime=t.votingEndTime??void 0,n}};function b(){return{yes:``,abstain:``,no:``,noWithVeto:``}}e.TallyResult={encode(e,t=r.default.Writer.create()){return e.yes!==``&&t.uint32(10).string(e.yes),e.abstain!==``&&t.uint32(18).string(e.abstain),e.no!==``&&t.uint32(26).string(e.no),e.noWithVeto!==``&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.yes=n.string();break;case 2:a.abstain=n.string();break;case 3:a.no=n.string();break;case 4:a.noWithVeto=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{yes:P(e.yes)?String(e.yes):``,abstain:P(e.abstain)?String(e.abstain):``,no:P(e.no)?String(e.no):``,noWithVeto:P(e.noWithVeto)?String(e.noWithVeto):``}},toJSON(e){let t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){let t=b();return t.yes=e.yes??``,t.abstain=e.abstain??``,t.no=e.no??``,t.noWithVeto=e.noWithVeto??``,t}};function x(){return{proposalId:`0`,voter:``,option:0,options:[]}}e.Vote={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.voter!==``&&n.uint32(18).string(t.voter),t.option!==0&&n.uint32(24).int32(t.option);for(let r of t.options)e.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.proposalId=N(i.uint64());break;case 2:o.voter=i.string();break;case 3:o.option=i.int32();break;case 4:o.options.push(e.WeightedVoteOption.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,voter:P(t.voter)?String(t.voter):``,option:P(t.option)?l(t.option):0,options:Array.isArray(t?.options)?t.options.map(t=>e.WeightedVoteOption.fromJSON(t)):[]}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.voter!==void 0&&(n.voter=t.voter),t.option!==void 0&&(n.option=u(t.option)),t.options?n.options=t.options.map(t=>t?e.WeightedVoteOption.toJSON(t):void 0):n.options=[],n},fromPartial(t){let n=x();return n.proposalId=t.proposalId??`0`,n.voter=t.voter??``,n.option=t.option??0,n.options=t.options?.map(t=>e.WeightedVoteOption.fromPartial(t))||[],n}};function S(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={encode(e,t=r.default.Writer.create()){for(let n of e.minDeposit)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&s.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.minDeposit.push(a.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{minDeposit:Array.isArray(e?.minDeposit)?e.minDeposit.map(e=>a.Coin.fromJSON(e)):[],maxDepositPeriod:P(e.maxDepositPeriod)?s.Duration.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){let t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?a.Coin.toJSON(e):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?s.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){let t=S();return t.minDeposit=e.minDeposit?.map(e=>a.Coin.fromPartial(e))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?s.Duration.fromPartial(e.maxDepositPeriod):void 0,t}};function C(){return{votingPeriod:void 0}}e.VotingParams={encode(e,t=r.default.Writer.create()){return e.votingPeriod!==void 0&&s.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=C();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.votingPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{votingPeriod:P(e.votingPeriod)?s.Duration.fromJSON(e.votingPeriod):void 0}},toJSON(e){let t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?s.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){let t=C();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?s.Duration.fromPartial(e.votingPeriod):void 0,t}};function w(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={encode(e,t=r.default.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=w();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.quorum=n.bytes();break;case 2:a.threshold=n.bytes();break;case 3:a.vetoThreshold=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{quorum:P(e.quorum)?D(e.quorum):new Uint8Array,threshold:P(e.threshold)?D(e.threshold):new Uint8Array,vetoThreshold:P(e.vetoThreshold)?D(e.vetoThreshold):new Uint8Array}},toJSON(e){let t={};return e.quorum!==void 0&&(t.quorum=k(e.quorum===void 0?new Uint8Array:e.quorum)),e.threshold!==void 0&&(t.threshold=k(e.threshold===void 0?new Uint8Array:e.threshold)),e.vetoThreshold!==void 0&&(t.vetoThreshold=k(e.vetoThreshold===void 0?new Uint8Array:e.vetoThreshold)),t},fromPartial(e){let t=w();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var T=(()=>{if(T!==void 0)return T;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),E=T.atob||(e=>T.Buffer.from(e,`base64`).toString(`binary`));function D(e){let t=E(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var O=T.btoa||(e=>T.Buffer.from(e,`binary`).toString(`base64`));function k(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return O(t.join(``))}function A(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function j(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function M(e){return e instanceof Date?e:typeof e==`string`?new Date(e):j(i.Timestamp.fromJSON(e))}function N(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function P(e){return e!=null}})),lv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=cv(),a=nv(),o=q_();e.protobufPackage=`cosmos.gov.v1beta1`;function s(){return{content:void 0,initialDeposit:[],proposer:``}}e.MsgSubmitProposal={encode(e,t=r.default.Writer.create()){e.content!==void 0&&a.Any.encode(e.content,t.uint32(10).fork()).ldelim();for(let n of e.initialDeposit)o.Coin.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==``&&t.uint32(26).string(e.proposer),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:c.content=a.Any.decode(n,n.uint32());break;case 2:c.initialDeposit.push(o.Coin.decode(n,n.uint32()));break;case 3:c.proposer=n.string();break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{content:g(e.content)?a.Any.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e?.initialDeposit)?e.initialDeposit.map(e=>o.Coin.fromJSON(e)):[],proposer:g(e.proposer)?String(e.proposer):``}},toJSON(e){let t={};return e.content!==void 0&&(t.content=e.content?a.Any.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(e=>e?o.Coin.toJSON(e):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){let t=s();return t.content=e.content!==void 0&&e.content!==null?a.Any.fromPartial(e.content):void 0,t.initialDeposit=e.initialDeposit?.map(e=>o.Coin.fromPartial(e))||[],t.proposer=e.proposer??``,t}};function c(){return{proposalId:`0`}}e.MsgSubmitProposalResponse={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),t},fromPartial(e){let t=c();return t.proposalId=e.proposalId??`0`,t}};function l(){return{proposalId:`0`,voter:``,option:0}}e.MsgVote={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.voter=n.string();break;case 3:a.option=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,option:g(e.option)?(0,i.voteOptionFromJSON)(e.option):0}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=(0,i.voteOptionToJSON)(e.option)),t},fromPartial(e){let t=l();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.option=e.option??0,t}};function u(){return{}}e.MsgVoteResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{proposalId:`0`,voter:``,options:[]}}e.MsgVoteWeighted={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter);for(let n of e.options)i.WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=h(n.uint64());break;case 2:o.voter=n.string();break;case 3:o.options.push(i.WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,options:Array.isArray(e?.options)?e.options.map(e=>i.WeightedVoteOption.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(e=>e?i.WeightedVoteOption.toJSON(e):void 0):t.options=[],t},fromPartial(e){let t=d();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.options=e.options?.map(e=>i.WeightedVoteOption.fromPartial(e))||[],t}};function f(){return{}}e.MsgVoteWeightedResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}};function p(){return{proposalId:`0`,depositor:``,amount:[]}}e.MsgDeposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)o.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.depositor=n.string();break;case 3:a.amount.push(o.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,depositor:g(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>o.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?o.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=p();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>o.Coin.fromPartial(e))||[],t}};function m(){return{}}e.MsgDepositResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return m()}};function h(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),uv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.distribution.v1beta1`;function a(){return{delegatorAddress:``,withdrawAddress:``}}e.MsgSetWithdrawAddress={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==``&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,withdrawAddress:p(e.withdrawAddress)?String(e.withdrawAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){let t=a();return t.delegatorAddress=e.delegatorAddress??``,t.withdrawAddress=e.withdrawAddress??``,t}};function o(){return{}}e.MsgSetWithdrawAddressResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return o()}};function s(){return{delegatorAddress:``,validatorAddress:``}}e.MsgWithdrawDelegatorReward={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=s();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function c(){return{}}e.MsgWithdrawDelegatorRewardResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return c()}};function l(){return{validatorAddress:``}}e.MsgWithdrawValidatorCommission={encode(e,t=r.default.Writer.create()){return e.validatorAddress!==``&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=l();return t.validatorAddress=e.validatorAddress??``,t}};function u(){return{}}e.MsgWithdrawValidatorCommissionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{amount:[],depositor:``}}e.MsgFundCommunityPool={encode(e,t=r.default.Writer.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==``&&t.uint32(18).string(e.depositor),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[],depositor:p(e.depositor)?String(e.depositor):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){let t=d();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.depositor=e.depositor??``,t}};function f(){return{}}e.MsgFundCommunityPoolResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function p(e){return e!=null}})),dv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Model=e.AbsoluteTxPosition=e.ContractCodeHistoryEntry=e.ContractInfo=e.CodeInfo=e.Params=e.AccessConfig=e.AccessTypeParam=e.contractCodeHistoryOperationTypeToJSON=e.contractCodeHistoryOperationTypeFromJSON=e.ContractCodeHistoryOperationType=e.accessTypeToJSON=e.accessTypeFromJSON=e.AccessType=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv();e.protobufPackage=`cosmwasm.wasm.v1`;var a;(function(e){e[e.ACCESS_TYPE_UNSPECIFIED=0]=`ACCESS_TYPE_UNSPECIFIED`,e[e.ACCESS_TYPE_NOBODY=1]=`ACCESS_TYPE_NOBODY`,e[e.ACCESS_TYPE_ONLY_ADDRESS=2]=`ACCESS_TYPE_ONLY_ADDRESS`,e[e.ACCESS_TYPE_EVERYBODY=3]=`ACCESS_TYPE_EVERYBODY`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AccessType||={});function o(e){switch(e){case 0:case`ACCESS_TYPE_UNSPECIFIED`:return a.ACCESS_TYPE_UNSPECIFIED;case 1:case`ACCESS_TYPE_NOBODY`:return a.ACCESS_TYPE_NOBODY;case 2:case`ACCESS_TYPE_ONLY_ADDRESS`:return a.ACCESS_TYPE_ONLY_ADDRESS;case 3:case`ACCESS_TYPE_EVERYBODY`:return a.ACCESS_TYPE_EVERYBODY;default:return a.UNRECOGNIZED}}e.accessTypeFromJSON=o;function s(e){switch(e){case a.ACCESS_TYPE_UNSPECIFIED:return`ACCESS_TYPE_UNSPECIFIED`;case a.ACCESS_TYPE_NOBODY:return`ACCESS_TYPE_NOBODY`;case a.ACCESS_TYPE_ONLY_ADDRESS:return`ACCESS_TYPE_ONLY_ADDRESS`;case a.ACCESS_TYPE_EVERYBODY:return`ACCESS_TYPE_EVERYBODY`;default:return`UNKNOWN`}}e.accessTypeToJSON=s;var c;(function(e){e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED=0]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT=1]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE=2]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS=3]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.ContractCodeHistoryOperationType||={});function l(e){switch(e){case 0:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;case 1:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;case 2:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;case 3:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;default:return c.UNRECOGNIZED}}e.contractCodeHistoryOperationTypeFromJSON=l;function u(e){switch(e){case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`;default:return`UNKNOWN`}}e.contractCodeHistoryOperationTypeToJSON=u;function d(){return{value:0}}e.AccessTypeParam={encode(e,t=r.default.Writer.create()){return e.value!==0&&t.uint32(8).int32(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.value=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{value:D(e.value)?o(e.value):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=s(e.value)),t},fromPartial(e){let t=d();return t.value=e.value??0,t}};function f(){return{permission:0,address:``}}e.AccessConfig={encode(e,t=r.default.Writer.create()){return e.permission!==0&&t.uint32(8).int32(e.permission),e.address!==``&&t.uint32(18).string(e.address),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.permission=n.int32();break;case 2:a.address=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{permission:D(e.permission)?o(e.permission):0,address:D(e.address)?String(e.address):``}},toJSON(e){let t={};return e.permission!==void 0&&(t.permission=s(e.permission)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){let t=f();return t.permission=e.permission??0,t.address=e.address??``,t}};function p(){return{codeUploadAccess:void 0,instantiateDefaultPermission:0,maxWasmCodeSize:`0`}}e.Params={encode(t,n=r.default.Writer.create()){return t.codeUploadAccess!==void 0&&e.AccessConfig.encode(t.codeUploadAccess,n.uint32(10).fork()).ldelim(),t.instantiateDefaultPermission!==0&&n.uint32(16).int32(t.instantiateDefaultPermission),t.maxWasmCodeSize!==`0`&&n.uint32(24).uint64(t.maxWasmCodeSize),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=p();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeUploadAccess=e.AccessConfig.decode(i,i.uint32());break;case 2:o.instantiateDefaultPermission=i.int32();break;case 3:o.maxWasmCodeSize=E(i.uint64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeUploadAccess:D(t.codeUploadAccess)?e.AccessConfig.fromJSON(t.codeUploadAccess):void 0,instantiateDefaultPermission:D(t.instantiateDefaultPermission)?o(t.instantiateDefaultPermission):0,maxWasmCodeSize:D(t.maxWasmCodeSize)?String(t.maxWasmCodeSize):`0`}},toJSON(t){let n={};return t.codeUploadAccess!==void 0&&(n.codeUploadAccess=t.codeUploadAccess?e.AccessConfig.toJSON(t.codeUploadAccess):void 0),t.instantiateDefaultPermission!==void 0&&(n.instantiateDefaultPermission=s(t.instantiateDefaultPermission)),t.maxWasmCodeSize!==void 0&&(n.maxWasmCodeSize=t.maxWasmCodeSize),n},fromPartial(t){let n=p();return n.codeUploadAccess=t.codeUploadAccess!==void 0&&t.codeUploadAccess!==null?e.AccessConfig.fromPartial(t.codeUploadAccess):void 0,n.instantiateDefaultPermission=t.instantiateDefaultPermission??0,n.maxWasmCodeSize=t.maxWasmCodeSize??`0`,n}};function g(){return{codeHash:new Uint8Array,creator:``,instantiateConfig:void 0}}e.CodeInfo={encode(t,n=r.default.Writer.create()){return t.codeHash.length!==0&&n.uint32(10).bytes(t.codeHash),t.creator!==``&&n.uint32(18).string(t.creator),t.instantiateConfig!==void 0&&e.AccessConfig.encode(t.instantiateConfig,n.uint32(42).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeHash=i.bytes();break;case 2:o.creator=i.string();break;case 5:o.instantiateConfig=e.AccessConfig.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeHash:D(t.codeHash)?C(t.codeHash):new Uint8Array,creator:D(t.creator)?String(t.creator):``,instantiateConfig:D(t.instantiateConfig)?e.AccessConfig.fromJSON(t.instantiateConfig):void 0}},toJSON(t){let n={};return t.codeHash!==void 0&&(n.codeHash=T(t.codeHash===void 0?new Uint8Array:t.codeHash)),t.creator!==void 0&&(n.creator=t.creator),t.instantiateConfig!==void 0&&(n.instantiateConfig=t.instantiateConfig?e.AccessConfig.toJSON(t.instantiateConfig):void 0),n},fromPartial(t){let n=g();return n.codeHash=t.codeHash??new Uint8Array,n.creator=t.creator??``,n.instantiateConfig=t.instantiateConfig!==void 0&&t.instantiateConfig!==null?e.AccessConfig.fromPartial(t.instantiateConfig):void 0,n}};function _(){return{codeId:`0`,creator:``,admin:``,label:``,created:void 0,ibcPortId:``,extension:void 0}}e.ContractInfo={encode(t,n=r.default.Writer.create()){return t.codeId!==`0`&&n.uint32(8).uint64(t.codeId),t.creator!==``&&n.uint32(18).string(t.creator),t.admin!==``&&n.uint32(26).string(t.admin),t.label!==``&&n.uint32(34).string(t.label),t.created!==void 0&&e.AbsoluteTxPosition.encode(t.created,n.uint32(42).fork()).ldelim(),t.ibcPortId!==``&&n.uint32(50).string(t.ibcPortId),t.extension!==void 0&&i.Any.encode(t.extension,n.uint32(58).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=_();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.codeId=E(a.uint64());break;case 2:s.creator=a.string();break;case 3:s.admin=a.string();break;case 4:s.label=a.string();break;case 5:s.created=e.AbsoluteTxPosition.decode(a,a.uint32());break;case 6:s.ibcPortId=a.string();break;case 7:s.extension=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{codeId:D(t.codeId)?String(t.codeId):`0`,creator:D(t.creator)?String(t.creator):``,admin:D(t.admin)?String(t.admin):``,label:D(t.label)?String(t.label):``,created:D(t.created)?e.AbsoluteTxPosition.fromJSON(t.created):void 0,ibcPortId:D(t.ibcPortId)?String(t.ibcPortId):``,extension:D(t.extension)?i.Any.fromJSON(t.extension):void 0}},toJSON(t){let n={};return t.codeId!==void 0&&(n.codeId=t.codeId),t.creator!==void 0&&(n.creator=t.creator),t.admin!==void 0&&(n.admin=t.admin),t.label!==void 0&&(n.label=t.label),t.created!==void 0&&(n.created=t.created?e.AbsoluteTxPosition.toJSON(t.created):void 0),t.ibcPortId!==void 0&&(n.ibcPortId=t.ibcPortId),t.extension!==void 0&&(n.extension=t.extension?i.Any.toJSON(t.extension):void 0),n},fromPartial(t){let n=_();return n.codeId=t.codeId??`0`,n.creator=t.creator??``,n.admin=t.admin??``,n.label=t.label??``,n.created=t.created!==void 0&&t.created!==null?e.AbsoluteTxPosition.fromPartial(t.created):void 0,n.ibcPortId=t.ibcPortId??``,n.extension=t.extension!==void 0&&t.extension!==null?i.Any.fromPartial(t.extension):void 0,n}};function v(){return{operation:0,codeId:`0`,updated:void 0,msg:new Uint8Array}}e.ContractCodeHistoryEntry={encode(t,n=r.default.Writer.create()){return t.operation!==0&&n.uint32(8).int32(t.operation),t.codeId!==`0`&&n.uint32(16).uint64(t.codeId),t.updated!==void 0&&e.AbsoluteTxPosition.encode(t.updated,n.uint32(26).fork()).ldelim(),t.msg.length!==0&&n.uint32(34).bytes(t.msg),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.operation=i.int32();break;case 2:o.codeId=E(i.uint64());break;case 3:o.updated=e.AbsoluteTxPosition.decode(i,i.uint32());break;case 4:o.msg=i.bytes();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{operation:D(t.operation)?l(t.operation):0,codeId:D(t.codeId)?String(t.codeId):`0`,updated:D(t.updated)?e.AbsoluteTxPosition.fromJSON(t.updated):void 0,msg:D(t.msg)?C(t.msg):new Uint8Array}},toJSON(t){let n={};return t.operation!==void 0&&(n.operation=u(t.operation)),t.codeId!==void 0&&(n.codeId=t.codeId),t.updated!==void 0&&(n.updated=t.updated?e.AbsoluteTxPosition.toJSON(t.updated):void 0),t.msg!==void 0&&(n.msg=T(t.msg===void 0?new Uint8Array:t.msg)),n},fromPartial(t){let n=v();return n.operation=t.operation??0,n.codeId=t.codeId??`0`,n.updated=t.updated!==void 0&&t.updated!==null?e.AbsoluteTxPosition.fromPartial(t.updated):void 0,n.msg=t.msg??new Uint8Array,n}};function y(){return{blockHeight:`0`,txIndex:`0`}}e.AbsoluteTxPosition={encode(e,t=r.default.Writer.create()){return e.blockHeight!==`0`&&t.uint32(8).uint64(e.blockHeight),e.txIndex!==`0`&&t.uint32(16).uint64(e.txIndex),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.blockHeight=E(n.uint64());break;case 2:a.txIndex=E(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{blockHeight:D(e.blockHeight)?String(e.blockHeight):`0`,txIndex:D(e.txIndex)?String(e.txIndex):`0`}},toJSON(e){let t={};return e.blockHeight!==void 0&&(t.blockHeight=e.blockHeight),e.txIndex!==void 0&&(t.txIndex=e.txIndex),t},fromPartial(e){let t=y();return t.blockHeight=e.blockHeight??`0`,t.txIndex=e.txIndex??`0`,t}};function b(){return{key:new Uint8Array,value:new Uint8Array}}e.Model={encode(e,t=r.default.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.bytes();break;case 2:a.value=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:D(e.key)?C(e.key):new Uint8Array,value:D(e.value)?C(e.value):new Uint8Array}},toJSON(e){let t={};return e.key!==void 0&&(t.key=T(e.key===void 0?new Uint8Array:e.key)),e.value!==void 0&&(t.value=T(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=b();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};var x=(()=>{if(x!==void 0)return x;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),S=x.atob||(e=>x.Buffer.from(e,`base64`).toString(`binary`));function C(e){let t=S(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var w=x.btoa||(e=>x.Buffer.from(e,`binary`).toString(`base64`));function T(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return w(t.join(``))}function E(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function D(e){return e!=null}})),fv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClearAdminResponse=e.MsgClearAdmin=e.MsgUpdateAdminResponse=e.MsgUpdateAdmin=e.MsgMigrateContractResponse=e.MsgMigrateContract=e.MsgExecuteContractResponse=e.MsgExecuteContract=e.MsgInstantiateContractResponse=e.MsgInstantiateContract=e.MsgStoreCodeResponse=e.MsgStoreCode=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=dv(),a=q_();e.protobufPackage=`cosmwasm.wasm.v1`;function o(){return{sender:``,wasmByteCode:new Uint8Array,instantiatePermission:void 0}}e.MsgStoreCode={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.wasmByteCode.length!==0&&t.uint32(18).bytes(e.wasmByteCode),e.instantiatePermission!==void 0&&i.AccessConfig.encode(e.instantiatePermission,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.sender=n.string();break;case 2:s.wasmByteCode=n.bytes();break;case 5:s.instantiatePermission=i.AccessConfig.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,wasmByteCode:E(e.wasmByteCode)?S(e.wasmByteCode):new Uint8Array,instantiatePermission:E(e.instantiatePermission)?i.AccessConfig.fromJSON(e.instantiatePermission):void 0}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.wasmByteCode!==void 0&&(t.wasmByteCode=w(e.wasmByteCode===void 0?new Uint8Array:e.wasmByteCode)),e.instantiatePermission!==void 0&&(t.instantiatePermission=e.instantiatePermission?i.AccessConfig.toJSON(e.instantiatePermission):void 0),t},fromPartial(e){let t=o();return t.sender=e.sender??``,t.wasmByteCode=e.wasmByteCode??new Uint8Array,t.instantiatePermission=e.instantiatePermission!==void 0&&e.instantiatePermission!==null?i.AccessConfig.fromPartial(e.instantiatePermission):void 0,t}};function s(){return{codeId:`0`}}e.MsgStoreCodeResponse={encode(e,t=r.default.Writer.create()){return e.codeId!==`0`&&t.uint32(8).uint64(e.codeId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.codeId=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{codeId:E(e.codeId)?String(e.codeId):`0`}},toJSON(e){let t={};return e.codeId!==void 0&&(t.codeId=e.codeId),t},fromPartial(e){let t=s();return t.codeId=e.codeId??`0`,t}};function c(){return{sender:``,admin:``,codeId:`0`,label:``,msg:new Uint8Array,funds:[]}}e.MsgInstantiateContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.admin!==``&&t.uint32(18).string(e.admin),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.label!==``&&t.uint32(34).string(e.label),e.msg.length!==0&&t.uint32(42).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.admin=n.string();break;case 3:o.codeId=T(n.uint64());break;case 4:o.label=n.string();break;case 5:o.msg=n.bytes();break;case 6:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,admin:E(e.admin)?String(e.admin):``,codeId:E(e.codeId)?String(e.codeId):`0`,label:E(e.label)?String(e.label):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.admin!==void 0&&(t.admin=e.admin),e.codeId!==void 0&&(t.codeId=e.codeId),e.label!==void 0&&(t.label=e.label),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=c();return t.sender=e.sender??``,t.admin=e.admin??``,t.codeId=e.codeId??`0`,t.label=e.label??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function l(){return{address:``,data:new Uint8Array}}e.MsgInstantiateContractResponse={encode(e,t=r.default.Writer.create()){return e.address!==``&&t.uint32(10).string(e.address),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:E(e.address)?String(e.address):``,data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=l();return t.address=e.address??``,t.data=e.data??new Uint8Array,t}};function u(){return{sender:``,contract:``,msg:new Uint8Array,funds:[]}}e.MsgExecuteContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.msg.length!==0&&t.uint32(26).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(42).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.contract=n.string();break;case 3:o.msg=n.bytes();break;case 5:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=u();return t.sender=e.sender??``,t.contract=e.contract??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function d(){return{data:new Uint8Array}}e.MsgExecuteContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=d();return t.data=e.data??new Uint8Array,t}};function f(){return{sender:``,contract:``,codeId:`0`,msg:new Uint8Array}}e.MsgMigrateContract={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.msg.length!==0&&t.uint32(34).bytes(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.contract=n.string();break;case 3:a.codeId=T(n.uint64());break;case 4:a.msg=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,codeId:E(e.codeId)?String(e.codeId):`0`,msg:E(e.msg)?S(e.msg):new Uint8Array}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.codeId!==void 0&&(t.codeId=e.codeId),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),t},fromPartial(e){let t=f();return t.sender=e.sender??``,t.contract=e.contract??``,t.codeId=e.codeId??`0`,t.msg=e.msg??new Uint8Array,t}};function p(){return{data:new Uint8Array}}e.MsgMigrateContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=p();return t.data=e.data??new Uint8Array,t}};function g(){return{sender:``,newAdmin:``,contract:``}}e.MsgUpdateAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.newAdmin!==``&&t.uint32(18).string(e.newAdmin),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.newAdmin=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,newAdmin:E(e.newAdmin)?String(e.newAdmin):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=g();return t.sender=e.sender??``,t.newAdmin=e.newAdmin??``,t.contract=e.contract??``,t}};function _(){return{}}e.MsgUpdateAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return _()}};function v(){return{sender:``,contract:``}}e.MsgClearAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=v();return t.sender=e.sender??``,t.contract=e.contract??``,t}};function y(){return{}}e.MsgClearAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return y()}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),pv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ModuleVersion=e.CancelSoftwareUpgradeProposal=e.SoftwareUpgradeProposal=e.Plan=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=X_(),a=nv();e.protobufPackage=`cosmos.upgrade.v1beta1`;function o(){return{name:``,time:void 0,height:`0`,info:``,upgradedClientState:void 0}}e.Plan={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.time!==void 0&&i.Timestamp.encode(u(e.time),t.uint32(18).fork()).ldelim(),e.height!==`0`&&t.uint32(24).int64(e.height),e.info!==``&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&a.Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,c=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:c.name=n.string();break;case 2:c.time=d(i.Timestamp.decode(n,n.uint32()));break;case 3:c.height=p(n.int64());break;case 4:c.info=n.string();break;case 5:c.upgradedClientState=a.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{name:m(e.name)?String(e.name):``,time:m(e.time)?f(e.time):void 0,height:m(e.height)?String(e.height):`0`,info:m(e.info)?String(e.info):``,upgradedClientState:m(e.upgradedClientState)?a.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=e.height),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?a.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=o();return t.name=e.name??``,t.time=e.time??void 0,t.height=e.height??`0`,t.info=e.info??``,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?a.Any.fromPartial(e.upgradedClientState):void 0,t}};function s(){return{title:``,description:``,plan:void 0}}e.SoftwareUpgradeProposal={encode(t,n=r.default.Writer.create()){return t.title!==``&&n.uint32(10).string(t.title),t.description!==``&&n.uint32(18).string(t.description),t.plan!==void 0&&e.Plan.encode(t.plan,n.uint32(26).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=s();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.title=i.string();break;case 2:o.description=i.string();break;case 3:o.plan=e.Plan.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{title:m(t.title)?String(t.title):``,description:m(t.description)?String(t.description):``,plan:m(t.plan)?e.Plan.fromJSON(t.plan):void 0}},toJSON(t){let n={};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.plan!==void 0&&(n.plan=t.plan?e.Plan.toJSON(t.plan):void 0),n},fromPartial(t){let n=s();return n.title=t.title??``,n.description=t.description??``,n.plan=t.plan!==void 0&&t.plan!==null?e.Plan.fromPartial(t.plan):void 0,n}};function c(){return{title:``,description:``}}e.CancelSoftwareUpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=c();return t.title=e.title??``,t.description=e.description??``,t}};function l(){return{name:``,version:`0`}}e.ModuleVersion={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.version!==`0`&&t.uint32(16).uint64(e.version),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.name=n.string();break;case 2:a.version=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{name:m(e.name)?String(e.name):``,version:m(e.version)?String(e.version):`0`}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=e.version),t},fromPartial(e){let t=l();return t.name=e.name??``,t.version=e.version??`0`,t}};function u(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function d(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function f(e){return e instanceof Date?e:typeof e==`string`?new Date(e):d(i.Timestamp.fromJSON(e))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),mv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.Height=e.UpgradeProposal=e.ClientUpdateProposal=e.ClientConsensusStates=e.ConsensusStateWithHeight=e.IdentifiedClientState=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv(),a=pv();e.protobufPackage=`ibc.core.client.v1`;function o(){return{clientId:``,clientState:void 0}}e.IdentifiedClientState={encode(e,t=r.default.Writer.create()){return e.clientId!==``&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&i.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.clientId=n.string();break;case 2:s.clientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{clientId:m(e.clientId)?String(e.clientId):``,clientState:m(e.clientState)?i.Any.fromJSON(e.clientState):void 0}},toJSON(e){let t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?i.Any.toJSON(e.clientState):void 0),t},fromPartial(e){let t=o();return t.clientId=e.clientId??``,t.clientState=e.clientState!==void 0&&e.clientState!==null?i.Any.fromPartial(e.clientState):void 0,t}};function s(){return{height:void 0,consensusState:void 0}}e.ConsensusStateWithHeight={encode(t,n=r.default.Writer.create()){return t.height!==void 0&&e.Height.encode(t.height,n.uint32(10).fork()).ldelim(),t.consensusState!==void 0&&i.Any.encode(t.consensusState,n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,c=s();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:c.height=e.Height.decode(a,a.uint32());break;case 2:c.consensusState=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{height:m(t.height)?e.Height.fromJSON(t.height):void 0,consensusState:m(t.consensusState)?i.Any.fromJSON(t.consensusState):void 0}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height?e.Height.toJSON(t.height):void 0),t.consensusState!==void 0&&(n.consensusState=t.consensusState?i.Any.toJSON(t.consensusState):void 0),n},fromPartial(t){let n=s();return n.height=t.height!==void 0&&t.height!==null?e.Height.fromPartial(t.height):void 0,n.consensusState=t.consensusState!==void 0&&t.consensusState!==null?i.Any.fromPartial(t.consensusState):void 0,n}};function c(){return{clientId:``,consensusStates:[]}}e.ClientConsensusStates={encode(t,n=r.default.Writer.create()){t.clientId!==``&&n.uint32(10).string(t.clientId);for(let r of t.consensusStates)e.ConsensusStateWithHeight.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.clientId=i.string();break;case 2:o.consensusStates.push(e.ConsensusStateWithHeight.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{clientId:m(t.clientId)?String(t.clientId):``,consensusStates:Array.isArray(t?.consensusStates)?t.consensusStates.map(t=>e.ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(t){let n={};return t.clientId!==void 0&&(n.clientId=t.clientId),t.consensusStates?n.consensusStates=t.consensusStates.map(t=>t?e.ConsensusStateWithHeight.toJSON(t):void 0):n.consensusStates=[],n},fromPartial(t){let n=c();return n.clientId=t.clientId??``,n.consensusStates=t.consensusStates?.map(t=>e.ConsensusStateWithHeight.fromPartial(t))||[],n}};function l(){return{title:``,description:``,subjectClientId:``,substituteClientId:``}}e.ClientUpdateProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.subjectClientId!==``&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==``&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.subjectClientId=n.string();break;case 4:a.substituteClientId=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,subjectClientId:m(e.subjectClientId)?String(e.subjectClientId):``,substituteClientId:m(e.substituteClientId)?String(e.substituteClientId):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){let t=l();return t.title=e.title??``,t.description=e.description??``,t.subjectClientId=e.subjectClientId??``,t.substituteClientId=e.substituteClientId??``,t}};function u(){return{title:``,description:``,plan:void 0,upgradedClientState:void 0}}e.UpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.plan!==void 0&&a.Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&i.Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=u();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.title=n.string();break;case 2:s.description=n.string();break;case 3:s.plan=a.Plan.decode(n,n.uint32());break;case 4:s.upgradedClientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,plan:m(e.plan)?a.Plan.fromJSON(e.plan):void 0,upgradedClientState:m(e.upgradedClientState)?i.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?a.Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?i.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=u();return t.title=e.title??``,t.description=e.description??``,t.plan=e.plan!==void 0&&e.plan!==null?a.Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?i.Any.fromPartial(e.upgradedClientState):void 0,t}};function d(){return{revisionNumber:`0`,revisionHeight:`0`}}e.Height={encode(e,t=r.default.Writer.create()){return e.revisionNumber!==`0`&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==`0`&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.revisionNumber=p(n.uint64());break;case 2:a.revisionHeight=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{revisionNumber:m(e.revisionNumber)?String(e.revisionNumber):`0`,revisionHeight:m(e.revisionHeight)?String(e.revisionHeight):`0`}},toJSON(e){let t={};return e.revisionNumber!==void 0&&(t.revisionNumber=e.revisionNumber),e.revisionHeight!==void 0&&(t.revisionHeight=e.revisionHeight),t},fromPartial(e){let t=d();return t.revisionNumber=e.revisionNumber??`0`,t.revisionHeight=e.revisionHeight??`0`,t}};function f(){return{allowedClients:[]}}e.Params={encode(e,t=r.default.Writer.create()){for(let n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.allowedClients.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{allowedClients:Array.isArray(e?.allowedClients)?e.allowedClients.map(e=>String(e)):[]}},toJSON(e){let t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(e=>e):t.allowedClients=[],t},fromPartial(e){let t=f();return t.allowedClients=e.allowedClients?.map(e=>e)||[],t}};function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),hv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MsgTransferResponse=e.MsgTransfer=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_(),a=mv();e.protobufPackage=`ibc.applications.transfer.v1`;function o(){return{sourcePort:``,sourceChannel:``,token:void 0,sender:``,receiver:``,timeoutHeight:void 0,timeoutTimestamp:`0`,memo:``}}e.MsgTransfer={encode(e,t=r.default.Writer.create()){return e.sourcePort!==``&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==``&&t.uint32(18).string(e.sourceChannel),e.token!==void 0&&i.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),e.sender!==``&&t.uint32(34).string(e.sender),e.receiver!==``&&t.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&a.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp!==`0`&&t.uint32(56).uint64(e.timeoutTimestamp),e.memo!==``&&t.uint32(66).string(e.memo),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,l=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:l.sourcePort=n.string();break;case 2:l.sourceChannel=n.string();break;case 3:l.token=i.Coin.decode(n,n.uint32());break;case 4:l.sender=n.string();break;case 5:l.receiver=n.string();break;case 6:l.timeoutHeight=a.Height.decode(n,n.uint32());break;case 7:l.timeoutTimestamp=c(n.uint64());break;case 8:l.memo=n.string();break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{sourcePort:l(e.sourcePort)?String(e.sourcePort):``,sourceChannel:l(e.sourceChannel)?String(e.sourceChannel):``,token:l(e.token)?i.Coin.fromJSON(e.token):void 0,sender:l(e.sender)?String(e.sender):``,receiver:l(e.receiver)?String(e.receiver):``,timeoutHeight:l(e.timeoutHeight)?a.Height.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:l(e.timeoutTimestamp)?String(e.timeoutTimestamp):`0`,memo:l(e.memo)?String(e.memo):``}},toJSON(e){let t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.token!==void 0&&(t.token=e.token?i.Coin.toJSON(e.token):void 0),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=e.timeoutTimestamp),e.memo!==void 0&&(t.memo=e.memo),t},fromPartial(e){let t=o();return t.sourcePort=e.sourcePort??``,t.sourceChannel=e.sourceChannel??``,t.token=e.token!==void 0&&e.token!==null?i.Coin.fromPartial(e.token):void 0,t.sender=e.sender??``,t.receiver=e.receiver??``,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?a.Height.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??`0`,t.memo=e.memo??``,t}};function s(){return{}}e.MsgTransferResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function l(e){return e!=null}})),gv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UnknownMessage=void 0;var t=A();e.UnknownMessage=class{constructor(e,t){this._typeUrl=e,this._value=t}get typeUrl(){return this._typeUrl}get value(){return this._value}toJSON(){return{typeUrl:this._typeUrl,value:t.Buffer.from(this._value).toString(`base64`)}}}})),_v=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.StakeAuthorization_Validators=e.StakeAuthorization=e.authorizationTypeToJSON=e.authorizationTypeFromJSON=e.AuthorizationType=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.staking.v1beta1`;var a;(function(e){e[e.AUTHORIZATION_TYPE_UNSPECIFIED=0]=`AUTHORIZATION_TYPE_UNSPECIFIED`,e[e.AUTHORIZATION_TYPE_DELEGATE=1]=`AUTHORIZATION_TYPE_DELEGATE`,e[e.AUTHORIZATION_TYPE_UNDELEGATE=2]=`AUTHORIZATION_TYPE_UNDELEGATE`,e[e.AUTHORIZATION_TYPE_REDELEGATE=3]=`AUTHORIZATION_TYPE_REDELEGATE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AuthorizationType||={});function o(e){switch(e){case 0:case`AUTHORIZATION_TYPE_UNSPECIFIED`:return a.AUTHORIZATION_TYPE_UNSPECIFIED;case 1:case`AUTHORIZATION_TYPE_DELEGATE`:return a.AUTHORIZATION_TYPE_DELEGATE;case 2:case`AUTHORIZATION_TYPE_UNDELEGATE`:return a.AUTHORIZATION_TYPE_UNDELEGATE;case 3:case`AUTHORIZATION_TYPE_REDELEGATE`:return a.AUTHORIZATION_TYPE_REDELEGATE;default:return a.UNRECOGNIZED}}e.authorizationTypeFromJSON=o;function s(e){switch(e){case a.AUTHORIZATION_TYPE_UNSPECIFIED:return`AUTHORIZATION_TYPE_UNSPECIFIED`;case a.AUTHORIZATION_TYPE_DELEGATE:return`AUTHORIZATION_TYPE_DELEGATE`;case a.AUTHORIZATION_TYPE_UNDELEGATE:return`AUTHORIZATION_TYPE_UNDELEGATE`;case a.AUTHORIZATION_TYPE_REDELEGATE:return`AUTHORIZATION_TYPE_REDELEGATE`;default:return`UNKNOWN`}}e.authorizationTypeToJSON=s;function c(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}e.StakeAuthorization={encode(t,n=r.default.Writer.create()){return t.maxTokens!==void 0&&i.Coin.encode(t.maxTokens,n.uint32(10).fork()).ldelim(),t.allowList!==void 0&&e.StakeAuthorization_Validators.encode(t.allowList,n.uint32(18).fork()).ldelim(),t.denyList!==void 0&&e.StakeAuthorization_Validators.encode(t.denyList,n.uint32(26).fork()).ldelim(),t.authorizationType!==0&&n.uint32(32).int32(t.authorizationType),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=c();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.maxTokens=i.Coin.decode(a,a.uint32());break;case 2:s.allowList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 3:s.denyList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 4:s.authorizationType=a.int32();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{maxTokens:u(t.maxTokens)?i.Coin.fromJSON(t.maxTokens):void 0,allowList:u(t.allowList)?e.StakeAuthorization_Validators.fromJSON(t.allowList):void 0,denyList:u(t.denyList)?e.StakeAuthorization_Validators.fromJSON(t.denyList):void 0,authorizationType:u(t.authorizationType)?o(t.authorizationType):0}},toJSON(t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens?i.Coin.toJSON(t.maxTokens):void 0),t.allowList!==void 0&&(n.allowList=t.allowList?e.StakeAuthorization_Validators.toJSON(t.allowList):void 0),t.denyList!==void 0&&(n.denyList=t.denyList?e.StakeAuthorization_Validators.toJSON(t.denyList):void 0),t.authorizationType!==void 0&&(n.authorizationType=s(t.authorizationType)),n},fromPartial(t){let n=c();return n.maxTokens=t.maxTokens!==void 0&&t.maxTokens!==null?i.Coin.fromPartial(t.maxTokens):void 0,n.allowList=t.allowList!==void 0&&t.allowList!==null?e.StakeAuthorization_Validators.fromPartial(t.allowList):void 0,n.denyList=t.denyList!==void 0&&t.denyList!==null?e.StakeAuthorization_Validators.fromPartial(t.denyList):void 0,n.authorizationType=t.authorizationType??0,n}};function l(){return{address:[]}}e.StakeAuthorization_Validators={encode(e,t=r.default.Writer.create()){for(let n of e.address)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:Array.isArray(e?.address)?e.address.map(e=>String(e)):[]}},toJSON(e){let t={};return e.address?t.address=e.address.map(e=>e):t.address=[],t},fromPartial(e){let t=l();return t.address=e.address?.map(e=>e)||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),vv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SendAuthorization=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=q_();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{spendLimit:[]}}e.SendAuthorization={encode(e,t=r.default.Writer.create()){for(let n of e.spendLimit)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.spendLimit.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{spendLimit:Array.isArray(e?.spendLimit)?e.spendLimit.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(e=>e?i.Coin.toJSON(e):void 0):t.spendLimit=[],t},fromPartial(e){let t=a();return t.spendLimit=e.spendLimit?.map(e=>i.Coin.fromPartial(e))||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure())})),yv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultProtoCodec=e.ProtoCodec=void 0;var r=K_(),i=Y_(),a=av(),o=sv(),s=lv(),c=uv(),l=fv(),u=hv(),d=gv(),f=ov(),p=_v(),m=vv(),h=A();n(gv(),e);var g=class{constructor(){this.typeUrlMap=new Map}unpackAnyFactory(e){if(this.typeUrlMap.has(e))return this.typeUrlMap.get(e)}unpackAny(e){let t=this.unpackAnyFactory(e.typeUrl);if(!t)return new d.UnknownMessage(e.typeUrl,e.value);let n=t.decode(e.value);return Object.assign(Object.assign({},e),{unpacked:n})}unpackedAnyToJSONRecursive(e){if(e instanceof d.UnknownMessage)return e.toJSON();let t=this.unpackAnyFactory(e.typeUrl);if(t&&`unpacked`in e&&e.unpacked){let n=e=>{let t=typeof e==`object`&&!(e instanceof d.UnknownMessage)&&`typeUrl`in e&&e.typeUrl&&typeof e.typeUrl==`string`&&`value`in e&&e.value&&typeof e.value==`string`;if(t)try{h.Buffer.from(e.value,`base64`)}catch{return!1}return t},r=e=>{let t=this.unpackAnyFactory(e.typeUrl),n=h.Buffer.from(e.value,`base64`);if(!t)return new d.UnknownMessage(e.typeUrl,n).toJSON();let r=t.decode(n);return{typeUrl:e.typeUrl,value:t.toJSON(r)}},i=e=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}else for(let t in e){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}return e},a=t.toJSON(e.unpacked);if(a&&typeof a==`object`)return a=i(a),{typeUrl:e.typeUrl,value:a}}return new d.UnknownMessage(e.typeUrl,e.value).toJSON()}registerAny(e,t){this.typeUrlMap.set(e,t)}};e.ProtoCodec=g,e.defaultProtoCodec=new g,e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgWalletSpendAction`,r.MsgWalletSpendAction),e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgProvision`,r.MsgProvision),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgSend`,i.MsgSend),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgMultiSend`,i.MsgMultiSend),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgDelegate`,a.MsgDelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgUndelegate`,a.MsgUndelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgBeginRedelegate`,a.MsgBeginRedelegate),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgExecuteContract`,l.MsgExecuteContract),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgInstantiateContract`,l.MsgInstantiateContract),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward`,c.MsgWithdrawDelegatorReward),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgSetWithdrawAddress`,c.MsgSetWithdrawAddress),e.defaultProtoCodec.registerAny(`/ibc.applications.transfer.v1.MsgTransfer`,u.MsgTransfer),e.defaultProtoCodec.registerAny(`/cosmos.gov.v1beta1.MsgVote`,s.MsgVote),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgGrant`,o.MsgGrant),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.GenericAuthorization`,f.GenericAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.StakeAuthorization`,p.StakeAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.SendAuthorization`,m.SendAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgRevoke`,o.MsgRevoke),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgExec`,o.MsgExec)})),bv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var n=t(J()),r=t(G_());e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function i(){return{signatures:[]}}e.MultiSignature={encode(e,t=r.default.Writer.create()){for(let n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>c(e)):[]}},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>u(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=i();return t.signatures=e.signatures?.map(e=>e)||[],t}};function a(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={encode(e,t=r.default.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{extraBitsStored:d(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:d(e.elems)?c(e.elems):new Uint8Array}},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=u(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=a();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var o=(()=>{if(o!==void 0)return o;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),s=o.atob||(e=>o.Buffer.from(e,`base64`).toString(`binary`));function c(e){let t=s(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var l=o.btoa||(e=>o.Buffer.from(e,`binary`).toString(`base64`));function u(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return l(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),xv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=nv(),a=bv();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var o;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(o=e.SignMode||={});function s(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return o.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return o.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return o.SIGN_MODE_TEXTUAL;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return o.SIGN_MODE_LEGACY_AMINO_JSON;default:return o.UNRECOGNIZED}}e.signModeFromJSON=s;function c(e){switch(e){case o.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case o.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case o.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case o.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;default:return`UNKNOWN`}}e.signModeToJSON=c;function l(){return{signatures:[]}}e.SignatureDescriptors={encode(t,n=r.default.Writer.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=l();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t)):[]}},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=l();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function u(){return{publicKey:void 0,data:void 0,sequence:`0`}}e.SignatureDescriptor={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&i.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=u();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=i.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=x(a.uint64());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:S(t.publicKey)?i.Any.fromJSON(t.publicKey):void 0,data:S(t.data)?e.SignatureDescriptor_Data.fromJSON(t.data):void 0,sequence:S(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?i.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(n.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=u();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?i.Any.fromPartial(t.publicKey):void 0,n.data=t.data!==void 0&&t.data!==null?e.SignatureDescriptor_Data.fromPartial(t.data):void 0,n.sequence=t.sequence??`0`,n}};function d(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:S(t.single)?e.SignatureDescriptor_Data_Single.fromJSON(t.single):void 0,multi:S(t.multi)?e.SignatureDescriptor_Data_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=d();return n.single=t.single!==void 0&&t.single!==null?e.SignatureDescriptor_Data_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.SignatureDescriptor_Data_Multi.fromPartial(t.multi):void 0,n}};function f(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:S(e.mode)?s(e.mode):0,signature:S(e.signature)?v(e.signature):new Uint8Array}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=c(e.mode)),e.signature!==void 0&&(t.signature=b(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=f();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function p(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&a.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.signatures)e.SignatureDescriptor_Data.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=a.CompactBitArray.decode(i,i.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:S(t.bitarray)?a.CompactBitArray.fromJSON(t.bitarray):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?a.CompactBitArray.toJSON(t.bitarray):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=p();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?a.CompactBitArray.fromPartial(t.bitarray):void 0,n.signatures=t.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],n}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),Sv=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var n=t(J()),r=t(G_()),i=xv(),a=nv(),o=bv(),s=q_();e.protobufPackage=`cosmos.tx.v1beta1`;function c(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={encode(t,n=r.default.Writer.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(i,i.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(i,i.uint32());break;case 3:o.signatures.push(i.bytes());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{body:E(t.body)?e.TxBody.fromJSON(t.body):void 0,authInfo:E(t.authInfo)?e.AuthInfo.fromJSON(t.authInfo):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(e=>S(e)):[]}},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>w(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=c();return n.body=t.body!==void 0&&t.body!==null?e.TxBody.fromPartial(t.body):void 0,n.authInfo=t.authInfo!==void 0&&t.authInfo!==null?e.AuthInfo.fromPartial(t.authInfo):void 0,n.signatures=t.signatures?.map(e=>e)||[],n}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={encode(e,t=r.default.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>S(e)):[]}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>w(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function u(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:`0`}}e.SignDoc={encode(e,t=r.default.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==`0`&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.chainId=n.string();break;case 4:a.accountNumber=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,chainId:E(e.chainId)?String(e.chainId):``,accountNumber:E(e.accountNumber)?String(e.accountNumber):`0`}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=e.accountNumber),t},fromPartial(e){let t=u();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,t.accountNumber=e.accountNumber??`0`,t}};function d(){return{messages:[],memo:``,timeoutHeight:`0`,extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={encode(e,t=r.default.Writer.create()){for(let n of e.messages)a.Any.encode(n,t.uint32(10).fork()).ldelim();e.memo!==``&&t.uint32(18).string(e.memo),e.timeoutHeight!==`0`&&t.uint32(24).uint64(e.timeoutHeight);for(let n of e.extensionOptions)a.Any.encode(n,t.uint32(8186).fork()).ldelim();for(let n of e.nonCriticalExtensionOptions)a.Any.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(a.Any.decode(n,n.uint32()));break;case 2:o.memo=n.string();break;case 3:o.timeoutHeight=T(n.uint64());break;case 1023:o.extensionOptions.push(a.Any.decode(n,n.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>a.Any.fromJSON(e)):[],memo:E(e.memo)?String(e.memo):``,timeoutHeight:E(e.timeoutHeight)?String(e.timeoutHeight):`0`,extensionOptions:Array.isArray(e?.extensionOptions)?e.extensionOptions.map(e=>a.Any.fromJSON(e)):[],nonCriticalExtensionOptions:Array.isArray(e?.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e?a.Any.toJSON(e):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){let t=d();return t.messages=e.messages?.map(e=>a.Any.fromPartial(e))||[],t.memo=e.memo??``,t.timeoutHeight=e.timeoutHeight??`0`,t.extensionOptions=e.extensionOptions?.map(e=>a.Any.fromPartial(e))||[],t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>a.Any.fromPartial(e))||[],t}};function f(){return{signerInfos:[],fee:void 0}}e.AuthInfo={encode(t,n=r.default.Writer.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=f();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(i,i.uint32()));break;case 2:o.fee=e.Fee.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signerInfos:Array.isArray(t?.signerInfos)?t.signerInfos.map(t=>e.SignerInfo.fromJSON(t)):[],fee:E(t.fee)?e.Fee.fromJSON(t.fee):void 0}},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],n.fee=t.fee!==void 0&&t.fee!==null?e.Fee.fromPartial(t.fee):void 0,n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:`0`}}e.SignerInfo={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&a.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.modeInfo!==void 0&&e.ModeInfo.encode(t.modeInfo,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.publicKey=a.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=T(i.uint64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:E(t.publicKey)?a.Any.fromJSON(t.publicKey):void 0,modeInfo:E(t.modeInfo)?e.ModeInfo.fromJSON(t.modeInfo):void 0,sequence:E(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?a.Any.toJSON(t.publicKey):void 0),t.modeInfo!==void 0&&(n.modeInfo=t.modeInfo?e.ModeInfo.toJSON(t.modeInfo):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=p();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?a.Any.fromPartial(t.publicKey):void 0,n.modeInfo=t.modeInfo!==void 0&&t.modeInfo!==null?e.ModeInfo.fromPartial(t.modeInfo):void 0,n.sequence=t.sequence??`0`,n}};function g(){return{single:void 0,multi:void 0}}e.ModeInfo={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(i,i.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:E(t.single)?e.ModeInfo_Single.fromJSON(t.single):void 0,multi:E(t.multi)?e.ModeInfo_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=g();return n.single=t.single!==void 0&&t.single!==null?e.ModeInfo_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.ModeInfo_Multi.fromPartial(t.multi):void 0,n}};function _(){return{mode:0}}e.ModeInfo_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:E(e.mode)?(0,i.signModeFromJSON)(e.mode):0}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,i.signModeToJSON)(e.mode)),t},fromPartial(e){let t=_();return t.mode=e.mode??0,t}};function v(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&o.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,s=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=o.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:E(t.bitarray)?o.CompactBitArray.fromJSON(t.bitarray):void 0,modeInfos:Array.isArray(t?.modeInfos)?t.modeInfos.map(t=>e.ModeInfo.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?o.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=v();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?o.CompactBitArray.fromPartial(t.bitarray):void 0,n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function y(){return{amount:[],gasLimit:`0`,payer:``,granter:``}}e.Fee={encode(e,t=r.default.Writer.create()){for(let n of e.amount)s.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==`0`&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.amount.push(s.Coin.decode(n,n.uint32()));break;case 2:a.gasLimit=T(n.uint64());break;case 3:a.payer=n.string();break;case 4:a.granter=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>s.Coin.fromJSON(e)):[],gasLimit:E(e.gasLimit)?String(e.gasLimit):`0`,payer:E(e.payer)?String(e.payer):``,granter:E(e.granter)?String(e.granter):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?s.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=e.gasLimit),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=y();return t.amount=e.amount?.map(e=>s.Coin.fromPartial(e))||[],t.gasLimit=e.gasLimit??`0`,t.payer=e.payer??``,t.granter=e.granter??``,t}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),Cv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtoSignDocDecoder=void 0;var t=Sv(),n=yv();e.ProtoSignDocDecoder=class e{static decode(n){return new e(t.SignDoc.decode(n))}constructor(e,t=n.defaultProtoCodec){this.signDoc=e,this.protoCodec=t}get txBody(){return this._txBody||=t.TxBody.decode(this.signDoc.bodyBytes),this._txBody}get txMsgs(){let e=[];for(let t of this.txBody.messages)e.push(this.protoCodec.unpackAny(t));return e}get authInfo(){return this._authInfo||=t.AuthInfo.decode(this.signDoc.authInfoBytes),this._authInfo}get chainId(){return this.signDoc.chainId}get accountNumber(){return this.signDoc.accountNumber.toString()}toBytes(){return t.SignDoc.encode(this.signDoc).finish()}toJSON(){return{txBody:Object.assign(Object.assign({},t.TxBody.toJSON(this.txBody)),{messages:this.txMsgs.map(e=>this.protoCodec.unpackedAnyToJSONRecursive(e))}),authInfo:t.AuthInfo.toJSON(this.authInfo),chainId:this.chainId,accountNumber:this.accountNumber}}}})),wv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Tv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseKVStore=void 0,e.BaseKVStore=class{constructor(e,t){this.provider=e,this._prefix=t}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return(yield this.provider.get())[t]})}set(e,t){let n=this.prefix()+`/`+e;return this.provider.set({[n]:t})}prefix(){return this._prefix}}})),Ev=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionKVStore=void 0;var n=Tv();e.ExtensionKVStore=class e extends n.BaseKVStore{constructor(t){if(e.KVStoreProvider||typeof browser>`u`||!browser.storage||!browser.storage.local||(e.KVStoreProvider={get:browser.storage.local.get,set:browser.storage.local.set,multiGet:browser.storage.local.get}),!e.KVStoreProvider)throw Error(`Can't initialize kv store for browser extension`);super(e.KVStoreProvider,t)}multiGet(n){return t(this,void 0,void 0,function*(){n=Array.from(new Set(n));let t=(yield e.KVStoreProvider.multiGet(n.map(e=>this.prefix()+`/`+e)))??{},r=Object.keys(t);for(let e of r){let n=e.slice(this.prefix().length+1);t[n]=t[e],delete t[e]}return t})}}})),Dv=a((e=>{s(),Object.defineProperty(e,"__esModule",{value:!0}),e.MemoryKVStore=void 0;var t=Tv(),n=class{constructor(){this.store={}}get(){return Promise.resolve(this.store)}set(e){return this.store=Object.assign(Object.assign({},this.store),e),Promise.resolve()}checkNotPrimitiveField(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n==`object`&&n){if(n.constructor!==Object&&n.constructor!==Array)throw Error(`${t} may not be serializable: ${n.constructor.name}`);this.checkNotPrimitiveField(n)}})}};e.MemoryKVStore=class extends t.BaseKVStore{constructor(e){super(new n,e)}}})),Ov=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LocalKVStore=void 0,e.LocalKVStore=class{constructor(e){this._prefix=e}get(e){let t=this.prefix()+`/`+e,n=localStorage.getItem(t);return n===null?Promise.resolve(void 0):Promise.resolve(JSON.parse(n))}set(e,t){let n=this.prefix()+`/`+e;return t===null?Promise.resolve(localStorage.removeItem(n)):Promise.resolve(localStorage.setItem(n,JSON.stringify(t)))}prefix(){return this._prefix}}})),kv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.IndexedDBKVStore=void 0,e.IndexedDBKVStore=class{constructor(e){this._prefix=e}get(e){return t(this,void 0,void 0,function*(){let t=(yield this.getDB()).transaction([this.prefix()],`readonly`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.get(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{i.result?n(i.result.data):n(void 0)}})})}set(e,n){return t(this,void 0,void 0,function*(){if(n===null){let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.delete(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{n()}})}else{let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((r,i)=>{let a=t.put({key:e,data:n});a.onerror=e=>{e.stopPropagation(),i(e.target)},a.onsuccess=()=>{r()}})}})}prefix(){return this._prefix}getDB(){return t(this,void 0,void 0,function*(){return this.cachedDB?this.cachedDB:new Promise((e,t)=>{let n=window.indexedDB.open(this.prefix());n.onerror=e=>{e.stopPropagation(),t(e.target)},n.onupgradeneeded=e=>{e.target.result.createObjectStore(this.prefix(),{keyPath:`key`})},n.onsuccess=()=>{this.cachedDB=n.result,e(n.result)}})})}}})),Av=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixKVStore=void 0,e.PrefixKVStore=class{constructor(e,t){this.kvStore=e,this._prefix=t}prefix(){return this._prefix}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.get(t)})}set(e,n){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.set(t,n)})}}})),jv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.WrapMultiGetKVStore=void 0,e.WrapMultiGetKVStore=class{constructor(e){this.kvStore=e}multiGet(e){return t(this,void 0,void 0,function*(){e=Array.from(new Set(e));let n={},r=[];for(let i of e)r.push(t(this,void 0,void 0,function*(){n[i]=yield this.kvStore.get(i)}));return yield Promise.all(r),n})}}})),Mv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(wv(),e),n(Ev(),e),n(Tv(),e),n(Dv(),e),n(Ov(),e),n(kv(),e),n(Av(),e),n(jv(),e)})),Nv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=M(),n=P();function r(e){let n=t(`sha256`).update(e).digest();try{return t(`rmd160`).update(n).digest()}catch{return t(`ripemd160`).update(n).digest()}}e.hash160=r;function i(e,t){return n(`sha512`,e).update(t).digest()}e.hmacSHA512=i})),Pv=a(((e,t)=>{_();var n=P(),r=v.alloc(1,1),i=v.alloc(1,0);function a(e,t,a,o,s){let c=v.alloc(32,0),l=v.alloc(32,1);c=n(`sha256`,c).update(l).update(i).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),c=n(`sha256`,c).update(l).update(r).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest();let u=l;for(;!o(u)||!a(u);)c=n(`sha256`,c).update(l).update(i).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest(),u=l;return u}t.exports=a})),Fv=a(((e,t)=>{_();var n=L(),r=F().ec,i=new r(`secp256k1`),a=Pv(),o=v.alloc(32,0),s=v.from(`fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`,`hex`),c=v.from(`fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`,`hex`),l=i.curve.n,u=l.shrn(1),d=i.curve.g,f=`Expected Private`,p=`Expected Point`,m=`Expected Tweak`,h=`Expected Hash`,g=`Expected Signature`,y=`Expected Extra Data (32 bytes)`;function b(e){return e instanceof Uint8Array&&e.length===32}function x(e){return b(e)?s.compare(e)>0:!1}function S(e){if(!(e instanceof Uint8Array)||e.length<33)return!1;let t=e[0],n=e.subarray(1,33);if(o.compare(n)===0||c.compare(n)<=0)return!1;if((t===2||t===3)&&e.length===33){try{A(e)}catch{return!1}return!0}let r=e.subarray(33);return o.compare(r)===0||c.compare(r)<=0?!1:t===4&&e.length===65}function C(e){return e[0]!==4}function w(e){return S(e)?C(e):!1}function T(e){return b(e)?o.compare(e)<0&&s.compare(e)>0:!1}function E(e){let t=e.subarray(0,32),n=e.subarray(32,64);return e instanceof Uint8Array&&e.length===64&&s.compare(t)>0&&s.compare(n)>0}function D(e,t){return e===void 0&&t!==void 0?C(t):e===void 0?!0:e}function O(e){return new n(e)}function k(e){return e.toArrayLike(v,`be`,32)}function A(e){return i.curve.decodePoint(e)}function j(e,t){return v.from(e._encode(t))}function M(e,t,n){if(!S(e)||!S(t))throw TypeError(p);let r=A(e),i=A(t),a=r.add(i);return a.isInfinity()?null:j(a,D(n,e))}function N(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=A(e);if(o.compare(t)===0)return j(i,r);let a=O(t),s=d.mul(a),c=i.add(s);return c.isInfinity()?null:j(c,r)}function P(e,t){if(!S(e))throw TypeError(p);let n=A(e);if(n.isInfinity())throw TypeError(p);return j(n,D(t,e))}function I(e,t){if(!T(e))throw TypeError(f);let n=O(e),r=d.mul(n);return r.isInfinity()?null:j(r,D(t))}function R(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=A(e),a=O(t),o=i.mul(a);return o.isInfinity()?null:j(o,r)}function ee(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=O(e),r=O(t),i=k(n.add(r).umod(l));return T(i)?i:null}function te(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=O(e),r=O(t),i=k(n.sub(r).umod(l));return T(i)?i:null}function ne(e,t){return ie(e,t)}function re(e,t,n){return ie(e,t,n)}function ie(e,t,n){if(!b(e))throw TypeError(h);if(!T(t))throw TypeError(f);if(n!==void 0&&!b(n))throw TypeError(y);let r=O(t),i=O(e),o,s;a(e,t,function(e){let t=O(e),n=d.mul(t);return!(n.isInfinity()||(o=n.x.umod(l),o.isZero()===0)||(s=t.invm(l).mul(i.add(r.mul(o))).umod(l),s.isZero()===0))},T,n),s.cmp(u)>0&&(s=l.sub(s));let c=v.allocUnsafe(64);return k(o).copy(c,0),k(s).copy(c,32),c}function ae(e,t,n,r){if(!b(e))throw TypeError(h);if(!S(t))throw TypeError(p);if(!E(n))throw TypeError(g);let i=A(t),a=O(n.subarray(0,32)),o=O(n.subarray(32,64));if(r&&o.cmp(u)>0||a.gtn(0)<=0||o.gtn(0)<=0)return!1;let s=O(e),c=o.invm(l),f=s.mul(c).umod(l),m=a.mul(c).umod(l),_=d.mulAdd(f,i,m);return _.isInfinity()?!1:_.x.umod(l).eq(a)}t.exports={isPoint:S,isPointCompressed:w,isPrivate:T,pointAdd:M,pointAddScalar:N,pointCompress:P,pointFromScalar:I,pointMultiply:R,privateAdd:ee,privateSub:te,sign:ne,signWithEntropy:re,verify:ae}})),Iv=a(((e,t)=>{var n={Array:function(e){return e!=null&&e.constructor===Array},Boolean:function(e){return typeof e==`boolean`},Function:function(e){return typeof e==`function`},Nil:function(e){return e==null},Number:function(e){return typeof e==`number`},Object:function(e){return typeof e==`object`},String:function(e){return typeof e==`string`},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(e){return e}.bind(null,r);t.exports=n})),Lv=a(((e,t)=>{var n=Iv();function r(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function i(e){return n.Nil(e)?``:r(e.constructor)}function a(e){return n.Function(e)?``:n.String(e)?JSON.stringify(e):e&&n.Object(e)?``:e}function o(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():r(e):n.Array(e)?`Array`:e&&n.Object(e)?`Object`:e===void 0?``:e}function c(e,t,n){var r=a(t);return`Expected `+s(e)+`, got`+(n===``?``:` `+n)+(r===``?``:` `+r)}function l(e,t,n){n||=i(t),this.message=c(e,t,n),o(this,l),this.__type=e,this.__value=t,this.__valueTypeName=n}l.prototype=Object.create(Error.prototype),l.prototype.constructor=l;function u(e,t,n,r,i){var a=`" of type `;return t===`key`&&(a=`" with key type `),c(`property "`+s(n)+a+s(e),r,i)}function d(e,t,n,r,a){e?(a||=i(r),this.message=u(e,n,t,r,a)):this.message=`Unexpected property "`+t+`"`,o(this,l),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=a}d.prototype=Object.create(Error.prototype),d.prototype.constructor=l;function f(e,t){return new l(e,{},t)}function p(e,t,n){return e instanceof d?(t=t+`.`+e.__property,e=new d(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof l&&(e=new d(e.__type,t,n,e.__value,e.__valueTypeName)),o(e),e}t.exports={TfTypeError:l,TfPropertyTypeError:d,tfCustomError:f,tfSubError:p,tfJSON:s,getValueTypeName:i}})),Rv=a(((e,t)=>{_();var n=Iv(),r=Lv();function i(e){return v.isBuffer(e)}function a(e){return typeof e==`string`&&/^([0-9a-f]{2})+$/i.test(e)}function o(e,t){var n=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw r.tfCustomError(n+`(Length: `+t+`)`,n+`(Length: `+i.length+`)`)}return i.toJSON=function(){return n},i}var s=o.bind(null,n.Array),c=o.bind(null,i),l=o.bind(null,a),u=o.bind(null,n.String);function d(e,t,r){r||=n.Number;function i(n,i){return r(n,i)&&n>e&&n<t}return i.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},i}var f=2**53-1;function p(e){return typeof e==`number`&&isFinite(e)}function m(e){return e<<24>>24===e}function h(e){return e<<16>>16===e}function g(e){return(e|0)===e}function y(e){return typeof e==`number`&&e>=-f&&e<=f&&Math.floor(e)===e}function b(e){return(e&255)===e}function x(e){return(e&65535)===e}function S(e){return e>>>0===e}function C(e){return typeof e==`number`&&e>=0&&e<=f&&Math.floor(e)===e}var w={ArrayN:s,Buffer:i,BufferN:c,Finite:p,Hex:a,HexN:l,Int8:m,Int16:h,Int32:g,Int53:y,Range:d,StringN:u,UInt8:b,UInt16:x,UInt32:S,UInt53:C};for(var T in w)w[T].toJSON=function(e){return e}.bind(null,T);t.exports=w})),zv=a(((e,t)=>{var n=Lv(),r=Iv(),i=n.tfJSON,a=n.TfTypeError,o=n.TfPropertyTypeError,s=n.tfSubError,c=n.getValueTypeName,l={arrayOf:function(e,t){e=u(e),t||={};function n(n,i){return!r.Array(n)||r.Nil(n)||t.minLength!==void 0&&n.length<t.minLength||t.maxLength!==void 0&&n.length>t.maxLength||t.length!==void 0&&n.length!==t.length?!1:n.every(function(t,n){try{return d(e,t,i)}catch(e){throw s(e,n)}})}return n.toJSON=function(){var n=`[`+i(e)+`]`;return t.length===void 0?(t.minLength!==void 0||t.maxLength!==void 0)&&(n+=`{`+(t.minLength===void 0?0:t.minLength)+`,`+(t.maxLength===void 0?1/0:t.maxLength)+`}`):n+=`{`+t.length+`}`,n},n},maybe:function e(t){t=u(t);function n(n,i){return r.Nil(n)||t(n,i,e)}return n.toJSON=function(){return`?`+i(t)},n},map:function(e,t){e=u(e),t&&=u(t);function n(n,i){if(!r.Object(n)||r.Nil(n))return!1;for(var a in n){try{t&&d(t,a,i)}catch(e){throw s(e,a,`key`)}try{var o=n[a];d(e,o,i)}catch(e){throw s(e,a)}}return!0}return t?n.toJSON=function(){return`{`+i(t)+`: `+i(e)+`}`}:n.toJSON=function(){return`{`+i(e)+`}`},n},object:function(e){var t={};for(var n in e)t[n]=u(e[n]);function a(e,n){if(!r.Object(e)||r.Nil(e))return!1;var i;try{for(i in t){var a=t[i],c=e[i];d(a,c,n)}}catch(e){throw s(e,i)}if(n){for(i in e)if(!t[i])throw new o(void 0,i)}return!0}return a.toJSON=function(){return i(t)},a},anyOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.some(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(`|`)},t},allOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.every(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(` & `)},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return r.Nil(t)||r.Nil(t.length)||n&&t.length!==e.length?!1:e.every(function(e,r){try{return d(e,t[r],n)}catch(e){throw s(e,r)}})}return t.toJSON=function(){return`(`+e.map(i).join(`, `)+`)`},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};l.oneOf=l.anyOf;function u(e){if(r.String(e))return e[0]===`?`?l.maybe(e.slice(1)):r[e]||l.quacksLike(e);if(e&&r.Object(e)){if(r.Array(e)){if(e.length!==1)throw TypeError(`Expected compile() parameter of type Array of length 1`);return l.arrayOf(e[0])}return l.object(e)}else if(r.Function(e))return e;return l.value(e)}function d(e,t,n,i){if(r.Function(e)){if(e(t,n))return!0;throw new a(i||e,t)}return d(u(e),t,n)}for(var f in r)d[f]=r[f];for(f in l)d[f]=l[f];var p=Rv();for(f in p)d[f]=p[f];d.compile=u,d.TfTypeError=a,d.TfPropertyTypeError=o,t.exports=d})),Bv=a(((e,t)=>{_();var n=ua();function r(e,t){if(t!==void 0&&e[0]!==t)throw Error(`Invalid network version`);if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw Error(`Invalid WIF length`);if(e[33]!==1)throw Error(`Invalid compression flag`);return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,t,n){var r=new v(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}function a(e,t){return r(n.decode(e),t)}function o(e,t,r){return typeof e==`number`?n.encode(i(e,t,r)):n.encode(i(e.version,e.privateKey,e.compressed))}t.exports={decode:a,decodeRaw:r,encode:o,encodeRaw:i}})),Vv=a((e=>{_(),Object.defineProperty(e,"__esModule",{value:!0});var t=Nv(),n=ua(),r=Fv(),i=zv(),a=Bv(),o=i.BufferN(32),s=i.compile({wif:i.UInt8,bip32:{public:i.UInt32,private:i.UInt32}}),c={messagePrefix:`Bitcoin Signed Message:
|
|
21
21
|
`,bech32:`bc`,bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},l=2147483648,u=2**31-1;function d(e){return i.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function f(e){return i.UInt32(e)&&e<=u}var p=class{constructor(e,t,n,r,a=0,o=0,c=0){this.__D=e,this.__Q=t,this.chainCode=n,this.network=r,this.__DEPTH=a,this.__INDEX=o,this.__PARENT_FINGERPRINT=c,i(s,r),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=r.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return t.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return b(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=v.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),n.encode(r)}toWIF(){if(!this.privateKey)throw TypeError(`Missing private key`);return a.encode(this.network.wif,this.privateKey,!0)}derive(e){i(i.UInt32,e);let n=e>=l,a=v.allocUnsafe(37);if(n){if(this.isNeutered())throw TypeError(`Missing private key for hardened child key`);a[0]=0,this.privateKey.copy(a,1),a.writeUInt32BE(e,33)}else this.publicKey.copy(a,0),a.writeUInt32BE(e,33);let o=t.hmacSHA512(this.chainCode,a),s=o.slice(0,32),c=o.slice(32);if(!r.isPrivate(s))return this.derive(e+1);let u;if(this.isNeutered()){let t=r.pointAddScalar(this.publicKey,s,!0);if(t===null)return this.derive(e+1);u=b(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{let t=r.privateAdd(this.privateKey,s);if(t==null)return this.derive(e+1);u=g(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return u}deriveHardened(e){return i(f,e),this.derive(e+l)}derivePath(e){i(d,e);let t=e.split(`/`);if(t[0]===`m`){if(this.parentFingerprint)throw TypeError(`Expected master, got child`);t=t.slice(1)}return t.reduce((e,t)=>{let n;return t.slice(-1)===`'`?(n=parseInt(t.slice(0,-1),10),e.deriveHardened(n)):(n=parseInt(t,10),e.derive(n))},this)}sign(e,t){if(!this.privateKey)throw Error(`Missing private key`);if(t===void 0&&(t=this.lowR),t===!1)return r.sign(e,this.privateKey);{let t=r.sign(e,this.privateKey),n=v.alloc(32,0),i=0;for(;t[0]>127;)i++,n.writeUIntLE(i,0,6),t=r.signWithEntropy(e,this.privateKey,n);return t}}verify(e,t){return r.verify(e,this.publicKey,t)}};function m(e,t){let r=n.decode(e);if(r.length!==78)throw TypeError(`Invalid buffer length`);t||=c;let i=r.readUInt32BE(0);if(i!==t.bip32.private&&i!==t.bip32.public)throw TypeError(`Invalid network version`);let a=r[4],o=r.readUInt32BE(5);if(a===0&&o!==0)throw TypeError(`Invalid parent fingerprint`);let s=r.readUInt32BE(9);if(a===0&&s!==0)throw TypeError(`Invalid index`);let l=r.slice(13,45),u;if(i===t.bip32.private){if(r.readUInt8(45)!==0)throw TypeError(`Invalid private key`);u=g(r.slice(46,78),l,t,a,s,o)}else u=b(r.slice(45,78),l,t,a,s,o);return u}e.fromBase58=m;function h(e,t,n){return g(e,t,n)}e.fromPrivateKey=h;function g(e,t,n,a,s,l){if(i({privateKey:o,chainCode:o},{privateKey:e,chainCode:t}),n||=c,!r.isPrivate(e))throw TypeError(`Private key not in range [1, n)`);return new p(e,void 0,t,n,a,s,l)}function y(e,t,n){return b(e,t,n)}e.fromPublicKey=y;function b(e,t,n,a,s,l){if(i({publicKey:i.BufferN(33),chainCode:o},{publicKey:e,chainCode:t}),n||=c,!r.isPoint(e))throw TypeError(`Point is not on the curve`);return new p(void 0,e,t,n,a,s,l)}function x(e,n){if(i(i.Buffer,e),e.length<16)throw TypeError(`Seed should be at least 128 bits`);if(e.length>64)throw TypeError(`Seed should be at most 512 bits`);n||=c;let r=t.hmacSHA512(v.from(`Bitcoin seed`,`utf8`),e);return h(r.slice(0,32),r.slice(32),n)}e.fromSeed=x})),Hv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Vv();e.fromSeed=t.fromSeed,e.fromBase58=t.fromBase58,e.fromPublicKey=t.fromPublicKey,e.fromPrivateKey=t.fromPrivateKey})),Uv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Mnemonic=void 0;var n=Ze(),r=Hv(),i=ua(),a=A();e.Mnemonic=class e{static generateWallet(n,r=`m/44'/118'/0'/0/0`,i=``,a=256){return t(this,void 0,void 0,function*(){let t=yield e.generateSeed(n,a);return{privKey:e.generateWalletFromMnemonic(t,r,i),mnemonic:t}})}static validateMnemonic(e){return n.validateMnemonic(e)}static generateSeed(e,r=128){return t(this,void 0,void 0,function*(){if(r%32!=0)throw TypeError(`invalid entropy`);let t=new Uint8Array(r/8);return t=yield e(t),n.entropyToMnemonic(a.Buffer.from(t).toString(`hex`))})}static generateWalletFromMnemonic(e,t=`m/44'/118'/0'/0/0`,i=``){let a=n.mnemonicToSeedSync(e,i),o=r.fromSeed(a).derivePath(t).privateKey;if(!o)throw Error(`null hd key`);return o}static generateMasterSeedFromMnemonic(e,t=``){let o=n.mnemonicToSeedSync(e,t),s=r.fromSeed(o);return a.Buffer.from(i.decode(s.toBase58()))}static generatePrivateKeyFromMasterSeed(e,t=`m/44'/118'/0'/0/0`){let n=r.fromBase58(i.encode(e)).derivePath(t).privateKey;if(!n)throw Error(`null hd key`);return n}}})),Wv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=void 0;var t=I(),r=(a_(),n(n_)),i=A();e.Hash=class{static sha256(e){return new Uint8Array(new t.sha256().update(e).digest())}static keccak256(e){return i.Buffer.from((0,r.keccak256)(e).replace(`0x`,``),`hex`)}static truncHashPortion(e,t=e.length,n=0){return e.substring(0,t)+`…`+e.substring(e.length-n,e.length)}}})),Gv=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.PubKeySecp256k1=e.PrivKeySecp256k1=void 0;var n=F(),r=t(Qa()),i=A(),a=Wv();e.PrivKeySecp256k1=class e{static generateRandomKey(){let t=new n.ec(`secp256k1`);return new e(i.Buffer.from(t.genKeyPair().getPrivate().toArray()))}constructor(e){this.privKey=e}toBytes(){return new Uint8Array(this.privKey)}getPubKey(){let e=new n.ec(`secp256k1`).keyFromPrivate(this.privKey);return new o(new Uint8Array(e.getPublic().encodeCompressed(`array`)))}signDigest32(e){if(e.length!==32)throw Error(`Invalid length of digest to sign: ${e.length}`);let t=new n.ec(`secp256k1`).keyFromPrivate(this.privKey).sign(e,{canonical:!0});return{r:new Uint8Array(t.r.toArray(`be`,32)),s:new Uint8Array(t.s.toArray(`be`,32)),v:t.recoveryParam}}};var o=class{constructor(e){if(this.pubKey=e,e.length!==33&&e.length!==65)throw Error(`Invalid length of public key: ${e.length}`)}toBytes(e){if(e&&this.pubKey.length===65||!e&&this.pubKey.length===33)return this.pubKey;let t=this.toKeyPair();return e?new Uint8Array(i.Buffer.from(t.getPublic().encode(`hex`,!1),`hex`)):new Uint8Array(i.Buffer.from(t.getPublic().encodeCompressed(`hex`),`hex`))}getAddress(){return this.getCosmosAddress()}getCosmosAddress(){let e=r.default.SHA256(r.default.lib.WordArray.create(this.toBytes(!1))).toString();return e=r.default.RIPEMD160(r.default.enc.Hex.parse(e)).toString(),new Uint8Array(i.Buffer.from(e,`hex`))}getEthAddress(){return a.Hash.keccak256(this.toBytes(!0).slice(1)).slice(-20)}toKeyPair(){return new n.ec(`secp256k1`).keyFromPublic(i.Buffer.from(this.pubKey).toString(`hex`),`hex`)}verifyDigest32(e,t){if(e.length!==32)throw Error(`Invalid length of digest to verify: ${e.length}`);if(t.length!==64)throw Error(`Invalid length of signature: ${t.length}`);let r=new n.ec(`secp256k1`),a=t.slice(0,32),o=t.slice(32);return r.verify(e,{r:i.Buffer.from(a).toString(`hex`),s:i.Buffer.from(o).toString(`hex`)},this.toKeyPair())}};e.PubKeySecp256k1=o})),Kv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Uv(),e),n(Gv(),e),n(Wv(),e)})),qv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DenomHelper=void 0;var t=A(),n=Kv();e.DenomHelper=class{static ibcDenom(e,r){let i=[];for(let t of e)i.push(`${t.portId}/${t.channelId}`);let a=`${i.join(`/`)}/${r}`;return`ibc/`+t.Buffer.from(n.Hash.sha256(t.Buffer.from(a))).toString(`hex`).toUpperCase()}constructor(e){this._denom=e;let t=this.denom.split(/(\w+):(\w+):(.+)/).filter(Boolean);if(t.length!==1&&t.length!==3)throw Error(`Invalid denom: ${this.denom}`);this._type=t.length===3?t[0]:``,this._contractAddress=t.length===3?t[1]:``}get denom(){return this._denom}get type(){return this._type||`native`}get contractAddress(){return this._contractAddress}}})),Jv=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toGenerator=void 0;function*t(e){return yield e}e.toGenerator=t})),Yv=r({$mobx:()=>Z,FlowCancellationError:()=>cw,ObservableMap:()=>ww,ObservableSet:()=>Dw,Reaction:()=>BC,_allowStateChanges:()=>Ob,_allowStateChangesInsideComputed:()=>ux,_allowStateReadsEnd:()=>Vb,_allowStateReadsStart:()=>Bb,_autoAction:()=>ew,_endAction:()=>Db,_getAdministration:()=>FS,_getGlobalState:()=>Wb,_interceptReads:()=>Ax,_isComputingDerivation:()=>Nb,_resetGlobalState:()=>Gb,_startAction:()=>Eb,action:()=>$C,autorun:()=>fx,comparer:()=>aC,computed:()=>TC,configure:()=>yx,createAtom:()=>Py,defineProperty:()=>qx,entries:()=>Hx,extendObservable:()=>bx,flow:()=>dw,flowResult:()=>Ox,get:()=>Kx,getAtom:()=>PS,getDebugName:()=>IS,getDependencyTree:()=>xx,getObserverTree:()=>Cx,has:()=>Gx,intercept:()=>jx,isAction:()=>dx,isBoxedObservable:()=>jC,isComputed:()=>Fx,isComputedProp:()=>Ix,isFlow:()=>kx,isFlowCancellationError:()=>Ex,isObservable:()=>Rx,isObservableArray:()=>xS,isObservableMap:()=>Tw,isObservableObject:()=>DS,isObservableProp:()=>zx,isObservableSet:()=>Ow,keys:()=>Bx,makeAutoObservable:()=>hS,makeObservable:()=>mS,observable:()=>bC,observe:()=>Yx,onBecomeObserved:()=>gx,onBecomeUnobserved:()=>_x,onReactionError:()=>rx,override:()=>sC,ownKeys:()=>Jx,reaction:()=>mx,remove:()=>Wx,runInAction:()=>ux,set:()=>Ux,spy:()=>cx,toJS:()=>eS,trace:()=>tS,transaction:()=>nS,untracked:()=>Lb,values:()=>Vx,when:()=>rS});function X(e){var t=[...arguments].slice(1);throw Error(typeof e==`number`?`[MobX] minified error nr: `+e+(t.length?` `+t.map(String).join(`,`):``)+`. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`:`[MobX] `+e)}function Xv(){return typeof globalThis<`u`?globalThis:typeof window<`u`?window:h===void 0?typeof self<`u`?self:US:h}function Zv(){XS||X(`Proxy not available`)}function Qv(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function $v(e){return typeof e==`function`}function ey(e){switch(typeof e){case`string`:case`symbol`:case`number`:return!0}return!1}function ty(e){return typeof e==`object`&&!!e}function ny(e){if(!ty(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n.toString()===ZS}function ry(e){var t=e?.constructor;return t?t.name===`GeneratorFunction`||t.displayName===`GeneratorFunction`:!1}function iy(e,t,n){KS(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function ay(e,t,n){KS(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function oy(e,t){var n=`isMobX`+e;return t.prototype[n]=!0,function(e){return ty(e)&&e[n]===!0}}function sy(e){return e!=null&&Object.prototype.toString.call(e)===`[object Map]`}function cy(e){return Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(e)))===null}function ly(e){return e!=null&&Object.prototype.toString.call(e)===`[object Set]`}function uy(e){var t=Object.keys(e);if(!$S)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(t){return qS.propertyIsEnumerable.call(e,t)})):t}function dy(e){return e===null?null:typeof e==`object`?``+e:e}function fy(e,t){return qS.hasOwnProperty.call(e,t)}function py(e,t){return!!(e&t)}function my(e,t,n){return n?e|=t:e&=~t,e}function hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gy(e,t,n){if(wy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Ty(i,n.prototype),i}function _y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Dy(r.key),r)}}function vy(e,t,n){return t&&_y(e.prototype,t),n&&_y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yy(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Oy(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
22
22
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function by(){return by=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},by.apply(null,arguments)}function xy(e){return xy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xy(e)}function Sy(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ty(e,t)}function Cy(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}function wy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wy=function(){return!!e})()}function Ty(e,t){return Ty=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ty(e,t)}function Ey(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Dy(e){var t=Ey(e,`string`);return typeof t==`symbol`?t:t+``}function Oy(e,t){if(e){if(typeof e==`string`)return hy(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hy(e,t):void 0}}function ky(e){var t=typeof Map==`function`?new Map:void 0;return ky=function(e){if(e===null||!Cy(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return gy(e,arguments,xy(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ty(n,e)},ky(e)}function Ay(e){function t(t,n){if(Ny(n))return e.decorate_20223_(t,n);jy(t,n,e)}return Object.assign(t,e)}function jy(e,t,n){fy(e,nC)||iy(e,nC,by({},e[nC])),Uy(n)||(e[nC][t]=n)}function My(e){return fy(e,nC)||iy(e,nC,by({},e[nC])),e[nC]}function Ny(e){return typeof e==`object`&&typeof e.kind==`string`}function Py(e,t,n){t===void 0&&(t=QS),n===void 0&&(n=QS);var r=new rC(e);return t!==QS&&gx(r,t),n!==QS&&_x(r,n),r}function Fy(e,t){return e===t}function Iy(e,t){return RS(e,t)}function Ly(e,t){return RS(e,t,1)}function Ry(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e==1/t:e!==e&&t!==t}function zy(e,t,n){return Rx(e)?e:Array.isArray(e)?bC.array(e,{name:n}):ny(e)?bC.object(e,void 0,{name:n}):sy(e)?bC.map(e,{name:n}):ly(e)?bC.set(e,{name:n}):typeof e==`function`&&!dx(e)&&!kx(e)?ry(e)?dw(e):ew(n,e):e}function By(e,t,n){if(e==null||DS(e)||xS(e)||Tw(e)||Ow(e))return e;if(Array.isArray(e))return bC.array(e,{name:n,deep:!1});if(ny(e))return bC.object(e,void 0,{name:n,deep:!1});if(sy(e))return bC.map(e,{name:n,deep:!1});if(ly(e))return bC.set(e,{name:n,deep:!1})}function Vy(e){return e}function Hy(e,t){return RS(e,t)?t:e}function Uy(e){return e.annotationType_===oC}function Wy(e,t){return 0}function Gy(e,t,n,r){X(`'`+this.annotationType_+`' can only be used with 'makeObservable'`)}function Ky(e,t){}function qy(e,t){return{annotationType_:e,options_:t,make_:Jy,extend_:Yy,decorate_20223_:Xy}}function Jy(e,t,n,r){var i;return(i=this.options_)!=null&&i.bound?this.extend_(e,t,n,!1)===null?0:1:r===e.target_?this.extend_(e,t,n,!1)===null?0:2:dx(n.value)?1:(KS(r,t,Qy(e,this,t,n,!1)),2)}function Yy(e,t,n,r){var i=Qy(e,this,t,n);return e.defineProperty_(t,i,r)}function Xy(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(e){return wb(a.options_?.name??r.toString(),e,a.options_?.autoAction??!1)};if(n==`field`)return function(e){var t,n=e;return dx(n)||(n=o(n)),(t=a.options_)!=null&&t.bound&&(n=n.bind(this),n.isMobxAction=!0),n};if(n==`method`){var s;return dx(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobxAction=!0,e[r]=t}),e}X(`Cannot apply '`+a.annotationType_+`' to '`+String(r)+`' (kind: `+n+`):`+(`
|
|
23
|
-
'`+a.annotationType_+`' can only be used on properties with a function value.`))}function Zy(e,t,n,r){t.annotationType_,r.value}function Qy(e,t,n,r,i){var a,o;i===void 0&&(i=$.safeDescriptors),Zy(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:wb(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function $y(e,t){return{annotationType_:e,options_:t,make_:eb,extend_:tb,decorate_20223_:nb}}function eb(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!fy(e.target_,t)||!kx(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:kx(n.value)?1:(KS(r,t,ib(e,this,t,n,!1,!1)),2)}function tb(e,t,n,r){var i=ib(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function nb(e,t){var n,r=t.name,i=t.addInitializer;return kx(e)||(e=dw(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function rb(e,t,n,r){t.annotationType_,r.value}function ib(e,t,n,r,i,a){a===void 0&&(a=$.safeDescriptors),rb(e,t,n,r);var o=r.value;return kx(o)||(o=dw(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function ab(e,t){return{annotationType_:e,options_:t,make_:ob,extend_:sb,decorate_20223_:cb}}function ob(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function sb(e,t,n,r){return lb(e,this,t,n),e.defineComputedProperty_(t,by({},this.options_,{get:n.get,set:n.set}),r)}function cb(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=TS(this)[Z],i=by({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new MC(i))}),function(){return this[Z].getObservablePropValue_(r)}}function lb(e,t,n,r){t.annotationType_,r.get}function ub(e,t){return{annotationType_:e,options_:t,make_:db,extend_:fb,decorate_20223_:pb}}function db(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function fb(e,t,n,r){return mb(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??zy,r)}function pb(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=TS(e)[Z],o=new AC(t,n.options_?.enhancer??zy,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Z].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[Z].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function mb(e,t,n,r){t.annotationType_}function hb(e){return{annotationType_:cC,options_:e,make_:gb,extend_:_b,decorate_20223_:vb}}function gb(e,t,n,r){var i;if(n.get)return TC.make_(e,t,n,r);if(n.set){var a=dx(n.set)?n.set:wb(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:$.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(KS(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(ry(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?dw.bound:dw).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?ew.bound:ew).make_(e,t,n,r)}var c=this.options_?.deep===!1?bC.ref:bC;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function _b(e,t,n,r){var i;return n.get?TC.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:$.safeDescriptors?e.isPlainObject_:!0,set:wb(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?bC.ref:bC).extend_(e,t,n,r))}function vb(e,t){X(`'`+this.annotationType_+`' cannot be used as a decorator`)}function yb(e){return e||mC}function bb(e){return e.deep===!0?zy:e.deep===!1?Vy:Sb(e.defaultDecorator)}function xb(e){return e?e.defaultDecorator??hb(e):void 0}function Sb(e){return e?e.options_?.enhancer??zy:zy}function Cb(e,t,n){if(Ny(t))return hC.decorate_20223_(e,t);if(ey(t)){jy(e,t,hC);return}return Rx(e)?e:ny(e)?bC.object(e,t,n):Array.isArray(e)?bC.array(e,t):sy(e)?bC.map(e,t):ly(e)?bC.set(e,t):typeof e==`object`&&e?e:bC.box(e,t)}function wb(e,t,n,r){n===void 0&&(n=!1);function i(){return Tb(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},OC&&(kC.value=e,KS(i,`name`,kC)),i}function Tb(e,t,n,r,i){var a=Eb(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{Db(a)}}function Eb(e,t,n,r){var i=!1,a=0,o=$.trackingDerivation,s=!t||!o;Zb();var c=$.allowStateChanges;s&&(Rb(),c=kb(!0));var l=Bb(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:DC++,parentActionId_:EC};return EC=u.actionId_,u}function Db(e){EC!==e.actionId_&&X(30),EC=e.parentActionId_,e.error_!==void 0&&($.suppressReactionErrors=!0),Ab(e.prevAllowStateChanges_),Vb(e.prevAllowStateReads_),Qb(),e.runAsAction_&&zb(e.prevDerivation_),$.suppressReactionErrors=!1}function Ob(e,t){var n=kb(e);try{return t()}finally{Ab(n)}}function kb(e){var t=$.allowStateChanges;return $.allowStateChanges=e,t}function Ab(e){$.allowStateChanges=e}function jb(e){return e instanceof FC}function Mb(e){switch(e.dependenciesState_){case Q.UP_TO_DATE_:return!1;case Q.NOT_TRACKING_:case Q.STALE_:return!0;case Q.POSSIBLY_STALE_:for(var t=Bb(!0),n=Rb(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(NC(o)){if($.disableErrorBoundaries)o.get();else try{o.get()}catch{return zb(n),Vb(t),!0}if(e.dependenciesState_===Q.STALE_)return zb(n),Vb(t),!0}}return Hb(e),zb(n),Vb(t),!1}}function Nb(){return $.trackingDerivation!==null}function Pb(e,t,n){var r=Bb(!0);Hb(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++$.runId;var i=$.trackingDerivation;$.trackingDerivation=e,$.inBatch++;var a;if($.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new FC(e)}return $.inBatch--,$.trackingDerivation=i,Fb(e),Vb(r),a}function Fb(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Q.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Yb(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,Jb(l,e))}r!==Q.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Ib(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Yb(t[n],e);e.dependenciesState_=Q.NOT_TRACKING_}function Lb(e){var t=Rb();try{return e()}finally{zb(t)}}function Rb(){var e=$.trackingDerivation;return $.trackingDerivation=null,e}function zb(e){$.trackingDerivation=e}function Bb(e){var t=$.allowStateReads;return $.allowStateReads=e,t}function Vb(e){$.allowStateReads=e}function Hb(e){if(e.dependenciesState_!==Q.UP_TO_DATE_){e.dependenciesState_=Q.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Q.UP_TO_DATE_}}function Ub(){if(($.pendingReactions.length||$.inBatch||$.isRunningReactions)&&X(36),zC=!0,RC){var e=Xv();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),$=new LC}}function Wb(){return $}function Gb(){var e=new LC;for(var t in e)IC.indexOf(t)===-1&&($[t]=e[t]);$.allowStateChanges=!$.enforceActions}function Kb(e){return e.observers_&&e.observers_.size>0}function qb(e){return e.observers_}function Jb(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Yb(e,t){e.observers_.delete(t),e.observers_.size===0&&Xb(e)}function Xb(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,$.pendingUnobservations.push(e))}function Zb(){$.inBatch++}function Qb(){if(--$.inBatch===0){ix();for(var e=$.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof MC&&n.suspend_())}$.pendingUnobservations=[]}}function $b(e){var t=$.trackingDerivation;return t===null?(e.observers_.size===0&&$.inBatch>0&&Xb(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&$.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function ex(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Q.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Q.STALE_}))}function tx(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Q.POSSIBLY_STALE_?t.dependenciesState_=Q.STALE_:t.dependenciesState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.UP_TO_DATE_)}))}function nx(e){e.lowestObserverState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Q.UP_TO_DATE_&&(e.dependenciesState_=Q.POSSIBLY_STALE_,e.onBecomeStale_())}))}function rx(e){return $.globalReactionErrorHandlers.push(e),function(){var t=$.globalReactionErrorHandlers.indexOf(e);t>=0&&$.globalReactionErrorHandlers.splice(t,1)}}function ix(){$.inBatch>0||$.isRunningReactions||HC(ax)}function ax(){$.isRunningReactions=!0;for(var e=$.pendingReactions,t=0;e.length>0;){++t===VC&&e.splice(0);for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}$.isRunningReactions=!1}function ox(e){var t=HC;HC=function(n){return e(function(){return t(n)})}}function sx(){return!1}function cx(e){return function(){}}function lx(e){return function(t,n){if($v(t))return wb(t.name||JC,t,e);if($v(n))return wb(t,n,e);if(Ny(n))return(e?ZC:YC).decorate_20223_(t,n);if(ey(n))return jy(t,n,e?ZC:YC);if(ey(t))return Ay(qy(e?KC:WC,{name:t,autoAction:e}))}}function ux(e){return Tb(e.name||JC,!1,e,this,void 0)}function dx(e){return $v(e)&&e.isMobxAction===!0}function fx(e,t){var n;t===void 0&&(t=YS);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new BC(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=px(t),s=!1;a=new BC(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}function px(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:tw}function mx(e,t,n){var r;n===void 0&&(n=YS);var i=n.name??`Reaction`,a=$C(i,n.onError?hx(n.onError,t):t),o=!n.scheduler&&!n.delay,s=px(n),c=!0,l=!1,u,d=n.compareStructural?aC.structural:n.equals||aC.default,f=new BC(i,function(){c||o?p():l||(l=!0,s(p))},n.onError,n.requiresObservable);function p(){if(l=!1,!f.isDisposed){var t=!1,r=u;f.track(function(){var n=Ob(!1,function(){return e(f)});t=c||!d(u,n),u=n}),(c&&n.fireImmediately||!c&&t)&&a(u,r,f),c=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||f.schedule_(),f.getDisposer_(n?.signal)}function hx(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function gx(e,t,n){return vx(nw,e,t,n)}function _x(e,t,n){return vx(rw,e,t,n)}function vx(e,t,n,r){var i=typeof r==`function`?PS(t,n):PS(t),a=$v(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}function yx(e){e.isolateGlobalState===!0&&Ub();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&($.useProxies=t===aw?!0:t===iw?!1:typeof Proxy<`u`),t===`ifavailable`&&($.verifyProxies=!0),n!==void 0){var r=n===aw?aw:n===ow;$.enforceActions=r,$.allowStateChanges=!(r===!0||r===aw)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&($[t]=!!e[t])}),$.allowStateReads=!$.observableRequiresReaction,e.reactionScheduler&&ox(e.reactionScheduler)}function bx(e,t,n,r){var i=tC(t);return LS(function(){var t=TS(e,r)[Z];eC(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function xx(e,t){return Sx(PS(e,t))}function Sx(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Tx(e.observing_).map(Sx)),t}function Cx(e,t){return wx(PS(e,t))}function wx(e){var t={name:e.name_};return Kb(e)&&(t.observers=Array.from(qb(e)).map(wx)),t}function Tx(e){return Array.from(new Set(e))}function Ex(e){return e instanceof cw}function Dx(e){$v(e.cancel)&&e.cancel()}function Ox(e){return e}function kx(e){return e?.isMobXFlow===!0}function Ax(e,t,n){var r;return Tw(e)||xS(e)||jC(e)?r=FS(e):DS(e)&&(r=FS(e,t)),r.dehancer=typeof t==`function`?t:n,function(){r.dehancer=void 0}}function jx(e,t,n){return $v(n)?Nx(e,t,n):Mx(e,t)}function Mx(e,t){return FS(e).intercept_(t)}function Nx(e,t,n){return FS(e,t).intercept_(n)}function Px(e,t){return t===void 0?NC(e):DS(e)===!1||!e[Z].values_.has(t)?!1:NC(PS(e,t))}function Fx(e){return Px(e)}function Ix(e,t){return Px(e,t)}function Lx(e,t){return e?t===void 0?DS(e)||!!e[Z]||iC(e)||UC(e)||NC(e):DS(e)?e[Z].values_.has(t):!1:!1}function Rx(e){return Lx(e)}function zx(e,t){return Lx(e,t)}function Bx(e){if(DS(e))return e[Z].keys_();if(Tw(e)||Ow(e))return Array.from(e.keys());if(xS(e))return e.map(function(e,t){return t});X(5)}function Vx(e){if(DS(e))return Bx(e).map(function(t){return e[t]});if(Tw(e))return Bx(e).map(function(t){return e.get(t)});if(Ow(e))return Array.from(e.values());if(xS(e))return e.slice();X(6)}function Hx(e){if(DS(e))return Bx(e).map(function(t){return[t,e[t]]});if(Tw(e))return Bx(e).map(function(t){return[t,e.get(t)]});if(Ow(e))return Array.from(e.entries());if(xS(e))return e.map(function(e,t){return[t,e]});X(7)}function Ux(e,t,n){if(arguments.length===2&&!Ow(e)){Zb();var r=t;try{for(var i in r)Ux(e,i,r[i])}finally{Qb()}return}DS(e)?e[Z].set_(t,n):Tw(e)?e.set(t,n):Ow(e)?e.add(t):xS(e)?(typeof t!=`number`&&(t=parseInt(t,10)),t<0&&X(`Invalid index: '`+t+`'`),Zb(),t>=e.length&&(e.length=t+1),e[t]=n,Qb()):X(8)}function Wx(e,t){DS(e)?e[Z].delete_(t):Tw(e)||Ow(e)?e.delete(t):xS(e)?(typeof t!=`number`&&(t=parseInt(t,10)),e.splice(t,1)):X(9)}function Gx(e,t){if(DS(e))return e[Z].has_(t);if(Tw(e)||Ow(e))return e.has(t);if(xS(e))return t>=0&&t<e.length;X(10)}function Kx(e,t){if(Gx(e,t)){if(DS(e))return e[Z].get_(t);if(Tw(e))return e.get(t);if(xS(e))return e[t];X(11)}}function qx(e,t,n){if(DS(e))return e[Z].defineProperty_(t,n);X(39)}function Jx(e){if(DS(e))return e[Z].ownKeys_();X(38)}function Yx(e,t,n,r){return $v(n)?Zx(e,t,n,r):Xx(e,t,n)}function Xx(e,t,n){return FS(e).observe_(t,n)}function Zx(e,t,n,r){return FS(e,t).observe_(n,r)}function Qx(e,t,n){return e.set(t,n),n}function $x(e,t){if(typeof e!=`object`||!e||e instanceof Date||!Rx(e))return e;if(jC(e)||NC(e))return $x(e.get(),t);if(t.has(e))return t.get(e);if(xS(e)){var n=Qx(t,e,Array(e.length));return e.forEach(function(e,r){n[r]=$x(e,t)}),n}if(Ow(e)){var r=Qx(t,e,new Set);return e.forEach(function(e){r.add($x(e,t))}),r}if(Tw(e)){var i=Qx(t,e,new Map);return e.forEach(function(e,n){i.set(n,$x(e,t))}),i}else{var a=Qx(t,e,{});return Jx(e).forEach(function(n){qS.propertyIsEnumerable.call(e,n)&&(a[n]=$x(e[n],t))}),a}}function eS(e,t){return $x(e,new Map)}function tS(){}function nS(e,t){t===void 0&&(t=void 0),Zb();try{return e.apply(t)}finally{Qb()}}function rS(e,t,n){return arguments.length===1||t&&typeof t==`object`?aS(e,t):iS(e,t,n||{})}function iS(e,t,n){var r;if(typeof n.timeout==`number`){var i=Error(`WHEN_TIMEOUT`);r=setTimeout(function(){if(!o[Z].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name=`When`;var a=wb(`When-effect`,t),o=fx(function(t){Ob(!1,e)&&(t.dispose(),r&&clearTimeout(r),a())},n);return o}function aS(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(Error(`WHEN_ABORTED`)),{cancel:function(){return null}});var r,i,a=new Promise(function(n,a){var o,s=iS(e,n,by({},t,{onError:a}));r=function(){s(),a(Error(`WHEN_CANCELLED`))},i=function(){s(),a(Error(`WHEN_ABORTED`))},t==null||(o=t.signal)==null||o.addEventListener==null||o.addEventListener(`abort`,i)}).finally(function(){var e;return t==null||(e=t.signal)==null||e.removeEventListener==null?void 0:e.removeEventListener(`abort`,i)});return a.cancel=r,a}function oS(e){return e[Z]}function sS(e,t){var n;return Zv(),e=TS(e,t),(n=e[Z]).proxy_??(n.proxy_=new Proxy(e,fw))}function cS(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function lS(e,t){var n=e.interceptors_||=[];return n.push(t),Qv(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function uS(e,t){var n=Rb();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&X(14),t);i++);return t}finally{zb(n)}}function dS(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function fS(e,t){var n=e.changeListeners_||=[];return n.push(t),Qv(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function pS(e,t){var n=Rb(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);zb(n)}}function mS(e,t,n){return LS(function(){var r=TS(e,n)[Z];t??=My(e),eC(t).forEach(function(e){return r.make_(e,t[e])})}),e}function hS(e,t,n){return ny(e)?bx(e,e,t,n):(LS(function(){var r=TS(e,n)[Z];if(!e[pw]){var i=Object.getPrototypeOf(e),a=new Set([].concat(eC(e),eC(i)));a.delete(`constructor`),a.delete(Z),iy(i,pw,a)}e[pw].forEach(function(e){return r.make_(e,t&&e in t?t[e]:!0)})}),e)}function gS(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Zv(),LS(function(){var i=new vw(n,t,r,!1);ay(i.values_,Z,i);var a=new Proxy(i.values_,_w);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}function _S(e,t){typeof Array.prototype[e]==`function`&&(yw[e]=t(e))}function vS(e){return function(){var t=this[Z];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function yS(e){return function(t,n){var r=this,i=this[Z];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function bS(e){return function(){var t=this,n=this[Z];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}function xS(e){return ty(e)&&bw(e[Z])}function SS(e){return e[Symbol.toStringTag]=`MapIterator`,VS(e)}function CS(e){if(sy(e)||Tw(e))return e;if(Array.isArray(e))return new Map(e);if(ny(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return X(21,e)}function wS(e){return e[Symbol.toStringTag]=`SetIterator`,VS(e)}function TS(e,t){if(fy(e,Z))return e;var n=t?.name??`ObservableObject`;return iy(e,Z,new jw(e,new Map,String(n),xb(t))),e}function ES(e){return kw[e]||(kw[e]={get:function(){return this[Z].getObservablePropValue_(e)},set:function(t){return this[Z].setObservablePropValue_(e,t)}})}function DS(e){return ty(e)?Mw(e[Z]):!1}function OS(e,t,n){var r;(r=e.target_[nC])==null||delete r[n]}function kS(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}function AS(e){return{enumerable:!1,configurable:!0,get:function(){return this[Z].get_(e)},set:function(t){this[Z].set_(e,t)}}}function jS(e){KS(Lw.prototype,``+e,AS(e))}function MS(e){if(e>Fw){for(var t=Fw;t<e+100;t++)jS(t);Fw=e}}function NS(e,t,n){return new Lw(e,t,n)}function PS(e,t){if(typeof e==`object`&&e){if(xS(e))return t!==void 0&&X(23),e[Z].atom_;if(Ow(e))return e.atom_;if(Tw(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||X(25,t,IS(e)),n}if(DS(e)){if(!t)return X(26);var r=e[Z].values_.get(t);return r||X(27,t,IS(e)),r}if(iC(e)||NC(e)||UC(e))return e}else if($v(e)&&UC(e[Z]))return e[Z];X(28)}function FS(e,t){if(e||X(29),t!==void 0)return FS(PS(e,t));if(iC(e)||NC(e)||UC(e)||Tw(e)||Ow(e))return e;if(e[Z])return e[Z];X(24,e)}function IS(e,t){var n;if(t!==void 0)n=PS(e,t);else if(dx(e))return e.name;else n=DS(e)||Tw(e)||Ow(e)?FS(e):PS(e);return n.name_}function LS(e){var t=Rb(),n=kb(!0);Zb();try{return e()}finally{Qb(),Ab(n),zb(t)}}function RS(e,t,n){return n===void 0&&(n=-1),zS(e,t,n)}function zS(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Rw.call(e);if(o!==Rw.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=BS(e),t=BS(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!($v(c)&&c instanceof c&&$v(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!zS(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(fy(t,m)&&zS(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function BS(e){return xS(e)?e.slice():sy(e)||Tw(e)||ly(e)||Ow(e)?Array.from(e.entries()):e}function VS(e){return e[Symbol.iterator]=HS,Object.assign(Object.create(zw),e)}function HS(){return this}var US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,Z,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,Q,PC,FC,IC,LC,RC,zC,$,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw=t((()=>{m(),US={},WS=Object.assign,GS=Object.getOwnPropertyDescriptor,KS=Object.defineProperty,qS=Object.prototype,JS=[],Object.freeze(JS),YS={},Object.freeze(YS),XS=typeof Proxy<`u`,ZS=Object.toString(),QS=function(){},$S=Object.getOwnPropertySymbols!==void 0,eC=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:$S?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,tC=Object.getOwnPropertyDescriptors||function(e){var t={};return eC(e).forEach(function(n){t[n]=GS(e,n)}),t},nC=Symbol(`mobx-stored-annotations`),Z=Symbol(`mobx administration`),rC=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Q.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return $b(this)},t.reportChanged=function(){Zb(),ex(this),Qb()},t.toString=function(){return this.name_},vy(e,[{key:`isBeingObserved`,get:function(){return py(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=my(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return py(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=my(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),rC.isBeingObservedMask_=1,rC.isPendingUnobservationMask_=2,rC.diffValueMask_=4,iC=oy(`Atom`,rC),aC={identity:Fy,structural:Iy,default:Ry,shallow:Ly},oC=`override`,sC=Ay({annotationType_:oC,make_:Wy,extend_:Gy,decorate_20223_:Ky}),cC=`true`,lC=hb(),uC=`observable`,dC=`observable.ref`,fC=`observable.shallow`,pC=`observable.struct`,mC={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0},Object.freeze(mC),hC=ub(uC),gC=ub(dC,{enhancer:Vy}),_C=ub(fC,{enhancer:By}),vC=ub(pC,{enhancer:Hy}),yC=Ay(hC),WS(Cb,yC),bC=WS(Cb,{box:function(e,t){var n=yb(t);return new AC(e,bb(n),n.name,!0,n.equals)},array:function(e,t){var n=yb(t);return($.useProxies===!1||n.proxy===!1?NS:gS)(e,bb(n),n.name)},map:function(e,t){var n=yb(t);return new ww(e,bb(n),n.name)},set:function(e,t){var n=yb(t);return new Dw(e,bb(n),n.name)},object:function(e,t,n){return LS(function(){return bx($.useProxies===!1||n?.proxy===!1?TS({},n):sS({},n),e,t)})},ref:Ay(gC),shallow:Ay(_C),deep:yC,struct:Ay(vC)}),xC=`computed`,SC=`computed.struct`,CC=ab(xC),wC=ab(SC,{equals:aC.structural}),TC=function(e,t){if(Ny(t))return CC.decorate_20223_(e,t);if(ey(t))return jy(e,t,CC);if(ny(e))return Ay(ab(xC,e));var n=ny(t)?t:{};return n.get=e,n.name||=e.name||``,new MC(n)},Object.assign(TC,CC),TC.struct=Ay(wC),EC=0,DC=1,OC=GS(function(){},`name`)?.configurable??!1,kC={value:`action`,configurable:!0,writable:!1,enumerable:!1},AC=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=aC.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}Sy(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==$.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(cS(this)){var t=uS(this,{object:this,type:hw,newValue:e});if(!t)return $.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?$.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),dS(this)&&pS(this,{type:hw,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return lS(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:hw,newValue:this.value_,oldValue:void 0}),fS(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return dy(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(rC),jC=oy(`ObservableValue`,AC),MC=function(){function e(e){this.dependenciesState_=Q.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Q.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new FC(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=PC.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||X(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=wb(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?aC.structural:aC.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){nx(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&X(32,this.name_,this.derivation),$.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Mb(this)&&(this.warnAboutUntrackedRead_(),Zb(),this.value_=this.computeValue_(!1),Qb());else if($b(this),Mb(this)){var e=$.trackingContext;this.keepAlive_&&!e&&($.trackingContext=this),this.trackAndCompute()&&tx(this),$.trackingContext=e}var t=this.value_;if(jb(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&X(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else X(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Q.NOT_TRACKING_,n=this.computeValue_(!0),r=t||jb(e)||jb(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=kb(!1),n;if(e)n=Pb(this,this.derivation,this.scope_);else if($.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new FC(e)}return Ab(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(Ib(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return fx(function(){var a=n.get();if(!r||t){var o=Rb();e({observableKind:`computed`,debugObjectName:n.name_,type:hw,object:n,newValue:a,oldValue:i}),zb(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return dy(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},vy(e,[{key:`isComputing`,get:function(){return py(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=my(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return py(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=my(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return py(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=my(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return py(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=my(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),MC.isComputingMask_=1,MC.isRunningSetterMask_=2,MC.isBeingObservedMask_=4,MC.isPendingUnobservationMask_=8,MC.diffValueMask_=16,NC=oy(`ComputedValue`,MC),(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(Q||={}),(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(PC||={}),FC=function(e){this.cause=void 0,this.cause=e},IC=[`mobxGuid`,`spyListeners`,`enforceActions`,`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`allowStateReads`,`disableErrorBoundaries`,`runId`,`UNCHANGED`,`useProxies`],LC=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},RC=!0,zC=!1,$=function(){var e=Xv();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(RC=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new LC().version&&(RC=!1),RC?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new LC):(setTimeout(function(){zC||X(35)},1),new LC)}(),BC=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Q.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=PC.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,$.pendingReactions.push(this),ix())},t.runReaction_=function(){if(!this.isDisposed){Zb(),this.isScheduled=!1;var e=$.trackingContext;if($.trackingContext=this,Mb(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}$.trackingContext=e,Qb()}},t.track=function(e){if(!this.isDisposed){Zb(),this.isRunning=!0;var t=$.trackingContext;$.trackingContext=this;var n=Pb(this,e,void 0);$.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ib(this),jb(n)&&this.reportExceptionInDerivation_(n.cause),Qb()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if($.disableErrorBoundaries)throw e;``+this,$.suppressReactionErrors,$.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Zb(),Ib(this),Qb()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[Z]=this,`dispose`in Symbol&&typeof Symbol.dispose==`symbol`&&(n[Symbol.dispose]=n),n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},vy(e,[{key:`isDisposed`,get:function(){return py(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=my(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return py(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=my(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return py(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=my(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return py(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=my(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),BC.isDisposedMask_=1,BC.isScheduledMask_=2,BC.isTrackPendingMask_=4,BC.isRunningMask_=8,BC.diffValueMask_=16,VC=100,HC=function(e){return e()},UC=oy(`Reaction`,BC),WC=`action`,GC=`action.bound`,KC=`autoAction`,qC=`autoAction.bound`,JC=`<unnamed action>`,YC=qy(WC),XC=qy(GC,{bound:!0}),ZC=qy(KC,{autoAction:!0}),QC=qy(qC,{autoAction:!0,bound:!0}),$C=lx(!1),Object.assign($C,YC),ew=lx(!0),Object.assign(ew,ZC),$C.bound=Ay(XC),ew.bound=Ay(QC),tw=function(e){return e()},nw=`onBO`,rw=`onBUO`,iw=`never`,aw=`always`,ow=`observed`,sw=0,cw=function(e){function t(){var n=e.call(this,`FLOW_CANCELLED`)||this;return Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n.name=`FlowCancellationError`,n}Sy(t,e);var n=t.prototype;return n.toString=function(){return`Error: `+this.message},t}(ky(Error)),lw=$y(`flow`),uw=$y(`flow.bound`,{bound:!0}),dw=Object.assign(function(e,t){if(Ny(t))return lw.decorate_20223_(e,t);if(ey(t))return jy(e,t,lw);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++sw,a=$C(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=$C(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=$C(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if($v(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=$C(r+` - runid: `+i+` - cancel`,function(){try{s&&Dx(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(QS,QS),Dx(t),o(new cw)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},lw),dw.bound=Ay(uw),fw={has:function(e,t){return oS(e).has_(t)},get:function(e,t){return oS(e).get_(t)},set:function(e,t,n){return ey(t)?oS(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return ey(t)?oS(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return oS(e).defineProperty_(t,n)??!0},ownKeys:function(e){return oS(e).ownKeys_()},preventExtensions:function(e){X(13)}},pw=Symbol(`mobx-keys`),mw=`splice`,hw=`update`,gw=1e4,_w={get:function(e,t){var n=e[Z];return t===Z?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):fy(yw,t)?yw[t]:e[t]},set:function(e,t,n){var r=e[Z];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){X(15)}},vw=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new rC(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return lS(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),fS(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&X(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&X(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&MS(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=JS),cS(this)){var a=uS(this,{object:this.proxy_,type:mw,index:e,removedCount:t,added:n});if(!a)return JS;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<gw){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&sx(),i=dS(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:hw,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pS(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&sx(),i=dS(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:mw,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pS(this,a)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&X(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(cS(this)){var i=uS(this,{type:hw,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}(),yw={clear:function(){return this.splice(0)},replace:function(e){var t=this[Z];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[Z];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[Z].spliceWithArray_(e,t,n)},push:function(){var e=this[Z],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[Z].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[Z],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return $.trackingDerivation&&X(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){$.trackingDerivation&&X(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[Z],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}},_S(`at`,vS),_S(`concat`,vS),_S(`flat`,vS),_S(`includes`,vS),_S(`indexOf`,vS),_S(`join`,vS),_S(`lastIndexOf`,vS),_S(`slice`,vS),_S(`toString`,vS),_S(`toLocaleString`,vS),_S(`toSorted`,vS),_S(`toSpliced`,vS),_S(`with`,vS),_S(`every`,yS),_S(`filter`,yS),_S(`find`,yS),_S(`findIndex`,yS),_S(`findLast`,yS),_S(`findLastIndex`,yS),_S(`flatMap`,yS),_S(`forEach`,yS),_S(`map`,yS),_S(`some`,yS),_S(`toReversed`,yS),_S(`reduce`,bS),_S(`reduceRight`,bS),bw=oy(`ObservableArrayAdministration`,vw),xw={},Sw=`add`,Cw=`delete`,ww=function(){function e(e,t,n){var r=this;t===void 0&&(t=zy),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[Z]=xw,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,$v(Map)||X(18),LS(function(){r.keysAtom_=Py(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!$.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new AC(this.has_(e),Vy,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),_x(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(cS(this)){var r=uS(this,{type:n?hw:Sw,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,cS(this)&&!uS(this,{type:Cw,object:this,name:e}))return!1;if(this.has_(e)){var n=sx(),r=dS(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:Cw,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return nS(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&pS(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==$.UNCHANGED){var r=sx(),i=dS(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:hw,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pS(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,nS(function(){var r,i=new AC(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=sx(),i=dS(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:Sw,object:this,name:e,newValue:t}:null;i&&pS(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return SS({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return SS({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=yy(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return Tw(e)&&(e=new Map(e)),nS(function(){ny(e)?uy(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):sy(e)?(cy(e)||X(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&X(20,e)}),this},t.clear=function(){var e=this;nS(function(){Lb(function(){for(var t=yy(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return nS(function(){for(var n=CS(e),r=new Map,i=!1,a=yy(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=yy(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},vy(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),Tw=oy(`ObservableMap`,ww),Ew={},Dw=function(){function e(e,t,n){var r=this;t===void 0&&(t=zy),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[Z]=Ew,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,$v(Set)||X(22),this.enhancer_=function(e,r){return t(e,r,n)},LS(function(){r.atom_=Py(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;nS(function(){Lb(function(){for(var t=yy(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=yy(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,cS(this)){var n=uS(this,{type:Sw,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){nS(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=dS(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:Sw,object:this,newValue:e}:null;i&&pS(this,a)}return this},t.delete=function(e){var t=this;if(cS(this)&&!uS(this,{type:Cw,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=dS(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:Cw,object:this,oldValue:e}:null;return nS(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&pS(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return wS({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return wS({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return ly(e)&&!Ow(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return ly(e)&&!Ow(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return ly(e)&&!Ow(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return ly(e)&&!Ow(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Ow(e)&&(e=new Set(e)),nS(function(){Array.isArray(e)||ly(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&X(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},vy(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Ow=oy(`ObservableSet`,Dw),kw=Object.create(null),Aw=`remove`,jw=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=lC),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new rC(`ObservableObject.keys`),this.isPlainObject_=ny(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof MC)return n.set(t),!0;if(cS(this)){var r=uS(this,{type:hw,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==$.UNCHANGED){var i=dS(this),a=i?{type:hw,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pS(this,a)}return!0},t.get_=function(e){return $.trackingDerivation&&!fy(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),fy(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!$.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new AC(e in this.target_,Vy,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[nC])!=null&&n[e])return;X(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==qS;){var i=GS(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}OS(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&OS(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Zb();var r=this.delete_(e);if(!r)return r;if(cS(this)){var i=uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=by({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else KS(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Qb()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{Zb();var i=this.delete_(e);if(!i)return i;if(cS(this)){var a=uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:t});if(!a)return null;t=a.newValue}var o=ES(e),s={configurable:$.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else KS(this.target_,e,s);var c=new AC(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{Qb()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Zb();var r=this.delete_(e);if(!r)return r;if(cS(this)&&!uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=ES(e),a={configurable:$.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else KS(this.target_,e,a);this.values_.set(e,new MC(t)),this.notifyPropertyAddition_(e,void 0)}finally{Qb()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!fy(this.target_,e))return!0;if(cS(this)&&!uS(this,{object:this.proxy_||this.target_,name:e,type:Aw}))return null;try{var n;Zb();var r=dS(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=GS(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof AC&&(o=a.value_),ex(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Aw,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&pS(this,s)}}finally{Qb()}return!0},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=dS(this),i=!1;if(r||i){var a=r||i?{type:Sw,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&pS(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),eC(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}(),Mw=oy(`ObservableObjectAdministration`,jw),Nw=AS(0),Pw=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Fw=0,Iw=function(){},kS(Iw,Array.prototype),Lw=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,LS(function(){var e=new vw(r,n,i,!0);e.proxy_=a,ay(a,Z,e),t&&t.length&&a.spliceWithArray(0,0,t),Pw&&Object.defineProperty(a,"0",Nw)}),a}Sy(t,e);var n=t.prototype;return n.concat=function(){this[Z].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return xS(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return VS({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},vy(t,[{key:`length`,get:function(){return this[Z].getArrayLength_()},set:function(e){this[Z].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Iw),Object.entries(yw).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&iy(Lw.prototype,t,n)}),MS(1e3),Rw=qS.toString,zw=Xv().Iterator?.prototype||{},[`Symbol`,`Map`,`Set`].forEach(function(e){Xv()[e]===void 0&&X(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:cx,extras:{getDebugName:IS},$mobx:Z})})),Vw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DebounceActionTimer=void 0;var t=(Bw(),n(Yv));e.DebounceActionTimer=class{constructor(e,n){this.debounceMs=e,this.handler=n,this.requests=[],this.startTime=0,this.tick=()=>{let e=this.debounceMs<=0;if(this.debounceMs>0&&Date.now()-this.startTime>=this.debounceMs&&(e=!0),e){let e=this.requests.slice(),t=this.handler(e);typeof t==`object`&&`then`in t?Promise.resolve(t).then(t=>{this.handleResponses(e,t)}):this.handleResponses(e,t),this.requests=[]}else this.nextTick(this.tick)},this.handleResponses=(e,n)=>{(0,t.runInAction)(()=>{for(let t=0;t<e.length;t++){let r=e[t],i=n[t];r.action(i)}});for(let t of e)t.resolver()}}call(e,t){return new Promise(n=>{let r=this.requests.length===0;this.requests.push({args:e,action:t,resolver:n}),r&&this.startTimer()})}startTimer(){this.startTime=Date.now(),this.nextTick(this.tick)}nextTick(e){if(this.debounceMs<=0){Promise.resolve().then(e);return}typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,this.debounceMs)}}})),Hw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Jv(),e),n(Vw(),e)})),Uw=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Debouncer=void 0,e.Debouncer=class{static promise(e){let n;return(...r)=>t(this,void 0,void 0,function*(){if(n)return n;try{return n=e.apply(this,r),yield n}finally{n=void 0}})}}})),Ww=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Uw(),e)})),Gw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unescapeHTML=e.escapeHTML=void 0;function t(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}e.escapeHTML=t;function n(e){return e.replace(/\\u003c/g,`<`).replace(/\\u003e/g,`>`).replace(/\\u0026/g,`&`)}e.unescapeHTML=n})),Kw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sortedJsonByKeyStringify=e.sortObjectByKey=void 0;function t(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n=Object.keys(e).sort(),r={};return n.forEach(n=>{r[n]=t(e[n])}),r}e.sortObjectByKey=t;function n(e){return JSON.stringify(t(e))}e.sortedJsonByKeyStringify=n})),qw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Kw(),e)})),Jw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateICNSName=e.parseICNSName=void 0;function t(e){let t=e.split(`.`);if(t.length===2&&t[0].length>0&&t[1].length>0)return[t[0],t[1]]}e.parseICNSName=t;function n(e,n){let r=t(e);return r?r[1]===n:!1}e.validateICNSName=n})),Yw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Mv(),e),n(qv(),e),n(Hw(),e),n(Ww(),e),n(Gw(),e),n(qw(),e),n(Jw(),e)})),Xw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeSignDoc=e.encodeSecp256k1Signature=e.encodeSecp256k1Pubkey=void 0;var t=A(),n=Yw();function r(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw Error(`Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03`);return{type:`tendermint/PubKeySecp256k1`,value:t.Buffer.from(e).toString(`base64`)}}e.encodeSecp256k1Pubkey=r;function i(e,n){if(n.length!==64)throw Error(`Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.`);return{pub_key:r(e),signature:t.Buffer.from(n).toString(`base64`)}}e.encodeSecp256k1Signature=i;function a(e){return t.Buffer.from((0,n.escapeHTML)((0,n.sortedJsonByKeyStringify)(e)))}e.serializeSignDoc=a})),Zw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Xw(),e)})),Qw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.verifyADR36Amino=e.verifyADR36AminoSignDoc=e.makeADR36AminoSignDoc=e.checkAndValidateADR36AminoSignDoc=void 0;var t=Zw(),n=k_(),r=A(),i=Kv();function a(e,t){if(!(e&&e.msgs&&Array.isArray(e.msgs)&&e.msgs.length===1&&e.msgs[0].type===`sign/MsgSignData`))return!1;if(e.chain_id!==``)throw Error(`Chain id should be empty string for ADR-36 signing`);if(e.memo!==``)throw Error(`Memo should be empty string for ADR-36 signing`);if(e.account_number!==`0`)throw Error(`Account number should be "0" for ADR-36 signing`);if(e.sequence!==`0`)throw Error(`Sequence should be "0" for ADR-36 signing`);if(e.fee.gas!==`0`)throw Error(`Gas should be "0" for ADR-36 signing`);if(e.fee.amount.length!==0)throw Error(`Fee amount should be empty array for ADR-36 signing`);let i=e.msgs[0];if(i.type!==`sign/MsgSignData`)throw Error(`Invalid type of ADR-36 sign msg: ${i.type}`);if(!i.value)throw Error(`Empty value in the msg`);let a=i.value.signer;if(!a)throw Error(`Empty signer in the ADR-36 msg`);n.Bech32Address.validate(a,t);let o=i.value.data;if(!o)throw Error(`Empty data in the ADR-36 msg`);let s=r.Buffer.from(o,`base64`);if(s.toString(`base64`)!==o)throw Error(`Data is not encoded by base64`);if(s.length===0)throw Error(`Empty data in the ADR-36 msg`);return!0}e.checkAndValidateADR36AminoSignDoc=a;function o(e,t){return t=r.Buffer.from(t).toString(`base64`),{chain_id:``,account_number:`0`,sequence:`0`,fee:{gas:`0`,amount:[]},msgs:[{type:`sign/MsgSignData`,value:{signer:e,data:t}}],memo:``}}e.makeADR36AminoSignDoc=o;function s(e,r,o,s,c=`secp256k1`){if(!a(r,e))throw Error(`Invalid sign doc for ADR-36`);let l=new i.PubKeySecp256k1(o);if((c===`ethsecp256k1`?new n.Bech32Address(l.getEthAddress()).toBech32(e):new n.Bech32Address(l.getCosmosAddress()).toBech32(e))!==r.msgs[0].value.signer)throw Error(`Unmatched signer`);let u=(0,t.serializeSignDoc)(r);return l.verifyDigest32(c===`ethsecp256k1`?i.Hash.keccak256(u):i.Hash.sha256(u),s)}e.verifyADR36AminoSignDoc=s;function c(e,t,n,r,i,a=`secp256k1`){return s(e,o(t,n),r,i,a)}e.verifyADR36Amino=c})),$w=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Qw(),e)})),eT=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignDocWrapper=void 0;var t=Cv(),n=Sv(),r=$w();e.SignDocWrapper=class e{constructor(e){this.signDoc=e,`msgs`in e?this.mode=`amino`:this.mode=`direct`,this.mode===`amino`?this.isADR36SignDoc=(0,r.checkAndValidateADR36AminoSignDoc)(this.aminoSignDoc):this.isADR36SignDoc=!1}static fromAminoSignDoc(t){return new e(t)}static fromDirectSignDoc(t){return new e(t)}static fromDirectSignDocBytes(t){return new e(n.SignDoc.decode(t))}clone(){return new e(this.signDoc)}get protoSignDoc(){if(this.mode===`amino`)throw Error(`Sign doc is encoded as Amino Json`);if(`msgs`in this.signDoc)throw Error(`Unexpected error`);return this._protoSignDoc||=new t.ProtoSignDocDecoder(this.signDoc),this._protoSignDoc}get aminoSignDoc(){if(this.mode===`direct`)throw Error(`Sign doc is encoded as Protobuf`);if(!(`msgs`in this.signDoc))throw Error(`Unexpected error`);return this.signDoc}get chainId(){return this.mode===`direct`?this.protoSignDoc.chainId:this.aminoSignDoc.chain_id}get memo(){return this.mode===`direct`?this.protoSignDoc.txBody.memo:this.aminoSignDoc.memo}get fees(){if(this.mode===`direct`){let e=[];for(let t of this.protoSignDoc.authInfo.fee?.amount??[]){if(t.denom==null||t.amount==null)throw Error(`Invalid fee`);e.push({denom:t.denom,amount:t.amount})}return e}return this.aminoSignDoc.fee.amount}get payer(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.payer:this.aminoSignDoc.fee.payer}get granter(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.granter:this.aminoSignDoc.fee.granter}get gas(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.gasLimit?parseInt(this.protoSignDoc.authInfo.fee.gasLimit):0:parseInt(this.aminoSignDoc.fee.gas)}}})),tT=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(yv(),e),n(Cv(),e),n(eT(),e)})),nT=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(sg(),e),n(k_(),e),n(M_(),e),n(P_(),e),n(tT(),e),n($w(),e),n(Zw(),e)})),rT=Uh(),iT=nT(),aT=e=>e.apis?.rpc?.[0]?.address??``,oT=e=>e.apis?.rest?.[0]?.address??``,sT=e=>e.explorers?.[0]?.url??``,cT={fullSemver:/v?(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,partialSemver:/v?(\d+\.\d+)(?=(?:\.\d+)?(?=-[\w.-]+|$))/,basicVersion:/v?(\d+)(?=(?:\.\d+)?(?:\.\d+)?(?=-[\w.-]+|$))/,tagged:/@v(\d+\.\d+)(?:\.x)?(?=-[\w.-]+|$)/,embedded:/\/v(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,simple:/v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/,complexEmbedded:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-\d+[\w.-]*)/,taggedVersion:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?=-[\w.-]+|$)/};function lT(e){let t=null;return cT.fullSemver.test(e)?t=e.match(cT.fullSemver)?.[1]:cT.partialSemver.test(e)?t=e.match(cT.partialSemver)?.[1]:cT.basicVersion.test(e)?t=e.match(cT.basicVersion)?.[1]:cT.taggedVersion.test(e)?t=e.match(cT.taggedVersion)?.[1]:cT.complexEmbedded.test(e)?t=e.match(cT.complexEmbedded)?.[1]:cT.simple.test(e)?t=e.match(cT.simple)?.[1]:cT.tagged.test(e)?t=e.match(cT.tagged)?.[1]:cT.embedded.test(e)&&(t=e.match(cT.embedded)?.[1]),t?uT(t):null}function uT(e){let t=e.split(`.`);for(;t.length<3;)t.push(`0`);return t.join(`.`)}var dT=(e,t,n={getRpcEndpoint:aT,getRestEndpoint:oT,getExplorer:sT})=>{n.getRestEndpoint||=oT,n.getRpcEndpoint||=aT,n.getExplorer||=sT;let r=[];if(e.codebase?.sdk?.type===`cosmos`||e.codebase?.cosmos_sdk_version){let t;if(t=e.codebase?.sdk?.type===`cosmos`&&e.codebase.sdk.version?lT(e.codebase.sdk.version):e.codebase?.cosmos_sdk_version?lT(e.codebase.cosmos_sdk_version):`0.40.0`,gc.default.satisfies(t,`>=0.40`)&&r.push(`stargate`),gc.default.satisfies(t,`>=0.43`)&&r.push(`no-legacy-stdTx`),r.push(`ibc-transfer`),gc.default.satisfies(t,`>=0.45`)&&r.push(`ibc-go`),e.codebase?.cosmwasm?.enabled??e.codebase?.cosmwasm_enabled??!1){r.push(`cosmwasm`);let t=lT(e.codebase?.cosmwasm?.version??e.codebase?.cosmwasm_version??`0.24.0`);gc.default.satisfies(t,`>=0.24.0`)&&r.push(`wasmd_0.24+`)}}let i=t.find(t=>t.chain_name===e.chain_name)?.assets||[],a=e.fees?.fee_tokens.map(e=>e.denom)||[],o=e.fees?.fee_tokens?.reduce((e,t)=>(e[t.denom]={low:t.low_gas_price??.01,average:t.average_gas_price??.025,high:t.high_gas_price??.04},e),{}),s=e.staking?.staking_tokens.map(e=>e.denom)||[],c=i.map(e=>({coinDenom:e.symbol,coinMinimalDenom:e.base,coinDecimals:e.denom_units.filter(t=>t.denom===e.display)[0]?.exponent,coinGeckoId:e.coingecko_id||void 0,coinImageUrl:e.logo_URIs?.svg??e.logo_URIs?.png})),l=c.find(e=>s.includes(e.coinDenom))??c[0],u=c.filter(e=>a.includes(e.coinMinimalDenom)).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}}),d=c.filter(e=>l.coinDenom===e.coinDenom).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}});return{rpc:n.getRpcEndpoint(e),rest:n.getRestEndpoint(e),chainId:e.chain_id,chainName:e.pretty_name,bip44:{coinType:e.slip44},bech32Config:iT.Bech32Address.defaultBech32Config(e.bech32_prefix),currencies:c,stakeCurrency:l||c[0],feeCurrencies:u.length===0?d:u,features:r}},fT=i(J()),pT=class{static addItem(e,t,n){let r={value:t,expiry:new Date().getTime()+n},i=localStorage.getItem(e),a=i?JSON.parse(i):[];a.push(r),localStorage.setItem(e,JSON.stringify(a))}static getItems(e){let t=localStorage.getItem(e);if(!t)return[];let n=JSON.parse(t),r=new Date,i=[];for(let e of n)r.getTime()<=e.expiry&&i.push(e.value);return localStorage.setItem(e,JSON.stringify(i.map(e=>({value:e,expiry:n.find(t=>t.value===e).expiry})))),i}static removeItem(e,t){let n=localStorage.getItem(e);if(!n)return;let r=JSON.parse(n);r=r.filter(e=>e.value!==t),localStorage.setItem(e,JSON.stringify(r))}},mT=class{client;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}constructor(e){this.client=e}async enable(e){await this.client.enable(e)}async suggestToken({chainId:e,tokens:t,type:n}){if(n===`cw20`)for(let{contractAddress:n,viewingKey:r}of t)await this.client.suggestToken(e,n,r)}async getSimpleAccount(e){let{address:t,username:n}=await this.getAccount(e);return{namespace:`cosmos`,chainId:e,address:t,username:n}}async getAccount(e){let t=await this.client.getKey(e);return{username:t.name,address:t.bech32Address,algo:t.algo,pubkey:t.pubKey,isNanoLedger:t.isNanoLedger}}getOfflineSigner(e,t){switch(t){case`amino`:return this.getOfflineSignerAmino(e);case`direct`:return this.getOfflineSignerDirect(e);default:return this.getOfflineSignerAmino(e)}}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:async(t,n)=>this.signAmino(e,t,n,this.defaultSignOptions)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:async(t,n)=>{let r=await this.signDirect(e,t,n,this.defaultSignOptions);return{...r,signed:{...r.signed,accountNumber:BigInt(r.signed.accountNumber.toString())}}}}}async addChain(e){let t=pT.getItems(`cosmos-kit@2:keplr/supported-chain`);if(t&&t.length>0&&t.includes(e.name))return;let n=dT(e.chain,e.assetList?[e.assetList]:[]);e.preferredEndpoints?.rest?.[0]&&(n.rest=e.preferredEndpoints?.rest?.[0]),e.preferredEndpoints?.rpc?.[0]&&(n.rpc=e.preferredEndpoints?.rpc?.[0]);try{await this.client.experimentalSuggestChain(n),pT.addItem(`cosmos-kit@2:keplr/supported-chain`,e.name,1e3*60)}catch(e){throw e}}async signAmino(e,t,n,r){return await this.client.signAmino(e,t,n,r||this.defaultSignOptions)}async signArbitrary(e,t,n){return await this.client.signArbitrary(e,t,n)}async signDirect(e,t,n,r){let i=await this.client.signDirect(e,t,{...n,accountNumber:fT.default.fromString(n.accountNumber.toString())},r||this.defaultSignOptions);return{...i,signed:{...i.signed,accountNumber:BigInt(i.signed.accountNumber.toString())}}}async sendTx(e,t,n){return await this.client.sendTx(e,t,n)}},hT=[new class extends Xp{constructor(e,t){super(e,Xm),this.preferredEndpoints=t}async initClient(){this.initingClient();try{let e=await rT.Keplr.getKeplr();this.initClientDone(e?new mT(e):void 0)}catch(e){this.initClientError(e)}}}({name:`keplr-extension`,prettyName:`Keplr`,logo:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB+ASURBVHgB7Z1NbFxVlsfPKzsfTUJc6baZjkTcFTELJLA6ySzQJJGwe9FSmAXxzAJ604QN9GJomgVsoEUi0RtY8NWLhg2kN8NqKlkMGbHARgpILDoYGSQ2KIWNFIQNKZskhNiu1/f/PpxyuapcH/e+e+595yc9XrnKuFKv3jn3fN+AhK4pla8Uq3SjuI0GiiEFxYCCUvpaSGH0OCAaqgVhMX0+CAM8Ltb/nSD6OSi2e68w+p2w7e/wJaiqz1ht/zthNWzyO2EQVtb/Shh8VfeS+pvx362p/xdPrNJqpUg7q5XJvVu8l9BIQMI6EOxrtFIiKhxUgqwEm34FIVY3YCkV8lTABa5AOYQVKBUokUIYQMF8VaCgAoWxmwZnRFHcIpcKoFi+XNpO2w6qG6KkbpJfq5tECXxQcnelFbojUAognKHY8vhUHdODNFj5ZnJvhXKG9woAq/pVWj2oHuK4X33kcRF0oTnriuEDdUwvTo5Mk+d4qQBGyt9iRR9XDx9UH/GgCLzQB9PqOKfciumFyTtmyDO8UQDD5YXxIBb4E+KnCyZQcaAKRQqh9qovysBpBZCY90+qhycoNvEFIRNiZVA7PUDbpl2OHTipANLVXpn5J8W8F2yjlMHbAzRw2kVF4JQCgOCr0/PqGCdBYIaLisAJBfDL8pXSKq2+RSL4ggO4pAhYK4DEx8eK/ycSBMdwQRGwVQAj5757MqyFp8THF1wmDRaqrMHbxBB2CkDMfcFHoAiUNTDBzRooECOw6q/S2ickwi94BmpT1MJ2SQWynydGsLAAZNUX8gQna8C6BSCrvpA3Emvgk+HyN9aD29YsAInwC0IkgK/sosHTtlqUrSgAmPxrtFoOpXxXEKy6BJkrgJHylYMhrU1Jek8QbpGkCyezbjLKNAbwi3OLj4TK9xHhF4SNIC4QUpB5XCAzBTB87rvng1r4NgmC0IaBl7NMFWbiAkD4qVY7RYIgdMqpxcmR02QY4wpAabOXSSL9gtALxpWAUQUwUl58S/k2J0kQhJ5AQ9HC5PCjZAhjMQCY/SL8gtAfkKGR2Io2ghEFID6/IOgjVC60qcCgdhdAhF8QjKE9JqBVAcQ9/LVXSBAEI4SF4OR3Dw6fIU1oUwBxhR+KfIR+2H9bgYa24Qho9LaB6Lk96jGO9PWU9PXGx41/rx/mr9c2Pbe0UlNHWPdzGD1X//vL6rnl5Pn49fhxs78ndEdA4SFdFYNaFEBc2782JfP4WwNBhJDiuFM9TgV9tE7gUyHPA1AEc9fXIsUwn5y/Tp7DIYqiLdVBGjyko3eg7zsu3lBz7RMR/ljIx4YG1Xkgeoxz/DOruSvO8NnSaqQYcIZCwDl9Lu8owZ3ZRYMT/XYRDlKfJC29JcoZEOpjw9vpnqEBulcJOQQ9Tyt4FuC6gqPD2zY8D9diNlEGHy2uKIshVg55Ap2012LZe4r6oK87Nk9BP9yEuCGPqPMxdYiw8wJK4YJSBlAIUAYfqnM+WHtqcfKXPctgz3dxPMZrzdvOPvjkD4/uFIF3lFQhnL98UymFm5GV4Cl9xQN6vqtHyouXfPP7U6E/vm/7JrNTcBtYBO/M/eSrMsBW5hPUAz0pAJ+KfUTo80eqDM5f/smjgGJvrkDXCiCZ4HuJHAf+/MOjO+h3SvjFvM8ncBPeVUrgpS+u+2AV9OQKdH3nu276Y5V/+u7bZLUXNvDO3I3IKnA8eNi1K9CVAhgpf3sypOAtchARfKEToAD+ePEHhy2C7lyBjhWAq9V+qLR77fDtIvhCV8AicNQ1qO6mwQOdFgh1XKKmhP9514QfK/7UxF4RfqFrEBj+x29/Ht1DjlFMCoQ6oiMLwLXAH6ryzty3R0pwBS2gDPnEhapT1oAKCB7oJCDYkYRg9SdHePyunfT+RFGEX9AG7iXXrIFkr80t2dICcGX1Rz4fq76Y+4JJ3r18k/48e9UVa2BCZQWm2/3ClsukC6s/An3i6wtZ8MC+7XT2WDG65xxgS9ltawG4sPrD3z97bEiKeYRMQVzg9x8vu9CF2NYKaKvGuK/+xyNtLMIvZA/iArj3YBFwJgjDE21fb/UC99Ufwv935fMLgm0eUZYAYgNMaVsX0NICWKOVcWIKzP6/Hr6dBIEDKDRLh5cwpHi1drPlzlwtLQCuNf+jkeklaT6OLCWDQGejsV3xANCvk2h54yDRRjArEa5cOkoNWR0I1ZAj7h0+22+mrrDMDmB82MLkyKEWr21mpPztQWxVTMwQ4ecDhPvC4k36fGktGuo5m8zt0w2UwlgyiSmdysRVKeDzT0xV1yckM6NpMLCF3VJ4Mpo6xowXxnaL8Fviw2TUFibsQNiXM+qjx/vgvXG8lDwHRZDOb+BkeuPePHPf7XTiwhJxIwkGTm96vtkvczT/n7n7Nhfrsp0Fqxl65bMW+G6B0GGmw0Pq4JKbf3b2Gr355Y/EiYCCysLk8IHNzzfA0fwfTUoxBbNA6NEFl664roGU3GN3/YxFQRhcAW41As02FNlkPynhHydmwO8XzIDgFVYrV4W+HqTicMAqgMWIjj5bIEV9+L3viROJbG9QAM1spgeJEfgixe/XD4Qdvuq//t939OIX170aow1L5omLVyMBtBWVxz3L0GXdJNubXIDh8gIbZ09Mf72kq/3f1MHVpzcBLAEIY9YxAoapwU1FQRuuiBL+cWKEBP30gNUd1Wrpap8n4QeIa6CfH+csQbryNV4Fa8WrtHqw/olGlThOTIC2tunD+UBq5uNgXKqaCalb8JyK0GeZpz+a1C8woq0CuJ+YwExzOkW94Odni6zOeEO5P4jQZ2mW87Jka+P1PzUqgIPEAIZa0wlE8DsjHfGVVZqO1/1c2LDIrysAdP+pE4t8GzbsEDpHBL97YiWQnWvEyAooFsuXS+kP6wpglVZLxADx/TsHUWb4tSL4vYHrh+AoNgQxDaey5e20bd3Sr3cBxokBEvnvDMysR54768i2jzxx8YdMLAEuC1utrsy/XgH8miyDtMlx5hNWbIOVHoKfx3SeSbAbkOmYAFzboW32i9rCIFiX9fp/jXX///g+HheII/Xm/jyfwhJvwPXFjD+T2QEscA8xiG8VwrCpC2A9AyDBv+bAzBdz3zxQrIgJmKwT4DBDUNmNpfRxpACK5StY/a1aAAj+SepvI3NJpBorv5j72QA34KUvzLXy4h5nYOUWS7HMxwpgsKE80AZHhsX3rwd9+BNTVyS6b4E3ku5IU3BwA67RSgnnSAGEFFj3/8X8j4EvinJV+KOy6tsDmQFTrgCPUeKFaNGPFEBgefqPmP8xmLyDVf8NZtNk8gjiAaZcAQ5uQEjhLRdAWQAlsoiY/zA7b9BvpqoS4WeESVfAthsQhPGiX4j/U7PqAhzfl9/VP07v/aDM/qsk8AMFVyawbfHWCoUhnFML4Fdkkbya/3PRGOkrmZSiCr1halSa7Xt+gwVAFlOATNIimZNG+cXk548JKwBFQTaVQEBBCedU8kpkiXuHBihvoIxXovzuYMoKuIdBc5B1C+BIzsx/pPhM+ZWCOUzM+bdpAaT7fgzGVYD25pfnxf9PW0+lsMdN0C2IugCd7qrtex/VgIWddMPa6g/zPw/+fxrsE+F3G93B2qFkM1RbVJXsF1ZpsESWwI6wvjOXjJ+SYJ/7nDcwM+CoxRqYbTRQtLr8+u7/p5V9Ivx+AAtO93dpc0oQWgAKNvsAOO3sqhsIPzr5JNLvF9gwVSc2s2BIBQ4qE6Bo6xb1NQUIX/HZWV4tvHG/RWfm5oeLNzntZsMKuAGP3/Uz0oXtRXAwbQrIGgRAfAwAQvhR2ssNjFp7YWx3R7+L+QNzMnykKbrHhqWBQFtuIiTQigLw0fznKvxgTxfKVjZjbQ3SubqzOWNDdmJhqAWw9k37Zv5zFn7QzcaYogDao9sKuNPi9bb2zvs9SgEi4Pcs826+bq63DGZtz2dLa6QTW+nwIAyLBVvDQHxxAVyJ9sPX7JQ81Gf0A4KkOrFlcaEl2Jqq7+aG5MpcMkXWhVRfNzeZD9+NSXQH7MYsLoYWYwBuWwCuVfgNSRBQKzq/d5vXu2BjGIjrN5hrwt/L9RYl0J7ZJb2ZABvXOwjX9lr5ll33MWH2u1Te28v1lkBge3S7fXZkwlIMwOUMAPr5s9pXXhe9+PQ+l2nrQHelpC2ZsKQA3FxdMMnHxZHdvUye2SOBwLYsr+hWAHZkwsq7uhhlRg24q5N8erMAJBXYDs0hAKsKIPNSYNcsAJh7/824ym8rejHnJQaQLTaut1oWUAiUfTuwSzcXar8R8Xe5rbcXC2BMYgBt0e0C2AkCBkXJAmwBgn6uD/ToxQKQNGB7ljQvCLbcYgkCtgFBv3ccb4vtx5cXJZAde/KkAFxgLtoc0v3x3f1YW0dlz8bMyI0F4MKqkvr9PtDP3EWpBWiNiby9DdnI/B1dSAFi5fdlkGc/QiypwGyxERy3oAB4WwDw+V0s9mnF0T4tAEkHNsfEEB8bi6NYAHXA73/Ro227+t15Bt+VWAHN2WNAMdooBy5kPRR0D+MVxSfTHzw8uoP65fi+/v+Gj4x6kCGB7GdeCTjEdC8QmP6up/wa0RHF16FEfMRE2s5CKjD7QiCOFoBvpj+A+a8jqmx7H3uumChmy0UMgCO+mf7gsbt2ki6evvs2EjbiS5FU5p+Cm++EbZ99M/1xjR/Q6LvDAhAr4BamNrXJRR0AN55jPs67F84e0x/WESvgFj4VSFmIAfBJA77ooen/jBJUEysJLIDHNO6J5zI+TU3ObSEQAn8+FfwAtPCaXKn/MrZLXAEyt629jS7Z3LoACPz5tHU3/P4z9+0h0+A9fMiB94O4AI6D1d+nwB8EEn5/FkEkmL94rzwrAZ+qI3NZCvxnjwJ/WQp/yv7kPfOoBCD8ptzYXLgAtmMA2NoZqT8fQJXe1MReK+kjvOf76r0fHtVXb+AC93ItZe2R3DV8+zDkA1YUgn2PW47K49/x+uHd0ar40hc/0tKKXxmVZhwd9ktkcmXDwe+HBeAyWHEv/vbn1oW/HvxbpiaKubAGfJuSlCsL4I0v3Qz8YaVFDv4P6uC6YQdcAlgDqENAevX85Z+0755jG8Q8fJuTmBsFgJXflS294j78QTq+b3t0din3DgF5YWxXdOB647pjUxU8XnI87XrEwxmJmSsAWxqUo++Pa4GgKAp47lF+NAZC4LEvqwyUF47UXYESgFWA89fqPHd9LTpcqcY8vs+sIrbxvefCAsBNl5Xvj9UbZjpSOmnTyJ2J6YjHo8k5jyO3Y4VA9MC+zSvpfKIQYCXMJ2coCQQW8RivoXDLphXhYxVkLhSAztUfNwFKQVNBz7tQ62J/F/51qixAvWL4f+VqzBpy86C0fJyP6L0C0F31h9x73nLf3KhXFkdp46psSgEc3+fnHgneL1m+NfwIdvB1kxTvFQDSUYLQDzD/fXXvvFYAMP196/cXssdX8x94rgBk9Rf6A8Fen2M+3iqALFN/gr/4vi+Ctwrgo0U/Ov4Eu/i+L4K3CsDVun+BD+hy9H0EmpcKIC03FYR+4NRxaQovFcB5TwZ+CPZAdWceCr68rAQ0Oe8PmQVYGM1q/qUUOBvmkx6BueSclgLrVPw+dv41wzsFYNr8R2ahXXYh7g/Y3AyEx/uT5/CaKIuNNAo1fm5sBsI5q0nOz+RkIxTvFIDt6P9ycpN2UoAEJQBlgANKAt1yo8nZR3BNUKuPbr/Pl9aix6mwcwKmf14UdOZ3Gr5skxf3/GV3cv+4Fjg+pI3/ZlgRY8lAEEShXVUI6RCW80mXniv7MNha/W0oQu+WGh+KfyAo9a7G/mSzT4wF4z6KG2b6m1/+SH9Th4sbr+Rp9QdeKQAIjI+TaeeTbcxw4AbFRGBuigCC/9zsNec3XMmL75/ilar7bGmNfAcC9pupK9EqywUUXR1+73vnhT9vqz/w6tPmpfUXq+2zarV94uJVqxYP/h1PXPwh2mLdh30W87b6A7EAHAYr7sRU1cr4bbznhLJEfOm45LD625h3mPknTme56QbCn4edaRpBfODEhWyVwFzynr7MWkBtBofV38b9640FYEqxuECqBLK4gXwTfoCa/7wWZnnzqfPe+w+BfOTjH8g0j3y87JXwI5vydA59/5TMFcC8oZX6c+n+i5QgUnGmePGL6951WXIS/lzEAEzh+rZTukCtgAlrCKa/Dzsr14Nhn5w6/iQG0AfS/38LE4IKv983XhjbTXnHQhZAv5bLW/pvK7bqWOyWdy/f9G66MqL+3AJ/Nq6xFxZAHtN/W6HTCuBUdaiDvAf+6slcASwbENY8pwBboasvwsfpymePFYkjtoKAmTp3SwbuJdn8ozk6qvR8m67M0fRPsVBOXS0EFDgf3ZEMQHN0jMjyaXMV7qZ/1goAsu9FHYAPjSgm+CyZuNMPPpn/XE3/lFykAU18yHmJATQFllE/GRKfhJ+z6Z+Si0IgMdezpZ/6CF/Sqxir5kLUPxcWgATssqUfIf7IAwsAfv/rh28nF8hNHYDk7bPjwz6i+D6kV1HtJyPYW2PlyizLpr2Z0c+q4np5Nfx+TFZ2AVuWsVgAOaCXm8t1/98Vvz/FlrVVCCnMvA5AKveyZbaH6iuXlbRLfn+KneB4WM28EhDozttj+y2hNb1cb1ctAIz3Qr7fNb/fhgsQohKQLKC7IxA76Qit6cWXd9UCwMrvYtDP1vW2cqXmRQFkSi/9F587aAG4FPRrJFdBQN2Ve9hcU2jNZzmIATx+106nW3xtVbNaiQHoDgLu2UZCG3oJMLkUqMWq7/p0H2tZgIDCJcoY3ebO2JBogHb0cr1dqdhExP+vjkX8m2ElCBgEFWvREp0fWCq9tqab6+1KvwaEHxF/12NANjMu1iRnVuNkEKR+RAm0pxuf3oXVPxV+H753m/GWQo0KVgaCiBuQLd34mNwDgD4JP7BlAQRh+BViAJYUgN4PfadYAG3pphiIcwDQN+EHNq+3FzEA8ICj+d+s6Kb4iqsL4KPwA5u7WmEmYIUsMKv5Q987NEhCa1wPAvoq/MBiELBqTWpwQ8LX1FXHj0AgOsDyvkloKzAX4MSFzjK+s8zagH0WfihbWzEXDAW1umxC8x0d1velHhEF0BIoXBenMfks/MDmzIUAzUAhhRWyhO4PDwtA8AffhR/YrAGooR3YVhYA6P7wUABSD+AHYyqm47vwA9tzFwsDtGZNAXxoYNcZTts9C70BRX722FAulLnNFOAqrVYKN2inNQWQBgJ18vhdPyPBXdDVB+HPQ4t3vG+DvRhAUcl+oTq51+rWYLqDdmk2QHAP9PO73tXXDbYD1hUl+5GNZasWAJjwgWTrZ7eA0sYkn7x9b5YVQLTwW3eyTERBYQGIFeAGcaR/SMVudlDe+NxuCrCCc6QAbKYCde1j34hYAfyBkp6a2JvLKk74/zYtgLDeAlCpwK/IIiYuhFgBvIG/n5dgXzNs+/8YBoJzpABstQSnmMqFihXAj3hs91Duv5vzl/WnwLuhUKtFdeGpBVAhi7wz9xOZABbAY5IWZENq8otlZqYGphs2WABoCiCLmPSHYGrKxiH2eWFsV26Ke7YC97rtvowC1SkA5QTMkGXOXzZjBcDkfO1wfnLL3ECUf2qiKAVadZiyeLuhlrQARApghbZVyDImLwqGhYgrkD2o6strlL8dts1/sJsGo0U/UgBJNaC3bgCAKyA3YjakuX1U9cmuTRvhYP4rqpWkArjeIauQZUy5AQCuwN/v2xPdnIIZcI0R3ZdAX2s4mP+KdZd/XRpUJuBTsgwujsnpKAhAnVFKQIKC+kkj/LC0ZNVvDqxc2+m/mNr6aKh1SQgpsB4IxAUyrSHhBrwwJvUBuoBFBctKIvxbAwuXx8j1wmYLILTYEFTPO3M3yDSYGfC6ZAb6ot7cd3VH3qx58YvrxITp9MF6VGwbrcyskv0gGZqDECgx7UNCCexRrsAfL151bidc2yC6/8zdu8TU7wIsbFxmMg7SaiV9vOEbHC4vXCHMCbBMOhEmCzCQ4ZGPl7uam59XoDTh44up3z2YyMxkYG11cXJkb/pD4zc5TQzAhcrqYt2bzJ6T7EBrUoUMt0mEv3uyvJ87YEOsr/Hb/ICY8FKG/hJu6n/89udSLNQAVvyL6rpA+CWt1ztPXPyBGLFBxhudfuuZgJRUa2Z54/1lbBeNDQ1EyievLgGCe1CEf1CH+Pj9w8n3T5iu/2HDN1wsXymqAMElYhAHAPuTOvKs8/b4whCxzSIjwQUoWkTzfxcFR0XwdXH4ve9ZKQDl/2/4cjdIVlISzMYKwIV788vshRCKB/4uzF+fTV+s9mjSgYmP43FZ9bWCRYTz6g+a5f3OqWOcmICL+JBalWwE6fYnNe1wReAW+LLtGJTaQ6M76D/27RCBNwRcyJf45P1TzjU+sUkBBBROh8TrpkCaDq6ALaLxYokiQKWia64BVnpkO8TEz44TF6z21jUFsr35uSaMlBcvhRSWiBEwTzFUggMw69DS+YZyTz5jtpNuCqyXB9QKD6HHNlsi9NkBq5Xb6o+pXwuTdxxofL5p6Z/yWs6p2+VJYsQbX/4Y3cwcfHIIF1JkOFJlAMsAygD9DLb+TceGt9O/Dw9GZ8nX2wHNPgxNf6UBCtNNn2725HB5YVydpogZMGXfn9jLumgHbgIUAQadwg/UbSHgGuy/bSBa1e9RKUuY9rLC8wDfN0x/jtuwKwvgkLIAZjY/3wKlBD5Rp4PEDFupwX5ILQNsBImbY1k9Xk4shfrNISHc6eeCQO+JhL0QPQelN6oEXwSdJ8yFv6n5D9p1/yBiyE4BzEcXellF593p608nER0lqabzESh3BKo5Cn/C6VYvtJSgVRp8hSyPCWsFVlR08QkCB1DqyzUYDAZobbrVay0VAIqCVDrwDDHlXRVsgdaVVl7BFlj5f6/uQR5TfpoTBMHb30zuq7R6va0NrXyHs8QYKAG4A9LKK2QNhB8tvpyFHwyEK6fbvd5WASxOjkwTkxbhVsD0QvBFlICQFbjXJqausDb7wVarP+gkinaamDOfRGDfZa6NBfdBmhfCzzjgt85Wqz/oKKekUoKoCRgnB8DEGtkUVDDBc7PXooI0F8Dqv3Bi+NEtf4864JflyyWVFbhEjhA38ciUH0EPMPkRcOZu8tczSKsHtjL/QUcSgj+kMgKvkiPAPPu3977nWZIpOAMCfbiHcC+5JPyd+P7rv0sdwm1YSKfAGoBbgLp9QegU+PrI77vg69eDqj+V95/QrgCAigX8SZ1eJgeJh3zcLrPthLa4PvtBKYBHFybveLvz3+8SlwKCzYACeHh0h1gEwgZ8GPrSrua/9f/TJUlAEI1CTrkCjaSuwfF9O6ImHCF/xFvR3Vhv5XadTgN/9fR057vsCjSC7joMzoBVIO5BPsAqjwq+/1HCv2xpfoN2arXTi//1L6eoS3pe+lx3BZoBq+Do8HZRBh7ipdAn9GL63/p/e8QXV6AVqTJIpxCJm+AWMO8h9BjM4qPQ11FVpv+hbk3/lL7uap9cga2AEkBf/xEMCBWFwI56gYc/78sE5w54anFy5BXqkb7v4l+UF19RJgir+YFZAGWASsMjiWLAIUohGyDsEHIcny+t0YXFm87l63UQhOGrC/95x5+oD/q+Y5MCIcQD2E0PyhoEFMcSZQAXIlUK6UQgoTsg1LNKyOeTUWo4xz9L5yf8/l107VBl8kBfQ3u0LFm+xwN0sD+Z6YfjzmjOXzzcE2c8l6cpvkvJTEQMc0GdPc4Q6q+v16IZiensRKE53Vb7tf9bmhgpf3swpOATEvoiHQIaDwiNh4SmA0LT10H6Oyn1A0Ub/14/tBLE+mGm9Y/T328cfLqUCLwIdv+0mvDb29/SiFICJ5USeIsEQTBFX0G/RrTanUkNMvsBIoLgJCj20Sj8wEjYWqUHT6nT8yQIgh56rPTbCmN5q7ymBwVBO4aEHxhNXI/877dvh0HwCAmC0BMq139G5fpPkiGM5p6Sf7jEBAShB5JCn5NkEOPJZxW0OEWiBAShO5TZ32+VXydkVrsqgUFB6BCDPn8jmRav56l5SBB6IaTw0e+6GOnVL5l3r6BiUJ3KIQUlEgQhpaqyZhO6Kvw6JfMCdHxA1DGjnpkEQUBp7wx6+rMWfmClAwVNDCu07ZBLew0IggkQ6d9F17Q09vT0/mSZJC6A4KB0Egp5Am282kt7u4XFBAu0E6/RwJTEBYScMK1M/kdtrfr1sBphI6lCwXNYrPr1sJthJdaA4ClsVv162A6xw2wBdXpeFIHgOOxW/XrYzqHCbIEkXXiGBMFBEOHfTVcPcBV+4MQY28QtOKWsAeksFFyApbnfDKfmWIsiEJgzTbG5P02O4OQge1EEAiNQwntG3YtnXRL8FKd3skgUwThJsFDIGCU4MyHROeXjv9LvbH6beLOVTdJkhKrC+0UZCCYIKKgQ1c65uto3w8u9rJI9CsbVwwfJsx2MhUzByo4GnXPKzJ+20axjmlxsZjdcXhinWBHcT/EWZtJ3IDSjqiRimkL6QD2eUeb9jMvmfSfkcjfLZCuzEkEpBPRr9YVDIYhiyA8Q6koYhDNBGHyqrMXKGq3MVB1I2+lGtrOto1S+VLxKu+E+FJXJV8JRC2hI3SQlipVDehaYEvvp0WQdCHilENISBFw9r4S+NrOLrlV8X9W7QRRAD0BRVGlncTC2IggKo6AUg7rpoBzWFYS6AX+VPk6USCNK0QRtFUrj33SMaix4rVGfD69v/J2AqsnzEYkQV+OXYgFP/l8l2GF1hdaqRbpRFcHunn8Cz9Ea2bs7Ut4AAAAASUVORK5CYII=`,mode:`extension`,mobileDisabled:()=>!(typeof document<`u`&&document.readyState===`complete`&&window.keplr&&window.keplr.mode===`mobile-web`),rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[`keplr_keystorechange`],supportedChains:`agoric.akash.archway.axelar.bostrom.celestia.certik.comdex.cosmoshub.cryptoorgchain.dymension.emoney.evmos.gravitybridge.injective.irisnet.ixo.juno.kava.kujira.noble.nois.osmosis.persistence.quicksilver.regen.secretnetwork.sentinel.sifchain.sommelier.stargaze.starname.stride.terra2.tgrade.umee`.split(`.`),downloads:[{device:`desktop`,browser:`chrome`,link:`https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap?hl=en`},{device:`desktop`,browser:`firefox`,link:`https://addons.mozilla.org/en-US/firefox/addon/keplr/`},{link:`https://www.keplr.app/download`}]},Ym)],gT={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},_T=class extends Yp{WCClient;clientMutable={state:U.Init};options;constructor(e,t,n){super(e,t),this.WCClient=n}setClientNotExist(){this.setState(U.Error),this.setMessage(this.clientMutable.message)}},vT=class extends we{constructor(e){super(),this.opts=e,this.protocol=`wc`,this.version=2}},yT=class extends we{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},bT=class{constructor(e,t){this.logger=e,this.core=t}},xT=class extends we{constructor(e,t){super(),this.relayer=e,this.logger=t}},ST=class extends we{constructor(e){super()}},CT=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},wT=class extends we{constructor(e,t){super(),this.relayer=e,this.logger=t}},TT=class extends we{constructor(e,t){super(),this.core=e,this.logger=t}},ET=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},DT=class{constructor(e,t){this.projectId=e,this.logger=t}},OT=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},kT=class{constructor(e){this.opts=e,this.protocol=`wc`,this.version=2}},AT=class{constructor(e){this.client=e}};function jT(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function MT(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function NT(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var PT=`[object RegExp]`,FT=`[object String]`,IT=`[object Number]`,LT=`[object Boolean]`,RT=`[object Symbol]`,zT=`[object Date]`,BT=`[object Map]`,VT=`[object Set]`,HT=`[object Array]`,UT=`[object Function]`,WT=`[object ArrayBuffer]`,GT=`[object Object]`,KT=`[object Error]`,qT=`[object DataView]`,JT=`[object Uint8Array]`,YT=`[object Uint8ClampedArray]`,XT=`[object Uint16Array]`,ZT=`[object Uint32Array]`,QT=`[object BigUint64Array]`,$T=`[object Int8Array]`,eE=`[object Int16Array]`,tE=`[object Int32Array]`,nE=`[object BigInt64Array]`,rE=`[object Float32Array]`,iE=`[object Float64Array]`;function aE(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}_();function oE(e,t,n){return sE(e,t,void 0,void 0,void 0,void 0,n)}function sE(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return cE(e,t,a,o)}return cE(e,t,a,o)}function cE(e,t,n,r){if(Object.is(e,t))return!0;let i=NT(e),a=NT(t);if(i===`[object Arguments]`&&(i=GT),a===`[object Arguments]`&&(a=GT),i!==a)return!1;switch(i){case FT:return e.toString()===t.toString();case IT:return jT(e.valueOf(),t.valueOf());case LT:case zT:case RT:return Object.is(e.valueOf(),t.valueOf());case PT:return e.source===t.source&&e.flags===t.flags;case UT:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case BT:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!sE(a,t.get(i),i,e,t,n,r))return!1;return!0;case VT:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>sE(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case HT:case JT:case YT:case XT:case ZT:case QT:case $T:case eE:case tE:case nE:case rE:case iE:if(v!==void 0&&v.isBuffer(e)!==v.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!sE(e[i],t[i],i,e,t,n,r))return!1;return!0;case WT:return e.byteLength===t.byteLength?cE(new Uint8Array(e),new Uint8Array(t),n,r):!1;case qT:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:cE(new Uint8Array(e),new Uint8Array(t),n,r);case KT:return e.name===t.name&&e.message===t.message;case GT:{if(!(cE(e.constructor,t.constructor,n,r)||aE(e)&&aE(t)))return!1;let i=[...Object.keys(e),...MT(e)],a=[...Object.keys(t),...MT(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!sE(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function lE(){}function uE(e,t){return oE(e,t,lE)}s();var dE=`core`,fE=`wc@2:${dE}:`,pE={name:dE,logger:`error`},mE={database:`:memory:`},hE=`crypto`,gE=`client_ed25519_seed`,_E=B.ONE_DAY,vE=`keychain`,yE=`messages`,bE=B.SIX_HOURS,xE=`publisher`,SE=`relayer`,CE={message:`relayer_message`,message_ack:`relayer_message_ack`,connect:`relayer_connect`,disconnect:`relayer_disconnect`,error:`relayer_error`,connection_stalled:`relayer_connection_stalled`,transport_closed:`relayer_transport_closed`,publish:`relayer_publish`},wE={payload:`payload`,connect:`connect`,disconnect:`disconnect`,error:`error`},TE=.1,EE=`2.23.9`,DE={link_mode:`link_mode`,relay:`relay`},OE={inbound:`inbound`,outbound:`outbound`},kE=`WALLETCONNECT_CLIENT_ID`,AE={created:`subscription_created`,deleted:`subscription_deleted`,expired:`subscription_expired`,disabled:`subscription_disabled`,sync:`subscription_sync`,resubscribed:`subscription_resubscribed`};B.THIRTY_DAYS;var jE=`subscription`;B.FIVE_SECONDS*1e3;var ME=`pairing`;B.THIRTY_DAYS;var NE={wc_pairingDelete:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:B.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:B.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:B.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:B.ONE_DAY,prompt:!1,tag:0},res:{ttl:B.ONE_DAY,prompt:!1,tag:0}}},PE={create:`pairing_create`,expire:`pairing_expire`,delete:`pairing_delete`,ping:`pairing_ping`},FE={created:`history_created`,updated:`history_updated`,deleted:`history_deleted`,sync:`history_sync`},IE=`history`,LE=`expirer`,RE={created:`expirer_created`,deleted:`expirer_deleted`,expired:`expirer_expired`,sync:`expirer_sync`};B.ONE_DAY;var zE=`verify-api`,BE=`https://verify.walletconnect.com`,VE=`https://verify.walletconnect.org`,HE=`${VE}/v3`,UE=[BE,VE],WE=`echo`,GE=`https://echo.walletconnect.com`,KE={pairing_started:`pairing_started`,pairing_uri_validation_success:`pairing_uri_validation_success`,pairing_uri_not_expired:`pairing_uri_not_expired`,store_new_pairing:`store_new_pairing`,subscribing_pairing_topic:`subscribing_pairing_topic`,subscribe_pairing_topic_success:`subscribe_pairing_topic_success`,existing_pairing:`existing_pairing`,pairing_not_expired:`pairing_not_expired`,emit_inactive_pairing:`emit_inactive_pairing`,emit_session_proposal:`emit_session_proposal`,subscribing_to_pairing_topic:`subscribing_to_pairing_topic`},qE={no_wss_connection:`no_wss_connection`,no_internet_connection:`no_internet_connection`,malformed_pairing_uri:`malformed_pairing_uri`,active_pairing_already_exists:`active_pairing_already_exists`,subscribe_pairing_topic_failure:`subscribe_pairing_topic_failure`,pairing_expired:`pairing_expired`,proposal_expired:`proposal_expired`,proposal_listener_not_found:`proposal_listener_not_found`},JE={session_approve_started:`session_approve_started`,proposal_not_expired:`proposal_not_expired`,session_namespaces_validation_success:`session_namespaces_validation_success`,create_session_topic:`create_session_topic`,subscribing_session_topic:`subscribing_session_topic`,subscribe_session_topic_success:`subscribe_session_topic_success`,publishing_session_approve:`publishing_session_approve`,session_approve_publish_success:`session_approve_publish_success`,store_session:`store_session`,publishing_session_settle:`publishing_session_settle`,session_settle_publish_success:`session_settle_publish_success`,session_request_response_started:`session_request_response_started`,session_request_response_validation_success:`session_request_response_validation_success`,session_request_response_publish_started:`session_request_response_publish_started`},YE={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,proposal_expired:`proposal_expired`,subscribe_session_topic_failure:`subscribe_session_topic_failure`,session_approve_publish_failure:`session_approve_publish_failure`,session_settle_publish_failure:`session_settle_publish_failure`,session_approve_namespace_validation_failure:`session_approve_namespace_validation_failure`,proposal_not_found:`proposal_not_found`,session_request_response_validation_failure:`session_request_response_validation_failure`,session_request_response_publish_failure:`session_request_response_publish_failure`},XE={authenticated_session_approve_started:`authenticated_session_approve_started`,authenticated_session_not_expired:`authenticated_session_not_expired`,chains_caip2_compliant:`chains_caip2_compliant`,chains_evm_compliant:`chains_evm_compliant`,create_authenticated_session_topic:`create_authenticated_session_topic`,cacaos_verified:`cacaos_verified`,store_authenticated_session:`store_authenticated_session`,subscribing_authenticated_session_topic:`subscribing_authenticated_session_topic`,subscribe_authenticated_session_topic_success:`subscribe_authenticated_session_topic_success`,publishing_authenticated_session_approve:`publishing_authenticated_session_approve`,authenticated_session_approve_publish_success:`authenticated_session_approve_publish_success`},ZE={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,missing_session_authenticate_request:`missing_session_authenticate_request`,session_authenticate_request_expired:`session_authenticate_request_expired`,chains_caip2_compliant_failure:`chains_caip2_compliant_failure`,chains_evm_compliant_failure:`chains_evm_compliant_failure`,invalid_cacao:`invalid_cacao`,subscribe_authenticated_session_topic_failure:`subscribe_authenticated_session_topic_failure`,authenticated_session_approve_publish_failure:`authenticated_session_approve_publish_failure`,authenticated_session_pending_request_not_found:`authenticated_session_pending_request_not_found`},QE=.1,$E=`event-client`,eD=`https://pulse.walletconnect.org/batch`,tD=class{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=vE,this.version=`0.3`,this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();typeof e<`u`&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>`u`){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Fu(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?Iu(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},nD=class{constructor(e,t,n){this.core=e,this.logger=t,this.name=hE,this.randomSessionIdentifier=tf(),this.initialized=!1,this.init=async()=>{this.initialized||=(await this.keychain.init(),!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let e=se(ae(await this.getClientSeed()).publicKey);return this.clientId=e,e},this.generateKeyPair=()=>{this.isInitialized();let e=ef();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=ae(await this.getClientSeed()),n=this.randomSessionIdentifier;return await ne(n,e,_E,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();let r=nf(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();let n=t||rf(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();let r=_f(n),i=Te(t);if(yf(r))return ff(i,n?.encoding);if(vf(r)){let t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}let a=this.getSymKey(e),{type:o,senderPublicKey:s}=r;return uf({type:o,symKey:a,message:i,senderPublicKey:s,encoding:n?.encoding})},this.decode=async(e,t,n)=>{this.isInitialized();let r=gf(t,n);if(yf(r))return Ee(pf(t,n?.encoding));if(vf(r)){let t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}try{return Ee(df({symKey:this.getSymKey(e),encoded:t,encoding:n?.encoding}))}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=qd)=>sf(hf({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=qd)=>{let n=hf({encoded:e,encoding:t});return n.senderPublicKey?tt(n.senderPublicKey,Kd):void 0},this.core=e,this.logger=su(t,this.name),this.keychain=n||new tD(this.core,this.logger)}get context(){return au(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e=``;try{e=this.keychain.get(gE)}catch{e=tf(),await this.keychain.set(gE,e)}return $e(e,`base16`)}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},rD=class extends bT{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=yE,this.version=`0.3`,this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{if(!this.initialized){this.logger.trace(`Initialized`);try{let e=await this.getRelayerMessages();typeof e<`u`&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();typeof t<`u`&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t,n)=>{this.isInitialized();let r=af(t),i=this.messages.get(e);if(typeof i>`u`&&(i={}),typeof i[r]<`u`)return r;if(i[r]=t,this.messages.set(e,i),n===OE.inbound){let n=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,{...n,[r]:t})}return await this.persist(),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>`u`&&(t={}),t},this.getWithoutAck=e=>{this.isInitialized();let t={};for(let n of e){let e=this.messagesWithoutClientAck.get(n)||{};t[n]=Object.values(e)}return t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[af(t)]<`u`),this.ack=async(e,t)=>{this.isInitialized();let n=this.messagesWithoutClientAck.get(e);if(typeof n>`u`)return;let r=af(t);delete n[r],Object.keys(n).length===0?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,n),await this.persist()},this.del=async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()},this.logger=su(e,this.name),this.core=t}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name+`_withoutClientAck`}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Fu(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,Fu(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?Iu(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<`u`?Iu(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},iD=class extends xT{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new ot.EventEmitter,this.name=xE,this.queue=new Map,this.publishTimeout=(0,B.toMiliseconds)(B.ONE_MINUTE),this.initialPublishTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(e,t,n)=>{this.logger.debug(`Publishing Payload`),this.logger.trace({type:`method`,method:`publish`,params:{topic:e,message:t,opts:n}});let r=n?.ttl||bE,i=n?.prompt||!1,a=n?.tag||0,o=n?.id||pe().toString(),s=Cf(Sf().protocol),c={id:o,method:n?.publishMethod||s.publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:a,attestation:n?.attestation,...n?.tvf}},l=`Failed to publish payload, please try again. id:${o} tag:${a}`;try{Wf(c.params?.prompt)&&delete c.params?.prompt,Wf(c.params?.tag)&&delete c.params?.tag;let r=new Promise(async e=>{let t=({id:n})=>{c.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(CE.publish,t),e())};this.relayer.events.on(CE.publish,t);let r=Ru(new Promise((e,t)=>{this.rpcPublish(c,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${o} tag:${a}`);try{await r,this.events.removeListener(CE.publish,t)}catch(e){this.queue.set(o,{request:c,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:o,topic:e,message:t,opts:n}}),await Ru(r,this.publishTimeout,l)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(o)}},this.publishCustom=async e=>{this.logger.debug(`Publishing custom payload`),this.logger.trace({type:`method`,method:`publishCustom`,params:e});let{payload:t,opts:n={}}=e,{attestation:r,tvf:i,publishMethod:a,prompt:o,tag:s,ttl:c=B.FIVE_MINUTES}=n,l=n.id||pe().toString(),u=Cf(Sf().protocol),d=a||u.publish,f={id:l,method:d,params:{...t,ttl:c,prompt:o,tag:s,attestation:r,...i}},p=`Failed to publish custom payload, please try again. id:${l} tag:${s}`;try{Wf(f.params?.prompt)&&delete f.params?.prompt,Wf(f.params?.tag)&&delete f.params?.tag;let e=new Promise(async e=>{let t=({id:n})=>{f.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(CE.publish,t),e())};this.relayer.events.on(CE.publish,t);let r=Ru(new Promise((e,t)=>{this.rpcPublish(f,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${d} id:${l} tag:${s}`);try{await r,this.events.removeListener(CE.publish,t)}catch(e){this.queue.set(l,{request:f,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:l,payload:t,opts:n}}),await Ru(e,this.publishTimeout,p)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(l)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=su(t,this.name),this.registerEventListeners()}get context(){return au(this.logger)}async rpcPublish(e,t){this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`message`,direction:`outgoing`,request:e});let n=await this.relayer.request(e);return this.relayer.events.emit(CE.publish,{...e,...t}),this.logger.debug(`Successfully Published Payload`),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{let n=e.attempt+1;this.queue.set(t,{...e,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${e.request.params?.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(ue.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(CE.connection_stalled);return}this.checkQueue()}),this.relayer.on(CE.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}},aD=class{constructor(){this.map=new Map,this.set=(e,t)=>{let n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>`u`){this.map.delete(e);return}if(!this.map.has(e))return;let n=this.get(e);if(!this.exists(e,t))return;let r=n.filter(e=>e!==t);if(!r.length){this.map.delete(e);return}this.map.set(e,r)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},oD=class extends wT{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new aD,this.events=new ot.EventEmitter,this.name=jE,this.version=`0.3`,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.subscribeTimeout=(0,B.toMiliseconds)(B.ONE_MINUTE),this.initialSubscribeTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace(`Initialized`),this.registerEventListeners(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug(`Subscribing Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}});try{let n=Sf(t),r={topic:e,relay:n,transportType:t?.transportType};t?.internal?.skipSubscribe||this.pending.set(e,r);let i=await this.rpcSubscribe(e,n,t);return typeof i==`string`&&(this.onSubscribe(i,r),this.logger.debug(`Successfully Subscribed Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug(`Failed to Subscribe Topic`),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{this.isInitialized(),typeof t?.id<`u`?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=e=>new Promise(t=>{t(this.topicMap.topics.includes(e))}),this.isKnownTopic=e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))}),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(ue.pulse,async()=>{await this.checkPending()}),this.events.on(AE.created,async e=>{let t=AE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()}),this.events.on(AE.deleted,async e=>{let t=AE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()})},this.relayer=e,this.logger=su(t,this.name),this.clientId=``}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+`//`+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let n=this.topicMap.get(e);await Promise.all(n.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,n){this.logger.debug(`Unsubscribing Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}});try{let r=_u(`USER_DISCONNECTED`,`${this.name}, ${e}`);await this.onUnsubscribe(e,t,r);let i=Sf(n);await this.restartToComplete({topic:e,id:t,relay:i}),await this.rpcUnsubscribe(e,t,i),this.logger.debug(`Successfully Unsubscribed Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug(`Failed to Unsubscribe Topic`),this.logger.error(e),e}}async rpcSubscribe(e,t,n){let r=await this.getSubscriptionId(e);if(n?.internal?.skipSubscribe)return r;(!n||n?.transportType===DE.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});let i={method:Cf(t.protocol).subscribe,params:{topic:e}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:i});let a=n?.internal?.throwOnFailedPublish;try{if(n?.transportType===DE.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,B.toMiliseconds)(B.ONE_SECOND)),r;let t=await Ru(new Promise(async t=>{let n=r=>{r.topic===e&&(this.events.removeListener(AE.created,n),t(r.id))};this.events.on(AE.created,n);try{let r=await Ru(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(AE.created,n),t(r)}catch{}}),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!t&&a)throw Error(`Subscribing to ${e} failed, please try again`);return t?r:null}catch(e){if(this.logger.debug(`Outgoing Relay Subscribe Payload stalled`),this.relayer.events.emit(CE.connection_stalled),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;let t=e[0].relay,n={method:Cf(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});try{return await Ru(new Promise((e,t)=>{this.relayer.request(n).then(e).catch(e=>{this.logger.warn(e),t(e)})}),this.subscribeTimeout,`rpcBatchSubscribe failed, please try again`),!0}catch{return this.relayer.events.emit(CE.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;let t=e[0].relay,n={method:Cf(t.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});let r;try{r=await await Ru(new Promise((e,t)=>{this.relayer.request(n).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,`rpcBatchFetchMessages failed, please try again`)}catch{this.relayer.events.emit(CE.connection_stalled)}return r}rpcUnsubscribe(e,t,n){let r={method:Cf(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,{...t,id:e}),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,{...e}),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug(`Setting subscription`),this.logger.trace({type:`method`,method:`setSubscription`,id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,{...t}),this.topicMap.set(t.topic,e),this.events.emit(AE.created,t)}getSubscription(e){this.logger.debug(`Getting subscription`),this.logger.trace({type:`method`,method:`getSubscription`,id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug(`Deleting subscription`),this.logger.trace({type:`method`,method:`deleteSubscription`,id:e,reason:t});let n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(AE.deleted,{...n,reason:t})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(AE.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<t;n++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(AE.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>`u`||!e.length)return;if(this.subscriptions.size&&!e.every(e=>e.topic===this.subscriptions.get(e.id)?.topic)){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(e=>{this.pending.set(e.topic,e)});return}this.onBatchSubscribe(await Promise.all(e.map(async e=>({...e,id:await this.getSubscriptionId(e.topic)}))))}}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await rd((0,B.toMiliseconds)(B.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||=await this.relayer.core.crypto.getClientId(),this.clientId}async getSubscriptionId(e){return af(e+await this.getClientId())}},sD=class extends ST{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.events=new ot.EventEmitter,this.name=SE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=(0,B.toMiliseconds)(B.THIRTY_SECONDS+B.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=(0,B.toMiliseconds)(B.ONE_SECOND*2),this.stalledRestartMaxInterval=(0,B.toMiliseconds)(B.THIRTY_SECONDS),this.request=async e=>{this.logger.debug(`Publishing Request Payload`);let t=e.id||pe().toString();await this.toEstablishConnection();try{this.logger.trace({id:t,method:e.method,topic:e.params?.topic},`relayer.request - publishing...`);let n=`${t}:${e.params?.tag||``}`;this.requestsInFlight.push(n);let r=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==n),r}catch(e){throw this.logger.debug(`Failed to Publish Request: ${t}`),e}},this.resetPingTimeout=()=>{bu()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{try{this.logger.debug({},`pingTimeout: Connection stalled, terminating...`),this.provider?.connection?.socket?.terminate?.()}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},`Relayer connected 🛜`),this.startPingTimeout(),this.stalledRestartBackoff=0,this.events.emit(CE.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},`Relayer disconnected 🛑`),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(CE.error,e),this.logger.fatal(`Fatal socket error received, closing transport`),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(e=>this.logger.warn(e))},this.registerProviderListeners=()=>{this.provider.on(wE.payload,this.onPayloadHandler),this.provider.on(wE.connect,this.onConnectHandler),this.provider.on(wE.disconnect,this.onDisconnectHandler),this.provider.on(wE.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=Wp({logger:e.logger??`error`,name:this.name}),this.messages=new rD(this.logger,e.core),this.subscriber=new oD(this,this.logger),this.publisher=new iD(this,this.logger),this.projectId=e.projectId,this.relayUrl=e.relayUrl||`wss://relay.walletconnect.org`,Su()?this.packageName=Eu():Cu()&&(this.bundleId=Eu()),this.provider={}}async init(){this.logger.trace(`Initialized`),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return au(this.logger)}get connected(){return this.provider?.connection?.socket?.readyState===1}get connecting(){return this.provider?.connection?.socket?.readyState===0||this.connectPromise!==void 0}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:DE.relay},OE.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){this.isInitialized(),(!t?.transportType||t?.transportType===`relay`)&&await this.toEstablishConnection();let n=t?.internal?.throwOnFailedPublish??!0,r=this.subscriber.topicMap.get(e)?.[0]||``,i,a=t=>{t.topic===e&&(this.subscriber.off(AE.created,a),i())};return await Promise.all([new Promise(e=>{i=e,this.subscriber.on(AE.created,a)}),new Promise((i,a)=>{this.subscriber.subscribe(e,{internal:{throwOnFailedPublish:n},...t}).then(e=>{r=e||r,i()}).catch(e=>{n?a(e):i()})})]),r}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ru(this.provider.disconnect(),2e3,`provider.disconnect()`).catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info(`Starting WS connection skipped because the client has no topics to work with.`);return}if(this.connectPromise?(this.logger.debug({},`Waiting for existing connection attempt to resolve...`),await this.connectPromise,this.logger.debug({},`Existing connection attempt resolved`)):(this.connectPromise=this.connect(e).finally(()=>{this.connectPromise=void 0}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},`Restarting transport...`),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await Tp())throw Error(`No internet connection detected. Please restart your network and try again.`)}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace(`Batch message events is empty. Ignoring...`);return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(let e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,`Error while processing batch message event: `+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:n}=e;if(!t.sessionExists){let e={topic:n,expiry:Uu(B.FIVE_MINUTES),relay:{protocol:`irn`},active:!1};await this.core.pairing.pairings.set(n,e)}this.events.emit(CE.message,e),await this.recordMessageEvent(e,OE.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.transportExplicitlyClosed=!1;let t=1;try{for(;t<6;){this.connectionAttemptInProgress=!0;try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to connect`))};this.provider.once(wE.disconnect,n),Ru(this.provider.connect(),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).then(()=>e()).catch(t).finally(()=>{this.provider.off(wE.disconnect,n),clearTimeout(this.reconnectTimeout)})}),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to subscribe`))};this.provider.once(wE.disconnect,n),this.subscriber.start().then(e).catch(t).finally(()=>{this.provider.off(wE.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1}catch(e){await this.subscriber.stop();let t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,B.toMiliseconds)(t*1))),t++}}finally{this.connectionAttemptInProgress=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}}startPingTimeout(){if(bu())try{this.provider?.connection?.socket?.on(`ping`,()=>{this.resetPingTimeout()}),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){if(this.provider.connection&&(this.unregisterProviderListeners(),this.connected))try{await Ru(this.provider.disconnect(),1e3,`Closing previous provider`)}catch{}let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new be(new ve(Nu({sdkVersion:EE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:n,message:r}=e;await this.messages.set(n,r,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let r=this.messages.has(t,n);return r&&this.logger.warn(`Ignoring duplicate message: ${n}`),r}async onProviderPayload(e){if(this.logger.debug(`Incoming Relay Payload`),this.logger.trace({type:`payload`,direction:`incoming`,payload:e}),de(e)){if(!e.method.endsWith(`_subscription`))return;let t=e.params,{topic:n,message:r,publishedAt:i,attestation:a}=t.data,o={topic:n,message:r,publishedAt:i,transportType:DE.relay,attestation:a};this.logger.debug(`Emitting Relayer Payload`),this.logger.trace({type:`event`,event:t.id,...o}),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else ye(e)&&this.events.emit(CE.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,OE.inbound),this.events.emit(CE.message,e))}async acknowledgePayload(e){let t=fe(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(wE.payload,this.onPayloadHandler),this.provider.off(wE.connect,this.onConnectHandler),this.provider.off(wE.disconnect,this.onDisconnectHandler),this.provider.off(wE.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Tp();kp(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(ue.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&Mp())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}),this.events.on(CE.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let e=this.stalledRestartBackoff===0?0:Math.min(2**(this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${e?` in ${e}ms`:``}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(e){this.logger.error(e,e?.message)}finally{this.stalledRestartInProgress=!1}},e)})}async onProviderDisconnect(){if(clearTimeout(this.pingTimeout),this.events.emit(CE.disconnect),!this.reconnectInProgress){this.reconnectInProgress=!0;try{await this.subscriber.stop()}catch(e){this.logger.warn(e,`subscriber.stop() failed during disconnect`)}if(!this.subscriber.hasAnyTopics||this.transportExplicitlyClosed){this.reconnectInProgress=!1;return}this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,B.toMiliseconds)(TE))}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}this.connectPromise=this.connect().finally(()=>{this.connectPromise=void 0}),await this.connectPromise}}},cD=class extends CT{constructor(e,t,n,r=fE,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>{this.getKey&&e!==null&&!Wf(e)?this.map.set(this.getKey(e),e):Zf(e)?this.map.set(e.id,e):Qf(e)&&this.map.set(e.topic,e)}),this.cached=[],!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug(`Setting value`),this.logger.trace({type:`method`,method:`set`,key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug(`Getting value`),this.logger.trace({type:`method`,method:`get`,key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(n=>uE(t[n],e[n]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug(`Updating value`),this.logger.trace({type:`method`,method:`update`,key:e,update:t});let n={...this.getData(e),...t};this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug(`Deleting value`),this.logger.trace({type:`method`,method:`delete`,key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=su(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=K(`MISSING_OR_INVALID`,`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>`u`||!e.length)return;if(this.map.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},lD=class{constructor(e,t){this.core=e,this.logger=t,this.name=ME,this.version=`0.3`,this.events=new ot.default,this.initialized=!1,this.storagePrefix=fE,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace(`Initialized`))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=tf(),n=await this.core.crypto.setSymKey(t),r=Uu(B.FIVE_MINUTES),i={protocol:`irn`},a={topic:n,expiry:r,relay:i,active:!1,methods:e?.methods},o=Of({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:t,relay:i,expiryTimestamp:r,methods:e?.methods});return this.events.emit(PE.create,a),this.core.expirer.set(n,r),await this.pairings.set(n,a),await this.core.relayer.subscribe(n,{transportType:e?.transportType,internal:e?.internal}),{topic:n,uri:o}},this.pair=async e=>{this.isInitialized();let t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[KE.pairing_started]}});this.isValidPair(e,t);let{topic:n,symKey:r,relay:i,expiryTimestamp:a,methods:o}=Tf(e.uri);t.props.properties.topic=n,t.addTrace(KE.pairing_uri_validation_success),t.addTrace(KE.pairing_uri_not_expired);let s;if(this.pairings.keys.includes(n)){if(s=this.pairings.get(n),t.addTrace(KE.existing_pairing),s.active)throw t.setError(qE.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);t.addTrace(KE.pairing_not_expired)}let c=a||Uu(B.FIVE_MINUTES),l={topic:n,relay:i,expiry:c,active:!1,methods:o};this.core.expirer.set(n,c),await this.pairings.set(n,l),t.addTrace(KE.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(PE.create,l),t.addTrace(KE.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(r,n),t.addTrace(KE.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(qE.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:i})}catch(e){throw t.setError(qE.subscribe_pairing_topic_failure),e}return t.addTrace(KE.subscribe_pairing_topic_success),l},this.activate=async({topic:e})=>{this.isInitialized();let t=Uu(B.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn(`ping() is deprecated and will be removed in the next major release.`);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,`wc_pairingPing`,{}),{done:n,resolve:r,reject:i}=Lu();this.events.once(q(`pairing_ping`,e),({error:e})=>{e?i(e):r()}),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,`wc_pairingDelete`,_u(`USER_DISCONNECTED`)),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:n,expiry:r,methods:i}=e,a=this.core.crypto.keychain.get(t);return Of({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:a,relay:n,expiryTimestamp:r,methods:i})},this.sendRequest=async(e,t,n)=>{let r=Ce(t,n),i=await this.core.crypto.encode(e,r),a=NE[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,a),r.id},this.sendResult=async(e,t,n)=>{let r=fe(e,n),i=await this.core.crypto.encode(t,r),a=NE[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,a),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{let r=_e(e,n),i=await this.core.crypto.encode(t,r),a=(await this.core.history.get(t,e)).request.method,o=NE[a]?NE[a].res:NE.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,_u(`USER_DISCONNECTED`)),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>Wu(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=async e=>{let{topic:t,payload:n}=e;switch(n.method){case`wc_pairingPing`:return await this.onPairingPingRequest(t,n);case`wc_pairingDelete`:return await this.onPairingDeleteRequest(t,n);default:return await this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;switch(r){case`wc_pairingPing`:return this.onPairingPingResponse(t,n);default:return this.onUnknownRpcMethodResponse(r)}},this.onPairingPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit(PE.ping,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:n}=t;setTimeout(()=>{xe(t)?this.events.emit(q(`pairing_ping`,n),{}):ge(t)&&this.events.emit(q(`pairing_ping`,n),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(PE.delete,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=_u(`WC_METHOD_UNSUPPORTED`,r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(_u(`WC_METHOD_UNSUPPORTED`,e))},this.isValidPair=(e,t)=>{if(!fp(e)){let{message:n}=K(`MISSING_OR_INVALID`,`pair() params: ${e}`);throw t.setError(qE.malformed_pairing_uri),Error(n)}if(!Xf(e.uri)){let{message:n}=K(`MISSING_OR_INVALID`,`pair() uri: ${e.uri}`);throw t.setError(qE.malformed_pairing_uri),Error(n)}let n=Tf(e?.uri);if(!n?.relay?.protocol){let{message:e}=K(`MISSING_OR_INVALID`,`pair() uri#relay-protocol`);throw t.setError(qE.malformed_pairing_uri),Error(e)}if(!n?.symKey){let{message:e}=K(`MISSING_OR_INVALID`,`pair() uri#symKey`);throw t.setError(qE.malformed_pairing_uri),Error(e)}if(n?.expiryTimestamp&&(0,B.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(qE.pairing_expired);let{message:e}=K(`EXPIRED`,`pair() URI has expired. Please try again with a new connection URI.`);throw Error(e)}},this.isValidPing=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=K(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=su(t,this.name),this.pairings=new cD(this.core,this.logger,this.name,this.storagePrefix)}get context(){return au(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(CE.message,async e=>{let{topic:t,message:n,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==DE.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let e=await this.core.crypto.decode(t,n);de(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):ye(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,n)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(RE.expired,async e=>{let{topic:t}=Hu(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(PE.expire,{topic:t}))})}},uD=class extends yT{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new ot.EventEmitter,this.name=IE,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug(`Setting JSON-RPC request history record`),this.logger.trace({type:`method`,method:`set`,topic:e,request:t,chainId:n}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:Uu(B.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(FE.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug(`Updating JSON-RPC response history record`),this.logger.trace({type:`method`,method:`update`,response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response<`u`||(t.response=ge(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(FE.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug(`Getting record`),this.logger.trace({type:`method`,method:`get`,topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug(`Deleting record`),this.logger.trace({type:`method`,method:`delete`,id:t}),this.values.forEach(n=>{if(n.topic===e){if(typeof t<`u`&&n.id!==t)return;this.records.delete(n.id),this.events.emit(FE.deleted,n)}}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),this.records.has(t)?(await this.getRecord(t)).topic===e:!1),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if(typeof t.response<`u`)return;let n={topic:t.topic,request:Ce(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(FE.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>`u`||!e.length)return;if(this.records.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(FE.created,e=>{let t=FE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(FE.updated,e=>{let t=FE.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(FE.deleted,e=>{let t=FE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.core.heartbeat.on(ue.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,B.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(FE.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},dD=class extends TT{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new ot.EventEmitter,this.name=LE,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),!0)},this.has=e=>{try{let t=this.formatTarget(e);return typeof this.getExpiration(t)<`u`}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(RE.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(RE.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e==`string`)return Bu(e);if(typeof e==`number`)return Vu(e);let{message:t}=K(`UNKNOWN_TYPE`,`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(RE.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>`u`||!e.length)return;if(this.expirations.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:n}=t;(0,B.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(RE.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(ue.pulse,()=>this.checkExpirations()),this.events.on(RE.created,e=>{let t=RE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(RE.expired,e=>{let t=RE.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(RE.deleted,e=>{let t=RE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},fD=class extends ET{constructor(e,t,n){super(e,t,n),this.core=e,this.logger=t,this.store=n,this.name=zE,this.verifyUrlV3=HE,this.storagePrefix=fE,this.version=2,this.init=async()=>{this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,B.toMiliseconds)(this.publicKey?.expiresAt)<Date.now()&&(this.logger.debug(`verify v2 public key expired`),await this.removePublicKey()))},this.register=async e=>{if(!wu()||this.isDevEnv)return;let t=window.location.origin,{id:n,decryptedId:r}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${n}&decryptedId=${r}`;try{let e=(0,ct.getDocument)(),t=this.startAbortTimer(B.ONE_SECOND*5),r=await new Promise((r,a)=>{let o=()=>{window.removeEventListener(`message`,c),e.body.removeChild(s),a(`attestation aborted`)};this.abortController.signal.addEventListener(`abort`,o);let s=e.createElement(`iframe`);s.src=i,s.style.display=`none`,s.addEventListener(`error`,o,{signal:this.abortController.signal});let c=i=>{if(i.data&&typeof i.data==`string`)try{let a=JSON.parse(i.data);if(a.type===`verify_attestation`){if(ie(a.attestation).payload.id!==n)return;clearInterval(t),e.body.removeChild(s),this.abortController.signal.removeEventListener(`abort`,o),window.removeEventListener(`message`,c),r(a.attestation===null?``:a.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(s),window.addEventListener(`message`,c,{signal:this.abortController.signal})});return this.logger.debug(r,`jwt attestation`),r}catch(e){this.logger.warn(e)}return``},this.resolve=async e=>{if(this.isDevEnv)return``;let{attestationId:t,hash:n,encryptedId:r}=e;if(t===``){this.logger.debug(`resolve: attestationId is empty, skipping`);return}if(t){if(ie(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn(`resolve: jwt attestation: origin url not verified`);return}return e}}if(!n)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(n,i)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let n=this.startAbortTimer(B.ONE_SECOND*5),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(n),r.status===200?await r.json():void 0},this.getVerifyUrl=e=>{let t=e||`https://verify.walletconnect.org`;return UE.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: https://verify.walletconnect.org`),t=`https://verify.walletconnect.org`),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(B.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug(e,`persisting public key to local storage`),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug(`removing verify v2 public key from storage`),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}let n=await this.fetchAndPersistPublicKey();try{if(n)return this.validateAttestation(e,n)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let n=xf(e,t.publicKey),r={hasExpired:(0,B.toMiliseconds)(n.exp)<Date.now(),payload:n};if(r.hasExpired)throw this.logger.warn(`resolve: jwt attestation expired`),Error(`JWT attestation expired`);return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}},this.logger=su(t,this.name),this.abortController=new AbortController,this.isDevEnv=Qu(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//verify:public:key`}get context(){return au(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,B.toMiliseconds)(e))}},pD=class extends DT{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=WE,this.registerDeviceToken=async e=>{let{clientId:t,token:n,notificationType:r,enableEncrypted:i=!1}=e,a=`${GE}/${this.projectId}/clients`;await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_id:t,type:r,token:n,always_raw:i})})},this.logger=su(t,this.context)}},mD=class extends OT{constructor(e,t,n=!0){super(e,t,n),this.core=e,this.logger=t,this.context=$E,this.storagePrefix=fE,this.storageVersion=QE,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Qu())try{let e={eventId:Zu(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:`INIT`,type:``,properties:{client_id:await this.core.crypto.getClientId(),user_agent:Mu(this.core.relayer.protocol,this.core.relayer.version,EE)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t=`ERROR`,type:n=``,properties:{topic:r,trace:i}}=e,a=Zu(),o=this.core.projectId||``,s={eventId:a,timestamp:Date.now(),props:{event:t,type:n,properties:{topic:r,trace:i}},bundleId:o,domain:this.getAppDomain(),...this.setMethods(a)};return this.telemetryEnabled&&(this.events.set(a,s),this.shouldPersist=!0),s},this.getEvent=e=>{let{eventId:t,topic:n}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===n);if(r)return{...r,...this.setMethods(r.eventId)}},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(ue.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,B.fromMiliseconds)(Date.now())-(0,B.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let n=this.events.get(e);n&&(n.props.properties.trace.push(t),this.events.set(e,n),this.shouldPersist=!0)},this.setError=(e,t)=>{let n=this.events.get(e);n&&(n.props.type=t,n.timestamp=Date.now(),this.events.set(e,n),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,{...e,...this.setMethods(e.eventId)})})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let e=[];for(let[t,n]of this.events)n.props.type&&e.push(n);if(e.length!==0)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?``:`&sp=desktop`;return await fetch(`${eD}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${EE}${t}`,{method:`POST`,body:JSON.stringify(e)})},this.getAppDomain=()=>ku().url,this.logger=su(t,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+`//`+this.context}},hD=class e extends vT{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=dE,this.events=new ot.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:n})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:DE.link_mode};this.relayer.onLinkMessageEvent(r,{sessionExists:n})};let t=this.getGlobalCore(e?.customStoragePrefix);if(t)try{return this.customStoragePrefix=t.customStoragePrefix,this.logger=t.logger,this.heartbeat=t.heartbeat,this.crypto=t.crypto,this.history=t.history,this.expirer=t.expirer,this.storage=t.storage,this.relayer=t.relayer,this.pairing=t.pairing,this.verify=t.verify,this.echoClient=t.echoClient,this.linkModeSupportedApps=t.linkModeSupportedApps,this.eventClient=t.eventClient,this.initialized=t.initialized,this.logChunkController=t.logChunkController,t}catch{}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||`wss://relay.walletconnect.org`,this.customStoragePrefix=e?.customStoragePrefix?`:${e.customStoragePrefix}`:``;let{logger:n,chunkLoggerController:r}=uu({opts:ru({level:typeof e?.logger==`string`&&e.logger?e.logger:pE.logger,name:dE}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=r,this.logChunkController?.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{this.logChunkController?.downloadLogsBlobInBrowser&&this.logChunkController?.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()})}),this.logger=su(n,this.name),this.heartbeat=new me,this.crypto=new nD(this,this.logger,e?.keychain),this.history=new uD(this,this.logger),this.expirer=new dD(this,this.logger),this.storage=e?.storage?e.storage:new he({...mE,...e?.storageOptions}),this.relayer=new sD({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new lD(this,this.logger),this.verify=new fD(this,this.logger,this.storage),this.echoClient=new pD(this.projectId||``,this.logger),this.linkModeSupportedApps=[],this.eventClient=new mD(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let n=new e(t);await n.initialize();let r=await n.crypto.getClientId();return await n.storage.setItem(kE,r),n}get context(){return au(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){return this.logChunkController?.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(`WALLETCONNECT_LINK_MODE_APPS`,this.linkModeSupportedApps))}async initialize(){this.logger.trace(`Initialized`);try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(`WALLETCONNECT_LINK_MODE_APPS`)||[],this.initialized=!0,this.logger.info(`Core Initialization Success`)}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=``){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,n=`${t}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n],globalThis[t]}catch{return}}setGlobalCore(e){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e.opts?.customStoragePrefix||``}`;globalThis[t]=e}catch{}}isGlobalCoreDisabled(){try{return typeof o<`u`&&{}.DISABLE_GLOBAL_CORE===`true`}catch{return!0}}};m();var gD=`client`,_D=`wc@2:${gD}:`,vD={name:gD,logger:`error`,controller:!1,relayUrl:`wss://relay.walletconnect.org`},yD=`WALLETCONNECT_DEEPLINK_CHOICE`,bD=`proposal`;B.THIRTY_DAYS;var xD=`Proposal expired`,SD=`session`,CD=B.SEVEN_DAYS,wD=`engine`,TD={wc_sessionPropose:{req:{ttl:B.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1104},res:{ttl:B.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1106},res:{ttl:B.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:B.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:B.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:B.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1112},res:{ttl:B.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1114},res:{ttl:B.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:B.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:B.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1119}}},ED={min:B.FIVE_MINUTES,max:B.SEVEN_DAYS},DD={idle:`IDLE`,active:`ACTIVE`},OD={eth_sendTransaction:{key:``},eth_sendRawTransaction:{key:``},wallet_sendCalls:{key:``},solana_signTransaction:{key:`signature`},solana_signAllTransactions:{key:`transactions`},solana_signAndSendTransaction:{key:`signature`},sui_signAndExecuteTransaction:{key:`digest`},sui_signTransaction:{key:``},hedera_signAndExecuteTransaction:{key:`transactionId`},hedera_executeTransaction:{key:`transactionId`},near_signTransaction:{key:``},near_signTransactions:{key:``},tron_signTransaction:{key:`txID`},xrpl_signTransaction:{key:``},xrpl_signTransactionFor:{key:``},algo_signTxn:{key:``},sendTransfer:{key:`txid`},stacks_stxTransfer:{key:`txId`},polkadot_signTransaction:{key:``},cosmos_signDirect:{key:``}},kD=`request`,AD=[`wc_sessionPropose`,`wc_sessionRequest`,`wc_authRequest`,`wc_sessionAuthenticate`],jD=`auth`,MD=`authKeys`,ND=`pairingTopics`,PD=`requests`,FD=`wc@1.5:${jD}:`,ID=`${FD}:PUB_KEY`,LD=class extends AT{constructor(e){super(e),this.name=wD,this.events=new ot.default,this.initialized=!1,this.requestQueue={state:DD.idle,queue:[]},this.sessionRequestQueue={state:DD.idle,queue:[]},this.emittedSessionRequests=new id({limit:500}),this.requestQueueDelay=B.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.registerSubscriptionCleanup(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(TD)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,B.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t={...e,requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}};await this.isValidConnect(t),t.optionalNamespaces=Vf(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:a,scopedProperties:o,relays:s,authentication:c,walletPay:l}=t,u=c?.[0]?.ttl||TD.wc_sessionPropose.req.ttl||B.FIVE_MINUTES;this.validateRequestExpiry(u);let d=n,f,p=!1;try{if(d){let e=this.client.core.pairing.pairings.get(d);this.client.logger.warn(`connect() with existing pairing topic is deprecated and will be removed in the next major release.`),p=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),e}if(!d||!p){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});d=e,f=t}if(!d){let{message:e}=K(`NO_MATCHING_KEY`,`connect() pairing topic: ${d}`);throw Error(e)}let m=await this.client.core.crypto.generateKeyPair(),h=Uu(u),g={requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:`irn`}],proposer:{publicKey:m,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:d,...a&&{sessionProperties:a},...o&&{scopedProperties:o},id:z(),...(c||l)&&{requests:{authentication:c?.map(e=>{let{domain:t,chains:n,nonce:r,uri:i,exp:a,nbf:o,type:s,statement:c,requestId:l,resources:u,signatureTypes:d}=e;return{domain:t,chains:n,nonce:r,type:s??`caip122`,aud:i,version:`1`,iat:new Date().toISOString(),exp:a,nbf:o,statement:c,requestId:l,resources:u,signatureTypes:d}}),walletPay:l}}},_=q(`session_connect`,g.id),{reject:v,resolve:y,done:b}=Lu(u,xD),x=({id:e})=>{if(e===g.id){this.client.events.off(`proposal_expire`,x);let e=this.pendingSessions.get(g.id);if(e){let{sessionTopic:t,publicKey:n}=e;Promise.all([this.client.core.relayer.unsubscribe(t),this.client.core.crypto.keychain.has(t)?this.client.core.crypto.deleteSymKey(t):Promise.resolve(),this.client.core.crypto.keychain.has(n)?this.client.core.crypto.deleteKeyPair(n):Promise.resolve()]).catch(e=>this.client.logger.warn(e))}this.pendingSessions.delete(g.id),this.events.emit(_,{error:{message:xD,code:0}})}};return this.client.events.on(`proposal_expire`,x),this.events.once(_,({error:e,session:t})=>{this.client.events.off(`proposal_expire`,x),e?v(e):t&&y(t)}),await this.setProposal(g.id,g),await this.sendProposeSession({proposal:g,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:g.id}}}).catch(e=>{throw this.deleteProposal(g.id),e}),{uri:f,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error(`pair() failed`),e}},this.approve=async e=>{let t=this.client.core.eventClient.createEvent({properties:{topic:e?.id?.toString(),trace:[JE.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw t.setError(YE.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(n){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),t.setError(YE.proposal_not_found),n}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error(`approve() -> isValidApprove() failed`),t.setError(YE.session_approve_namespace_validation_failure),e}let{id:n,relayProtocol:r,namespaces:i,sessionProperties:a,scopedProperties:o,sessionConfig:s,proposalRequestsResponses:c}=e,l=this.client.proposal.get(n);this.client.core.eventClient.deleteEvent({eventId:t.eventId});let{pairingTopic:u,proposer:d,requiredNamespaces:f,optionalNamespaces:p}=l,m=this.client.core.eventClient?.getEvent({topic:u});m||=this.client.core.eventClient?.createEvent({type:JE.session_approve_started,properties:{topic:u,trace:[JE.session_approve_started,JE.session_namespaces_validation_success]}});let h=await this.client.core.crypto.generateKeyPair(),g=d.publicKey,_=await this.client.core.crypto.generateSharedKey(h,g),v={relay:{protocol:r??`irn`},namespaces:i,controller:{publicKey:h,metadata:this.client.metadata},expiry:Uu(CD),...a&&{sessionProperties:a},...o&&{scopedProperties:o},...s&&{sessionConfig:s},proposalRequestsResponses:c},y=DE.relay;m.addTrace(JE.subscribing_session_topic);try{await this.client.core.relayer.subscribe(_,{transportType:y,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(YE.subscribe_session_topic_failure),e}m.addTrace(JE.subscribe_session_topic_success);let b={...v,topic:_,requiredNamespaces:f,optionalNamespaces:p,pairingTopic:u,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:h,transportType:DE.relay,authentication:c?.authentication,walletPayResult:c?.walletPay};await this.client.session.set(_,b),m.addTrace(JE.store_session);try{await this.sendApproveSession({sessionTopic:_,proposal:l,pairingProposalResponse:{relay:{protocol:r??`irn`},responderPublicKey:h},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:n,...this.getTVFApproveParams(b)}}}),m.addTrace(JE.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(_,_u(`USER_DISCONNECTED`)),await this.client.core.relayer.unsubscribe(_),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:u,metadata:d.metadata}),await this.deleteProposal(n),await this.client.core.pairing.activate({topic:u}),await this.setExpiry(_,Uu(CD)),{topic:_,acknowledged:()=>Promise.resolve(this.client.session.get(_))}},this.reject=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error(`reject() -> isValidReject() failed`),e}let{id:t,reason:n}=e,r;try{r=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}r&&await this.sendError({id:t,topic:r,error:n,rpcOpts:TD.wc_sessionPropose.reject}),await this.deleteProposal(t)},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error(`update() -> isValidUpdate() failed`),e}let{topic:t,namespaces:n}=e,{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Session update request expired without receiving any acknowledgement`),o=z(),s=pe().toString(),c=this.client.session.get(t).namespaces;return this.events.once(q(`session_update`,o),({error:e})=>{e?a(e):i()}),await this.client.session.update(t,{namespaces:n}),await this.sendRequest({topic:t,method:`wc_sessionUpdate`,params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),a(e)}),{acknowledged:r}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error(`extend() -> isValidExtend() failed`),e}let{topic:t}=e,n=z(),{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Session extend request expired without receiving any acknowledgement`);return this.events.once(q(`session_extend`,n),({error:e})=>{e?a(e):i()}),await this.setExpiry(t,Uu(CD)),this.sendRequest({topic:t,method:`wc_sessionExtend`,params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(e=>{a(e)}),{acknowledged:r}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error(`request() -> isValidRequest() failed`),e}let{chainId:t,request:n,topic:r,expiry:i=TD.wc_sessionRequest.req.ttl}=e,a=this.client.session.get(r);a?.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let o=z(),s=pe().toString(),{done:c,resolve:l,reject:u}=Lu(i,`Request expired. Please try again.`);this.events.once(q(`session_request`,o),({error:e,result:t})=>{e?u(e):l(t)});let d=`wc_sessionRequest`,f=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(f)return await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:{request:{...n,expiryTimestamp:Uu(i)},chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),await c();let p={request:{...n,expiryTimestamp:Uu(i)},chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(o,p)}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),e()}),new Promise(async e=>{a.sessionConfig?.disableDeepLink||await Ku({id:o,topic:r,wcDeepLink:await Yu(this.client.core.storage,yD)}),e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized();let t=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||e?.response?.id?.toString(),trace:[JE.session_request_response_started]}});try{await this.isValidRespond(e)}catch(e){throw t.addTrace(e?.message),t.setError(YE.session_request_response_validation_failure),e}t.addTrace(JE.session_request_response_validation_success);let{topic:n,response:r}=e,{id:i}=r,a=this.client.session.get(n);a.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{t.addTrace(JE.session_request_response_publish_started),xe(r)?await this.sendResult({id:i,topic:n,result:r.result,throwOnFailedPublish:!0,appLink:o}):ge(r)&&await this.sendError({id:i,topic:n,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}catch(e){throw t.addTrace(e?.message),t.setError(YE.session_request_response_publish_failure),e}},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error(`ping() -> isValidPing() failed`),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=z(),n=pe().toString(),{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Ping request expired without receiving any acknowledgement`);this.events.once(q(`session_ping`,e),({error:e})=>{e?a(e):i()}),await Promise.all([this.sendRequest({topic:t,method:`wc_sessionPing`,params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:n}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn(`ping() on pairing topic is deprecated and will be removed in the next major release.`),await this.client.core.pairing.ping({topic:t}))},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:n,chainId:r}=e,i=pe().toString(),a=z();await this.sendRequest({topic:t,method:`wc_sessionEvent`,params:{event:n,chainId:r},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:`wc_sessionDelete`,params:_u(`USER_DISCONNECTED`),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=K(`MISMATCHED_TOPIC`,`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>qf(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&this.client.metadata.redirect?.linkMode,r=n?DE.link_mode:DE.relay;r===DE.relay&&await this.confirmOnlineStateOrThrow();let{chains:i,statement:a=``,uri:o,domain:s,nonce:c,type:l,exp:u,nbf:d,methods:f=[],expiry:p}=e,m=[...e.resources||[]],{topic:h,uri:g}=await this.client.core.pairing.create({methods:[`wc_sessionAuthenticate`],transportType:r});if(this.client.logger.info({message:`Generated new pairing`,pairing:{topic:h,uri:g}}),this.client.auth.authKeys.keys.includes(ID)){let{responseTopic:e,publicKey:t}=this.client.auth.authKeys.get(ID);e&&(await this.client.core.relayer.unsubscribe(e).catch(e=>this.client.logger.warn(e)),await this.client.auth.pairingTopics.delete(e,{message:`replaced`,code:0}).catch(e=>this.client.logger.warn(e))),t&&this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteKeyPair(t)}let _=await this.client.core.crypto.generateKeyPair(),v=rf(_);if(await Promise.all([this.client.auth.authKeys.set(ID,{responseTopic:v,publicKey:_}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:h})]),await this.client.core.relayer.subscribe(v,{transportType:r}),this.client.logger.info(`sending request to new pairing topic: ${h}`),f.length>0){let{namespace:e}=pu(i[0]),t=Ld(e,`request`,f);Wd(m)&&(t=zd(t,m.pop())),m.push(t)}let y=p&&p>TD.wc_sessionAuthenticate.req.ttl?p:TD.wc_sessionAuthenticate.req.ttl,b={authPayload:{type:l??`caip122`,chains:i,statement:a,aud:o,domain:s,version:`1`,nonce:c,iat:new Date().toISOString(),exp:u,nbf:d,resources:m},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Uu(y)},x={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set([`personal_sign`,...f])],events:[`chainChanged`,`accountsChanged`]}},relays:[{protocol:`irn`}],pairingTopic:h,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Uu(TD.wc_sessionPropose.req.ttl),id:z()},{done:S,resolve:C,reject:w}=Lu(y,`Request expired`),T=z(),E=q(`session_connect`,x.id),D=q(`session_request`,T),O=async({error:e,session:t})=>{this.events.off(D,k),e?w(e):t&&C({session:t})},k=async e=>{if(await this.deletePendingAuthRequest(T,{message:`fulfilled`,code:0}),e.error){let t=_u(`WC_METHOD_UNSUPPORTED`,`wc_sessionAuthenticate`);return e.error.code===t.code?void 0:(this.events.off(E,O),w(e.error.message))}await this.deleteProposal(x.id),this.events.off(E,O);let{cacaos:n,responder:i}=e.result,a=[],o=[];for(let e of n){await Od({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,`Signature verification failed`),w(_u(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`)));let{p:t}=e,n=Wd(t.resources),r=[Ed(t.iss)],i=Dd(t.iss);if(n){let e=Hd(n),t=Ud(n);a.push(...e),r.push(...t)}for(let e of r)o.push(`${e}:${i}`)}let s=await this.client.core.crypto.generateSharedKey(_,i.publicKey),c;a.length>0&&(c={topic:s,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:i,controller:i.publicKey,expiry:Uu(CD),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:h,namespaces:Bf([...new Set(a)],[...new Set(o)]),transportType:r},await this.client.core.relayer.subscribe(s,{transportType:r}),await this.client.session.set(s,c),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:i.metadata}),c=this.client.session.get(s)),this.client.metadata.redirect?.linkMode&&i.metadata.redirect?.linkMode&&i.metadata.redirect?.universal&&t&&(this.client.core.addLinkModeSupportedApp(i.metadata.redirect.universal),this.client.session.update(s,{transportType:DE.link_mode})),C({auths:n,session:c})};this.events.once(E,O),this.events.once(D,k);let A;try{if(n){let e=Ce(`wc_sessionAuthenticate`,b,T);this.client.core.history.set(h,e),A=kf(t,h,await this.client.core.crypto.encode(``,e,{type:2,encoding:Jd}))}else await Promise.all([this.sendRequest({topic:h,method:`wc_sessionAuthenticate`,params:b,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:h,method:`wc_sessionPropose`,params:x,expiry:TD.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:x.id})])}catch(e){throw this.events.off(E,O),this.events.off(D,k),e}return await this.setProposal(x.id,x),await this.setAuthRequest(T,{request:{...b,verifyContext:{}},pairingTopic:h,transportType:r}),{uri:A??g,response:S}},this.approveSessionAuthenticate=async e=>{let{id:t,auths:n}=e,r=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[XE.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw r.setError(ZE.no_internet_connection),e}let i=this.getPendingAuthRequest(t);if(!i)throw r.setError(ZE.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${t}`);let a=i.transportType||DE.relay;a===DE.relay&&await this.confirmOnlineStateOrThrow();let o=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),c=rf(o),l={type:1,receiverPublicKey:o,senderPublicKey:s},u=[],d=[];for(let e of n){if(!await Od({cacao:e,projectId:this.client.core.projectId})){r.setError(ZE.invalid_cacao);let e=_u(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`);throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),Error(e.message)}r.addTrace(XE.cacaos_verified);let{p:n}=e,i=Wd(n.resources),a=[Ed(n.iss)],o=Dd(n.iss);if(i){let e=Hd(i),t=Ud(i);u.push(...e),a.push(...t)}for(let e of a)d.push(`${e}:${o}`)}let f=await this.client.core.crypto.generateSharedKey(s,o);r.addTrace(XE.create_authenticated_session_topic);let p;if(u?.length>0){p={topic:f,acknowledged:!0,self:{publicKey:s,metadata:this.client.metadata},peer:{publicKey:o,metadata:i.requester.metadata},controller:o,expiry:Uu(CD),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:i.pairingTopic,namespaces:Bf([...new Set(u)],[...new Set(d)]),transportType:a},r.addTrace(XE.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(f,{transportType:a})}catch(e){throw r.setError(ZE.subscribe_authenticated_session_topic_failure),e}r.addTrace(XE.subscribe_authenticated_session_topic_success),await this.client.session.set(f,p),r.addTrace(XE.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}r.addTrace(XE.publishing_authenticated_session_approve);try{await this.sendResult({topic:c,id:t,result:{cacaos:n,responder:{publicKey:s,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(e){throw r.setError(ZE.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(t,{message:`fulfilled`,code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:r.eventId}),{session:p}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:n}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let i=r.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),o=rf(i),s={type:1,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:t,topic:o,error:n,encodeOpts:s,rpcOpts:TD.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:`rejected`,code:0}),await this.deleteProposal(t)},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:n}=e;return kd(t,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(n=>n.peerMetadata?.url&&n.peerMetadata?.url===e.peer.metadata.url&&n.topic&&n.topic!==t.topic);if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info(`Duplicate pairings clean up finished`)}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{let{topic:t,expirerHasDeleted:n=!1,emitEvent:r=!0,id:i=0}=e,{self:a}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),await this.client.session.delete(t,_u(`USER_DISCONNECTED`)),this.addToRecentlyDeleted(t,`session`),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),n||this.client.core.expirer.del(t),this.client.core.storage.removeItem(yD).catch(e=>this.client.logger.warn(e)),t===this.sessionRequestQueue.queue[0]?.topic&&(this.sessionRequestQueue.state=DD.idle),await Promise.all(this.getPendingSessionRequests().filter(e=>e.topic===t).map(e=>this.deletePendingSessionRequest(e.id,_u(`USER_DISCONNECTED`)))),r&&this.client.events.emit(`session_delete`,{id:i,topic:t})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e);this.client.core.eventClient.getEvent({topic:t.pairingTopic})?.setError(YE.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,_u(`USER_DISCONNECTED`)),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`proposal`)},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`request`),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),n&&(this.sessionRequestQueue.state=DD.idle,this.client.events.emit(`session_request_expire`,{id:e}))},this.deletePendingAuthRequest=async(e,t,n=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,Uu(TD.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:n,pairingTopic:r,transportType:i=DE.relay}=t;this.client.core.expirer.set(e,n.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:e,pairingTopic:r,verifyContext:n.verifyContext,transportType:i})},this.setPendingSessionRequest=async e=>{let{id:t,topic:n,params:r,verifyContext:i}=e,a=r.request.expiryTimestamp||Uu(TD.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,a),await this.client.pendingRequest.set(t,{id:t,topic:n,params:r,verifyContext:i})},this.sendRequest=async e=>{let{topic:t,method:n,params:r,expiry:i,relayRpcId:a,clientRpcId:o,throwOnFailedPublish:s,appLink:c,tvf:l,publishOpts:u={}}=e,d=Ce(n,r,o),f,p=!!c;try{let e=p?Jd:qd;f=await this.client.core.crypto.encode(t,d,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let m;if(AD.includes(n)){let e=af(JSON.stringify(d)),t=af(f);m=await this.client.core.verify.register({id:t,decryptedId:e})}let g={...TD[n].req,...u};if(g.attestation=m,i&&(g.ttl=i),a&&(g.id=a),this.client.core.history.set(t,d),p){let e=kf(c,t,f);await h.Linking.openURL(e,this.client.name)}else g.tvf={...l,correlationId:d.id},s?(g.internal={...g.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(t,f,g)):this.client.core.relayer.publish(t,f,g).catch(e=>this.client.logger.error(e));return d.id},this.sendProposeSession=async e=>{let{proposal:t,publishOpts:n}=e,r=Ce(`wc_sessionPropose`,t,t.id);this.client.core.history.set(t.pairingTopic,r);let i=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:qd}),a=af(JSON.stringify(r)),o=af(i),s=await this.client.core.verify.register({id:o,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:{...n,publishMethod:`wc_proposeSession`,attestation:s}})},this.sendApproveSession=async e=>{let{sessionTopic:t,pairingProposalResponse:n,proposal:r,sessionSettleRequest:i,publishOpts:a}=e,o=fe(r.id,n),s=await this.client.core.crypto.encode(r.pairingTopic,o,{encoding:qd}),c=Ce(`wc_sessionSettle`,i,a?.id),l=await this.client.core.crypto.encode(t,c,{encoding:qd});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:s,sessionSettlementRequest:l},opts:{...a,publishMethod:`wc_approveSession`}})},this.sendResult=async e=>{let{id:t,topic:n,result:r,throwOnFailedPublish:i,encodeOpts:a,appLink:o}=e,s=fe(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Jd:qd;c=await this.client.core.crypto.encode(n,s,{...a||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),e}let u,d;try{u=await this.client.core.history.get(n,t);let e=u.request;try{d=this.getTVFParams(t,e.params,r)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${t}) failed`),e}if(l){let e=kf(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=TD[u.request.method].res;e.tvf={...d,correlationId:t},i?(e.internal={...e.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,c,e)):this.client.core.relayer.publish(n,c,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(s)},this.sendError=async e=>{let{id:t,topic:n,error:r,encodeOpts:i,rpcOpts:a,appLink:o}=e,s=_e(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Jd:qd;c=await this.client.core.crypto.encode(n,s,{...i||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}let u;try{u=await this.client.core.history.get(n,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),e}if(l){let e=kf(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=u.request.method,t=a||TD[e].res;this.client.core.relayer.publish(n,c,t)}await this.client.core.history.resolve(s)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let n=!1;Wu(t.expiry)&&(n=!0),this.client.core.crypto.keychain.has(t.topic)||(n=!0),n&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{Wu(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onProviderMessageEvent=async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===DD.active){this.client.logger.info(`Request queue already active, skipping...`);return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=DD.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=DD.idle},this.processRequest=async e=>{let{topic:t,payload:n,attestation:r,transportType:i,encryptedId:a}=e,o=n.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case`wc_sessionPropose`:return await this.onSessionProposeRequest({topic:t,payload:n,attestation:r,encryptedId:a});case`wc_sessionSettle`:return await this.onSessionSettleRequest(t,n);case`wc_sessionUpdate`:return await this.onSessionUpdateRequest(t,n);case`wc_sessionExtend`:return await this.onSessionExtendRequest(t,n);case`wc_sessionPing`:return await this.onSessionPingRequest(t,n);case`wc_sessionDelete`:return await this.onSessionDeleteRequest(t,n);case`wc_sessionRequest`:return await this.onSessionRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});case`wc_sessionEvent`:return await this.onSessionEventRequest(t,n);case`wc_sessionAuthenticate`:return await this.onSessionAuthenticateRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n,transportType:r}=e,i=(await this.client.core.history.get(t,n.id)).request.method;switch(i){case`wc_sessionPropose`:return this.onSessionProposeResponse(t,n,r);case`wc_sessionSettle`:return this.onSessionSettleResponse(t,n);case`wc_sessionUpdate`:return this.onSessionUpdateResponse(t,n);case`wc_sessionExtend`:return this.onSessionExtendResponse(t,n);case`wc_sessionPing`:return this.onSessionPingResponse(t,n);case`wc_sessionRequest`:return this.onSessionRequestResponse(t,n);case`wc_sessionAuthenticate`:return this.onSessionAuthenticateResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:n}=K(`MISSING_OR_INVALID`,`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(n)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:n}=e,r=this.expectedPairingMethodMap.get(t);return!r||r.includes(n)?!1:!!(r.includes(`wc_sessionAuthenticate`)&&this.client.events.listenerCount(`session_authenticate`)>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i}=e,{params:a,id:o}=n;try{let e=this.client.core.eventClient.getEvent({topic:t});this.client.events.listenerCount(`session_proposal`)===0&&e?.setError(qE.proposal_listener_not_found),this.isValidConnect({...n.params});let s={id:o,pairingTopic:t,expiryTimestamp:a.expiryTimestamp||Uu(TD.wc_sessionPropose.req.ttl),attestation:r,encryptedId:i,...a};await this.setProposal(o,s);let c=await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(n)),encryptedId:i,metadata:s.proposer.metadata});e?.addTrace(KE.emit_session_proposal),this.client.events.emit(`session_proposal`,{id:o,params:s,verifyContext:c})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:TD.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,n)=>{let{id:r}=t;if(xe(t)){let{result:i}=t;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,result:i});let a=this.client.proposal.get(r);this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,proposal:a});let o=a.proposer.publicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,selfPublicKey:o});let s=i.responderPublicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,peerPublicKey:s});let c=await this.client.core.crypto.generateSharedKey(o,s);this.pendingSessions.set(r,{sessionTopic:c,pairingTopic:e,proposalId:r,publicKey:o});let l=await this.client.core.relayer.subscribe(c,{transportType:n});this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(ge(t)){await this.deleteProposal(r);let e=q(`session_connect`,r);if(this.events.listenerCount(e)===0)throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);let{relay:n,controller:i,expiry:a,namespaces:o,sessionProperties:s,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=t.params,d=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!d)return this.client.logger.error(`Pending session not found for topic ${e}`);let f=this.client.proposal.get(d.proposalId),p={topic:e,relay:n,expiry:a,namespaces:o,acknowledged:!0,pairingTopic:d.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:i.publicKey,self:{publicKey:d.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata},...s&&{sessionProperties:s},...c&&{scopedProperties:c},...l&&{sessionConfig:l},transportType:DE.relay,authentication:u?.authentication,walletPayResult:u?.walletPay};await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:d.pairingTopic,metadata:p.peer.metadata}),this.pendingSessions.delete(d.proposalId),this.deleteProposal(d.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit(`session_connect`,{session:p}),this.events.emit(q(`session_connect`,d.proposalId),{session:p})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:n}=t;xe(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(q(`session_approve`,n),{})):ge(t)&&(await this.deleteSession({topic:e,emitEvent:!1}),this.events.emit(q(`session_approve`,n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:n,id:r}=t;try{let t=`${e}_session_update`,i=Pp.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.warn(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:_u(`INVALID_UPDATE_REQUEST`)});return}this.isValidUpdate({topic:e,...n});try{Pp.set(t,r),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(e){throw Pp.delete(t),e}this.client.events.emit(`session_update`,{id:r,topic:e,params:n})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3),this.onSessionUpdateResponse=(e,t)=>{let{id:n}=t,r=q(`session_update`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_update`,n),{}):ge(t)&&this.events.emit(q(`session_update`,n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Uu(CD)),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit(`session_extend`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:n}=t,r=q(`session_extend`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_extend`,n),{}):ge(t)&&this.events.emit(q(`session_extend`,n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(`session_ping`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:n}=t,r=q(`session_ping`,n);setTimeout(()=>{if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners 2176`);xe(t)?this.events.emit(q(`session_ping`,n),{}):ge(t)&&this.events.emit(q(`session_ping`,n),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:n}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:_u(`USER_DISCONNECTED`)}),await this.deleteSession({topic:e,id:n})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e,{id:o,params:s}=n;try{await this.isValidRequest({topic:t,...s});let e=this.client.session.get(t),n={id:o,topic:t,params:s,verifyContext:await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(Ce(`wc_sessionRequest`,s,o))),encryptedId:i,metadata:e.peer.metadata,transportType:a})};await this.setPendingSessionRequest(n),a===DE.link_mode&&e.peer.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.peer.metadata.redirect?.universal),this.client.signConfig?.disableRequestQueue?this.emitSessionRequest(n):(this.addSessionRequestToSessionRequestQueue(n),this.processSessionRequestQueue())}catch(e){await this.sendError({id:o,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:n}=t,r=q(`session_request`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_request`,n),{result:t.result}):ge(t)&&this.events.emit(q(`session_request`,n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:n,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,i=Pp.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit({topic:e,...r}),this.client.events.emit(`session_event`,{id:n,topic:e,params:r}),Pp.set(t,n)}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:n}=t;this.client.logger.trace({type:`method`,method:`onSessionAuthenticateResponse`,topic:e,payload:t}),xe(t)?this.events.emit(q(`session_request`,n),{result:t.result}):ge(t)&&this.events.emit(q(`session_request`,n),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:s}=n.params,c=await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:a}),l={requester:e,pairingTopic:t,id:n.id,authPayload:o,verifyContext:c,expiryTimestamp:s};await this.setAuthRequest(n.id,{request:l,pairingTopic:t,transportType:a}),a===DE.link_mode&&e.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit(`session_authenticate`,{topic:t,params:n.params,id:n.id,verifyContext:c})}catch(e){this.client.logger.error(e);let r=n.params.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),o=this.getAppLinkIfEnabled(n.params.requester.metadata,a),s={type:1,receiverPublicKey:r,senderPublicKey:i};await this.sendError({id:n.id,topic:t,error:e,encodeOpts:s,rpcOpts:TD.wc_sessionAuthenticate.autoReject,appLink:o})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:`fulfilled`,code:0}),setTimeout(()=>{this.sessionRequestQueue.state=DD.idle,this.processSessionRequestQueue()},(0,B.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let n=this.client.core.history.pending;n.length>0&&n.filter(t=>t.topic===e&&t.request.method===`wc_sessionRequest`).forEach(e=>{this.events.emit(q(`session_request`,e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===DD.active){this.client.logger.info(`session request queue is already active.`);return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info(`session request queue is empty.`);return}try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{if(this.emittedSessionRequests.has(e.id)){this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);return}this.sessionRequestQueue.state=DD.active,this.emittedSessionRequests.add(e.id),this.client.events.emit(`session_request`,e)},this.cleanupInProgress=!1,this.cleanupOrphanedSubscriptions=async()=>{let e=this.client.core.relayer.subscriber.topics;if(e.length===0)return;let t=new Set(this.client.session.keys),n=new Set(this.client.core.pairing.pairings.keys),r=new Set([...this.pendingSessions.values()].map(e=>e.sessionTopic)),i;if(this.client.auth.authKeys.keys.includes(ID)){let{responseTopic:e}=this.client.auth.authKeys.get(ID);i=e}for(let a of e)if(!t.has(a)&&!n.has(a)&&!r.has(a)&&a!==i){this.client.logger.info(`Cleaning up orphaned subscriber topic: ${a}`);try{await this.client.core.relayer.subscriber.unsubscribe(a)}catch(e){this.client.logger.warn(e,`Failed to clean up orphaned subscription: ${a}`)}}},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:Ce(`wc_sessionPropose`,{...t,requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties},t.id),attestation:t.attestation,encryptedId:t.encryptedId})},this.isValidConnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,scopedProperties:a,relays:o}=e;if(Wf(t)||await this.isValidPairingTopic(t),!up(o,!0)){let{message:e}=K(`MISSING_OR_INVALID`,`connect() relays: ${o}`);throw Error(e)}if(n&&!Wf(n)&&Uf(n)!==0&&([`fatal`,`error`,`silent`].includes(this.client.logger.level)||this.client.logger.warn(`requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces`),this.validateNamespaces(n,`requiredNamespaces`)),r&&!Wf(r)&&Uf(r)!==0&&this.validateNamespaces(r,`optionalNamespaces`),i&&!Wf(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!Wf(a)){this.validateSessionProps(a,`scopedProperties`);let e=Object.keys(n||{}).concat(Object.keys(r||{}));if(!Object.keys(a).every(t=>e.includes(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(e)}`)}},this.validateNamespaces=(e,t)=>{let n=sp(e,`connect()`,t);if(n)throw Error(n.message)},this.isValidApprove=async e=>{if(!fp(e))throw Error(K(`MISSING_OR_INVALID`,`approve() params: ${e}`).message);let{id:t,namespaces:n,relayProtocol:r,sessionProperties:i,scopedProperties:a}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let o=this.client.proposal.get(t),s=cp(n,`approve()`);if(s)throw Error(s.message);let c=bp(o.requiredNamespaces,n,`approve()`);if(c)throw Error(c.message);if(!Gf(r,!0)){let{message:e}=K(`MISSING_OR_INVALID`,`approve() relayProtocol: ${r}`);throw Error(e)}if(i&&!Wf(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!Wf(a)){this.validateSessionProps(a,`scopedProperties`);let e=new Set(Object.keys(n));if(!Object.keys(a).every(t=>e.has(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(e).join(`, `)}`)}},this.isValidReject=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`reject() params: ${e}`);throw Error(t)}let{id:t,reason:n}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!pp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`reject() reason: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!lp(t)){let{message:e}=K(`MISSING_OR_INVALID`,`onSessionSettleRequest() relay protocol should be a string`);throw Error(e)}let a=$f(n,`onSessionSettleRequest()`);if(a)throw Error(a.message);let o=cp(r,`onSessionSettleRequest()`);if(o)throw Error(o.message);if(Wu(i)){let{message:e}=K(`EXPIRED`,`onSessionSettleRequest()`);throw Error(e)}},this.isValidUpdate=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),i=cp(n,`update()`);if(i)throw Error(i.message);let a=bp(r.requiredNamespaces,n,`update()`);if(a)throw Error(a.message)},this.isValidExtend=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`request() params: ${e}`);throw Error(t)}let{topic:t,request:n,chainId:r,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:a}=this.client.session.get(t);if(!_p(a,r)){let{message:e}=K(`MISSING_OR_INVALID`,`request() chainId: ${r}`);throw Error(e)}if(!mp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`request() ${JSON.stringify(n)}`);throw Error(e)}if(!vp(a,r,n.method)){let{message:e}=K(`MISSING_OR_INVALID`,`request() method: ${n.method}`);throw Error(e)}this.validateRequestExpiry(i)},this.isValidRespond=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`respond() params: ${e}`);throw Error(t)}let{topic:t,response:n}=e;try{await this.isValidSessionTopic(t)}catch(t){throw e?.response?.id&&this.cleanupAfterResponse(e),t}if(!hp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`respond() response: ${JSON.stringify(n)}`);throw Error(e)}let r=this.client.pendingRequest.get(n.id);if(r.topic!==t){let{message:e}=K(`MISMATCHED_TOPIC`,`Request response topic mismatch. reqId: ${n.id}, expected topic: ${r.topic}, received topic: ${t}`);throw Error(e)}},this.isValidPing=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`emit() params: ${e}`);throw Error(t)}let{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!_p(i,r)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() chainId: ${r}`);throw Error(e)}if(!gp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!yp(i,r,n.name)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:n,domain:r,nonce:i}=e;if(!Array.isArray(t)||t.length===0)throw Error(`chains is required and must be a non-empty array`);if(!Gf(n,!1))throw Error(`uri is required parameter`);if(!Gf(r,!1))throw Error(`domain is required parameter`);if(!Gf(i,!1))throw Error(`nonce is required parameter`);if([...new Set(t.map(e=>pu(e).namespace))].length>1)throw Error(`Multi-namespace requests are not supported. Please request single namespace only.`);let{namespace:a}=pu(t[0]);if(a!==`eip155`)throw Error(`Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.`)},this.getVerifyContext=async e=>{let{attestationId:t,hash:n,encryptedId:r,metadata:i,transportType:a}=e,o={verified:{verifyUrl:i.verifyUrl||`https://verify.walletconnect.org`,validation:`UNKNOWN`,origin:i.url||``}};try{if(a===DE.link_mode){let e=this.getAppLinkIfEnabled(i,a);return o.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?`VALID`:`INVALID`,o}let e=await this.client.core.verify.resolve({attestationId:t,hash:n,encryptedId:r,verifyUrl:i.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(i.url).origin?`VALID`:`INVALID`)}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((n,r)=>{if(n==null){let{message:i}=K(`MISSING_OR_INVALID`,`${t} must contain an existing value for each key. Received: ${n} for key ${Object.keys(e)[r]}`);throw Error(i)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return typeof t==`object`?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let n of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(n)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:n}=K(`MISSING_OR_INVALID`,`Record was recently deleted - ${t}: ${e}`);throw Error(n)}},this.isLinkModeEnabled=(e,t)=>!e||t!==DE.link_mode?!1:this.client.metadata?.redirect?.linkMode===!0&&this.client.metadata?.redirect?.universal!==void 0&&this.client.metadata?.redirect?.universal!==``&&e?.redirect?.universal!==void 0&&e?.redirect?.universal!==``&&e?.redirect?.linkMode===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof h?.Linking<`u`,this.getAppLinkIfEnabled=(e,t)=>this.isLinkModeEnabled(e,t)?e?.redirect?.universal:void 0,this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes(`wc_ev`)||!e.includes(`topic`))return;let t=Xu(e,`topic`)||``,n=decodeURIComponent(Xu(e,`wc_ev`)||``),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:DE.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:n,sessionExists:r})},this.registerLinkModeListeners=async()=>{if(Qu()||xu()&&this.client.metadata.redirect?.linkMode){let e=h?.Linking;if(typeof e<`u`){e.addEventListener(`url`,this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}},this.getTVFApproveParams=e=>{try{return{approvedChains:jf(e.namespaces),approvedMethods:Mf(e.namespaces),approvedEvents:Nf(e.namespaces),sessionProperties:e.sessionProperties,scopedProperties:e.scopedProperties}}catch(e){return this.client.logger.warn(e,`Error getting TVF approve params`),{}}},this.getTVFParams=(e,t,n)=>{if(!t.request?.method)return{};let r={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{r.txHashes=this.extractTxHashesFromResult(t.request,n),r.contractAddresses=this.isValidContractData(t.request.params)?[t.request.params?.[0]?.to]:[]}catch(e){this.client.logger.warn(e,`Error getting TVF params`)}return r},this.isValidContractData=e=>{if(!e)return!1;try{let t=e?.data||e?.[0]?.data;if(!t.startsWith(`0x`))return!1;let n=t.slice(2);return/^[0-9a-fA-F]*$/.test(n)?n.length%2==0:!1}catch{}return!1},this.extractTxHashesFromResult=(e,t)=>{try{if(!t)return[];let n=e.method,r=OD[n];if(n===`sui_signTransaction`)return[pd(t.transactionBytes)];if(n===`near_signTransaction`)return[md(t)];if(n===`near_signTransactions`)return t.map(e=>md(e));if(n===`xrpl_signTransactionFor`||n===`xrpl_signTransaction`)return[t.tx_json?.hash];if(n===`polkadot_signTransaction`)return[Up({transaction:e.params.transactionPayload,signature:t.signature})];if(n===`algo_signTxn`)return Hf(t)?t.map(e=>gd(e)):[gd(t)];if(n===`cosmos_signDirect`)return[vd(t)];if(n===`wallet_sendCalls`)return yd(t);if(typeof t==`string`)return[t];let i=t[r.key];if(Hf(i))return n===`solana_signAllTransactions`?i.map(e=>fd(e)):i;if(typeof i==`string`)return[i]}catch(e){this.client.logger.warn(e,`Error extracting tx hashes from result`)}return[]}}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,n]of Object.entries(t))for(let t of n)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,`processPendingMessageEvents failed`)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(CE.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:n,attestation:r,transportType:i}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(ID)?this.client.auth.authKeys.get(ID):{publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,n,{receiverPublicKey:a,encoding:i===DE.link_mode?Jd:qd});de(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:i,encryptedId:af(n)})):ye(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i})),await this.client.core.relayer.messages.ack(t,n)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(RE.expired,async e=>{let{topic:t,id:n}=Hu(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,K(`EXPIRED`),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,K(`EXPIRED`),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit(`session_expire`,{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit(`proposal_expire`,{id:n}))})}registerSubscriptionCleanup(){this.client.core.heartbeat.on(`heartbeat_pulse`,async()=>{if(!this.cleanupInProgress){this.cleanupInProgress=!0;try{await this.cleanupOrphanedSubscriptions()}catch(e){this.client.logger.warn(e)}finally{this.cleanupInProgress=!1}}})}registerPairingEvents(){this.client.core.pairing.events.on(PE.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(PE.delete,e=>{this.addToRecentlyDeleted(e.topic,`pairing`)})}isValidPairingTopic(e){if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=K(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`session topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=K(`EXPIRED`,`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=K(`MISSING_OR_INVALID`,`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Gf(e,!1)){let{message:t}=K(`NO_MATCHING_KEY`,`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=K(`MISSING_OR_INVALID`,`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!dp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`proposal id doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=K(`EXPIRED`,`proposal id: ${e}`);throw Error(t)}}validateRequestExpiry(e){if(e&&!wp(e,ED)){let{message:t}=K(`MISSING_OR_INVALID`,`request() expiry: ${e}. Expiry must be a number (in seconds) between ${ED.min} and ${ED.max}`);throw Error(t)}}},RD=class extends cD{constructor(e,t){super(e,t,bD,_D),this.core=e,this.logger=t}},zD=class extends cD{constructor(e,t){super(e,t,SD,_D),this.core=e,this.logger=t}},BD=class extends cD{constructor(e,t){super(e,t,kD,_D,e=>e.id),this.core=e,this.logger=t}},VD=class extends cD{constructor(e,t){super(e,t,MD,FD,()=>ID),this.core=e,this.logger=t}},HD=class extends cD{constructor(e,t){super(e,t,ND,FD),this.core=e,this.logger=t}},UD=class extends cD{constructor(e,t){super(e,t,PD,FD,e=>e.id),this.core=e,this.logger=t}},WD=class{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new VD(this.core,this.logger),this.pairingTopics=new HD(this.core,this.logger),this.requests=new UD(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},GD=class e extends kT{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=vD.name,this.events=new ot.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||vD.name,this.metadata=Ou(e?.metadata),this.signConfig=e?.signConfig;let t=Wp({logger:e?.logger||vD.logger,name:this.name});this.logger=t,this.core=e?.core||new hD(e),this.session=new zD(this.core,this.logger),this.proposal=new RD(this.core,this.logger),this.pendingRequest=new BD(this.core,this.logger),this.engine=new LD(this),this.auth=new WD(this.core,this.logger)}static async init(t){let n=new e(t);return await n.initialize(),n}get context(){return au(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace(`Initialized`);try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info(`SignClient Initialization Success`)}catch(e){throw this.logger.info(`SignClient Initialization Failure`),this.logger.error(e.message),e}}},KD=`WALLETCONNECT_DEEPLINK_CHOICE`,qD={isHttpUrl(e){return e.startsWith(`http://`)||e.startsWith(`https://`)},formatNativeUrl(e,t,n,r){if(qD.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let i=e.replaceAll(`/`,``).replaceAll(`:`,``);return qD.setWalletConnectDeepLink(i,r),`${i}://wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!qD.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;return e.endsWith(`/`)&&(r=e.slice(0,-1)),qD.setWalletConnectDeepLink(r,n),`${r}/wc?uri=${encodeURIComponent(t)}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t=`_self`){window.open(e,t,`noreferrer noopener`)},setWalletConnectDeepLink(e,t){localStorage.setItem(KD,JSON.stringify({href:e,name:t}))},removeWalletConnectDeepLink(){localStorage.removeItem(KD)}};_();var JD=`https://explorer-api.walletconnect.com`,YD=class{walletInfo;signClient;wcCloudInfo;actions;qrUrl;appUrl;pairings=[];sessions=[];emitter;logger;options;relayUrl;env;requiredNamespaces;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};constructor(e){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);this.walletInfo=e,this.qrUrl={state:U.Init},this.appUrl={state:U.Init},this.requiredNamespaces=e.walletconnect.requiredNamespaces}get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}get isMobile(){return this.env?.device===`mobile`}get wcName(){return this.walletInfo.walletconnect.name}get wcEncoding(){return this.walletInfo.walletconnect.encoding||`hex`}get wcProjectId(){return this.walletInfo.walletconnect.projectId}get wcMobile(){return this.walletInfo.walletconnect.mobile}get accounts(){let e=[];return this.sessions.forEach(t=>{Object.entries(t.namespaces).forEach(([,t])=>{t.accounts.forEach(t=>{let[n,r,i]=t.split(`:`);e.push({namespace:n,chainId:r,address:i})})})}),e}deleteSession(e){let t=[];this.sessions=this.sessions.filter(n=>n.topic===e?(n.namespaces.cosmos.accounts.forEach(e=>{let[,n]=e.split(`:`);t.push(n)}),!1):!0),this.emitter?.emit(`reset`,t),this.logger?.debug("[WALLET EVENT] Emit `reset`")}subscribeToEvents(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.signClient.on(`session_ping`,e=>{this.logger?.debug(`EVENT`,`session_ping`,e)}),this.signClient.on(`session_event`,async e=>{this.logger?.debug(`EVENT`,`session_event`,e)}),this.signClient.on(`session_update`,({topic:e,params:t})=>{this.logger?.debug(`EVENT`,`session_update`,{topic:e,params:t})}),this.signClient.on(`session_delete`,e=>{this.logger?.debug(`EVENT`,`session_delete`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_expire`,e=>{this.logger?.debug(`EVENT`,`session_expire`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_proposal`,e=>{this.logger?.debug(`EVENT`,`session_proposal`,e)}),this.signClient.on(`session_request`,e=>{this.logger?.debug(`EVENT`,`session_request`,e)}),this.signClient.on(`proposal_expire`,e=>{this.logger?.debug(`EVENT`,`proposal_expire`,e)})}async deleteInactivePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll({active:!1}))await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear inactive pairings.`}),this.logger?.debug(`Delete inactive pairing:`,e.topic)}async deleteAllPairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll())await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear pairings.`}),this.logger?.debug(`Delete pairing:`,e.topic)}restorePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.pairings=this.signClient.pairing.getAll({active:!0}).filter(e=>e.peerMetadata?.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED PAIRINGS: `,this.pairings)}get pairing(){return this.pairings[0]}restoreSessions(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.sessions=this.signClient.session.getAll().filter(e=>e.peer.metadata.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED SESSIONS: `,this.sessions)}async getSession(e,t){return this.signClient===void 0&&await this.init(),this.sessions.find(n=>n.namespaces[e]?.accounts?.find(n=>n.startsWith(`${e}:${t}`)))}get walletName(){return this.walletInfo.name}get dappProjectId(){return this.options?.signClient.projectId}setActions(e){this.actions=e}setQRState(e){this.qrUrl.state=e,this.actions?.qrUrl?.state(e)}setQRError(e){this.setQRState(U.Error),this.qrUrl.message=typeof e==`string`?e:e?.message,this.actions?.qrUrl?.message?.(this.qrUrl.message),typeof e!=`string`&&e?.stack&&this.logger?.error(e.stack)}async init(){await this.initSignClient(),this.isMobile&&await this.initAppUrl()}async initSignClient(){this.signClient&&this.relayUrl===this.options?.signClient.relayUrl||(this.signClient=await GD.init(this.options?.signClient),this.relayUrl=this.options?.signClient.relayUrl,this.logger?.debug(`CREATED CLIENT: `,this.signClient),this.logger?.debug(`relayerRegion `,this.options?.signClient.relayUrl),this.subscribeToEvents(),this.restorePairings(),this.restoreSessions())}async initWCCloudInfo(){let e=`${JD}/v3/wallets?projectId=${this.dappProjectId}&sdks=sign_v2&search=${this.wcName}`,t=await(await fetch(e)).json();this.wcCloudInfo=t.listings[this.walletInfo.walletconnect.projectId],this.logger?.debug(`WalletConnect Info:`,this.wcCloudInfo)}async initAppUrl(){this.appUrl.state=U.Pending,this.wcCloudInfo||await this.initWCCloudInfo();let e=this.wcCloudInfo.mobile.native||this.wcMobile?.native,t=this.wcCloudInfo.mobile.universal||this.wcMobile?.universal;this.appUrl.data={native:e,universal:t},this.appUrl.state=U.Done}get nativeUrl(){let e=this.appUrl.data?.native;if(typeof e==`string`||e===void 0)return e;{let{android:t,ios:n,macos:r,windows:i}=e;switch(this.env?.os){case`android`:return t;case`ios`:return n;case`macos`:return r;case`windows`:return i;default:throw Error(`Unknown os: ${this.env?.os}.`)}}}get universalUrl(){return this.appUrl.data?.universal}get redirectHref(){return this.nativeUrl||this.universalUrl}get redirectHrefWithWCUri(){let e;return this.nativeUrl?e=(this.walletInfo.walletconnect.formatNativeUrl||qD.formatNativeUrl)(this.nativeUrl,this.qrUrl.data,this.env?.os,this.walletName):this.universalUrl&&(e=(this.walletInfo.walletconnect.formatUniversalUrl||qD.formatUniversalUrl)(this.universalUrl,this.qrUrl.data,this.walletName)),e}get displayQRCode(){return!(this.pairing||this.redirect)}get redirect(){return!!(this.isMobile&&(this.nativeUrl||this.universalUrl))}openApp(e=!0){let t=e?this.redirectHrefWithWCUri:this.redirectHref;t?(this.logger?.debug(`Redirecting:`,t),qD.openHref(t)):this.logger?.error(`No redirecting href.`)}async connect(e,t){this.signClient===void 0&&await this.init(),this.qrUrl.state!==`Init`&&this.setQRState(U.Init);let n=typeof e==`string`?[`cosmos:${e}`]:e.map(e=>`cosmos:${e}`);this.restorePairings();let r=this.pairing;this.logger?.debug(`Restored active pairing topic is:`,r?.topic),this.displayQRCode&&this.setQRState(U.Pending);let i={cosmos:{methods:[`cosmos_getAccounts`,`cosmos_signAmino`,`cosmos_signDirect`,...this.requiredNamespaces?.methods??[]],chains:n,events:[`chainChanged`,`accountsChanged`,...this.requiredNamespaces?.events??[]]}},a;try{this.logger?.debug(`Connecting chains:`,n),a=await this.signClient.connect({pairingTopic:r?.topic,requiredNamespaces:i,...t}),this.qrUrl.data=a.uri,this.logger?.debug(`Using QR URI:`,a.uri),this.displayQRCode&&this.setQRState(U.Done)}catch(e){this.logger?.error(`Client connect error: `,e),this.displayQRCode&&this.setQRError(e);return}this.redirect&&this.openApp();try{let e=await a.approval();this.logger?.debug(`Established session:`,e),this.sessions.push(e),this.restorePairings()}catch(e){throw this.logger?.error(`Session approval error: `,e),await this.deleteInactivePairings(),e?e.code==5001?Xi:e:(this.displayQRCode&&this.setQRError(Zi),Error(`Proposal Expired`))}finally{!r&&this.qrUrl.message!==Zi.message&&this.setQRState(U.Init)}}async disconnect(e){if(this.signClient===void 0&&await this.init(),e?.walletconnect?.removeAllPairings===!0&&await this.deleteAllPairings(),this.sessions.length!==0){for(let e of this.sessions)try{this.logger?.debug(`Delete session:`,e);let{getSdkError:t}=await g(async()=>{let{getSdkError:e}=await import(`./dist-C0K_070R.js`);return{getSdkError:e}},[]);await this.signClient.disconnect({topic:e.topic,reason:t(`USER_DISCONNECTED`)})}catch(t){this.logger?.error(`SignClient.disconnect session ${e.topic} failed:`,t)}this.sessions=[],this.emitter?.emit(`sync_disconnect`),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")}}async getSimpleAccount(e){let t=this.accounts.find(({chainId:t})=>t===e);if(!t)throw Error(`Chain ${e} is not connected yet, please check the session approval namespaces`);return t}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:(t,n)=>this.signAmino(e,t,n)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:(t,n)=>this.signDirect(e,t,n)}}async getOfflineSigner(e,t){return t===`amino`&&this.getOfflineSignerAmino?this.getOfflineSignerAmino(e):t===`direct`&&this.getOfflineSignerDirect?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino?this.getOfflineSignerAmino?.(e):this.getOfflineSignerDirect(e)}async _getAccount(e){let t=await this.getSession(`cosmos`,e);if(!t)throw Error(`Session for ${e} not established yet.`);let n=await this.signClient.request({topic:t.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_getAccounts`,params:{}}});return this.logger?.debug(`Response of cosmos_getAccounts`,n),n}async getAccount(e){let{address:t,algo:n,pubkey:r}=(await this._getAccount(e))[0];return{address:t,algo:n,pubkey:new Uint8Array(v.from(r,this.wcEncoding))}}async _signAmino(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);this.redirect&&this.openApp();let a=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signAmino`,params:{signerAddress:t,signDoc:n}}});return this.logger?.debug(`Response of cosmos_signAmino`,a),a}async signAmino(e,t,n,r){return await this._signAmino(e,t,n,r||this.defaultSignOptions)}async _signDirect(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);let a={signerAddress:t,signDoc:{chainId:n.chainId,bodyBytes:v.from(n.bodyBytes).toString(this.wcEncoding),authInfoBytes:v.from(n.authInfoBytes).toString(this.wcEncoding),accountNumber:n.accountNumber.toString()}};this.redirect&&this.openApp();let o=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signDirect`,params:a}});return this.logger?.debug(`Response of cosmos_signDirect`,o),o}async signDirect(e,t,n,r){let{signed:i,signature:a}=await this._signDirect(e,t,n,r||this.defaultSignOptions);return{signed:{chainId:i.chainId,accountNumber:BigInt(i.accountNumber),authInfoBytes:new Uint8Array(v.from(i.authInfoBytes,this.wcEncoding)),bodyBytes:new Uint8Array(v.from(i.bodyBytes,this.wcEncoding))},signature:a}}},XD=class extends Xp{WCClient;clientMutable={state:U.Init};constructor(e,t,n){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);super(e,t),this.WCClient=n}async initClient(e){if(!e){this.initClientError(Error("`walletconnectOptions` is not provided."));return}if(!e.signClient.projectId){this.initClientError(Error("`projectId` is not provided in `walletconnectOptions`."));return}this.initingClient();try{let t=new this.WCClient(this.walletInfo);t.logger=this.logger,t.emitter=this.emitter,t.env=this.env,t.options=e,this.initClientDone(t)}catch(e){this.initClientError(e)}}},ZD=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageRegistry=void 0,e.MessageRegistry=class{constructor(){this.registeredMsgType=new Map}registerMessage(e){if(this.registeredMsgType.has(e.type()))throw Error(`Already registered type ${e.type()}`);this.registeredMsgType.set(e.type(),e)}parseMessage(e){if(!e.type)throw Error(`Null type`);let t=this.registeredMsgType.get(e.type);if(!t)throw Error(`Unregistered msg type ${e.type}`);return Object.setPrototypeOf(e.msg,t.prototype)}}})),QD=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),$D=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSONUint8Array=void 0;var t=QD();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),eO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Router=void 0;var n=ZD(),r=$D();e.Router=class{constructor(e){this.envProducer=e,this.msgRegistry=new n.MessageRegistry,this.registeredHandler=new Map,this.guards=[],this.port=``,this._isInitialized=!1}get isInitialized(){return this._isInitialized}registerMessage(e){this.msgRegistry.registerMessage(e)}addHandler(e,t){if(this.registeredHandler.has(e))throw Error(`Already registered type ${e}`);this.registeredHandler.set(e,t)}addGuard(e){this.guards.push(e)}listen(e,n){return t(this,void 0,void 0,function*(){if(this.port=e,this.attachHandler(),n){let e;this._initWaiter=new Promise(t=>{e=t}),yield n(),e()}this._isInitialized=!0})}unlisten(){this.port=``,this.detachHandler()}handleMessage(e,n){return t(this,void 0,void 0,function*(){this.isInitialized||(yield this._initWaiter);let t=this.msgRegistry.parseMessage(r.JSONUint8Array.unwrap(e)),i=this.envProducer(n,t.routerMeta??{});for(let e of this.guards)yield e(i,t,n);t.validateBasic();let a=t.route();if(!a)throw Error(`Null router`);let o=this.registeredHandler.get(a);if(!o)throw Error(`Can't get handler`);return r.JSONUint8Array.wrap(yield o(i,t))})}}})),tO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),rO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),iO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumProviderRpcError=e.KeplrError=void 0,e.KeplrError=class e extends Error{constructor(t,n,r){super(r),this.module=t,this.code=n,Object.setPrototypeOf(this,e.prototype)}},e.EthereumProviderRpcError=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}}})),aO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=void 0,e.Message=class{approveExternal(e,t){return!1}}})),oO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WEBPAGE_PORT=e.APP_PORT=e.BACKGROUND_PORT=void 0,e.BACKGROUND_PORT=`background`,e.APP_PORT=`popup`,e.WEBPAGE_PORT=`webpage`})),sO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sendSimpleMessage=e.SimpleMessage=void 0;var n=aO(),r=Symbol(),i=Symbol(),a=class extends n.Message{constructor(e,t,n){super(),this[r]=e,this[i]=t;for(let e of Object.keys(n))this[e]=n[e]}route(){return this[r]}type(){return this[i]}validateBasic(){}approveExternal(){return!0}};e.SimpleMessage=a;function o(e,n,r,i,o){return t(this,void 0,void 0,function*(){return yield e.sendMessage(n,new a(r,i,o))})}e.sendSimpleMessage=o})),cO=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(eO(),e),n(tO(),e),n(nO(),e),n(rO(),e),n(iO(),e),n(aO(),e),n(oO(),e),n(ZD(),e),n(sO(),e),n($D(),e)})),lO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),uO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),dO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Keplr=void 0;var r=cO(),i=lO(),a=uO(),o=n(at()),s=n(J()),c=A(),l=n(ee());e.Keplr=class{constructor(e,t,n){this.version=e,this.mode=t,this.requester=n,this.enigmaUtils=new Map,this.defaultOptions={},this.ethereum=new d(this,this.requester),this.starknet=new p(this,this.requester),this.bitcoin=new m(this,this.requester)}ping(){return t(this,void 0,void 0,function*(){yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`keplr-ping`,{})})}enable(e){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`enable-access`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})}isEnabled(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`is-enabled-access`,{chainIds:e})})}disable(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`disable-access`,{chainIds:e??[]}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);if(e.gasPriceStep){let t=Object.assign({},e.gasPriceStep);for(let n of e.feeCurrencies)n.gasPriceStep||=t;delete e.gasPriceStep}return e.coinType&&delete e.coinType,new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`need-suggest-chain-info-interaction`,{chainInfo:e}).then(a=>{a||(i=!0),(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`suggest-chain-info`,{chainInfo:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})})}getKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return new Promise((e,t)=>{let n=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`get-chain-infos-without-endpoints`,{}).then(t=>e(t.chainInfos)).catch(t).finally(()=>n=!0),setTimeout(()=>{n||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`get-chain-info-without-endpoints`,{chainId:e}).then(e=>t(e.chainInfo)).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}sendTx(e,n,i){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`background-tx`,`send-tx-to-background`,{chainId:e,tx:n,mode:i})})}signAmino(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino`,{chainId:e,signer:n,signDoc:i,signOptions:(0,o.default)(this.defaultOptions.sign??{},a)}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirect(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct`,{chainId:e,signer:n,signDoc:{bodyBytes:i.bodyBytes,authInfoBytes:i.authInfoBytes,chainId:i.chainId,accountNumber:i.accountNumber?i.accountNumber.toString():null},signOptions:(0,o.default)(this.defaultOptions.sign??{},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,authInfoBytes:e.signed.authInfoBytes,chainId:e.signed.chainId,accountNumber:s.default.fromString(e.signed.accountNumber)},signature:e.signature})).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirectAux(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct-aux`,{chainId:e,signer:n,signDoc:{bodyBytes:i.bodyBytes,publicKey:i.publicKey,chainId:i.chainId,accountNumber:i.accountNumber?i.accountNumber.toString():null,sequence:i.sequence?i.sequence.toString():null},signOptions:(0,o.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,publicKey:e.signed.publicKey,chainId:e.signed.chainId,accountNumber:s.default.fromString(e.signed.accountNumber),sequence:s.default.fromString(e.signed.sequence)},signature:e.signature})).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signArbitrary(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:typeof i==`string`?c.Buffer.from(i):i,signOptions:{isADR36WithString:typeof i==`string`}}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}verifyArbitrary(e,n,i,a){return t(this,void 0,void 0,function*(){return typeof i==`string`&&(i=c.Buffer.from(i)),new Promise((t,o)=>{let s=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`verify-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:i,signature:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signEthereum(e,n,i,a){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let s=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-ethereum`,`request-sign-ethereum`,{chainId:e,signer:n,message:typeof i==`string`?c.Buffer.from(i):i,signType:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signICNSAdr36(e,n,i,a,o){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-icns-adr-36-signatures-v2`,{chainId:e,contractAddress:n,owner:i,username:a,addressChainIds:o}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getOfflineSigner(e,t){return new a.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new a.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new a.CosmJSOfflineSignerOnlyAmino(e,this,n):new a.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-cw20`,`SuggestTokenMsg`,{chainId:e,contractAddress:n,viewingKey:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-cw20`,`get-secret20-viewing-key`,{chainId:e,contractAddress:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`get-pubkey-msg`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`get-tx-encryption-key-msg`,{chainId:e,nonce:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaEncrypt(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`request-encrypt-msg`,{chainId:e,contractCodeHash:n,msg:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaDecrypt(e,n,i){return t(this,void 0,void 0,function*(){return!n||n.length===0?new Uint8Array:new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`request-decrypt-msg`,{chainId:e,cipherText:n,nonce:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new i.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,i,a,s={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-sign-eip-712-cosmos-tx-v0`,{chainId:e,signer:n,eip712:i,signDoc:a,signOptions:(0,o.default)(this.defaultOptions.sign??{},s)}).then(t).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`analytics`,`get-analytics-id`,{})})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-v2`,`change-keyring-name-interactive`,{defaultName:e,editable:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__privilageSignAminoWithdrawRewards(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoWithdrawRewards`,{chainId:e,signer:n,signDoc:i})})}__core__privilageSignAminoDelegate(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoDelegate`,{chainId:e,signer:n,signDoc:i})})}__core__privilageSignAminoExecuteCosmWasm(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoExecuteCosmWasm`,{chainId:e,signer:n,signDoc:i})})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`background-tx-ethereum`,`send-ethereum-tx-to-background`,{chainId:e,tx:n})})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-erc20`,`SuggestERC20TokenMsg`,{chainId:e,contractAddress:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`interaction`,`injected-webpage-closed`,{})})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetTx(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-tx`,{chainId:e,transactions:n,details:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-deploy-account-tx`,{chainId:e,transaction:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()})})})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signPsbt(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbt`,{chainId:e,psbtHex:n,options:i})})}signPsbts(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbts`,{chainId:e,psbtsHexes:n,options:i})})}protectedTryOpenSidePanelIfEnabled(e=!1){return t(this,void 0,void 0,function*(){let t=!1;if(typeof window<`u`&&window.__keplr_content_script===!0&&(t=!0),t&&(yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`side-panel`,`GetSidePanelEnabledMsg`,{})).enabled)try{return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`router-extension/src/router/extension.ts`,`tryOpenSidePanelIfEnabled`,{})}catch(t){if(!e&&t.message&&t.message.includes(`in response to a user gesture`)&&!document.getElementById(`__open_keplr_side_panel__`)){if(yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`interaction`,`ping-content-script-tab-has-opened-side-panel`,{}))return;let e=yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring`,`GetIsLockedMsg`,{}),t=yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`settings`,`GetThemeOptionMsg`,{}),n=`
|
|
23
|
+
'`+a.annotationType_+`' can only be used on properties with a function value.`))}function Zy(e,t,n,r){t.annotationType_,r.value}function Qy(e,t,n,r,i){var a,o;i===void 0&&(i=$.safeDescriptors),Zy(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:wb(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function $y(e,t){return{annotationType_:e,options_:t,make_:eb,extend_:tb,decorate_20223_:nb}}function eb(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!fy(e.target_,t)||!kx(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:kx(n.value)?1:(KS(r,t,ib(e,this,t,n,!1,!1)),2)}function tb(e,t,n,r){var i=ib(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function nb(e,t){var n,r=t.name,i=t.addInitializer;return kx(e)||(e=dw(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function rb(e,t,n,r){t.annotationType_,r.value}function ib(e,t,n,r,i,a){a===void 0&&(a=$.safeDescriptors),rb(e,t,n,r);var o=r.value;return kx(o)||(o=dw(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function ab(e,t){return{annotationType_:e,options_:t,make_:ob,extend_:sb,decorate_20223_:cb}}function ob(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function sb(e,t,n,r){return lb(e,this,t,n),e.defineComputedProperty_(t,by({},this.options_,{get:n.get,set:n.set}),r)}function cb(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=TS(this)[Z],i=by({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new MC(i))}),function(){return this[Z].getObservablePropValue_(r)}}function lb(e,t,n,r){t.annotationType_,r.get}function ub(e,t){return{annotationType_:e,options_:t,make_:db,extend_:fb,decorate_20223_:pb}}function db(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function fb(e,t,n,r){return mb(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??zy,r)}function pb(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=TS(e)[Z],o=new AC(t,n.options_?.enhancer??zy,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Z].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[Z].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function mb(e,t,n,r){t.annotationType_}function hb(e){return{annotationType_:cC,options_:e,make_:gb,extend_:_b,decorate_20223_:vb}}function gb(e,t,n,r){var i;if(n.get)return TC.make_(e,t,n,r);if(n.set){var a=dx(n.set)?n.set:wb(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:$.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(KS(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(ry(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?dw.bound:dw).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?ew.bound:ew).make_(e,t,n,r)}var c=this.options_?.deep===!1?bC.ref:bC;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function _b(e,t,n,r){var i;return n.get?TC.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:$.safeDescriptors?e.isPlainObject_:!0,set:wb(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?bC.ref:bC).extend_(e,t,n,r))}function vb(e,t){X(`'`+this.annotationType_+`' cannot be used as a decorator`)}function yb(e){return e||mC}function bb(e){return e.deep===!0?zy:e.deep===!1?Vy:Sb(e.defaultDecorator)}function xb(e){return e?e.defaultDecorator??hb(e):void 0}function Sb(e){return e?e.options_?.enhancer??zy:zy}function Cb(e,t,n){if(Ny(t))return hC.decorate_20223_(e,t);if(ey(t)){jy(e,t,hC);return}return Rx(e)?e:ny(e)?bC.object(e,t,n):Array.isArray(e)?bC.array(e,t):sy(e)?bC.map(e,t):ly(e)?bC.set(e,t):typeof e==`object`&&e?e:bC.box(e,t)}function wb(e,t,n,r){n===void 0&&(n=!1);function i(){return Tb(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},OC&&(kC.value=e,KS(i,`name`,kC)),i}function Tb(e,t,n,r,i){var a=Eb(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{Db(a)}}function Eb(e,t,n,r){var i=!1,a=0,o=$.trackingDerivation,s=!t||!o;Zb();var c=$.allowStateChanges;s&&(Rb(),c=kb(!0));var l=Bb(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:DC++,parentActionId_:EC};return EC=u.actionId_,u}function Db(e){EC!==e.actionId_&&X(30),EC=e.parentActionId_,e.error_!==void 0&&($.suppressReactionErrors=!0),Ab(e.prevAllowStateChanges_),Vb(e.prevAllowStateReads_),Qb(),e.runAsAction_&&zb(e.prevDerivation_),$.suppressReactionErrors=!1}function Ob(e,t){var n=kb(e);try{return t()}finally{Ab(n)}}function kb(e){var t=$.allowStateChanges;return $.allowStateChanges=e,t}function Ab(e){$.allowStateChanges=e}function jb(e){return e instanceof FC}function Mb(e){switch(e.dependenciesState_){case Q.UP_TO_DATE_:return!1;case Q.NOT_TRACKING_:case Q.STALE_:return!0;case Q.POSSIBLY_STALE_:for(var t=Bb(!0),n=Rb(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(NC(o)){if($.disableErrorBoundaries)o.get();else try{o.get()}catch{return zb(n),Vb(t),!0}if(e.dependenciesState_===Q.STALE_)return zb(n),Vb(t),!0}}return Hb(e),zb(n),Vb(t),!1}}function Nb(){return $.trackingDerivation!==null}function Pb(e,t,n){var r=Bb(!0);Hb(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++$.runId;var i=$.trackingDerivation;$.trackingDerivation=e,$.inBatch++;var a;if($.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new FC(e)}return $.inBatch--,$.trackingDerivation=i,Fb(e),Vb(r),a}function Fb(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Q.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Yb(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,Jb(l,e))}r!==Q.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Ib(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Yb(t[n],e);e.dependenciesState_=Q.NOT_TRACKING_}function Lb(e){var t=Rb();try{return e()}finally{zb(t)}}function Rb(){var e=$.trackingDerivation;return $.trackingDerivation=null,e}function zb(e){$.trackingDerivation=e}function Bb(e){var t=$.allowStateReads;return $.allowStateReads=e,t}function Vb(e){$.allowStateReads=e}function Hb(e){if(e.dependenciesState_!==Q.UP_TO_DATE_){e.dependenciesState_=Q.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Q.UP_TO_DATE_}}function Ub(){if(($.pendingReactions.length||$.inBatch||$.isRunningReactions)&&X(36),zC=!0,RC){var e=Xv();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),$=new LC}}function Wb(){return $}function Gb(){var e=new LC;for(var t in e)IC.indexOf(t)===-1&&($[t]=e[t]);$.allowStateChanges=!$.enforceActions}function Kb(e){return e.observers_&&e.observers_.size>0}function qb(e){return e.observers_}function Jb(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Yb(e,t){e.observers_.delete(t),e.observers_.size===0&&Xb(e)}function Xb(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,$.pendingUnobservations.push(e))}function Zb(){$.inBatch++}function Qb(){if(--$.inBatch===0){ix();for(var e=$.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof MC&&n.suspend_())}$.pendingUnobservations=[]}}function $b(e){var t=$.trackingDerivation;return t===null?(e.observers_.size===0&&$.inBatch>0&&Xb(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&$.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function ex(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Q.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Q.STALE_}))}function tx(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Q.POSSIBLY_STALE_?t.dependenciesState_=Q.STALE_:t.dependenciesState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.UP_TO_DATE_)}))}function nx(e){e.lowestObserverState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Q.UP_TO_DATE_&&(e.dependenciesState_=Q.POSSIBLY_STALE_,e.onBecomeStale_())}))}function rx(e){return $.globalReactionErrorHandlers.push(e),function(){var t=$.globalReactionErrorHandlers.indexOf(e);t>=0&&$.globalReactionErrorHandlers.splice(t,1)}}function ix(){$.inBatch>0||$.isRunningReactions||HC(ax)}function ax(){$.isRunningReactions=!0;for(var e=$.pendingReactions,t=0;e.length>0;){++t===VC&&e.splice(0);for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}$.isRunningReactions=!1}function ox(e){var t=HC;HC=function(n){return e(function(){return t(n)})}}function sx(){return!1}function cx(e){return function(){}}function lx(e){return function(t,n){if($v(t))return wb(t.name||JC,t,e);if($v(n))return wb(t,n,e);if(Ny(n))return(e?ZC:YC).decorate_20223_(t,n);if(ey(n))return jy(t,n,e?ZC:YC);if(ey(t))return Ay(qy(e?KC:WC,{name:t,autoAction:e}))}}function ux(e){return Tb(e.name||JC,!1,e,this,void 0)}function dx(e){return $v(e)&&e.isMobxAction===!0}function fx(e,t){var n;t===void 0&&(t=YS);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new BC(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=px(t),s=!1;a=new BC(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}function px(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:tw}function mx(e,t,n){var r;n===void 0&&(n=YS);var i=n.name??`Reaction`,a=$C(i,n.onError?hx(n.onError,t):t),o=!n.scheduler&&!n.delay,s=px(n),c=!0,l=!1,u,d=n.compareStructural?aC.structural:n.equals||aC.default,f=new BC(i,function(){c||o?p():l||(l=!0,s(p))},n.onError,n.requiresObservable);function p(){if(l=!1,!f.isDisposed){var t=!1,r=u;f.track(function(){var n=Ob(!1,function(){return e(f)});t=c||!d(u,n),u=n}),(c&&n.fireImmediately||!c&&t)&&a(u,r,f),c=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||f.schedule_(),f.getDisposer_(n?.signal)}function hx(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function gx(e,t,n){return vx(nw,e,t,n)}function _x(e,t,n){return vx(rw,e,t,n)}function vx(e,t,n,r){var i=typeof r==`function`?PS(t,n):PS(t),a=$v(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}function yx(e){e.isolateGlobalState===!0&&Ub();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&($.useProxies=t===aw?!0:t===iw?!1:typeof Proxy<`u`),t===`ifavailable`&&($.verifyProxies=!0),n!==void 0){var r=n===aw?aw:n===ow;$.enforceActions=r,$.allowStateChanges=!(r===!0||r===aw)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&($[t]=!!e[t])}),$.allowStateReads=!$.observableRequiresReaction,e.reactionScheduler&&ox(e.reactionScheduler)}function bx(e,t,n,r){var i=tC(t);return LS(function(){var t=TS(e,r)[Z];eC(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function xx(e,t){return Sx(PS(e,t))}function Sx(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Tx(e.observing_).map(Sx)),t}function Cx(e,t){return wx(PS(e,t))}function wx(e){var t={name:e.name_};return Kb(e)&&(t.observers=Array.from(qb(e)).map(wx)),t}function Tx(e){return Array.from(new Set(e))}function Ex(e){return e instanceof cw}function Dx(e){$v(e.cancel)&&e.cancel()}function Ox(e){return e}function kx(e){return e?.isMobXFlow===!0}function Ax(e,t,n){var r;return Tw(e)||xS(e)||jC(e)?r=FS(e):DS(e)&&(r=FS(e,t)),r.dehancer=typeof t==`function`?t:n,function(){r.dehancer=void 0}}function jx(e,t,n){return $v(n)?Nx(e,t,n):Mx(e,t)}function Mx(e,t){return FS(e).intercept_(t)}function Nx(e,t,n){return FS(e,t).intercept_(n)}function Px(e,t){return t===void 0?NC(e):DS(e)===!1||!e[Z].values_.has(t)?!1:NC(PS(e,t))}function Fx(e){return Px(e)}function Ix(e,t){return Px(e,t)}function Lx(e,t){return e?t===void 0?DS(e)||!!e[Z]||iC(e)||UC(e)||NC(e):DS(e)?e[Z].values_.has(t):!1:!1}function Rx(e){return Lx(e)}function zx(e,t){return Lx(e,t)}function Bx(e){if(DS(e))return e[Z].keys_();if(Tw(e)||Ow(e))return Array.from(e.keys());if(xS(e))return e.map(function(e,t){return t});X(5)}function Vx(e){if(DS(e))return Bx(e).map(function(t){return e[t]});if(Tw(e))return Bx(e).map(function(t){return e.get(t)});if(Ow(e))return Array.from(e.values());if(xS(e))return e.slice();X(6)}function Hx(e){if(DS(e))return Bx(e).map(function(t){return[t,e[t]]});if(Tw(e))return Bx(e).map(function(t){return[t,e.get(t)]});if(Ow(e))return Array.from(e.entries());if(xS(e))return e.map(function(e,t){return[t,e]});X(7)}function Ux(e,t,n){if(arguments.length===2&&!Ow(e)){Zb();var r=t;try{for(var i in r)Ux(e,i,r[i])}finally{Qb()}return}DS(e)?e[Z].set_(t,n):Tw(e)?e.set(t,n):Ow(e)?e.add(t):xS(e)?(typeof t!=`number`&&(t=parseInt(t,10)),t<0&&X(`Invalid index: '`+t+`'`),Zb(),t>=e.length&&(e.length=t+1),e[t]=n,Qb()):X(8)}function Wx(e,t){DS(e)?e[Z].delete_(t):Tw(e)||Ow(e)?e.delete(t):xS(e)?(typeof t!=`number`&&(t=parseInt(t,10)),e.splice(t,1)):X(9)}function Gx(e,t){if(DS(e))return e[Z].has_(t);if(Tw(e)||Ow(e))return e.has(t);if(xS(e))return t>=0&&t<e.length;X(10)}function Kx(e,t){if(Gx(e,t)){if(DS(e))return e[Z].get_(t);if(Tw(e))return e.get(t);if(xS(e))return e[t];X(11)}}function qx(e,t,n){if(DS(e))return e[Z].defineProperty_(t,n);X(39)}function Jx(e){if(DS(e))return e[Z].ownKeys_();X(38)}function Yx(e,t,n,r){return $v(n)?Zx(e,t,n,r):Xx(e,t,n)}function Xx(e,t,n){return FS(e).observe_(t,n)}function Zx(e,t,n,r){return FS(e,t).observe_(n,r)}function Qx(e,t,n){return e.set(t,n),n}function $x(e,t){if(typeof e!=`object`||!e||e instanceof Date||!Rx(e))return e;if(jC(e)||NC(e))return $x(e.get(),t);if(t.has(e))return t.get(e);if(xS(e)){var n=Qx(t,e,Array(e.length));return e.forEach(function(e,r){n[r]=$x(e,t)}),n}if(Ow(e)){var r=Qx(t,e,new Set);return e.forEach(function(e){r.add($x(e,t))}),r}if(Tw(e)){var i=Qx(t,e,new Map);return e.forEach(function(e,n){i.set(n,$x(e,t))}),i}else{var a=Qx(t,e,{});return Jx(e).forEach(function(n){qS.propertyIsEnumerable.call(e,n)&&(a[n]=$x(e[n],t))}),a}}function eS(e,t){return $x(e,new Map)}function tS(){}function nS(e,t){t===void 0&&(t=void 0),Zb();try{return e.apply(t)}finally{Qb()}}function rS(e,t,n){return arguments.length===1||t&&typeof t==`object`?aS(e,t):iS(e,t,n||{})}function iS(e,t,n){var r;if(typeof n.timeout==`number`){var i=Error(`WHEN_TIMEOUT`);r=setTimeout(function(){if(!o[Z].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name=`When`;var a=wb(`When-effect`,t),o=fx(function(t){Ob(!1,e)&&(t.dispose(),r&&clearTimeout(r),a())},n);return o}function aS(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(Error(`WHEN_ABORTED`)),{cancel:function(){return null}});var r,i,a=new Promise(function(n,a){var o,s=iS(e,n,by({},t,{onError:a}));r=function(){s(),a(Error(`WHEN_CANCELLED`))},i=function(){s(),a(Error(`WHEN_ABORTED`))},t==null||(o=t.signal)==null||o.addEventListener==null||o.addEventListener(`abort`,i)}).finally(function(){var e;return t==null||(e=t.signal)==null||e.removeEventListener==null?void 0:e.removeEventListener(`abort`,i)});return a.cancel=r,a}function oS(e){return e[Z]}function sS(e,t){var n;return Zv(),e=TS(e,t),(n=e[Z]).proxy_??(n.proxy_=new Proxy(e,fw))}function cS(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function lS(e,t){var n=e.interceptors_||=[];return n.push(t),Qv(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function uS(e,t){var n=Rb();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&X(14),t);i++);return t}finally{zb(n)}}function dS(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function fS(e,t){var n=e.changeListeners_||=[];return n.push(t),Qv(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function pS(e,t){var n=Rb(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);zb(n)}}function mS(e,t,n){return LS(function(){var r=TS(e,n)[Z];t??=My(e),eC(t).forEach(function(e){return r.make_(e,t[e])})}),e}function hS(e,t,n){return ny(e)?bx(e,e,t,n):(LS(function(){var r=TS(e,n)[Z];if(!e[pw]){var i=Object.getPrototypeOf(e),a=new Set([].concat(eC(e),eC(i)));a.delete(`constructor`),a.delete(Z),iy(i,pw,a)}e[pw].forEach(function(e){return r.make_(e,t&&e in t?t[e]:!0)})}),e)}function gS(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Zv(),LS(function(){var i=new vw(n,t,r,!1);ay(i.values_,Z,i);var a=new Proxy(i.values_,_w);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}function _S(e,t){typeof Array.prototype[e]==`function`&&(yw[e]=t(e))}function vS(e){return function(){var t=this[Z];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function yS(e){return function(t,n){var r=this,i=this[Z];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function bS(e){return function(){var t=this,n=this[Z];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}function xS(e){return ty(e)&&bw(e[Z])}function SS(e){return e[Symbol.toStringTag]=`MapIterator`,VS(e)}function CS(e){if(sy(e)||Tw(e))return e;if(Array.isArray(e))return new Map(e);if(ny(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return X(21,e)}function wS(e){return e[Symbol.toStringTag]=`SetIterator`,VS(e)}function TS(e,t){if(fy(e,Z))return e;var n=t?.name??`ObservableObject`;return iy(e,Z,new jw(e,new Map,String(n),xb(t))),e}function ES(e){return kw[e]||(kw[e]={get:function(){return this[Z].getObservablePropValue_(e)},set:function(t){return this[Z].setObservablePropValue_(e,t)}})}function DS(e){return ty(e)?Mw(e[Z]):!1}function OS(e,t,n){var r;(r=e.target_[nC])==null||delete r[n]}function kS(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}function AS(e){return{enumerable:!1,configurable:!0,get:function(){return this[Z].get_(e)},set:function(t){this[Z].set_(e,t)}}}function jS(e){KS(Lw.prototype,``+e,AS(e))}function MS(e){if(e>Fw){for(var t=Fw;t<e+100;t++)jS(t);Fw=e}}function NS(e,t,n){return new Lw(e,t,n)}function PS(e,t){if(typeof e==`object`&&e){if(xS(e))return t!==void 0&&X(23),e[Z].atom_;if(Ow(e))return e.atom_;if(Tw(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||X(25,t,IS(e)),n}if(DS(e)){if(!t)return X(26);var r=e[Z].values_.get(t);return r||X(27,t,IS(e)),r}if(iC(e)||NC(e)||UC(e))return e}else if($v(e)&&UC(e[Z]))return e[Z];X(28)}function FS(e,t){if(e||X(29),t!==void 0)return FS(PS(e,t));if(iC(e)||NC(e)||UC(e)||Tw(e)||Ow(e))return e;if(e[Z])return e[Z];X(24,e)}function IS(e,t){var n;if(t!==void 0)n=PS(e,t);else if(dx(e))return e.name;else n=DS(e)||Tw(e)||Ow(e)?FS(e):PS(e);return n.name_}function LS(e){var t=Rb(),n=kb(!0);Zb();try{return e()}finally{Qb(),Ab(n),zb(t)}}function RS(e,t,n){return n===void 0&&(n=-1),zS(e,t,n)}function zS(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Rw.call(e);if(o!==Rw.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=BS(e),t=BS(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!($v(c)&&c instanceof c&&$v(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!zS(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(fy(t,m)&&zS(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function BS(e){return xS(e)?e.slice():sy(e)||Tw(e)||ly(e)||Ow(e)?Array.from(e.entries()):e}function VS(e){return e[Symbol.iterator]=HS,Object.assign(Object.create(zw),e)}function HS(){return this}var US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,Z,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,Q,PC,FC,IC,LC,RC,zC,$,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw=t((()=>{m(),US={},WS=Object.assign,GS=Object.getOwnPropertyDescriptor,KS=Object.defineProperty,qS=Object.prototype,JS=[],Object.freeze(JS),YS={},Object.freeze(YS),XS=typeof Proxy<`u`,ZS=Object.toString(),QS=function(){},$S=Object.getOwnPropertySymbols!==void 0,eC=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:$S?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,tC=Object.getOwnPropertyDescriptors||function(e){var t={};return eC(e).forEach(function(n){t[n]=GS(e,n)}),t},nC=Symbol(`mobx-stored-annotations`),Z=Symbol(`mobx administration`),rC=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Q.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return $b(this)},t.reportChanged=function(){Zb(),ex(this),Qb()},t.toString=function(){return this.name_},vy(e,[{key:`isBeingObserved`,get:function(){return py(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=my(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return py(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=my(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),rC.isBeingObservedMask_=1,rC.isPendingUnobservationMask_=2,rC.diffValueMask_=4,iC=oy(`Atom`,rC),aC={identity:Fy,structural:Iy,default:Ry,shallow:Ly},oC=`override`,sC=Ay({annotationType_:oC,make_:Wy,extend_:Gy,decorate_20223_:Ky}),cC=`true`,lC=hb(),uC=`observable`,dC=`observable.ref`,fC=`observable.shallow`,pC=`observable.struct`,mC={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0},Object.freeze(mC),hC=ub(uC),gC=ub(dC,{enhancer:Vy}),_C=ub(fC,{enhancer:By}),vC=ub(pC,{enhancer:Hy}),yC=Ay(hC),WS(Cb,yC),bC=WS(Cb,{box:function(e,t){var n=yb(t);return new AC(e,bb(n),n.name,!0,n.equals)},array:function(e,t){var n=yb(t);return($.useProxies===!1||n.proxy===!1?NS:gS)(e,bb(n),n.name)},map:function(e,t){var n=yb(t);return new ww(e,bb(n),n.name)},set:function(e,t){var n=yb(t);return new Dw(e,bb(n),n.name)},object:function(e,t,n){return LS(function(){return bx($.useProxies===!1||n?.proxy===!1?TS({},n):sS({},n),e,t)})},ref:Ay(gC),shallow:Ay(_C),deep:yC,struct:Ay(vC)}),xC=`computed`,SC=`computed.struct`,CC=ab(xC),wC=ab(SC,{equals:aC.structural}),TC=function(e,t){if(Ny(t))return CC.decorate_20223_(e,t);if(ey(t))return jy(e,t,CC);if(ny(e))return Ay(ab(xC,e));var n=ny(t)?t:{};return n.get=e,n.name||=e.name||``,new MC(n)},Object.assign(TC,CC),TC.struct=Ay(wC),EC=0,DC=1,OC=GS(function(){},`name`)?.configurable??!1,kC={value:`action`,configurable:!0,writable:!1,enumerable:!1},AC=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=aC.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}Sy(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==$.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(cS(this)){var t=uS(this,{object:this,type:hw,newValue:e});if(!t)return $.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?$.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),dS(this)&&pS(this,{type:hw,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return lS(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:hw,newValue:this.value_,oldValue:void 0}),fS(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return dy(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(rC),jC=oy(`ObservableValue`,AC),MC=function(){function e(e){this.dependenciesState_=Q.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Q.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new FC(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=PC.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||X(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=wb(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?aC.structural:aC.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){nx(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&X(32,this.name_,this.derivation),$.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Mb(this)&&(this.warnAboutUntrackedRead_(),Zb(),this.value_=this.computeValue_(!1),Qb());else if($b(this),Mb(this)){var e=$.trackingContext;this.keepAlive_&&!e&&($.trackingContext=this),this.trackAndCompute()&&tx(this),$.trackingContext=e}var t=this.value_;if(jb(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&X(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else X(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Q.NOT_TRACKING_,n=this.computeValue_(!0),r=t||jb(e)||jb(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=kb(!1),n;if(e)n=Pb(this,this.derivation,this.scope_);else if($.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new FC(e)}return Ab(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(Ib(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return fx(function(){var a=n.get();if(!r||t){var o=Rb();e({observableKind:`computed`,debugObjectName:n.name_,type:hw,object:n,newValue:a,oldValue:i}),zb(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return dy(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},vy(e,[{key:`isComputing`,get:function(){return py(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=my(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return py(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=my(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return py(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=my(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return py(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=my(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),MC.isComputingMask_=1,MC.isRunningSetterMask_=2,MC.isBeingObservedMask_=4,MC.isPendingUnobservationMask_=8,MC.diffValueMask_=16,NC=oy(`ComputedValue`,MC),(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(Q||={}),(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(PC||={}),FC=function(e){this.cause=void 0,this.cause=e},IC=[`mobxGuid`,`spyListeners`,`enforceActions`,`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`allowStateReads`,`disableErrorBoundaries`,`runId`,`UNCHANGED`,`useProxies`],LC=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},RC=!0,zC=!1,$=function(){var e=Xv();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(RC=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new LC().version&&(RC=!1),RC?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new LC):(setTimeout(function(){zC||X(35)},1),new LC)}(),BC=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Q.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=PC.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,$.pendingReactions.push(this),ix())},t.runReaction_=function(){if(!this.isDisposed){Zb(),this.isScheduled=!1;var e=$.trackingContext;if($.trackingContext=this,Mb(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}$.trackingContext=e,Qb()}},t.track=function(e){if(!this.isDisposed){Zb(),this.isRunning=!0;var t=$.trackingContext;$.trackingContext=this;var n=Pb(this,e,void 0);$.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ib(this),jb(n)&&this.reportExceptionInDerivation_(n.cause),Qb()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if($.disableErrorBoundaries)throw e;``+this,$.suppressReactionErrors,$.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Zb(),Ib(this),Qb()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[Z]=this,`dispose`in Symbol&&typeof Symbol.dispose==`symbol`&&(n[Symbol.dispose]=n),n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},vy(e,[{key:`isDisposed`,get:function(){return py(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=my(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return py(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=my(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return py(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=my(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return py(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=my(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!py(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=my(this.flags_,e.diffValueMask_,t===1)}}])}(),BC.isDisposedMask_=1,BC.isScheduledMask_=2,BC.isTrackPendingMask_=4,BC.isRunningMask_=8,BC.diffValueMask_=16,VC=100,HC=function(e){return e()},UC=oy(`Reaction`,BC),WC=`action`,GC=`action.bound`,KC=`autoAction`,qC=`autoAction.bound`,JC=`<unnamed action>`,YC=qy(WC),XC=qy(GC,{bound:!0}),ZC=qy(KC,{autoAction:!0}),QC=qy(qC,{autoAction:!0,bound:!0}),$C=lx(!1),Object.assign($C,YC),ew=lx(!0),Object.assign(ew,ZC),$C.bound=Ay(XC),ew.bound=Ay(QC),tw=function(e){return e()},nw=`onBO`,rw=`onBUO`,iw=`never`,aw=`always`,ow=`observed`,sw=0,cw=function(e){function t(){var n=e.call(this,`FLOW_CANCELLED`)||this;return Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n.name=`FlowCancellationError`,n}Sy(t,e);var n=t.prototype;return n.toString=function(){return`Error: `+this.message},t}(ky(Error)),lw=$y(`flow`),uw=$y(`flow.bound`,{bound:!0}),dw=Object.assign(function(e,t){if(Ny(t))return lw.decorate_20223_(e,t);if(ey(t))return jy(e,t,lw);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++sw,a=$C(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=$C(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=$C(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if($v(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=$C(r+` - runid: `+i+` - cancel`,function(){try{s&&Dx(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(QS,QS),Dx(t),o(new cw)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},lw),dw.bound=Ay(uw),fw={has:function(e,t){return oS(e).has_(t)},get:function(e,t){return oS(e).get_(t)},set:function(e,t,n){return ey(t)?oS(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return ey(t)?oS(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return oS(e).defineProperty_(t,n)??!0},ownKeys:function(e){return oS(e).ownKeys_()},preventExtensions:function(e){X(13)}},pw=Symbol(`mobx-keys`),mw=`splice`,hw=`update`,gw=1e4,_w={get:function(e,t){var n=e[Z];return t===Z?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):fy(yw,t)?yw[t]:e[t]},set:function(e,t,n){var r=e[Z];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){X(15)}},vw=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new rC(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return lS(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),fS(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&X(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&X(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&MS(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=JS),cS(this)){var a=uS(this,{object:this.proxy_,type:mw,index:e,removedCount:t,added:n});if(!a)return JS;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<gw){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&sx(),i=dS(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:hw,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pS(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&sx(),i=dS(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:mw,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pS(this,a)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&X(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(cS(this)){var i=uS(this,{type:hw,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}(),yw={clear:function(){return this.splice(0)},replace:function(e){var t=this[Z];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[Z];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[Z].spliceWithArray_(e,t,n)},push:function(){var e=this[Z],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[Z].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[Z],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return $.trackingDerivation&&X(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){$.trackingDerivation&&X(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[Z],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}},_S(`at`,vS),_S(`concat`,vS),_S(`flat`,vS),_S(`includes`,vS),_S(`indexOf`,vS),_S(`join`,vS),_S(`lastIndexOf`,vS),_S(`slice`,vS),_S(`toString`,vS),_S(`toLocaleString`,vS),_S(`toSorted`,vS),_S(`toSpliced`,vS),_S(`with`,vS),_S(`every`,yS),_S(`filter`,yS),_S(`find`,yS),_S(`findIndex`,yS),_S(`findLast`,yS),_S(`findLastIndex`,yS),_S(`flatMap`,yS),_S(`forEach`,yS),_S(`map`,yS),_S(`some`,yS),_S(`toReversed`,yS),_S(`reduce`,bS),_S(`reduceRight`,bS),bw=oy(`ObservableArrayAdministration`,vw),xw={},Sw=`add`,Cw=`delete`,ww=function(){function e(e,t,n){var r=this;t===void 0&&(t=zy),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[Z]=xw,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,$v(Map)||X(18),LS(function(){r.keysAtom_=Py(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!$.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new AC(this.has_(e),Vy,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),_x(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(cS(this)){var r=uS(this,{type:n?hw:Sw,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,cS(this)&&!uS(this,{type:Cw,object:this,name:e}))return!1;if(this.has_(e)){var n=sx(),r=dS(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:Cw,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return nS(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&pS(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==$.UNCHANGED){var r=sx(),i=dS(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:hw,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pS(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,nS(function(){var r,i=new AC(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=sx(),i=dS(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:Sw,object:this,name:e,newValue:t}:null;i&&pS(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return SS({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return SS({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=yy(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return Tw(e)&&(e=new Map(e)),nS(function(){ny(e)?uy(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):sy(e)?(cy(e)||X(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&X(20,e)}),this},t.clear=function(){var e=this;nS(function(){Lb(function(){for(var t=yy(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return nS(function(){for(var n=CS(e),r=new Map,i=!1,a=yy(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=yy(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},vy(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),Tw=oy(`ObservableMap`,ww),Ew={},Dw=function(){function e(e,t,n){var r=this;t===void 0&&(t=zy),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[Z]=Ew,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,$v(Set)||X(22),this.enhancer_=function(e,r){return t(e,r,n)},LS(function(){r.atom_=Py(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;nS(function(){Lb(function(){for(var t=yy(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=yy(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,cS(this)){var n=uS(this,{type:Sw,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){nS(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=dS(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:Sw,object:this,newValue:e}:null;i&&pS(this,a)}return this},t.delete=function(e){var t=this;if(cS(this)&&!uS(this,{type:Cw,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=dS(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:Cw,object:this,oldValue:e}:null;return nS(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&pS(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return wS({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return wS({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return ly(e)&&!Ow(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return ly(e)&&!Ow(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return ly(e)&&!Ow(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return ly(e)&&!Ow(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Ow(e)&&(e=new Set(e)),nS(function(){Array.isArray(e)||ly(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&X(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},vy(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Ow=oy(`ObservableSet`,Dw),kw=Object.create(null),Aw=`remove`,jw=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=lC),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new rC(`ObservableObject.keys`),this.isPlainObject_=ny(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof MC)return n.set(t),!0;if(cS(this)){var r=uS(this,{type:hw,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==$.UNCHANGED){var i=dS(this),a=i?{type:hw,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pS(this,a)}return!0},t.get_=function(e){return $.trackingDerivation&&!fy(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),fy(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!$.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new AC(e in this.target_,Vy,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[nC])!=null&&n[e])return;X(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==qS;){var i=GS(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}OS(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&OS(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Zb();var r=this.delete_(e);if(!r)return r;if(cS(this)){var i=uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=by({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else KS(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Qb()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{Zb();var i=this.delete_(e);if(!i)return i;if(cS(this)){var a=uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:t});if(!a)return null;t=a.newValue}var o=ES(e),s={configurable:$.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else KS(this.target_,e,s);var c=new AC(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{Qb()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Zb();var r=this.delete_(e);if(!r)return r;if(cS(this)&&!uS(this,{object:this.proxy_||this.target_,name:e,type:Sw,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=ES(e),a={configurable:$.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else KS(this.target_,e,a);this.values_.set(e,new MC(t)),this.notifyPropertyAddition_(e,void 0)}finally{Qb()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!fy(this.target_,e))return!0;if(cS(this)&&!uS(this,{object:this.proxy_||this.target_,name:e,type:Aw}))return null;try{var n;Zb();var r=dS(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=GS(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof AC&&(o=a.value_),ex(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Aw,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&pS(this,s)}}finally{Qb()}return!0},t.observe_=function(e,t){return fS(this,e)},t.intercept_=function(e){return lS(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=dS(this),i=!1;if(r||i){var a=r||i?{type:Sw,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&pS(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),eC(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}(),Mw=oy(`ObservableObjectAdministration`,jw),Nw=AS(0),Pw=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Fw=0,Iw=function(){},kS(Iw,Array.prototype),Lw=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,LS(function(){var e=new vw(r,n,i,!0);e.proxy_=a,ay(a,Z,e),t&&t.length&&a.spliceWithArray(0,0,t),Pw&&Object.defineProperty(a,"0",Nw)}),a}Sy(t,e);var n=t.prototype;return n.concat=function(){this[Z].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return xS(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return VS({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},vy(t,[{key:`length`,get:function(){return this[Z].getArrayLength_()},set:function(e){this[Z].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Iw),Object.entries(yw).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&iy(Lw.prototype,t,n)}),MS(1e3),Rw=qS.toString,zw=Xv().Iterator?.prototype||{},[`Symbol`,`Map`,`Set`].forEach(function(e){Xv()[e]===void 0&&X(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:cx,extras:{getDebugName:IS},$mobx:Z})})),Vw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DebounceActionTimer=void 0;var t=(Bw(),n(Yv));e.DebounceActionTimer=class{constructor(e,n){this.debounceMs=e,this.handler=n,this.requests=[],this.startTime=0,this.tick=()=>{let e=this.debounceMs<=0;if(this.debounceMs>0&&Date.now()-this.startTime>=this.debounceMs&&(e=!0),e){let e=this.requests.slice(),t=this.handler(e);typeof t==`object`&&`then`in t?Promise.resolve(t).then(t=>{this.handleResponses(e,t)}):this.handleResponses(e,t),this.requests=[]}else this.nextTick(this.tick)},this.handleResponses=(e,n)=>{(0,t.runInAction)(()=>{for(let t=0;t<e.length;t++){let r=e[t],i=n[t];r.action(i)}});for(let t of e)t.resolver()}}call(e,t){return new Promise(n=>{let r=this.requests.length===0;this.requests.push({args:e,action:t,resolver:n}),r&&this.startTimer()})}startTimer(){this.startTime=Date.now(),this.nextTick(this.tick)}nextTick(e){if(this.debounceMs<=0){Promise.resolve().then(e);return}typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,this.debounceMs)}}})),Hw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Jv(),e),n(Vw(),e)})),Uw=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Debouncer=void 0,e.Debouncer=class{static promise(e){let n;return(...r)=>t(this,void 0,void 0,function*(){if(n)return n;try{return n=e.apply(this,r),yield n}finally{n=void 0}})}}})),Ww=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Uw(),e)})),Gw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unescapeHTML=e.escapeHTML=void 0;function t(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}e.escapeHTML=t;function n(e){return e.replace(/\\u003c/g,`<`).replace(/\\u003e/g,`>`).replace(/\\u0026/g,`&`)}e.unescapeHTML=n})),Kw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sortedJsonByKeyStringify=e.sortObjectByKey=void 0;function t(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n=Object.keys(e).sort(),r={};return n.forEach(n=>{r[n]=t(e[n])}),r}e.sortObjectByKey=t;function n(e){return JSON.stringify(t(e))}e.sortedJsonByKeyStringify=n})),qw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Kw(),e)})),Jw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateICNSName=e.parseICNSName=void 0;function t(e){let t=e.split(`.`);if(t.length===2&&t[0].length>0&&t[1].length>0)return[t[0],t[1]]}e.parseICNSName=t;function n(e,n){let r=t(e);return r?r[1]===n:!1}e.validateICNSName=n})),Yw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Mv(),e),n(qv(),e),n(Hw(),e),n(Ww(),e),n(Gw(),e),n(qw(),e),n(Jw(),e)})),Xw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeSignDoc=e.encodeSecp256k1Signature=e.encodeSecp256k1Pubkey=void 0;var t=A(),n=Yw();function r(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw Error(`Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03`);return{type:`tendermint/PubKeySecp256k1`,value:t.Buffer.from(e).toString(`base64`)}}e.encodeSecp256k1Pubkey=r;function i(e,n){if(n.length!==64)throw Error(`Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.`);return{pub_key:r(e),signature:t.Buffer.from(n).toString(`base64`)}}e.encodeSecp256k1Signature=i;function a(e){return t.Buffer.from((0,n.escapeHTML)((0,n.sortedJsonByKeyStringify)(e)))}e.serializeSignDoc=a})),Zw=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Xw(),e)})),Qw=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.verifyADR36Amino=e.verifyADR36AminoSignDoc=e.makeADR36AminoSignDoc=e.checkAndValidateADR36AminoSignDoc=void 0;var t=Zw(),n=k_(),r=A(),i=Kv();function a(e,t){if(!(e&&e.msgs&&Array.isArray(e.msgs)&&e.msgs.length===1&&e.msgs[0].type===`sign/MsgSignData`))return!1;if(e.chain_id!==``)throw Error(`Chain id should be empty string for ADR-36 signing`);if(e.memo!==``)throw Error(`Memo should be empty string for ADR-36 signing`);if(e.account_number!==`0`)throw Error(`Account number should be "0" for ADR-36 signing`);if(e.sequence!==`0`)throw Error(`Sequence should be "0" for ADR-36 signing`);if(e.fee.gas!==`0`)throw Error(`Gas should be "0" for ADR-36 signing`);if(e.fee.amount.length!==0)throw Error(`Fee amount should be empty array for ADR-36 signing`);let i=e.msgs[0];if(i.type!==`sign/MsgSignData`)throw Error(`Invalid type of ADR-36 sign msg: ${i.type}`);if(!i.value)throw Error(`Empty value in the msg`);let a=i.value.signer;if(!a)throw Error(`Empty signer in the ADR-36 msg`);n.Bech32Address.validate(a,t);let o=i.value.data;if(!o)throw Error(`Empty data in the ADR-36 msg`);let s=r.Buffer.from(o,`base64`);if(s.toString(`base64`)!==o)throw Error(`Data is not encoded by base64`);if(s.length===0)throw Error(`Empty data in the ADR-36 msg`);return!0}e.checkAndValidateADR36AminoSignDoc=a;function o(e,t){return t=r.Buffer.from(t).toString(`base64`),{chain_id:``,account_number:`0`,sequence:`0`,fee:{gas:`0`,amount:[]},msgs:[{type:`sign/MsgSignData`,value:{signer:e,data:t}}],memo:``}}e.makeADR36AminoSignDoc=o;function s(e,r,o,s,c=`secp256k1`){if(!a(r,e))throw Error(`Invalid sign doc for ADR-36`);let l=new i.PubKeySecp256k1(o);if((c===`ethsecp256k1`?new n.Bech32Address(l.getEthAddress()).toBech32(e):new n.Bech32Address(l.getCosmosAddress()).toBech32(e))!==r.msgs[0].value.signer)throw Error(`Unmatched signer`);let u=(0,t.serializeSignDoc)(r);return l.verifyDigest32(c===`ethsecp256k1`?i.Hash.keccak256(u):i.Hash.sha256(u),s)}e.verifyADR36AminoSignDoc=s;function c(e,t,n,r,i,a=`secp256k1`){return s(e,o(t,n),r,i,a)}e.verifyADR36Amino=c})),$w=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Qw(),e)})),eT=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignDocWrapper=void 0;var t=Cv(),n=Sv(),r=$w();e.SignDocWrapper=class e{constructor(e){this.signDoc=e,`msgs`in e?this.mode=`amino`:this.mode=`direct`,this.mode===`amino`?this.isADR36SignDoc=(0,r.checkAndValidateADR36AminoSignDoc)(this.aminoSignDoc):this.isADR36SignDoc=!1}static fromAminoSignDoc(t){return new e(t)}static fromDirectSignDoc(t){return new e(t)}static fromDirectSignDocBytes(t){return new e(n.SignDoc.decode(t))}clone(){return new e(this.signDoc)}get protoSignDoc(){if(this.mode===`amino`)throw Error(`Sign doc is encoded as Amino Json`);if(`msgs`in this.signDoc)throw Error(`Unexpected error`);return this._protoSignDoc||=new t.ProtoSignDocDecoder(this.signDoc),this._protoSignDoc}get aminoSignDoc(){if(this.mode===`direct`)throw Error(`Sign doc is encoded as Protobuf`);if(!(`msgs`in this.signDoc))throw Error(`Unexpected error`);return this.signDoc}get chainId(){return this.mode===`direct`?this.protoSignDoc.chainId:this.aminoSignDoc.chain_id}get memo(){return this.mode===`direct`?this.protoSignDoc.txBody.memo:this.aminoSignDoc.memo}get fees(){if(this.mode===`direct`){let e=[];for(let t of this.protoSignDoc.authInfo.fee?.amount??[]){if(t.denom==null||t.amount==null)throw Error(`Invalid fee`);e.push({denom:t.denom,amount:t.amount})}return e}return this.aminoSignDoc.fee.amount}get payer(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.payer:this.aminoSignDoc.fee.payer}get granter(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.granter:this.aminoSignDoc.fee.granter}get gas(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.gasLimit?parseInt(this.protoSignDoc.authInfo.fee.gasLimit):0:parseInt(this.aminoSignDoc.fee.gas)}}})),tT=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(yv(),e),n(Cv(),e),n(eT(),e)})),nT=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(sg(),e),n(k_(),e),n(M_(),e),n(P_(),e),n(tT(),e),n($w(),e),n(Zw(),e)})),rT=Uh(),iT=nT(),aT=e=>e.apis?.rpc?.[0]?.address??``,oT=e=>e.apis?.rest?.[0]?.address??``,sT=e=>e.explorers?.[0]?.url??``,cT={fullSemver:/v?(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,partialSemver:/v?(\d+\.\d+)(?=(?:\.\d+)?(?=-[\w.-]+|$))/,basicVersion:/v?(\d+)(?=(?:\.\d+)?(?:\.\d+)?(?=-[\w.-]+|$))/,tagged:/@v(\d+\.\d+)(?:\.x)?(?=-[\w.-]+|$)/,embedded:/\/v(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,simple:/v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/,complexEmbedded:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-\d+[\w.-]*)/,taggedVersion:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?=-[\w.-]+|$)/};function lT(e){let t=null;return cT.fullSemver.test(e)?t=e.match(cT.fullSemver)?.[1]:cT.partialSemver.test(e)?t=e.match(cT.partialSemver)?.[1]:cT.basicVersion.test(e)?t=e.match(cT.basicVersion)?.[1]:cT.taggedVersion.test(e)?t=e.match(cT.taggedVersion)?.[1]:cT.complexEmbedded.test(e)?t=e.match(cT.complexEmbedded)?.[1]:cT.simple.test(e)?t=e.match(cT.simple)?.[1]:cT.tagged.test(e)?t=e.match(cT.tagged)?.[1]:cT.embedded.test(e)&&(t=e.match(cT.embedded)?.[1]),t?uT(t):null}function uT(e){let t=e.split(`.`);for(;t.length<3;)t.push(`0`);return t.join(`.`)}var dT=(e,t,n={getRpcEndpoint:aT,getRestEndpoint:oT,getExplorer:sT})=>{n.getRestEndpoint||=oT,n.getRpcEndpoint||=aT,n.getExplorer||=sT;let r=[];if(e.codebase?.sdk?.type===`cosmos`||e.codebase?.cosmos_sdk_version){let t;if(t=e.codebase?.sdk?.type===`cosmos`&&e.codebase.sdk.version?lT(e.codebase.sdk.version):e.codebase?.cosmos_sdk_version?lT(e.codebase.cosmos_sdk_version):`0.40.0`,gc.default.satisfies(t,`>=0.40`)&&r.push(`stargate`),gc.default.satisfies(t,`>=0.43`)&&r.push(`no-legacy-stdTx`),r.push(`ibc-transfer`),gc.default.satisfies(t,`>=0.45`)&&r.push(`ibc-go`),e.codebase?.cosmwasm?.enabled??e.codebase?.cosmwasm_enabled??!1){r.push(`cosmwasm`);let t=lT(e.codebase?.cosmwasm?.version??e.codebase?.cosmwasm_version??`0.24.0`);gc.default.satisfies(t,`>=0.24.0`)&&r.push(`wasmd_0.24+`)}}let i=t.find(t=>t.chain_name===e.chain_name)?.assets||[],a=e.fees?.fee_tokens.map(e=>e.denom)||[],o=e.fees?.fee_tokens?.reduce((e,t)=>(e[t.denom]={low:t.low_gas_price??.01,average:t.average_gas_price??.025,high:t.high_gas_price??.04},e),{}),s=e.staking?.staking_tokens.map(e=>e.denom)||[],c=i.map(e=>({coinDenom:e.symbol,coinMinimalDenom:e.base,coinDecimals:e.denom_units.filter(t=>t.denom===e.display)[0]?.exponent,coinGeckoId:e.coingecko_id||void 0,coinImageUrl:e.logo_URIs?.svg??e.logo_URIs?.png})),l=c.find(e=>s.includes(e.coinDenom))??c[0],u=c.filter(e=>a.includes(e.coinMinimalDenom)).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}}),d=c.filter(e=>l.coinDenom===e.coinDenom).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}});return{rpc:n.getRpcEndpoint(e),rest:n.getRestEndpoint(e),chainId:e.chain_id,chainName:e.pretty_name,bip44:{coinType:e.slip44},bech32Config:iT.Bech32Address.defaultBech32Config(e.bech32_prefix),currencies:c,stakeCurrency:l||c[0],feeCurrencies:u.length===0?d:u,features:r}},fT=i(J()),pT=class{static addItem(e,t,n){let r={value:t,expiry:new Date().getTime()+n},i=localStorage.getItem(e),a=i?JSON.parse(i):[];a.push(r),localStorage.setItem(e,JSON.stringify(a))}static getItems(e){let t=localStorage.getItem(e);if(!t)return[];let n=JSON.parse(t),r=new Date,i=[];for(let e of n)r.getTime()<=e.expiry&&i.push(e.value);return localStorage.setItem(e,JSON.stringify(i.map(e=>({value:e,expiry:n.find(t=>t.value===e).expiry})))),i}static removeItem(e,t){let n=localStorage.getItem(e);if(!n)return;let r=JSON.parse(n);r=r.filter(e=>e.value!==t),localStorage.setItem(e,JSON.stringify(r))}},mT=class{client;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}constructor(e){this.client=e}async enable(e){await this.client.enable(e)}async suggestToken({chainId:e,tokens:t,type:n}){if(n===`cw20`)for(let{contractAddress:n,viewingKey:r}of t)await this.client.suggestToken(e,n,r)}async getSimpleAccount(e){let{address:t,username:n}=await this.getAccount(e);return{namespace:`cosmos`,chainId:e,address:t,username:n}}async getAccount(e){let t=await this.client.getKey(e);return{username:t.name,address:t.bech32Address,algo:t.algo,pubkey:t.pubKey,isNanoLedger:t.isNanoLedger}}getOfflineSigner(e,t){switch(t){case`amino`:return this.getOfflineSignerAmino(e);case`direct`:return this.getOfflineSignerDirect(e);default:return this.getOfflineSignerAmino(e)}}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:async(t,n)=>this.signAmino(e,t,n,this.defaultSignOptions)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:async(t,n)=>{let r=await this.signDirect(e,t,n,this.defaultSignOptions);return{...r,signed:{...r.signed,accountNumber:BigInt(r.signed.accountNumber.toString())}}}}}async addChain(e){let t=pT.getItems(`cosmos-kit@2:keplr/supported-chain`);if(t&&t.length>0&&t.includes(e.name))return;let n=dT(e.chain,e.assetList?[e.assetList]:[]);e.preferredEndpoints?.rest?.[0]&&(n.rest=e.preferredEndpoints?.rest?.[0]),e.preferredEndpoints?.rpc?.[0]&&(n.rpc=e.preferredEndpoints?.rpc?.[0]);try{await this.client.experimentalSuggestChain(n),pT.addItem(`cosmos-kit@2:keplr/supported-chain`,e.name,1e3*60)}catch(e){throw e}}async signAmino(e,t,n,r){return await this.client.signAmino(e,t,n,r||this.defaultSignOptions)}async signArbitrary(e,t,n){return await this.client.signArbitrary(e,t,n)}async signDirect(e,t,n,r){let i=await this.client.signDirect(e,t,{...n,accountNumber:fT.default.fromString(n.accountNumber.toString())},r||this.defaultSignOptions);return{...i,signed:{...i.signed,accountNumber:BigInt(i.signed.accountNumber.toString())}}}async sendTx(e,t,n){return await this.client.sendTx(e,t,n)}},hT=[new class extends Xp{constructor(e,t){super(e,Xm),this.preferredEndpoints=t}async initClient(){this.initingClient();try{let e=await rT.Keplr.getKeplr();this.initClientDone(e?new mT(e):void 0)}catch(e){this.initClientError(e)}}}({name:`keplr-extension`,prettyName:`Keplr`,logo:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB+ASURBVHgB7Z1NbFxVlsfPKzsfTUJc6baZjkTcFTELJLA6ySzQJJGwe9FSmAXxzAJ604QN9GJomgVsoEUi0RtY8NWLhg2kN8NqKlkMGbHARgpILDoYGSQ2KIWNFIQNKZskhNiu1/f/PpxyuapcH/e+e+595yc9XrnKuFKv3jn3fN+AhK4pla8Uq3SjuI0GiiEFxYCCUvpaSGH0OCAaqgVhMX0+CAM8Ltb/nSD6OSi2e68w+p2w7e/wJaiqz1ht/zthNWzyO2EQVtb/Shh8VfeS+pvx362p/xdPrNJqpUg7q5XJvVu8l9BIQMI6EOxrtFIiKhxUgqwEm34FIVY3YCkV8lTABa5AOYQVKBUokUIYQMF8VaCgAoWxmwZnRFHcIpcKoFi+XNpO2w6qG6KkbpJfq5tECXxQcnelFbojUAognKHY8vhUHdODNFj5ZnJvhXKG9woAq/pVWj2oHuK4X33kcRF0oTnriuEDdUwvTo5Mk+d4qQBGyt9iRR9XDx9UH/GgCLzQB9PqOKfciumFyTtmyDO8UQDD5YXxIBb4E+KnCyZQcaAKRQqh9qovysBpBZCY90+qhycoNvEFIRNiZVA7PUDbpl2OHTipANLVXpn5J8W8F2yjlMHbAzRw2kVF4JQCgOCr0/PqGCdBYIaLisAJBfDL8pXSKq2+RSL4ggO4pAhYK4DEx8eK/ycSBMdwQRGwVQAj5757MqyFp8THF1wmDRaqrMHbxBB2CkDMfcFHoAiUNTDBzRooECOw6q/S2ickwi94BmpT1MJ2SQWynydGsLAAZNUX8gQna8C6BSCrvpA3Emvgk+HyN9aD29YsAInwC0IkgK/sosHTtlqUrSgAmPxrtFoOpXxXEKy6BJkrgJHylYMhrU1Jek8QbpGkCyezbjLKNAbwi3OLj4TK9xHhF4SNIC4QUpB5XCAzBTB87rvng1r4NgmC0IaBl7NMFWbiAkD4qVY7RYIgdMqpxcmR02QY4wpAabOXSSL9gtALxpWAUQUwUl58S/k2J0kQhJ5AQ9HC5PCjZAhjMQCY/SL8gtAfkKGR2Io2ghEFID6/IOgjVC60qcCgdhdAhF8QjKE9JqBVAcQ9/LVXSBAEI4SF4OR3Dw6fIU1oUwBxhR+KfIR+2H9bgYa24Qho9LaB6Lk96jGO9PWU9PXGx41/rx/mr9c2Pbe0UlNHWPdzGD1X//vL6rnl5Pn49fhxs78ndEdA4SFdFYNaFEBc2782JfP4WwNBhJDiuFM9TgV9tE7gUyHPA1AEc9fXIsUwn5y/Tp7DIYqiLdVBGjyko3eg7zsu3lBz7RMR/ljIx4YG1Xkgeoxz/DOruSvO8NnSaqQYcIZCwDl9Lu8owZ3ZRYMT/XYRDlKfJC29JcoZEOpjw9vpnqEBulcJOQQ9Tyt4FuC6gqPD2zY8D9diNlEGHy2uKIshVg55Ap2012LZe4r6oK87Nk9BP9yEuCGPqPMxdYiw8wJK4YJSBlAIUAYfqnM+WHtqcfKXPctgz3dxPMZrzdvOPvjkD4/uFIF3lFQhnL98UymFm5GV4Cl9xQN6vqtHyouXfPP7U6E/vm/7JrNTcBtYBO/M/eSrMsBW5hPUAz0pAJ+KfUTo80eqDM5f/smjgGJvrkDXCiCZ4HuJHAf+/MOjO+h3SvjFvM8ncBPeVUrgpS+u+2AV9OQKdH3nu276Y5V/+u7bZLUXNvDO3I3IKnA8eNi1K9CVAhgpf3sypOAtchARfKEToAD+ePEHhy2C7lyBjhWAq9V+qLR77fDtIvhCV8AicNQ1qO6mwQOdFgh1XKKmhP9514QfK/7UxF4RfqFrEBj+x29/Ht1DjlFMCoQ6oiMLwLXAH6ryzty3R0pwBS2gDPnEhapT1oAKCB7oJCDYkYRg9SdHePyunfT+RFGEX9AG7iXXrIFkr80t2dICcGX1Rz4fq76Y+4JJ3r18k/48e9UVa2BCZQWm2/3ClsukC6s/An3i6wtZ8MC+7XT2WDG65xxgS9ltawG4sPrD3z97bEiKeYRMQVzg9x8vu9CF2NYKaKvGuK/+xyNtLMIvZA/iArj3YBFwJgjDE21fb/UC99Ufwv935fMLgm0eUZYAYgNMaVsX0NICWKOVcWIKzP6/Hr6dBIEDKDRLh5cwpHi1drPlzlwtLQCuNf+jkeklaT6OLCWDQGejsV3xANCvk2h54yDRRjArEa5cOkoNWR0I1ZAj7h0+22+mrrDMDmB82MLkyKEWr21mpPztQWxVTMwQ4ecDhPvC4k36fGktGuo5m8zt0w2UwlgyiSmdysRVKeDzT0xV1yckM6NpMLCF3VJ4Mpo6xowXxnaL8Fviw2TUFibsQNiXM+qjx/vgvXG8lDwHRZDOb+BkeuPePHPf7XTiwhJxIwkGTm96vtkvczT/n7n7Nhfrsp0Fqxl65bMW+G6B0GGmw0Pq4JKbf3b2Gr355Y/EiYCCysLk8IHNzzfA0fwfTUoxBbNA6NEFl664roGU3GN3/YxFQRhcAW41As02FNlkPynhHydmwO8XzIDgFVYrV4W+HqTicMAqgMWIjj5bIEV9+L3viROJbG9QAM1spgeJEfgixe/XD4Qdvuq//t939OIX170aow1L5omLVyMBtBWVxz3L0GXdJNubXIDh8gIbZ09Mf72kq/3f1MHVpzcBLAEIY9YxAoapwU1FQRuuiBL+cWKEBP30gNUd1Wrpap8n4QeIa6CfH+csQbryNV4Fa8WrtHqw/olGlThOTIC2tunD+UBq5uNgXKqaCalb8JyK0GeZpz+a1C8woq0CuJ+YwExzOkW94Odni6zOeEO5P4jQZ2mW87Jka+P1PzUqgIPEAIZa0wlE8DsjHfGVVZqO1/1c2LDIrysAdP+pE4t8GzbsEDpHBL97YiWQnWvEyAooFsuXS+kP6wpglVZLxADx/TsHUWb4tSL4vYHrh+AoNgQxDaey5e20bd3Sr3cBxokBEvnvDMysR54768i2jzxx8YdMLAEuC1utrsy/XgH8miyDtMlx5hNWbIOVHoKfx3SeSbAbkOmYAFzboW32i9rCIFiX9fp/jXX///g+HheII/Xm/jyfwhJvwPXFjD+T2QEscA8xiG8VwrCpC2A9AyDBv+bAzBdz3zxQrIgJmKwT4DBDUNmNpfRxpACK5StY/a1aAAj+SepvI3NJpBorv5j72QA34KUvzLXy4h5nYOUWS7HMxwpgsKE80AZHhsX3rwd9+BNTVyS6b4E3ku5IU3BwA67RSgnnSAGEFFj3/8X8j4EvinJV+KOy6tsDmQFTrgCPUeKFaNGPFEBgefqPmP8xmLyDVf8NZtNk8gjiAaZcAQ5uQEjhLRdAWQAlsoiY/zA7b9BvpqoS4WeESVfAthsQhPGiX4j/U7PqAhzfl9/VP07v/aDM/qsk8AMFVyawbfHWCoUhnFML4Fdkkbya/3PRGOkrmZSiCr1halSa7Xt+gwVAFlOATNIimZNG+cXk548JKwBFQTaVQEBBCedU8kpkiXuHBihvoIxXovzuYMoKuIdBc5B1C+BIzsx/pPhM+ZWCOUzM+bdpAaT7fgzGVYD25pfnxf9PW0+lsMdN0C2IugCd7qrtex/VgIWddMPa6g/zPw/+fxrsE+F3G93B2qFkM1RbVJXsF1ZpsESWwI6wvjOXjJ+SYJ/7nDcwM+CoxRqYbTRQtLr8+u7/p5V9Ivx+AAtO93dpc0oQWgAKNvsAOO3sqhsIPzr5JNLvF9gwVSc2s2BIBQ4qE6Bo6xb1NQUIX/HZWV4tvHG/RWfm5oeLNzntZsMKuAGP3/Uz0oXtRXAwbQrIGgRAfAwAQvhR2ssNjFp7YWx3R7+L+QNzMnykKbrHhqWBQFtuIiTQigLw0fznKvxgTxfKVjZjbQ3SubqzOWNDdmJhqAWw9k37Zv5zFn7QzcaYogDao9sKuNPi9bb2zvs9SgEi4Pcs826+bq63DGZtz2dLa6QTW+nwIAyLBVvDQHxxAVyJ9sPX7JQ81Gf0A4KkOrFlcaEl2Jqq7+aG5MpcMkXWhVRfNzeZD9+NSXQH7MYsLoYWYwBuWwCuVfgNSRBQKzq/d5vXu2BjGIjrN5hrwt/L9RYl0J7ZJb2ZABvXOwjX9lr5ll33MWH2u1Te28v1lkBge3S7fXZkwlIMwOUMAPr5s9pXXhe9+PQ+l2nrQHelpC2ZsKQA3FxdMMnHxZHdvUye2SOBwLYsr+hWAHZkwsq7uhhlRg24q5N8erMAJBXYDs0hAKsKIPNSYNcsAJh7/824ym8rejHnJQaQLTaut1oWUAiUfTuwSzcXar8R8Xe5rbcXC2BMYgBt0e0C2AkCBkXJAmwBgn6uD/ToxQKQNGB7ljQvCLbcYgkCtgFBv3ccb4vtx5cXJZAde/KkAFxgLtoc0v3x3f1YW0dlz8bMyI0F4MKqkvr9PtDP3EWpBWiNiby9DdnI/B1dSAFi5fdlkGc/QiypwGyxERy3oAB4WwDw+V0s9mnF0T4tAEkHNsfEEB8bi6NYAHXA73/Ro227+t15Bt+VWAHN2WNAMdooBy5kPRR0D+MVxSfTHzw8uoP65fi+/v+Gj4x6kCGB7GdeCTjEdC8QmP6up/wa0RHF16FEfMRE2s5CKjD7QiCOFoBvpj+A+a8jqmx7H3uumChmy0UMgCO+mf7gsbt2ki6evvs2EjbiS5FU5p+Cm++EbZ99M/1xjR/Q6LvDAhAr4BamNrXJRR0AN55jPs67F84e0x/WESvgFj4VSFmIAfBJA77ooen/jBJUEysJLIDHNO6J5zI+TU3ObSEQAn8+FfwAtPCaXKn/MrZLXAEyt629jS7Z3LoACPz5tHU3/P4z9+0h0+A9fMiB94O4AI6D1d+nwB8EEn5/FkEkmL94rzwrAZ+qI3NZCvxnjwJ/WQp/yv7kPfOoBCD8ptzYXLgAtmMA2NoZqT8fQJXe1MReK+kjvOf76r0fHtVXb+AC93ItZe2R3DV8+zDkA1YUgn2PW47K49/x+uHd0ar40hc/0tKKXxmVZhwd9ktkcmXDwe+HBeAyWHEv/vbn1oW/HvxbpiaKubAGfJuSlCsL4I0v3Qz8YaVFDv4P6uC6YQdcAlgDqENAevX85Z+0755jG8Q8fJuTmBsFgJXflS294j78QTq+b3t0din3DgF5YWxXdOB647pjUxU8XnI87XrEwxmJmSsAWxqUo++Pa4GgKAp47lF+NAZC4LEvqwyUF47UXYESgFWA89fqPHd9LTpcqcY8vs+sIrbxvefCAsBNl5Xvj9UbZjpSOmnTyJ2J6YjHo8k5jyO3Y4VA9MC+zSvpfKIQYCXMJ2coCQQW8RivoXDLphXhYxVkLhSAztUfNwFKQVNBz7tQ62J/F/51qixAvWL4f+VqzBpy86C0fJyP6L0C0F31h9x73nLf3KhXFkdp46psSgEc3+fnHgneL1m+NfwIdvB1kxTvFQDSUYLQDzD/fXXvvFYAMP196/cXssdX8x94rgBk9Rf6A8Fen2M+3iqALFN/gr/4vi+Ctwrgo0U/Ov4Eu/i+L4K3CsDVun+BD+hy9H0EmpcKIC03FYR+4NRxaQovFcB5TwZ+CPZAdWceCr68rAQ0Oe8PmQVYGM1q/qUUOBvmkx6BueSclgLrVPw+dv41wzsFYNr8R2ahXXYh7g/Y3AyEx/uT5/CaKIuNNAo1fm5sBsI5q0nOz+RkIxTvFIDt6P9ycpN2UoAEJQBlgANKAt1yo8nZR3BNUKuPbr/Pl9aix6mwcwKmf14UdOZ3Gr5skxf3/GV3cv+4Fjg+pI3/ZlgRY8lAEEShXVUI6RCW80mXniv7MNha/W0oQu+WGh+KfyAo9a7G/mSzT4wF4z6KG2b6m1/+SH9Th4sbr+Rp9QdeKQAIjI+TaeeTbcxw4AbFRGBuigCC/9zsNec3XMmL75/ilar7bGmNfAcC9pupK9EqywUUXR1+73vnhT9vqz/w6tPmpfUXq+2zarV94uJVqxYP/h1PXPwh2mLdh30W87b6A7EAHAYr7sRU1cr4bbznhLJEfOm45LD625h3mPknTme56QbCn4edaRpBfODEhWyVwFzynr7MWkBtBofV38b9640FYEqxuECqBLK4gXwTfoCa/7wWZnnzqfPe+w+BfOTjH8g0j3y87JXwI5vydA59/5TMFcC8oZX6c+n+i5QgUnGmePGL6951WXIS/lzEAEzh+rZTukCtgAlrCKa/Dzsr14Nhn5w6/iQG0AfS/38LE4IKv983XhjbTXnHQhZAv5bLW/pvK7bqWOyWdy/f9G66MqL+3AJ/Nq6xFxZAHtN/W6HTCuBUdaiDvAf+6slcASwbENY8pwBboasvwsfpymePFYkjtoKAmTp3SwbuJdn8ozk6qvR8m67M0fRPsVBOXS0EFDgf3ZEMQHN0jMjyaXMV7qZ/1goAsu9FHYAPjSgm+CyZuNMPPpn/XE3/lFykAU18yHmJATQFllE/GRKfhJ+z6Z+Si0IgMdezpZ/6CF/Sqxir5kLUPxcWgATssqUfIf7IAwsAfv/rh28nF8hNHYDk7bPjwz6i+D6kV1HtJyPYW2PlyizLpr2Z0c+q4np5Nfx+TFZ2AVuWsVgAOaCXm8t1/98Vvz/FlrVVCCnMvA5AKveyZbaH6iuXlbRLfn+KneB4WM28EhDozttj+y2hNb1cb1ctAIz3Qr7fNb/fhgsQohKQLKC7IxA76Qit6cWXd9UCwMrvYtDP1vW2cqXmRQFkSi/9F587aAG4FPRrJFdBQN2Ve9hcU2jNZzmIATx+106nW3xtVbNaiQHoDgLu2UZCG3oJMLkUqMWq7/p0H2tZgIDCJcoY3ebO2JBogHb0cr1dqdhExP+vjkX8m2ElCBgEFWvREp0fWCq9tqab6+1KvwaEHxF/12NANjMu1iRnVuNkEKR+RAm0pxuf3oXVPxV+H753m/GWQo0KVgaCiBuQLd34mNwDgD4JP7BlAQRh+BViAJYUgN4PfadYAG3pphiIcwDQN+EHNq+3FzEA8ICj+d+s6Kb4iqsL4KPwA5u7WmEmYIUsMKv5Q987NEhCa1wPAvoq/MBiELBqTWpwQ8LX1FXHj0AgOsDyvkloKzAX4MSFzjK+s8zagH0WfihbWzEXDAW1umxC8x0d1velHhEF0BIoXBenMfks/MDmzIUAzUAhhRWyhO4PDwtA8AffhR/YrAGooR3YVhYA6P7wUABSD+AHYyqm47vwA9tzFwsDtGZNAXxoYNcZTts9C70BRX722FAulLnNFOAqrVYKN2inNQWQBgJ18vhdPyPBXdDVB+HPQ4t3vG+DvRhAUcl+oTq51+rWYLqDdmk2QHAP9PO73tXXDbYD1hUl+5GNZasWAJjwgWTrZ7eA0sYkn7x9b5YVQLTwW3eyTERBYQGIFeAGcaR/SMVudlDe+NxuCrCCc6QAbKYCde1j34hYAfyBkp6a2JvLKk74/zYtgLDeAlCpwK/IIiYuhFgBvIG/n5dgXzNs+/8YBoJzpABstQSnmMqFihXAj3hs91Duv5vzl/WnwLuhUKtFdeGpBVAhi7wz9xOZABbAY5IWZENq8otlZqYGphs2WABoCiCLmPSHYGrKxiH2eWFsV26Ke7YC97rtvowC1SkA5QTMkGXOXzZjBcDkfO1wfnLL3ECUf2qiKAVadZiyeLuhlrQARApghbZVyDImLwqGhYgrkD2o6strlL8dts1/sJsGo0U/UgBJNaC3bgCAKyA3YjakuX1U9cmuTRvhYP4rqpWkArjeIauQZUy5AQCuwN/v2xPdnIIZcI0R3ZdAX2s4mP+KdZd/XRpUJuBTsgwujsnpKAhAnVFKQIKC+kkj/LC0ZNVvDqxc2+m/mNr6aKh1SQgpsB4IxAUyrSHhBrwwJvUBuoBFBctKIvxbAwuXx8j1wmYLILTYEFTPO3M3yDSYGfC6ZAb6ot7cd3VH3qx58YvrxITp9MF6VGwbrcyskv0gGZqDECgx7UNCCexRrsAfL151bidc2yC6/8zdu8TU7wIsbFxmMg7SaiV9vOEbHC4vXCHMCbBMOhEmCzCQ4ZGPl7uam59XoDTh44up3z2YyMxkYG11cXJkb/pD4zc5TQzAhcrqYt2bzJ6T7EBrUoUMt0mEv3uyvJ87YEOsr/Hb/ICY8FKG/hJu6n/89udSLNQAVvyL6rpA+CWt1ztPXPyBGLFBxhudfuuZgJRUa2Z54/1lbBeNDQ1EyievLgGCe1CEf1CH+Pj9w8n3T5iu/2HDN1wsXymqAMElYhAHAPuTOvKs8/b4whCxzSIjwQUoWkTzfxcFR0XwdXH4ve9ZKQDl/2/4cjdIVlISzMYKwIV788vshRCKB/4uzF+fTV+s9mjSgYmP43FZ9bWCRYTz6g+a5f3OqWOcmICL+JBalWwE6fYnNe1wReAW+LLtGJTaQ6M76D/27RCBNwRcyJf45P1TzjU+sUkBBBROh8TrpkCaDq6ALaLxYokiQKWia64BVnpkO8TEz44TF6z21jUFsr35uSaMlBcvhRSWiBEwTzFUggMw69DS+YZyTz5jtpNuCqyXB9QKD6HHNlsi9NkBq5Xb6o+pXwuTdxxofL5p6Z/yWs6p2+VJYsQbX/4Y3cwcfHIIF1JkOFJlAMsAygD9DLb+TceGt9O/Dw9GZ8nX2wHNPgxNf6UBCtNNn2725HB5YVydpogZMGXfn9jLumgHbgIUAQadwg/UbSHgGuy/bSBa1e9RKUuY9rLC8wDfN0x/jtuwKwvgkLIAZjY/3wKlBD5Rp4PEDFupwX5ILQNsBImbY1k9Xk4shfrNISHc6eeCQO+JhL0QPQelN6oEXwSdJ8yFv6n5D9p1/yBiyE4BzEcXellF593p608nER0lqabzESh3BKo5Cn/C6VYvtJSgVRp8hSyPCWsFVlR08QkCB1DqyzUYDAZobbrVay0VAIqCVDrwDDHlXRVsgdaVVl7BFlj5f6/uQR5TfpoTBMHb30zuq7R6va0NrXyHs8QYKAG4A9LKK2QNhB8tvpyFHwyEK6fbvd5WASxOjkwTkxbhVsD0QvBFlICQFbjXJqausDb7wVarP+gkinaamDOfRGDfZa6NBfdBmhfCzzjgt85Wqz/oKKekUoKoCRgnB8DEGtkUVDDBc7PXooI0F8Dqv3Bi+NEtf4864JflyyWVFbhEjhA38ciUH0EPMPkRcOZu8tczSKsHtjL/QUcSgj+kMgKvkiPAPPu3977nWZIpOAMCfbiHcC+5JPyd+P7rv0sdwm1YSKfAGoBbgLp9QegU+PrI77vg69eDqj+V95/QrgCAigX8SZ1eJgeJh3zcLrPthLa4PvtBKYBHFybveLvz3+8SlwKCzYACeHh0h1gEwgZ8GPrSrua/9f/TJUlAEI1CTrkCjaSuwfF9O6ImHCF/xFvR3Vhv5XadTgN/9fR057vsCjSC7joMzoBVIO5BPsAqjwq+/1HCv2xpfoN2arXTi//1L6eoS3pe+lx3BZoBq+Do8HZRBh7ipdAn9GL63/p/e8QXV6AVqTJIpxCJm+AWMO8h9BjM4qPQ11FVpv+hbk3/lL7uap9cga2AEkBf/xEMCBWFwI56gYc/78sE5w54anFy5BXqkb7v4l+UF19RJgir+YFZAGWASsMjiWLAIUohGyDsEHIcny+t0YXFm87l63UQhOGrC/95x5+oD/q+Y5MCIcQD2E0PyhoEFMcSZQAXIlUK6UQgoTsg1LNKyOeTUWo4xz9L5yf8/l107VBl8kBfQ3u0LFm+xwN0sD+Z6YfjzmjOXzzcE2c8l6cpvkvJTEQMc0GdPc4Q6q+v16IZiensRKE53Vb7tf9bmhgpf3swpOATEvoiHQIaDwiNh4SmA0LT10H6Oyn1A0Ub/14/tBLE+mGm9Y/T328cfLqUCLwIdv+0mvDb29/SiFICJ5USeIsEQTBFX0G/RrTanUkNMvsBIoLgJCj20Sj8wEjYWqUHT6nT8yQIgh56rPTbCmN5q7ymBwVBO4aEHxhNXI/877dvh0HwCAmC0BMq139G5fpPkiGM5p6Sf7jEBAShB5JCn5NkEOPJZxW0OEWiBAShO5TZ32+VXydkVrsqgUFB6BCDPn8jmRav56l5SBB6IaTw0e+6GOnVL5l3r6BiUJ3KIQUlEgQhpaqyZhO6Kvw6JfMCdHxA1DGjnpkEQUBp7wx6+rMWfmClAwVNDCu07ZBLew0IggkQ6d9F17Q09vT0/mSZJC6A4KB0Egp5Am282kt7u4XFBAu0E6/RwJTEBYScMK1M/kdtrfr1sBphI6lCwXNYrPr1sJthJdaA4ClsVv162A6xw2wBdXpeFIHgOOxW/XrYzqHCbIEkXXiGBMFBEOHfTVcPcBV+4MQY28QtOKWsAeksFFyApbnfDKfmWIsiEJgzTbG5P02O4OQge1EEAiNQwntG3YtnXRL8FKd3skgUwThJsFDIGCU4MyHROeXjv9LvbH6beLOVTdJkhKrC+0UZCCYIKKgQ1c65uto3w8u9rJI9CsbVwwfJsx2MhUzByo4GnXPKzJ+20axjmlxsZjdcXhinWBHcT/EWZtJ3IDSjqiRimkL6QD2eUeb9jMvmfSfkcjfLZCuzEkEpBPRr9YVDIYhiyA8Q6koYhDNBGHyqrMXKGq3MVB1I2+lGtrOto1S+VLxKu+E+FJXJV8JRC2hI3SQlipVDehaYEvvp0WQdCHilENISBFw9r4S+NrOLrlV8X9W7QRRAD0BRVGlncTC2IggKo6AUg7rpoBzWFYS6AX+VPk6USCNK0QRtFUrj33SMaix4rVGfD69v/J2AqsnzEYkQV+OXYgFP/l8l2GF1hdaqRbpRFcHunn8Cz9Ea2bs7Ut4AAAAASUVORK5CYII=`,mode:`extension`,mobileDisabled:()=>!(typeof document<`u`&&document.readyState===`complete`&&window.keplr&&window.keplr.mode===`mobile-web`),rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[`keplr_keystorechange`],supportedChains:`agoric.akash.archway.axelar.bostrom.celestia.certik.comdex.cosmoshub.cryptoorgchain.dymension.emoney.evmos.gravitybridge.injective.irisnet.ixo.juno.kava.kujira.noble.nois.osmosis.persistence.quicksilver.regen.secretnetwork.sentinel.sifchain.sommelier.stargaze.starname.stride.terra2.tgrade.umee`.split(`.`),downloads:[{device:`desktop`,browser:`chrome`,link:`https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap?hl=en`},{device:`desktop`,browser:`firefox`,link:`https://addons.mozilla.org/en-US/firefox/addon/keplr/`},{link:`https://www.keplr.app/download`}]},Ym)],gT={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},_T=class extends Yp{WCClient;clientMutable={state:U.Init};options;constructor(e,t,n){super(e,t),this.WCClient=n}setClientNotExist(){this.setState(U.Error),this.setMessage(this.clientMutable.message)}},vT=class extends we{constructor(e){super(),this.opts=e,this.protocol=`wc`,this.version=2}},yT=class extends we{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},bT=class{constructor(e,t){this.logger=e,this.core=t}},xT=class extends we{constructor(e,t){super(),this.relayer=e,this.logger=t}},ST=class extends we{constructor(e){super()}},CT=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},wT=class extends we{constructor(e,t){super(),this.relayer=e,this.logger=t}},TT=class extends we{constructor(e,t){super(),this.core=e,this.logger=t}},ET=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},DT=class{constructor(e,t){this.projectId=e,this.logger=t}},OT=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},kT=class{constructor(e){this.opts=e,this.protocol=`wc`,this.version=2}},AT=class{constructor(e){this.client=e}};function jT(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function MT(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function NT(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var PT=`[object RegExp]`,FT=`[object String]`,IT=`[object Number]`,LT=`[object Boolean]`,RT=`[object Symbol]`,zT=`[object Date]`,BT=`[object Map]`,VT=`[object Set]`,HT=`[object Array]`,UT=`[object Function]`,WT=`[object ArrayBuffer]`,GT=`[object Object]`,KT=`[object Error]`,qT=`[object DataView]`,JT=`[object Uint8Array]`,YT=`[object Uint8ClampedArray]`,XT=`[object Uint16Array]`,ZT=`[object Uint32Array]`,QT=`[object BigUint64Array]`,$T=`[object Int8Array]`,eE=`[object Int16Array]`,tE=`[object Int32Array]`,nE=`[object BigInt64Array]`,rE=`[object Float32Array]`,iE=`[object Float64Array]`;function aE(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}_();function oE(e,t,n){return sE(e,t,void 0,void 0,void 0,void 0,n)}function sE(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return cE(e,t,a,o)}return cE(e,t,a,o)}function cE(e,t,n,r){if(Object.is(e,t))return!0;let i=NT(e),a=NT(t);if(i===`[object Arguments]`&&(i=GT),a===`[object Arguments]`&&(a=GT),i!==a)return!1;switch(i){case FT:return e.toString()===t.toString();case IT:return jT(e.valueOf(),t.valueOf());case LT:case zT:case RT:return Object.is(e.valueOf(),t.valueOf());case PT:return e.source===t.source&&e.flags===t.flags;case UT:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case BT:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!sE(a,t.get(i),i,e,t,n,r))return!1;return!0;case VT:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>sE(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case HT:case JT:case YT:case XT:case ZT:case QT:case $T:case eE:case tE:case nE:case rE:case iE:if(v!==void 0&&v.isBuffer(e)!==v.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!sE(e[i],t[i],i,e,t,n,r))return!1;return!0;case WT:return e.byteLength===t.byteLength?cE(new Uint8Array(e),new Uint8Array(t),n,r):!1;case qT:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:cE(new Uint8Array(e),new Uint8Array(t),n,r);case KT:return e.name===t.name&&e.message===t.message;case GT:{if(!(cE(e.constructor,t.constructor,n,r)||aE(e)&&aE(t)))return!1;let i=[...Object.keys(e),...MT(e)],a=[...Object.keys(t),...MT(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!sE(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function lE(){}function uE(e,t){return oE(e,t,lE)}s();var dE=`core`,fE=`wc@2:${dE}:`,pE={name:dE,logger:`error`},mE={database:`:memory:`},hE=`crypto`,gE=`client_ed25519_seed`,_E=B.ONE_DAY,vE=`keychain`,yE=`messages`,bE=B.SIX_HOURS,xE=`publisher`,SE=`relayer`,CE={message:`relayer_message`,message_ack:`relayer_message_ack`,connect:`relayer_connect`,disconnect:`relayer_disconnect`,error:`relayer_error`,connection_stalled:`relayer_connection_stalled`,transport_closed:`relayer_transport_closed`,publish:`relayer_publish`},wE={payload:`payload`,connect:`connect`,disconnect:`disconnect`,error:`error`},TE=.1,EE=`2.23.9`,DE={link_mode:`link_mode`,relay:`relay`},OE={inbound:`inbound`,outbound:`outbound`},kE=`WALLETCONNECT_CLIENT_ID`,AE={created:`subscription_created`,deleted:`subscription_deleted`,expired:`subscription_expired`,disabled:`subscription_disabled`,sync:`subscription_sync`,resubscribed:`subscription_resubscribed`};B.THIRTY_DAYS;var jE=`subscription`;B.FIVE_SECONDS*1e3;var ME=`pairing`;B.THIRTY_DAYS;var NE={wc_pairingDelete:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:B.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:B.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:B.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:B.ONE_DAY,prompt:!1,tag:0},res:{ttl:B.ONE_DAY,prompt:!1,tag:0}}},PE={create:`pairing_create`,expire:`pairing_expire`,delete:`pairing_delete`,ping:`pairing_ping`},FE={created:`history_created`,updated:`history_updated`,deleted:`history_deleted`,sync:`history_sync`},IE=`history`,LE=`expirer`,RE={created:`expirer_created`,deleted:`expirer_deleted`,expired:`expirer_expired`,sync:`expirer_sync`};B.ONE_DAY;var zE=`verify-api`,BE=`https://verify.walletconnect.com`,VE=`https://verify.walletconnect.org`,HE=`${VE}/v3`,UE=[BE,VE],WE=`echo`,GE=`https://echo.walletconnect.com`,KE={pairing_started:`pairing_started`,pairing_uri_validation_success:`pairing_uri_validation_success`,pairing_uri_not_expired:`pairing_uri_not_expired`,store_new_pairing:`store_new_pairing`,subscribing_pairing_topic:`subscribing_pairing_topic`,subscribe_pairing_topic_success:`subscribe_pairing_topic_success`,existing_pairing:`existing_pairing`,pairing_not_expired:`pairing_not_expired`,emit_inactive_pairing:`emit_inactive_pairing`,emit_session_proposal:`emit_session_proposal`,subscribing_to_pairing_topic:`subscribing_to_pairing_topic`},qE={no_wss_connection:`no_wss_connection`,no_internet_connection:`no_internet_connection`,malformed_pairing_uri:`malformed_pairing_uri`,active_pairing_already_exists:`active_pairing_already_exists`,subscribe_pairing_topic_failure:`subscribe_pairing_topic_failure`,pairing_expired:`pairing_expired`,proposal_expired:`proposal_expired`,proposal_listener_not_found:`proposal_listener_not_found`},JE={session_approve_started:`session_approve_started`,proposal_not_expired:`proposal_not_expired`,session_namespaces_validation_success:`session_namespaces_validation_success`,create_session_topic:`create_session_topic`,subscribing_session_topic:`subscribing_session_topic`,subscribe_session_topic_success:`subscribe_session_topic_success`,publishing_session_approve:`publishing_session_approve`,session_approve_publish_success:`session_approve_publish_success`,store_session:`store_session`,publishing_session_settle:`publishing_session_settle`,session_settle_publish_success:`session_settle_publish_success`,session_request_response_started:`session_request_response_started`,session_request_response_validation_success:`session_request_response_validation_success`,session_request_response_publish_started:`session_request_response_publish_started`},YE={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,proposal_expired:`proposal_expired`,subscribe_session_topic_failure:`subscribe_session_topic_failure`,session_approve_publish_failure:`session_approve_publish_failure`,session_settle_publish_failure:`session_settle_publish_failure`,session_approve_namespace_validation_failure:`session_approve_namespace_validation_failure`,proposal_not_found:`proposal_not_found`,session_request_response_validation_failure:`session_request_response_validation_failure`,session_request_response_publish_failure:`session_request_response_publish_failure`},XE={authenticated_session_approve_started:`authenticated_session_approve_started`,authenticated_session_not_expired:`authenticated_session_not_expired`,chains_caip2_compliant:`chains_caip2_compliant`,chains_evm_compliant:`chains_evm_compliant`,create_authenticated_session_topic:`create_authenticated_session_topic`,cacaos_verified:`cacaos_verified`,store_authenticated_session:`store_authenticated_session`,subscribing_authenticated_session_topic:`subscribing_authenticated_session_topic`,subscribe_authenticated_session_topic_success:`subscribe_authenticated_session_topic_success`,publishing_authenticated_session_approve:`publishing_authenticated_session_approve`,authenticated_session_approve_publish_success:`authenticated_session_approve_publish_success`},ZE={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,missing_session_authenticate_request:`missing_session_authenticate_request`,session_authenticate_request_expired:`session_authenticate_request_expired`,chains_caip2_compliant_failure:`chains_caip2_compliant_failure`,chains_evm_compliant_failure:`chains_evm_compliant_failure`,invalid_cacao:`invalid_cacao`,subscribe_authenticated_session_topic_failure:`subscribe_authenticated_session_topic_failure`,authenticated_session_approve_publish_failure:`authenticated_session_approve_publish_failure`,authenticated_session_pending_request_not_found:`authenticated_session_pending_request_not_found`},QE=.1,$E=`event-client`,eD=`https://pulse.walletconnect.org/batch`,tD=class{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=vE,this.version=`0.3`,this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();typeof e<`u`&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>`u`){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Fu(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?Iu(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},nD=class{constructor(e,t,n){this.core=e,this.logger=t,this.name=hE,this.randomSessionIdentifier=tf(),this.initialized=!1,this.init=async()=>{this.initialized||=(await this.keychain.init(),!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let e=se(ae(await this.getClientSeed()).publicKey);return this.clientId=e,e},this.generateKeyPair=()=>{this.isInitialized();let e=ef();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=ae(await this.getClientSeed()),n=this.randomSessionIdentifier;return await ne(n,e,_E,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();let r=nf(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();let n=t||rf(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();let r=_f(n),i=Te(t);if(yf(r))return ff(i,n?.encoding);if(vf(r)){let t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}let a=this.getSymKey(e),{type:o,senderPublicKey:s}=r;return uf({type:o,symKey:a,message:i,senderPublicKey:s,encoding:n?.encoding})},this.decode=async(e,t,n)=>{this.isInitialized();let r=gf(t,n);if(yf(r))return Ee(pf(t,n?.encoding));if(vf(r)){let t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}try{return Ee(df({symKey:this.getSymKey(e),encoded:t,encoding:n?.encoding}))}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=qd)=>sf(hf({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=qd)=>{let n=hf({encoded:e,encoding:t});return n.senderPublicKey?tt(n.senderPublicKey,Kd):void 0},this.core=e,this.logger=su(t,this.name),this.keychain=n||new tD(this.core,this.logger)}get context(){return au(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e=``;try{e=this.keychain.get(gE)}catch{e=tf(),await this.keychain.set(gE,e)}return $e(e,`base16`)}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},rD=class extends bT{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=yE,this.version=`0.3`,this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{if(!this.initialized){this.logger.trace(`Initialized`);try{let e=await this.getRelayerMessages();typeof e<`u`&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();typeof t<`u`&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t,n)=>{this.isInitialized();let r=af(t),i=this.messages.get(e);if(typeof i>`u`&&(i={}),typeof i[r]<`u`)return r;if(i[r]=t,this.messages.set(e,i),n===OE.inbound){let n=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,{...n,[r]:t})}return await this.persist(),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>`u`&&(t={}),t},this.getWithoutAck=e=>{this.isInitialized();let t={};for(let n of e){let e=this.messagesWithoutClientAck.get(n)||{};t[n]=Object.values(e)}return t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[af(t)]<`u`),this.ack=async(e,t)=>{this.isInitialized();let n=this.messagesWithoutClientAck.get(e);if(typeof n>`u`)return;let r=af(t);delete n[r],Object.keys(n).length===0?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,n),await this.persist()},this.del=async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()},this.logger=su(e,this.name),this.core=t}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name+`_withoutClientAck`}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Fu(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,Fu(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?Iu(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<`u`?Iu(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},iD=class extends xT{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new ot.EventEmitter,this.name=xE,this.queue=new Map,this.publishTimeout=(0,B.toMiliseconds)(B.ONE_MINUTE),this.initialPublishTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(e,t,n)=>{this.logger.debug(`Publishing Payload`),this.logger.trace({type:`method`,method:`publish`,params:{topic:e,message:t,opts:n}});let r=n?.ttl||bE,i=n?.prompt||!1,a=n?.tag||0,o=n?.id||pe().toString(),s=Cf(Sf().protocol),c={id:o,method:n?.publishMethod||s.publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:a,attestation:n?.attestation,...n?.tvf}},l=`Failed to publish payload, please try again. id:${o} tag:${a}`;try{Wf(c.params?.prompt)&&delete c.params?.prompt,Wf(c.params?.tag)&&delete c.params?.tag;let r=new Promise(async e=>{let t=({id:n})=>{c.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(CE.publish,t),e())};this.relayer.events.on(CE.publish,t);let r=Ru(new Promise((e,t)=>{this.rpcPublish(c,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${o} tag:${a}`);try{await r,this.events.removeListener(CE.publish,t)}catch(e){this.queue.set(o,{request:c,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:o,topic:e,message:t,opts:n}}),await Ru(r,this.publishTimeout,l)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(o)}},this.publishCustom=async e=>{this.logger.debug(`Publishing custom payload`),this.logger.trace({type:`method`,method:`publishCustom`,params:e});let{payload:t,opts:n={}}=e,{attestation:r,tvf:i,publishMethod:a,prompt:o,tag:s,ttl:c=B.FIVE_MINUTES}=n,l=n.id||pe().toString(),u=Cf(Sf().protocol),d=a||u.publish,f={id:l,method:d,params:{...t,ttl:c,prompt:o,tag:s,attestation:r,...i}},p=`Failed to publish custom payload, please try again. id:${l} tag:${s}`;try{Wf(f.params?.prompt)&&delete f.params?.prompt,Wf(f.params?.tag)&&delete f.params?.tag;let e=new Promise(async e=>{let t=({id:n})=>{f.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(CE.publish,t),e())};this.relayer.events.on(CE.publish,t);let r=Ru(new Promise((e,t)=>{this.rpcPublish(f,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${d} id:${l} tag:${s}`);try{await r,this.events.removeListener(CE.publish,t)}catch(e){this.queue.set(l,{request:f,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:l,payload:t,opts:n}}),await Ru(e,this.publishTimeout,p)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(l)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=su(t,this.name),this.registerEventListeners()}get context(){return au(this.logger)}async rpcPublish(e,t){this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`message`,direction:`outgoing`,request:e});let n=await this.relayer.request(e);return this.relayer.events.emit(CE.publish,{...e,...t}),this.logger.debug(`Successfully Published Payload`),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{let n=e.attempt+1;this.queue.set(t,{...e,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${e.request.params?.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(ue.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(CE.connection_stalled);return}this.checkQueue()}),this.relayer.on(CE.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}},aD=class{constructor(){this.map=new Map,this.set=(e,t)=>{let n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>`u`){this.map.delete(e);return}if(!this.map.has(e))return;let n=this.get(e);if(!this.exists(e,t))return;let r=n.filter(e=>e!==t);if(!r.length){this.map.delete(e);return}this.map.set(e,r)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},oD=class extends wT{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new aD,this.events=new ot.EventEmitter,this.name=jE,this.version=`0.3`,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.subscribeTimeout=(0,B.toMiliseconds)(B.ONE_MINUTE),this.initialSubscribeTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace(`Initialized`),this.registerEventListeners(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug(`Subscribing Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}});try{let n=Sf(t),r={topic:e,relay:n,transportType:t?.transportType};t?.internal?.skipSubscribe||this.pending.set(e,r);let i=await this.rpcSubscribe(e,n,t);return typeof i==`string`&&(this.onSubscribe(i,r),this.logger.debug(`Successfully Subscribed Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug(`Failed to Subscribe Topic`),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{this.isInitialized(),typeof t?.id<`u`?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=e=>new Promise(t=>{t(this.topicMap.topics.includes(e))}),this.isKnownTopic=e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))}),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(ue.pulse,async()=>{await this.checkPending()}),this.events.on(AE.created,async e=>{let t=AE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()}),this.events.on(AE.deleted,async e=>{let t=AE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()})},this.relayer=e,this.logger=su(t,this.name),this.clientId=``}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+`//`+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let n=this.topicMap.get(e);await Promise.all(n.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,n){this.logger.debug(`Unsubscribing Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}});try{let r=_u(`USER_DISCONNECTED`,`${this.name}, ${e}`);await this.onUnsubscribe(e,t,r);let i=Sf(n);await this.restartToComplete({topic:e,id:t,relay:i}),await this.rpcUnsubscribe(e,t,i),this.logger.debug(`Successfully Unsubscribed Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug(`Failed to Unsubscribe Topic`),this.logger.error(e),e}}async rpcSubscribe(e,t,n){let r=await this.getSubscriptionId(e);if(n?.internal?.skipSubscribe)return r;(!n||n?.transportType===DE.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});let i={method:Cf(t.protocol).subscribe,params:{topic:e}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:i});let a=n?.internal?.throwOnFailedPublish;try{if(n?.transportType===DE.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,B.toMiliseconds)(B.ONE_SECOND)),r;let t=await Ru(new Promise(async t=>{let n=r=>{r.topic===e&&(this.events.removeListener(AE.created,n),t(r.id))};this.events.on(AE.created,n);try{let r=await Ru(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(AE.created,n),t(r)}catch{}}),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!t&&a)throw Error(`Subscribing to ${e} failed, please try again`);return t?r:null}catch(e){if(this.logger.debug(`Outgoing Relay Subscribe Payload stalled`),this.relayer.events.emit(CE.connection_stalled),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;let t=e[0].relay,n={method:Cf(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});try{return await Ru(new Promise((e,t)=>{this.relayer.request(n).then(e).catch(e=>{this.logger.warn(e),t(e)})}),this.subscribeTimeout,`rpcBatchSubscribe failed, please try again`),!0}catch{return this.relayer.events.emit(CE.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;let t=e[0].relay,n={method:Cf(t.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});let r;try{r=await await Ru(new Promise((e,t)=>{this.relayer.request(n).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,`rpcBatchFetchMessages failed, please try again`)}catch{this.relayer.events.emit(CE.connection_stalled)}return r}rpcUnsubscribe(e,t,n){let r={method:Cf(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,{...t,id:e}),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,{...e}),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug(`Setting subscription`),this.logger.trace({type:`method`,method:`setSubscription`,id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,{...t}),this.topicMap.set(t.topic,e),this.events.emit(AE.created,t)}getSubscription(e){this.logger.debug(`Getting subscription`),this.logger.trace({type:`method`,method:`getSubscription`,id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug(`Deleting subscription`),this.logger.trace({type:`method`,method:`deleteSubscription`,id:e,reason:t});let n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(AE.deleted,{...n,reason:t})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(AE.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<t;n++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(AE.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>`u`||!e.length)return;if(this.subscriptions.size&&!e.every(e=>e.topic===this.subscriptions.get(e.id)?.topic)){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(e=>{this.pending.set(e.topic,e)});return}this.onBatchSubscribe(await Promise.all(e.map(async e=>({...e,id:await this.getSubscriptionId(e.topic)}))))}}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await rd((0,B.toMiliseconds)(B.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||=await this.relayer.core.crypto.getClientId(),this.clientId}async getSubscriptionId(e){return af(e+await this.getClientId())}},sD=class extends ST{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.events=new ot.EventEmitter,this.name=SE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=(0,B.toMiliseconds)(B.THIRTY_SECONDS+B.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=(0,B.toMiliseconds)(B.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=(0,B.toMiliseconds)(B.ONE_SECOND*2),this.stalledRestartMaxInterval=(0,B.toMiliseconds)(B.THIRTY_SECONDS),this.request=async e=>{this.logger.debug(`Publishing Request Payload`);let t=e.id||pe().toString();await this.toEstablishConnection();try{this.logger.trace({id:t,method:e.method,topic:e.params?.topic},`relayer.request - publishing...`);let n=`${t}:${e.params?.tag||``}`;this.requestsInFlight.push(n);let r=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==n),r}catch(e){throw this.logger.debug(`Failed to Publish Request: ${t}`),e}},this.resetPingTimeout=()=>{bu()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{try{this.logger.debug({},`pingTimeout: Connection stalled, terminating...`),this.provider?.connection?.socket?.terminate?.()}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},`Relayer connected 🛜`),this.startPingTimeout(),this.stalledRestartBackoff=0,this.events.emit(CE.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},`Relayer disconnected 🛑`),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(CE.error,e),this.logger.fatal(`Fatal socket error received, closing transport`),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(e=>this.logger.warn(e))},this.registerProviderListeners=()=>{this.provider.on(wE.payload,this.onPayloadHandler),this.provider.on(wE.connect,this.onConnectHandler),this.provider.on(wE.disconnect,this.onDisconnectHandler),this.provider.on(wE.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=Wp({logger:e.logger??`error`,name:this.name}),this.messages=new rD(this.logger,e.core),this.subscriber=new oD(this,this.logger),this.publisher=new iD(this,this.logger),this.projectId=e.projectId,this.relayUrl=e.relayUrl||`wss://relay.walletconnect.org`,Su()?this.packageName=Eu():Cu()&&(this.bundleId=Eu()),this.provider={}}async init(){this.logger.trace(`Initialized`),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return au(this.logger)}get connected(){return this.provider?.connection?.socket?.readyState===1}get connecting(){return this.provider?.connection?.socket?.readyState===0||this.connectPromise!==void 0}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:DE.relay},OE.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){this.isInitialized(),(!t?.transportType||t?.transportType===`relay`)&&await this.toEstablishConnection();let n=t?.internal?.throwOnFailedPublish??!0,r=this.subscriber.topicMap.get(e)?.[0]||``,i,a=t=>{t.topic===e&&(this.subscriber.off(AE.created,a),i())};return await Promise.all([new Promise(e=>{i=e,this.subscriber.on(AE.created,a)}),new Promise((i,a)=>{this.subscriber.subscribe(e,{internal:{throwOnFailedPublish:n},...t}).then(e=>{r=e||r,i()}).catch(e=>{n?a(e):i()})})]),r}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ru(this.provider.disconnect(),2e3,`provider.disconnect()`).catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info(`Starting WS connection skipped because the client has no topics to work with.`);return}if(this.connectPromise?(this.logger.debug({},`Waiting for existing connection attempt to resolve...`),await this.connectPromise,this.logger.debug({},`Existing connection attempt resolved`)):(this.connectPromise=this.connect(e).finally(()=>{this.connectPromise=void 0}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},`Restarting transport...`),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await Tp())throw Error(`No internet connection detected. Please restart your network and try again.`)}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace(`Batch message events is empty. Ignoring...`);return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(let e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,`Error while processing batch message event: `+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:n}=e;if(!t.sessionExists){let e={topic:n,expiry:Uu(B.FIVE_MINUTES),relay:{protocol:`irn`},active:!1};await this.core.pairing.pairings.set(n,e)}this.events.emit(CE.message,e),await this.recordMessageEvent(e,OE.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.transportExplicitlyClosed=!1;let t=1;try{for(;t<6;){this.connectionAttemptInProgress=!0;try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to connect`))};this.provider.once(wE.disconnect,n),Ru(this.provider.connect(),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).then(()=>e()).catch(t).finally(()=>{this.provider.off(wE.disconnect,n),clearTimeout(this.reconnectTimeout)})}),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to subscribe`))};this.provider.once(wE.disconnect,n),this.subscriber.start().then(e).catch(t).finally(()=>{this.provider.off(wE.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1}catch(e){await this.subscriber.stop();let t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,B.toMiliseconds)(t*1))),t++}}finally{this.connectionAttemptInProgress=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}}startPingTimeout(){if(bu())try{this.provider?.connection?.socket?.on(`ping`,()=>{this.resetPingTimeout()}),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){if(this.provider.connection&&(this.unregisterProviderListeners(),this.connected))try{await Ru(this.provider.disconnect(),1e3,`Closing previous provider`)}catch{}let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new be(new ve(Nu({sdkVersion:EE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:n,message:r}=e;await this.messages.set(n,r,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let r=this.messages.has(t,n);return r&&this.logger.warn(`Ignoring duplicate message: ${n}`),r}async onProviderPayload(e){if(this.logger.debug(`Incoming Relay Payload`),this.logger.trace({type:`payload`,direction:`incoming`,payload:e}),de(e)){if(!e.method.endsWith(`_subscription`))return;let t=e.params,{topic:n,message:r,publishedAt:i,attestation:a}=t.data,o={topic:n,message:r,publishedAt:i,transportType:DE.relay,attestation:a};this.logger.debug(`Emitting Relayer Payload`),this.logger.trace({type:`event`,event:t.id,...o}),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else ye(e)&&this.events.emit(CE.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,OE.inbound),this.events.emit(CE.message,e))}async acknowledgePayload(e){let t=fe(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(wE.payload,this.onPayloadHandler),this.provider.off(wE.connect,this.onConnectHandler),this.provider.off(wE.disconnect,this.onDisconnectHandler),this.provider.off(wE.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Tp();kp(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(ue.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&Mp())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}),this.events.on(CE.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let e=this.stalledRestartBackoff===0?0:Math.min(2**(this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${e?` in ${e}ms`:``}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(e){this.logger.error(e,e?.message)}finally{this.stalledRestartInProgress=!1}},e)})}async onProviderDisconnect(){if(clearTimeout(this.pingTimeout),this.events.emit(CE.disconnect),!this.reconnectInProgress){this.reconnectInProgress=!0;try{await this.subscriber.stop()}catch(e){this.logger.warn(e,`subscriber.stop() failed during disconnect`)}if(!this.subscriber.hasAnyTopics||this.transportExplicitlyClosed){this.reconnectInProgress=!1;return}this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,B.toMiliseconds)(TE))}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}this.connectPromise=this.connect().finally(()=>{this.connectPromise=void 0}),await this.connectPromise}}},cD=class extends CT{constructor(e,t,n,r=fE,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>{this.getKey&&e!==null&&!Wf(e)?this.map.set(this.getKey(e),e):Zf(e)?this.map.set(e.id,e):Qf(e)&&this.map.set(e.topic,e)}),this.cached=[],!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug(`Setting value`),this.logger.trace({type:`method`,method:`set`,key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug(`Getting value`),this.logger.trace({type:`method`,method:`get`,key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(n=>uE(t[n],e[n]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug(`Updating value`),this.logger.trace({type:`method`,method:`update`,key:e,update:t});let n={...this.getData(e),...t};this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug(`Deleting value`),this.logger.trace({type:`method`,method:`delete`,key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=su(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=K(`MISSING_OR_INVALID`,`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>`u`||!e.length)return;if(this.map.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},lD=class{constructor(e,t){this.core=e,this.logger=t,this.name=ME,this.version=`0.3`,this.events=new ot.default,this.initialized=!1,this.storagePrefix=fE,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace(`Initialized`))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=tf(),n=await this.core.crypto.setSymKey(t),r=Uu(B.FIVE_MINUTES),i={protocol:`irn`},a={topic:n,expiry:r,relay:i,active:!1,methods:e?.methods},o=Of({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:t,relay:i,expiryTimestamp:r,methods:e?.methods});return this.events.emit(PE.create,a),this.core.expirer.set(n,r),await this.pairings.set(n,a),await this.core.relayer.subscribe(n,{transportType:e?.transportType,internal:e?.internal}),{topic:n,uri:o}},this.pair=async e=>{this.isInitialized();let t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[KE.pairing_started]}});this.isValidPair(e,t);let{topic:n,symKey:r,relay:i,expiryTimestamp:a,methods:o}=Tf(e.uri);t.props.properties.topic=n,t.addTrace(KE.pairing_uri_validation_success),t.addTrace(KE.pairing_uri_not_expired);let s;if(this.pairings.keys.includes(n)){if(s=this.pairings.get(n),t.addTrace(KE.existing_pairing),s.active)throw t.setError(qE.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);t.addTrace(KE.pairing_not_expired)}let c=a||Uu(B.FIVE_MINUTES),l={topic:n,relay:i,expiry:c,active:!1,methods:o};this.core.expirer.set(n,c),await this.pairings.set(n,l),t.addTrace(KE.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(PE.create,l),t.addTrace(KE.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(r,n),t.addTrace(KE.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(qE.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:i})}catch(e){throw t.setError(qE.subscribe_pairing_topic_failure),e}return t.addTrace(KE.subscribe_pairing_topic_success),l},this.activate=async({topic:e})=>{this.isInitialized();let t=Uu(B.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn(`ping() is deprecated and will be removed in the next major release.`);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,`wc_pairingPing`,{}),{done:n,resolve:r,reject:i}=Lu();this.events.once(q(`pairing_ping`,e),({error:e})=>{e?i(e):r()}),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,`wc_pairingDelete`,_u(`USER_DISCONNECTED`)),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:n,expiry:r,methods:i}=e,a=this.core.crypto.keychain.get(t);return Of({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:a,relay:n,expiryTimestamp:r,methods:i})},this.sendRequest=async(e,t,n)=>{let r=Ce(t,n),i=await this.core.crypto.encode(e,r),a=NE[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,a),r.id},this.sendResult=async(e,t,n)=>{let r=fe(e,n),i=await this.core.crypto.encode(t,r),a=NE[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,a),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{let r=_e(e,n),i=await this.core.crypto.encode(t,r),a=(await this.core.history.get(t,e)).request.method,o=NE[a]?NE[a].res:NE.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,_u(`USER_DISCONNECTED`)),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>Wu(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=async e=>{let{topic:t,payload:n}=e;switch(n.method){case`wc_pairingPing`:return await this.onPairingPingRequest(t,n);case`wc_pairingDelete`:return await this.onPairingDeleteRequest(t,n);default:return await this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;switch(r){case`wc_pairingPing`:return this.onPairingPingResponse(t,n);default:return this.onUnknownRpcMethodResponse(r)}},this.onPairingPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit(PE.ping,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:n}=t;setTimeout(()=>{xe(t)?this.events.emit(q(`pairing_ping`,n),{}):ge(t)&&this.events.emit(q(`pairing_ping`,n),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(PE.delete,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=_u(`WC_METHOD_UNSUPPORTED`,r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(_u(`WC_METHOD_UNSUPPORTED`,e))},this.isValidPair=(e,t)=>{if(!fp(e)){let{message:n}=K(`MISSING_OR_INVALID`,`pair() params: ${e}`);throw t.setError(qE.malformed_pairing_uri),Error(n)}if(!Xf(e.uri)){let{message:n}=K(`MISSING_OR_INVALID`,`pair() uri: ${e.uri}`);throw t.setError(qE.malformed_pairing_uri),Error(n)}let n=Tf(e?.uri);if(!n?.relay?.protocol){let{message:e}=K(`MISSING_OR_INVALID`,`pair() uri#relay-protocol`);throw t.setError(qE.malformed_pairing_uri),Error(e)}if(!n?.symKey){let{message:e}=K(`MISSING_OR_INVALID`,`pair() uri#symKey`);throw t.setError(qE.malformed_pairing_uri),Error(e)}if(n?.expiryTimestamp&&(0,B.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(qE.pairing_expired);let{message:e}=K(`EXPIRED`,`pair() URI has expired. Please try again with a new connection URI.`);throw Error(e)}},this.isValidPing=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=K(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=su(t,this.name),this.pairings=new cD(this.core,this.logger,this.name,this.storagePrefix)}get context(){return au(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(CE.message,async e=>{let{topic:t,message:n,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==DE.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let e=await this.core.crypto.decode(t,n);de(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):ye(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,n)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(RE.expired,async e=>{let{topic:t}=Hu(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(PE.expire,{topic:t}))})}},uD=class extends yT{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new ot.EventEmitter,this.name=IE,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug(`Setting JSON-RPC request history record`),this.logger.trace({type:`method`,method:`set`,topic:e,request:t,chainId:n}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:Uu(B.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(FE.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug(`Updating JSON-RPC response history record`),this.logger.trace({type:`method`,method:`update`,response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response<`u`||(t.response=ge(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(FE.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug(`Getting record`),this.logger.trace({type:`method`,method:`get`,topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug(`Deleting record`),this.logger.trace({type:`method`,method:`delete`,id:t}),this.values.forEach(n=>{if(n.topic===e){if(typeof t<`u`&&n.id!==t)return;this.records.delete(n.id),this.events.emit(FE.deleted,n)}}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),this.records.has(t)?(await this.getRecord(t)).topic===e:!1),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if(typeof t.response<`u`)return;let n={topic:t.topic,request:Ce(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(FE.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>`u`||!e.length)return;if(this.records.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(FE.created,e=>{let t=FE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(FE.updated,e=>{let t=FE.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(FE.deleted,e=>{let t=FE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.core.heartbeat.on(ue.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,B.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(FE.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},dD=class extends TT{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new ot.EventEmitter,this.name=LE,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=fE,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),!0)},this.has=e=>{try{let t=this.formatTarget(e);return typeof this.getExpiration(t)<`u`}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(RE.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(RE.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=su(t,this.name)}get context(){return au(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e==`string`)return Bu(e);if(typeof e==`number`)return Vu(e);let{message:t}=K(`UNKNOWN_TYPE`,`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(RE.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>`u`||!e.length)return;if(this.expirations.size){let{message:e}=K(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=K(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:n}=t;(0,B.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(RE.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(ue.pulse,()=>this.checkExpirations()),this.events.on(RE.created,e=>{let t=RE.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(RE.expired,e=>{let t=RE.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(RE.deleted,e=>{let t=RE.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}},fD=class extends ET{constructor(e,t,n){super(e,t,n),this.core=e,this.logger=t,this.store=n,this.name=zE,this.verifyUrlV3=HE,this.storagePrefix=fE,this.version=2,this.init=async()=>{this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,B.toMiliseconds)(this.publicKey?.expiresAt)<Date.now()&&(this.logger.debug(`verify v2 public key expired`),await this.removePublicKey()))},this.register=async e=>{if(!wu()||this.isDevEnv)return;let t=window.location.origin,{id:n,decryptedId:r}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${n}&decryptedId=${r}`;try{let e=(0,ct.getDocument)(),t=this.startAbortTimer(B.ONE_SECOND*5),r=await new Promise((r,a)=>{let o=()=>{window.removeEventListener(`message`,c),e.body.removeChild(s),a(`attestation aborted`)};this.abortController.signal.addEventListener(`abort`,o);let s=e.createElement(`iframe`);s.src=i,s.style.display=`none`,s.addEventListener(`error`,o,{signal:this.abortController.signal});let c=i=>{if(i.data&&typeof i.data==`string`)try{let a=JSON.parse(i.data);if(a.type===`verify_attestation`){if(ie(a.attestation).payload.id!==n)return;clearInterval(t),e.body.removeChild(s),this.abortController.signal.removeEventListener(`abort`,o),window.removeEventListener(`message`,c),r(a.attestation===null?``:a.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(s),window.addEventListener(`message`,c,{signal:this.abortController.signal})});return this.logger.debug(r,`jwt attestation`),r}catch(e){this.logger.warn(e)}return``},this.resolve=async e=>{if(this.isDevEnv)return``;let{attestationId:t,hash:n,encryptedId:r}=e;if(t===``){this.logger.debug(`resolve: attestationId is empty, skipping`);return}if(t){if(ie(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn(`resolve: jwt attestation: origin url not verified`);return}return e}}if(!n)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(n,i)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let n=this.startAbortTimer(B.ONE_SECOND*5),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(n),r.status===200?await r.json():void 0},this.getVerifyUrl=e=>{let t=e||`https://verify.walletconnect.org`;return UE.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: https://verify.walletconnect.org`),t=`https://verify.walletconnect.org`),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(B.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug(e,`persisting public key to local storage`),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug(`removing verify v2 public key from storage`),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}let n=await this.fetchAndPersistPublicKey();try{if(n)return this.validateAttestation(e,n)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let n=xf(e,t.publicKey),r={hasExpired:(0,B.toMiliseconds)(n.exp)<Date.now(),payload:n};if(r.hasExpired)throw this.logger.warn(`resolve: jwt attestation expired`),Error(`JWT attestation expired`);return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}},this.logger=su(t,this.name),this.abortController=new AbortController,this.isDevEnv=Qu(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//verify:public:key`}get context(){return au(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,B.toMiliseconds)(e))}},pD=class extends DT{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=WE,this.registerDeviceToken=async e=>{let{clientId:t,token:n,notificationType:r,enableEncrypted:i=!1}=e,a=`${GE}/${this.projectId}/clients`;await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_id:t,type:r,token:n,always_raw:i})})},this.logger=su(t,this.context)}},mD=class extends OT{constructor(e,t,n=!0){super(e,t,n),this.core=e,this.logger=t,this.context=$E,this.storagePrefix=fE,this.storageVersion=QE,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Qu())try{let e={eventId:Zu(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:`INIT`,type:``,properties:{client_id:await this.core.crypto.getClientId(),user_agent:Mu(this.core.relayer.protocol,this.core.relayer.version,EE)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t=`ERROR`,type:n=``,properties:{topic:r,trace:i}}=e,a=Zu(),o=this.core.projectId||``,s={eventId:a,timestamp:Date.now(),props:{event:t,type:n,properties:{topic:r,trace:i}},bundleId:o,domain:this.getAppDomain(),...this.setMethods(a)};return this.telemetryEnabled&&(this.events.set(a,s),this.shouldPersist=!0),s},this.getEvent=e=>{let{eventId:t,topic:n}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===n);if(r)return{...r,...this.setMethods(r.eventId)}},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(ue.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,B.fromMiliseconds)(Date.now())-(0,B.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let n=this.events.get(e);n&&(n.props.properties.trace.push(t),this.events.set(e,n),this.shouldPersist=!0)},this.setError=(e,t)=>{let n=this.events.get(e);n&&(n.props.type=t,n.timestamp=Date.now(),this.events.set(e,n),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,{...e,...this.setMethods(e.eventId)})})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let e=[];for(let[t,n]of this.events)n.props.type&&e.push(n);if(e.length!==0)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?``:`&sp=desktop`;return await fetch(`${eD}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${EE}${t}`,{method:`POST`,body:JSON.stringify(e)})},this.getAppDomain=()=>ku().url,this.logger=su(t,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+`//`+this.context}},hD=class e extends vT{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=dE,this.events=new ot.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:n})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:DE.link_mode};this.relayer.onLinkMessageEvent(r,{sessionExists:n})};let t=this.getGlobalCore(e?.customStoragePrefix);if(t)try{return this.customStoragePrefix=t.customStoragePrefix,this.logger=t.logger,this.heartbeat=t.heartbeat,this.crypto=t.crypto,this.history=t.history,this.expirer=t.expirer,this.storage=t.storage,this.relayer=t.relayer,this.pairing=t.pairing,this.verify=t.verify,this.echoClient=t.echoClient,this.linkModeSupportedApps=t.linkModeSupportedApps,this.eventClient=t.eventClient,this.initialized=t.initialized,this.logChunkController=t.logChunkController,t}catch{}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||`wss://relay.walletconnect.org`,this.customStoragePrefix=e?.customStoragePrefix?`:${e.customStoragePrefix}`:``;let{logger:n,chunkLoggerController:r}=uu({opts:ru({level:typeof e?.logger==`string`&&e.logger?e.logger:pE.logger,name:dE}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=r,this.logChunkController?.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{this.logChunkController?.downloadLogsBlobInBrowser&&this.logChunkController?.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()})}),this.logger=su(n,this.name),this.heartbeat=new me,this.crypto=new nD(this,this.logger,e?.keychain),this.history=new uD(this,this.logger),this.expirer=new dD(this,this.logger),this.storage=e?.storage?e.storage:new he({...mE,...e?.storageOptions}),this.relayer=new sD({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new lD(this,this.logger),this.verify=new fD(this,this.logger,this.storage),this.echoClient=new pD(this.projectId||``,this.logger),this.linkModeSupportedApps=[],this.eventClient=new mD(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let n=new e(t);await n.initialize();let r=await n.crypto.getClientId();return await n.storage.setItem(kE,r),n}get context(){return au(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){return this.logChunkController?.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(`WALLETCONNECT_LINK_MODE_APPS`,this.linkModeSupportedApps))}async initialize(){this.logger.trace(`Initialized`);try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(`WALLETCONNECT_LINK_MODE_APPS`)||[],this.initialized=!0,this.logger.info(`Core Initialization Success`)}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=``){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,n=`${t}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n],globalThis[t]}catch{return}}setGlobalCore(e){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e.opts?.customStoragePrefix||``}`;globalThis[t]=e}catch{}}isGlobalCoreDisabled(){try{return typeof o<`u`&&{}.DISABLE_GLOBAL_CORE===`true`}catch{return!0}}};m();var gD=`client`,_D=`wc@2:${gD}:`,vD={name:gD,logger:`error`,controller:!1,relayUrl:`wss://relay.walletconnect.org`},yD=`WALLETCONNECT_DEEPLINK_CHOICE`,bD=`proposal`;B.THIRTY_DAYS;var xD=`Proposal expired`,SD=`session`,CD=B.SEVEN_DAYS,wD=`engine`,TD={wc_sessionPropose:{req:{ttl:B.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1104},res:{ttl:B.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1106},res:{ttl:B.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:B.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:B.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:B.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1112},res:{ttl:B.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:B.ONE_DAY,prompt:!1,tag:1114},res:{ttl:B.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:B.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:B.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:B.FIVE_MINUTES,prompt:!1,tag:1119}}},ED={min:B.FIVE_MINUTES,max:B.SEVEN_DAYS},DD={idle:`IDLE`,active:`ACTIVE`},OD={eth_sendTransaction:{key:``},eth_sendRawTransaction:{key:``},wallet_sendCalls:{key:``},solana_signTransaction:{key:`signature`},solana_signAllTransactions:{key:`transactions`},solana_signAndSendTransaction:{key:`signature`},sui_signAndExecuteTransaction:{key:`digest`},sui_signTransaction:{key:``},hedera_signAndExecuteTransaction:{key:`transactionId`},hedera_executeTransaction:{key:`transactionId`},near_signTransaction:{key:``},near_signTransactions:{key:``},tron_signTransaction:{key:`txID`},xrpl_signTransaction:{key:``},xrpl_signTransactionFor:{key:``},algo_signTxn:{key:``},sendTransfer:{key:`txid`},stacks_stxTransfer:{key:`txId`},polkadot_signTransaction:{key:``},cosmos_signDirect:{key:``}},kD=`request`,AD=[`wc_sessionPropose`,`wc_sessionRequest`,`wc_authRequest`,`wc_sessionAuthenticate`],jD=`auth`,MD=`authKeys`,ND=`pairingTopics`,PD=`requests`,FD=`wc@1.5:${jD}:`,ID=`${FD}:PUB_KEY`,LD=class extends AT{constructor(e){super(e),this.name=wD,this.events=new ot.default,this.initialized=!1,this.requestQueue={state:DD.idle,queue:[]},this.sessionRequestQueue={state:DD.idle,queue:[]},this.emittedSessionRequests=new id({limit:500}),this.requestQueueDelay=B.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.registerSubscriptionCleanup(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(TD)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,B.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t={...e,requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}};await this.isValidConnect(t),t.optionalNamespaces=Vf(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:a,scopedProperties:o,relays:s,authentication:c,walletPay:l}=t,u=c?.[0]?.ttl||TD.wc_sessionPropose.req.ttl||B.FIVE_MINUTES;this.validateRequestExpiry(u);let d=n,f,p=!1;try{if(d){let e=this.client.core.pairing.pairings.get(d);this.client.logger.warn(`connect() with existing pairing topic is deprecated and will be removed in the next major release.`),p=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),e}if(!d||!p){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});d=e,f=t}if(!d){let{message:e}=K(`NO_MATCHING_KEY`,`connect() pairing topic: ${d}`);throw Error(e)}let m=await this.client.core.crypto.generateKeyPair(),h=Uu(u),g={requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:`irn`}],proposer:{publicKey:m,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:d,...a&&{sessionProperties:a},...o&&{scopedProperties:o},id:z(),...(c||l)&&{requests:{authentication:c?.map(e=>{let{domain:t,chains:n,nonce:r,uri:i,exp:a,nbf:o,type:s,statement:c,requestId:l,resources:u,signatureTypes:d}=e;return{domain:t,chains:n,nonce:r,type:s??`caip122`,aud:i,version:`1`,iat:new Date().toISOString(),exp:a,nbf:o,statement:c,requestId:l,resources:u,signatureTypes:d}}),walletPay:l}}},_=q(`session_connect`,g.id),{reject:v,resolve:y,done:b}=Lu(u,xD),x=({id:e})=>{if(e===g.id){this.client.events.off(`proposal_expire`,x);let e=this.pendingSessions.get(g.id);if(e){let{sessionTopic:t,publicKey:n}=e;Promise.all([this.client.core.relayer.unsubscribe(t),this.client.core.crypto.keychain.has(t)?this.client.core.crypto.deleteSymKey(t):Promise.resolve(),this.client.core.crypto.keychain.has(n)?this.client.core.crypto.deleteKeyPair(n):Promise.resolve()]).catch(e=>this.client.logger.warn(e))}this.pendingSessions.delete(g.id),this.events.emit(_,{error:{message:xD,code:0}})}};return this.client.events.on(`proposal_expire`,x),this.events.once(_,({error:e,session:t})=>{this.client.events.off(`proposal_expire`,x),e?v(e):t&&y(t)}),await this.setProposal(g.id,g),await this.sendProposeSession({proposal:g,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:g.id}}}).catch(e=>{throw this.deleteProposal(g.id),e}),{uri:f,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error(`pair() failed`),e}},this.approve=async e=>{let t=this.client.core.eventClient.createEvent({properties:{topic:e?.id?.toString(),trace:[JE.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw t.setError(YE.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(n){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),t.setError(YE.proposal_not_found),n}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error(`approve() -> isValidApprove() failed`),t.setError(YE.session_approve_namespace_validation_failure),e}let{id:n,relayProtocol:r,namespaces:i,sessionProperties:a,scopedProperties:o,sessionConfig:s,proposalRequestsResponses:c}=e,l=this.client.proposal.get(n);this.client.core.eventClient.deleteEvent({eventId:t.eventId});let{pairingTopic:u,proposer:d,requiredNamespaces:f,optionalNamespaces:p}=l,m=this.client.core.eventClient?.getEvent({topic:u});m||=this.client.core.eventClient?.createEvent({type:JE.session_approve_started,properties:{topic:u,trace:[JE.session_approve_started,JE.session_namespaces_validation_success]}});let h=await this.client.core.crypto.generateKeyPair(),g=d.publicKey,_=await this.client.core.crypto.generateSharedKey(h,g),v={relay:{protocol:r??`irn`},namespaces:i,controller:{publicKey:h,metadata:this.client.metadata},expiry:Uu(CD),...a&&{sessionProperties:a},...o&&{scopedProperties:o},...s&&{sessionConfig:s},proposalRequestsResponses:c},y=DE.relay;m.addTrace(JE.subscribing_session_topic);try{await this.client.core.relayer.subscribe(_,{transportType:y,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(YE.subscribe_session_topic_failure),e}m.addTrace(JE.subscribe_session_topic_success);let b={...v,topic:_,requiredNamespaces:f,optionalNamespaces:p,pairingTopic:u,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:h,transportType:DE.relay,authentication:c?.authentication,walletPayResult:c?.walletPay};await this.client.session.set(_,b),m.addTrace(JE.store_session);try{await this.sendApproveSession({sessionTopic:_,proposal:l,pairingProposalResponse:{relay:{protocol:r??`irn`},responderPublicKey:h},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:n,...this.getTVFApproveParams(b)}}}),m.addTrace(JE.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(_,_u(`USER_DISCONNECTED`)),await this.client.core.relayer.unsubscribe(_),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:u,metadata:d.metadata}),await this.deleteProposal(n),await this.client.core.pairing.activate({topic:u}),await this.setExpiry(_,Uu(CD)),{topic:_,acknowledged:()=>Promise.resolve(this.client.session.get(_))}},this.reject=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error(`reject() -> isValidReject() failed`),e}let{id:t,reason:n}=e,r;try{r=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}r&&await this.sendError({id:t,topic:r,error:n,rpcOpts:TD.wc_sessionPropose.reject}),await this.deleteProposal(t)},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error(`update() -> isValidUpdate() failed`),e}let{topic:t,namespaces:n}=e,{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Session update request expired without receiving any acknowledgement`),o=z(),s=pe().toString(),c=this.client.session.get(t).namespaces;return this.events.once(q(`session_update`,o),({error:e})=>{e?a(e):i()}),await this.client.session.update(t,{namespaces:n}),await this.sendRequest({topic:t,method:`wc_sessionUpdate`,params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),a(e)}),{acknowledged:r}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error(`extend() -> isValidExtend() failed`),e}let{topic:t}=e,n=z(),{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Session extend request expired without receiving any acknowledgement`);return this.events.once(q(`session_extend`,n),({error:e})=>{e?a(e):i()}),await this.setExpiry(t,Uu(CD)),this.sendRequest({topic:t,method:`wc_sessionExtend`,params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(e=>{a(e)}),{acknowledged:r}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error(`request() -> isValidRequest() failed`),e}let{chainId:t,request:n,topic:r,expiry:i=TD.wc_sessionRequest.req.ttl}=e,a=this.client.session.get(r);a?.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let o=z(),s=pe().toString(),{done:c,resolve:l,reject:u}=Lu(i,`Request expired. Please try again.`);this.events.once(q(`session_request`,o),({error:e,result:t})=>{e?u(e):l(t)});let d=`wc_sessionRequest`,f=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(f)return await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:{request:{...n,expiryTimestamp:Uu(i)},chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),await c();let p={request:{...n,expiryTimestamp:Uu(i)},chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(o,p)}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),e()}),new Promise(async e=>{a.sessionConfig?.disableDeepLink||await Ku({id:o,topic:r,wcDeepLink:await Yu(this.client.core.storage,yD)}),e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized();let t=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||e?.response?.id?.toString(),trace:[JE.session_request_response_started]}});try{await this.isValidRespond(e)}catch(e){throw t.addTrace(e?.message),t.setError(YE.session_request_response_validation_failure),e}t.addTrace(JE.session_request_response_validation_success);let{topic:n,response:r}=e,{id:i}=r,a=this.client.session.get(n);a.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{t.addTrace(JE.session_request_response_publish_started),xe(r)?await this.sendResult({id:i,topic:n,result:r.result,throwOnFailedPublish:!0,appLink:o}):ge(r)&&await this.sendError({id:i,topic:n,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}catch(e){throw t.addTrace(e?.message),t.setError(YE.session_request_response_publish_failure),e}},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error(`ping() -> isValidPing() failed`),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=z(),n=pe().toString(),{done:r,resolve:i,reject:a}=Lu(B.FIVE_MINUTES,`Ping request expired without receiving any acknowledgement`);this.events.once(q(`session_ping`,e),({error:e})=>{e?a(e):i()}),await Promise.all([this.sendRequest({topic:t,method:`wc_sessionPing`,params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:n}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn(`ping() on pairing topic is deprecated and will be removed in the next major release.`),await this.client.core.pairing.ping({topic:t}))},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:n,chainId:r}=e,i=pe().toString(),a=z();await this.sendRequest({topic:t,method:`wc_sessionEvent`,params:{event:n,chainId:r},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:`wc_sessionDelete`,params:_u(`USER_DISCONNECTED`),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=K(`MISMATCHED_TOPIC`,`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>qf(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&this.client.metadata.redirect?.linkMode,r=n?DE.link_mode:DE.relay;r===DE.relay&&await this.confirmOnlineStateOrThrow();let{chains:i,statement:a=``,uri:o,domain:s,nonce:c,type:l,exp:u,nbf:d,methods:f=[],expiry:p}=e,m=[...e.resources||[]],{topic:h,uri:g}=await this.client.core.pairing.create({methods:[`wc_sessionAuthenticate`],transportType:r});if(this.client.logger.info({message:`Generated new pairing`,pairing:{topic:h,uri:g}}),this.client.auth.authKeys.keys.includes(ID)){let{responseTopic:e,publicKey:t}=this.client.auth.authKeys.get(ID);e&&(await this.client.core.relayer.unsubscribe(e).catch(e=>this.client.logger.warn(e)),await this.client.auth.pairingTopics.delete(e,{message:`replaced`,code:0}).catch(e=>this.client.logger.warn(e))),t&&this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteKeyPair(t)}let _=await this.client.core.crypto.generateKeyPair(),v=rf(_);if(await Promise.all([this.client.auth.authKeys.set(ID,{responseTopic:v,publicKey:_}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:h})]),await this.client.core.relayer.subscribe(v,{transportType:r}),this.client.logger.info(`sending request to new pairing topic: ${h}`),f.length>0){let{namespace:e}=pu(i[0]),t=Ld(e,`request`,f);Wd(m)&&(t=zd(t,m.pop())),m.push(t)}let y=p&&p>TD.wc_sessionAuthenticate.req.ttl?p:TD.wc_sessionAuthenticate.req.ttl,b={authPayload:{type:l??`caip122`,chains:i,statement:a,aud:o,domain:s,version:`1`,nonce:c,iat:new Date().toISOString(),exp:u,nbf:d,resources:m},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Uu(y)},x={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set([`personal_sign`,...f])],events:[`chainChanged`,`accountsChanged`]}},relays:[{protocol:`irn`}],pairingTopic:h,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Uu(TD.wc_sessionPropose.req.ttl),id:z()},{done:S,resolve:C,reject:w}=Lu(y,`Request expired`),T=z(),E=q(`session_connect`,x.id),D=q(`session_request`,T),O=async({error:e,session:t})=>{this.events.off(D,k),e?w(e):t&&C({session:t})},k=async e=>{if(await this.deletePendingAuthRequest(T,{message:`fulfilled`,code:0}),e.error){let t=_u(`WC_METHOD_UNSUPPORTED`,`wc_sessionAuthenticate`);return e.error.code===t.code?void 0:(this.events.off(E,O),w(e.error.message))}await this.deleteProposal(x.id),this.events.off(E,O);let{cacaos:n,responder:i}=e.result,a=[],o=[];for(let e of n){await Od({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,`Signature verification failed`),w(_u(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`)));let{p:t}=e,n=Wd(t.resources),r=[Ed(t.iss)],i=Dd(t.iss);if(n){let e=Hd(n),t=Ud(n);a.push(...e),r.push(...t)}for(let e of r)o.push(`${e}:${i}`)}let s=await this.client.core.crypto.generateSharedKey(_,i.publicKey),c;a.length>0&&(c={topic:s,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:i,controller:i.publicKey,expiry:Uu(CD),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:h,namespaces:Bf([...new Set(a)],[...new Set(o)]),transportType:r},await this.client.core.relayer.subscribe(s,{transportType:r}),await this.client.session.set(s,c),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:i.metadata}),c=this.client.session.get(s)),this.client.metadata.redirect?.linkMode&&i.metadata.redirect?.linkMode&&i.metadata.redirect?.universal&&t&&(this.client.core.addLinkModeSupportedApp(i.metadata.redirect.universal),this.client.session.update(s,{transportType:DE.link_mode})),C({auths:n,session:c})};this.events.once(E,O),this.events.once(D,k);let A;try{if(n){let e=Ce(`wc_sessionAuthenticate`,b,T);this.client.core.history.set(h,e),A=kf(t,h,await this.client.core.crypto.encode(``,e,{type:2,encoding:Jd}))}else await Promise.all([this.sendRequest({topic:h,method:`wc_sessionAuthenticate`,params:b,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:h,method:`wc_sessionPropose`,params:x,expiry:TD.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:x.id})])}catch(e){throw this.events.off(E,O),this.events.off(D,k),e}return await this.setProposal(x.id,x),await this.setAuthRequest(T,{request:{...b,verifyContext:{}},pairingTopic:h,transportType:r}),{uri:A??g,response:S}},this.approveSessionAuthenticate=async e=>{let{id:t,auths:n}=e,r=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[XE.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw r.setError(ZE.no_internet_connection),e}let i=this.getPendingAuthRequest(t);if(!i)throw r.setError(ZE.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${t}`);let a=i.transportType||DE.relay;a===DE.relay&&await this.confirmOnlineStateOrThrow();let o=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),c=rf(o),l={type:1,receiverPublicKey:o,senderPublicKey:s},u=[],d=[];for(let e of n){if(!await Od({cacao:e,projectId:this.client.core.projectId})){r.setError(ZE.invalid_cacao);let e=_u(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`);throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),Error(e.message)}r.addTrace(XE.cacaos_verified);let{p:n}=e,i=Wd(n.resources),a=[Ed(n.iss)],o=Dd(n.iss);if(i){let e=Hd(i),t=Ud(i);u.push(...e),a.push(...t)}for(let e of a)d.push(`${e}:${o}`)}let f=await this.client.core.crypto.generateSharedKey(s,o);r.addTrace(XE.create_authenticated_session_topic);let p;if(u?.length>0){p={topic:f,acknowledged:!0,self:{publicKey:s,metadata:this.client.metadata},peer:{publicKey:o,metadata:i.requester.metadata},controller:o,expiry:Uu(CD),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:i.pairingTopic,namespaces:Bf([...new Set(u)],[...new Set(d)]),transportType:a},r.addTrace(XE.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(f,{transportType:a})}catch(e){throw r.setError(ZE.subscribe_authenticated_session_topic_failure),e}r.addTrace(XE.subscribe_authenticated_session_topic_success),await this.client.session.set(f,p),r.addTrace(XE.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}r.addTrace(XE.publishing_authenticated_session_approve);try{await this.sendResult({topic:c,id:t,result:{cacaos:n,responder:{publicKey:s,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(e){throw r.setError(ZE.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(t,{message:`fulfilled`,code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:r.eventId}),{session:p}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:n}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===DE.relay&&await this.confirmOnlineStateOrThrow();let i=r.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),o=rf(i),s={type:1,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:t,topic:o,error:n,encodeOpts:s,rpcOpts:TD.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:`rejected`,code:0}),await this.deleteProposal(t)},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:n}=e;return kd(t,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(n=>n.peerMetadata?.url&&n.peerMetadata?.url===e.peer.metadata.url&&n.topic&&n.topic!==t.topic);if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info(`Duplicate pairings clean up finished`)}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{let{topic:t,expirerHasDeleted:n=!1,emitEvent:r=!0,id:i=0}=e,{self:a}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),await this.client.session.delete(t,_u(`USER_DISCONNECTED`)),this.addToRecentlyDeleted(t,`session`),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),n||this.client.core.expirer.del(t),this.client.core.storage.removeItem(yD).catch(e=>this.client.logger.warn(e)),t===this.sessionRequestQueue.queue[0]?.topic&&(this.sessionRequestQueue.state=DD.idle),await Promise.all(this.getPendingSessionRequests().filter(e=>e.topic===t).map(e=>this.deletePendingSessionRequest(e.id,_u(`USER_DISCONNECTED`)))),r&&this.client.events.emit(`session_delete`,{id:i,topic:t})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e);this.client.core.eventClient.getEvent({topic:t.pairingTopic})?.setError(YE.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,_u(`USER_DISCONNECTED`)),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`proposal`)},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`request`),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),n&&(this.sessionRequestQueue.state=DD.idle,this.client.events.emit(`session_request_expire`,{id:e}))},this.deletePendingAuthRequest=async(e,t,n=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,Uu(TD.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:n,pairingTopic:r,transportType:i=DE.relay}=t;this.client.core.expirer.set(e,n.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:e,pairingTopic:r,verifyContext:n.verifyContext,transportType:i})},this.setPendingSessionRequest=async e=>{let{id:t,topic:n,params:r,verifyContext:i}=e,a=r.request.expiryTimestamp||Uu(TD.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,a),await this.client.pendingRequest.set(t,{id:t,topic:n,params:r,verifyContext:i})},this.sendRequest=async e=>{let{topic:t,method:n,params:r,expiry:i,relayRpcId:a,clientRpcId:o,throwOnFailedPublish:s,appLink:c,tvf:l,publishOpts:u={}}=e,d=Ce(n,r,o),f,p=!!c;try{let e=p?Jd:qd;f=await this.client.core.crypto.encode(t,d,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let m;if(AD.includes(n)){let e=af(JSON.stringify(d)),t=af(f);m=await this.client.core.verify.register({id:t,decryptedId:e})}let g={...TD[n].req,...u};if(g.attestation=m,i&&(g.ttl=i),a&&(g.id=a),this.client.core.history.set(t,d),p){let e=kf(c,t,f);await h.Linking.openURL(e,this.client.name)}else g.tvf={...l,correlationId:d.id},s?(g.internal={...g.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(t,f,g)):this.client.core.relayer.publish(t,f,g).catch(e=>this.client.logger.error(e));return d.id},this.sendProposeSession=async e=>{let{proposal:t,publishOpts:n}=e,r=Ce(`wc_sessionPropose`,t,t.id);this.client.core.history.set(t.pairingTopic,r);let i=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:qd}),a=af(JSON.stringify(r)),o=af(i),s=await this.client.core.verify.register({id:o,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:{...n,publishMethod:`wc_proposeSession`,attestation:s}})},this.sendApproveSession=async e=>{let{sessionTopic:t,pairingProposalResponse:n,proposal:r,sessionSettleRequest:i,publishOpts:a}=e,o=fe(r.id,n),s=await this.client.core.crypto.encode(r.pairingTopic,o,{encoding:qd}),c=Ce(`wc_sessionSettle`,i,a?.id),l=await this.client.core.crypto.encode(t,c,{encoding:qd});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:s,sessionSettlementRequest:l},opts:{...a,publishMethod:`wc_approveSession`}})},this.sendResult=async e=>{let{id:t,topic:n,result:r,throwOnFailedPublish:i,encodeOpts:a,appLink:o}=e,s=fe(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Jd:qd;c=await this.client.core.crypto.encode(n,s,{...a||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),e}let u,d;try{u=await this.client.core.history.get(n,t);let e=u.request;try{d=this.getTVFParams(t,e.params,r)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${t}) failed`),e}if(l){let e=kf(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=TD[u.request.method].res;e.tvf={...d,correlationId:t},i?(e.internal={...e.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,c,e)):this.client.core.relayer.publish(n,c,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(s)},this.sendError=async e=>{let{id:t,topic:n,error:r,encodeOpts:i,rpcOpts:a,appLink:o}=e,s=_e(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Jd:qd;c=await this.client.core.crypto.encode(n,s,{...i||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}let u;try{u=await this.client.core.history.get(n,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),e}if(l){let e=kf(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=u.request.method,t=a||TD[e].res;this.client.core.relayer.publish(n,c,t)}await this.client.core.history.resolve(s)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let n=!1;Wu(t.expiry)&&(n=!0),this.client.core.crypto.keychain.has(t.topic)||(n=!0),n&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{Wu(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onProviderMessageEvent=async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===DD.active){this.client.logger.info(`Request queue already active, skipping...`);return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=DD.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=DD.idle},this.processRequest=async e=>{let{topic:t,payload:n,attestation:r,transportType:i,encryptedId:a}=e,o=n.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case`wc_sessionPropose`:return await this.onSessionProposeRequest({topic:t,payload:n,attestation:r,encryptedId:a});case`wc_sessionSettle`:return await this.onSessionSettleRequest(t,n);case`wc_sessionUpdate`:return await this.onSessionUpdateRequest(t,n);case`wc_sessionExtend`:return await this.onSessionExtendRequest(t,n);case`wc_sessionPing`:return await this.onSessionPingRequest(t,n);case`wc_sessionDelete`:return await this.onSessionDeleteRequest(t,n);case`wc_sessionRequest`:return await this.onSessionRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});case`wc_sessionEvent`:return await this.onSessionEventRequest(t,n);case`wc_sessionAuthenticate`:return await this.onSessionAuthenticateRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n,transportType:r}=e,i=(await this.client.core.history.get(t,n.id)).request.method;switch(i){case`wc_sessionPropose`:return this.onSessionProposeResponse(t,n,r);case`wc_sessionSettle`:return this.onSessionSettleResponse(t,n);case`wc_sessionUpdate`:return this.onSessionUpdateResponse(t,n);case`wc_sessionExtend`:return this.onSessionExtendResponse(t,n);case`wc_sessionPing`:return this.onSessionPingResponse(t,n);case`wc_sessionRequest`:return this.onSessionRequestResponse(t,n);case`wc_sessionAuthenticate`:return this.onSessionAuthenticateResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:n}=K(`MISSING_OR_INVALID`,`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(n)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:n}=e,r=this.expectedPairingMethodMap.get(t);return!r||r.includes(n)?!1:!!(r.includes(`wc_sessionAuthenticate`)&&this.client.events.listenerCount(`session_authenticate`)>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i}=e,{params:a,id:o}=n;try{let e=this.client.core.eventClient.getEvent({topic:t});this.client.events.listenerCount(`session_proposal`)===0&&e?.setError(qE.proposal_listener_not_found),this.isValidConnect({...n.params});let s={id:o,pairingTopic:t,expiryTimestamp:a.expiryTimestamp||Uu(TD.wc_sessionPropose.req.ttl),attestation:r,encryptedId:i,...a};await this.setProposal(o,s);let c=await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(n)),encryptedId:i,metadata:s.proposer.metadata});e?.addTrace(KE.emit_session_proposal),this.client.events.emit(`session_proposal`,{id:o,params:s,verifyContext:c})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:TD.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,n)=>{let{id:r}=t;if(xe(t)){let{result:i}=t;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,result:i});let a=this.client.proposal.get(r);this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,proposal:a});let o=a.proposer.publicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,selfPublicKey:o});let s=i.responderPublicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,peerPublicKey:s});let c=await this.client.core.crypto.generateSharedKey(o,s);this.pendingSessions.set(r,{sessionTopic:c,pairingTopic:e,proposalId:r,publicKey:o});let l=await this.client.core.relayer.subscribe(c,{transportType:n});this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(ge(t)){await this.deleteProposal(r);let e=q(`session_connect`,r);if(this.events.listenerCount(e)===0)throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);let{relay:n,controller:i,expiry:a,namespaces:o,sessionProperties:s,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=t.params,d=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!d)return this.client.logger.error(`Pending session not found for topic ${e}`);let f=this.client.proposal.get(d.proposalId),p={topic:e,relay:n,expiry:a,namespaces:o,acknowledged:!0,pairingTopic:d.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:i.publicKey,self:{publicKey:d.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata},...s&&{sessionProperties:s},...c&&{scopedProperties:c},...l&&{sessionConfig:l},transportType:DE.relay,authentication:u?.authentication,walletPayResult:u?.walletPay};await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:d.pairingTopic,metadata:p.peer.metadata}),this.pendingSessions.delete(d.proposalId),this.deleteProposal(d.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit(`session_connect`,{session:p}),this.events.emit(q(`session_connect`,d.proposalId),{session:p})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:n}=t;xe(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(q(`session_approve`,n),{})):ge(t)&&(await this.deleteSession({topic:e,emitEvent:!1}),this.events.emit(q(`session_approve`,n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:n,id:r}=t;try{let t=`${e}_session_update`,i=Pp.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.warn(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:_u(`INVALID_UPDATE_REQUEST`)});return}this.isValidUpdate({topic:e,...n});try{Pp.set(t,r),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(e){throw Pp.delete(t),e}this.client.events.emit(`session_update`,{id:r,topic:e,params:n})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3),this.onSessionUpdateResponse=(e,t)=>{let{id:n}=t,r=q(`session_update`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_update`,n),{}):ge(t)&&this.events.emit(q(`session_update`,n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Uu(CD)),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit(`session_extend`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:n}=t,r=q(`session_extend`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_extend`,n),{}):ge(t)&&this.events.emit(q(`session_extend`,n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(`session_ping`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:n}=t,r=q(`session_ping`,n);setTimeout(()=>{if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners 2176`);xe(t)?this.events.emit(q(`session_ping`,n),{}):ge(t)&&this.events.emit(q(`session_ping`,n),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:n}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:_u(`USER_DISCONNECTED`)}),await this.deleteSession({topic:e,id:n})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e,{id:o,params:s}=n;try{await this.isValidRequest({topic:t,...s});let e=this.client.session.get(t),n={id:o,topic:t,params:s,verifyContext:await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(Ce(`wc_sessionRequest`,s,o))),encryptedId:i,metadata:e.peer.metadata,transportType:a})};await this.setPendingSessionRequest(n),a===DE.link_mode&&e.peer.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.peer.metadata.redirect?.universal),this.client.signConfig?.disableRequestQueue?this.emitSessionRequest(n):(this.addSessionRequestToSessionRequestQueue(n),this.processSessionRequestQueue())}catch(e){await this.sendError({id:o,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:n}=t,r=q(`session_request`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);xe(t)?this.events.emit(q(`session_request`,n),{result:t.result}):ge(t)&&this.events.emit(q(`session_request`,n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:n,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,i=Pp.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit({topic:e,...r}),this.client.events.emit(`session_event`,{id:n,topic:e,params:r}),Pp.set(t,n)}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:n}=t;this.client.logger.trace({type:`method`,method:`onSessionAuthenticateResponse`,topic:e,payload:t}),xe(t)?this.events.emit(q(`session_request`,n),{result:t.result}):ge(t)&&this.events.emit(q(`session_request`,n),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:s}=n.params,c=await this.getVerifyContext({attestationId:r,hash:af(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:a}),l={requester:e,pairingTopic:t,id:n.id,authPayload:o,verifyContext:c,expiryTimestamp:s};await this.setAuthRequest(n.id,{request:l,pairingTopic:t,transportType:a}),a===DE.link_mode&&e.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit(`session_authenticate`,{topic:t,params:n.params,id:n.id,verifyContext:c})}catch(e){this.client.logger.error(e);let r=n.params.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),o=this.getAppLinkIfEnabled(n.params.requester.metadata,a),s={type:1,receiverPublicKey:r,senderPublicKey:i};await this.sendError({id:n.id,topic:t,error:e,encodeOpts:s,rpcOpts:TD.wc_sessionAuthenticate.autoReject,appLink:o})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:`fulfilled`,code:0}),setTimeout(()=>{this.sessionRequestQueue.state=DD.idle,this.processSessionRequestQueue()},(0,B.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let n=this.client.core.history.pending;n.length>0&&n.filter(t=>t.topic===e&&t.request.method===`wc_sessionRequest`).forEach(e=>{this.events.emit(q(`session_request`,e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===DD.active){this.client.logger.info(`session request queue is already active.`);return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info(`session request queue is empty.`);return}try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{if(this.emittedSessionRequests.has(e.id)){this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);return}this.sessionRequestQueue.state=DD.active,this.emittedSessionRequests.add(e.id),this.client.events.emit(`session_request`,e)},this.cleanupInProgress=!1,this.cleanupOrphanedSubscriptions=async()=>{let e=this.client.core.relayer.subscriber.topics;if(e.length===0)return;let t=new Set(this.client.session.keys),n=new Set(this.client.core.pairing.pairings.keys),r=new Set([...this.pendingSessions.values()].map(e=>e.sessionTopic)),i;if(this.client.auth.authKeys.keys.includes(ID)){let{responseTopic:e}=this.client.auth.authKeys.get(ID);i=e}for(let a of e)if(!t.has(a)&&!n.has(a)&&!r.has(a)&&a!==i){this.client.logger.info(`Cleaning up orphaned subscriber topic: ${a}`);try{await this.client.core.relayer.subscriber.unsubscribe(a)}catch(e){this.client.logger.warn(e,`Failed to clean up orphaned subscription: ${a}`)}}},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:Ce(`wc_sessionPropose`,{...t,requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties},t.id),attestation:t.attestation,encryptedId:t.encryptedId})},this.isValidConnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,scopedProperties:a,relays:o}=e;if(Wf(t)||await this.isValidPairingTopic(t),!up(o,!0)){let{message:e}=K(`MISSING_OR_INVALID`,`connect() relays: ${o}`);throw Error(e)}if(n&&!Wf(n)&&Uf(n)!==0&&([`fatal`,`error`,`silent`].includes(this.client.logger.level)||this.client.logger.warn(`requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces`),this.validateNamespaces(n,`requiredNamespaces`)),r&&!Wf(r)&&Uf(r)!==0&&this.validateNamespaces(r,`optionalNamespaces`),i&&!Wf(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!Wf(a)){this.validateSessionProps(a,`scopedProperties`);let e=Object.keys(n||{}).concat(Object.keys(r||{}));if(!Object.keys(a).every(t=>e.includes(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(e)}`)}},this.validateNamespaces=(e,t)=>{let n=sp(e,`connect()`,t);if(n)throw Error(n.message)},this.isValidApprove=async e=>{if(!fp(e))throw Error(K(`MISSING_OR_INVALID`,`approve() params: ${e}`).message);let{id:t,namespaces:n,relayProtocol:r,sessionProperties:i,scopedProperties:a}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let o=this.client.proposal.get(t),s=cp(n,`approve()`);if(s)throw Error(s.message);let c=bp(o.requiredNamespaces,n,`approve()`);if(c)throw Error(c.message);if(!Gf(r,!0)){let{message:e}=K(`MISSING_OR_INVALID`,`approve() relayProtocol: ${r}`);throw Error(e)}if(i&&!Wf(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!Wf(a)){this.validateSessionProps(a,`scopedProperties`);let e=new Set(Object.keys(n));if(!Object.keys(a).every(t=>e.has(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(e).join(`, `)}`)}},this.isValidReject=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`reject() params: ${e}`);throw Error(t)}let{id:t,reason:n}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!pp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`reject() reason: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!lp(t)){let{message:e}=K(`MISSING_OR_INVALID`,`onSessionSettleRequest() relay protocol should be a string`);throw Error(e)}let a=$f(n,`onSessionSettleRequest()`);if(a)throw Error(a.message);let o=cp(r,`onSessionSettleRequest()`);if(o)throw Error(o.message);if(Wu(i)){let{message:e}=K(`EXPIRED`,`onSessionSettleRequest()`);throw Error(e)}},this.isValidUpdate=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),i=cp(n,`update()`);if(i)throw Error(i.message);let a=bp(r.requiredNamespaces,n,`update()`);if(a)throw Error(a.message)},this.isValidExtend=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`request() params: ${e}`);throw Error(t)}let{topic:t,request:n,chainId:r,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:a}=this.client.session.get(t);if(!_p(a,r)){let{message:e}=K(`MISSING_OR_INVALID`,`request() chainId: ${r}`);throw Error(e)}if(!mp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`request() ${JSON.stringify(n)}`);throw Error(e)}if(!vp(a,r,n.method)){let{message:e}=K(`MISSING_OR_INVALID`,`request() method: ${n.method}`);throw Error(e)}this.validateRequestExpiry(i)},this.isValidRespond=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`respond() params: ${e}`);throw Error(t)}let{topic:t,response:n}=e;try{await this.isValidSessionTopic(t)}catch(t){throw e?.response?.id&&this.cleanupAfterResponse(e),t}if(!hp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`respond() response: ${JSON.stringify(n)}`);throw Error(e)}let r=this.client.pendingRequest.get(n.id);if(r.topic!==t){let{message:e}=K(`MISMATCHED_TOPIC`,`Request response topic mismatch. reqId: ${n.id}, expected topic: ${r.topic}, received topic: ${t}`);throw Error(e)}},this.isValidPing=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`emit() params: ${e}`);throw Error(t)}let{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!_p(i,r)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() chainId: ${r}`);throw Error(e)}if(!gp(n)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!yp(i,r,n.name)){let{message:e}=K(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!fp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:n,domain:r,nonce:i}=e;if(!Array.isArray(t)||t.length===0)throw Error(`chains is required and must be a non-empty array`);if(!Gf(n,!1))throw Error(`uri is required parameter`);if(!Gf(r,!1))throw Error(`domain is required parameter`);if(!Gf(i,!1))throw Error(`nonce is required parameter`);if([...new Set(t.map(e=>pu(e).namespace))].length>1)throw Error(`Multi-namespace requests are not supported. Please request single namespace only.`);let{namespace:a}=pu(t[0]);if(a!==`eip155`)throw Error(`Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.`)},this.getVerifyContext=async e=>{let{attestationId:t,hash:n,encryptedId:r,metadata:i,transportType:a}=e,o={verified:{verifyUrl:i.verifyUrl||`https://verify.walletconnect.org`,validation:`UNKNOWN`,origin:i.url||``}};try{if(a===DE.link_mode){let e=this.getAppLinkIfEnabled(i,a);return o.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?`VALID`:`INVALID`,o}let e=await this.client.core.verify.resolve({attestationId:t,hash:n,encryptedId:r,verifyUrl:i.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(i.url).origin?`VALID`:`INVALID`)}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((n,r)=>{if(n==null){let{message:i}=K(`MISSING_OR_INVALID`,`${t} must contain an existing value for each key. Received: ${n} for key ${Object.keys(e)[r]}`);throw Error(i)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return typeof t==`object`?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let n of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(n)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:n}=K(`MISSING_OR_INVALID`,`Record was recently deleted - ${t}: ${e}`);throw Error(n)}},this.isLinkModeEnabled=(e,t)=>!e||t!==DE.link_mode?!1:this.client.metadata?.redirect?.linkMode===!0&&this.client.metadata?.redirect?.universal!==void 0&&this.client.metadata?.redirect?.universal!==``&&e?.redirect?.universal!==void 0&&e?.redirect?.universal!==``&&e?.redirect?.linkMode===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof h?.Linking<`u`,this.getAppLinkIfEnabled=(e,t)=>this.isLinkModeEnabled(e,t)?e?.redirect?.universal:void 0,this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes(`wc_ev`)||!e.includes(`topic`))return;let t=Xu(e,`topic`)||``,n=decodeURIComponent(Xu(e,`wc_ev`)||``),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:DE.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:n,sessionExists:r})},this.registerLinkModeListeners=async()=>{if(Qu()||xu()&&this.client.metadata.redirect?.linkMode){let e=h?.Linking;if(typeof e<`u`){e.addEventListener(`url`,this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}},this.getTVFApproveParams=e=>{try{return{approvedChains:jf(e.namespaces),approvedMethods:Mf(e.namespaces),approvedEvents:Nf(e.namespaces),sessionProperties:e.sessionProperties,scopedProperties:e.scopedProperties}}catch(e){return this.client.logger.warn(e,`Error getting TVF approve params`),{}}},this.getTVFParams=(e,t,n)=>{if(!t.request?.method)return{};let r={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{r.txHashes=this.extractTxHashesFromResult(t.request,n),r.contractAddresses=this.isValidContractData(t.request.params)?[t.request.params?.[0]?.to]:[]}catch(e){this.client.logger.warn(e,`Error getting TVF params`)}return r},this.isValidContractData=e=>{if(!e)return!1;try{let t=e?.data||e?.[0]?.data;if(!t.startsWith(`0x`))return!1;let n=t.slice(2);return/^[0-9a-fA-F]*$/.test(n)?n.length%2==0:!1}catch{}return!1},this.extractTxHashesFromResult=(e,t)=>{try{if(!t)return[];let n=e.method,r=OD[n];if(n===`sui_signTransaction`)return[pd(t.transactionBytes)];if(n===`near_signTransaction`)return[md(t)];if(n===`near_signTransactions`)return t.map(e=>md(e));if(n===`xrpl_signTransactionFor`||n===`xrpl_signTransaction`)return[t.tx_json?.hash];if(n===`polkadot_signTransaction`)return[Up({transaction:e.params.transactionPayload,signature:t.signature})];if(n===`algo_signTxn`)return Hf(t)?t.map(e=>gd(e)):[gd(t)];if(n===`cosmos_signDirect`)return[vd(t)];if(n===`wallet_sendCalls`)return yd(t);if(typeof t==`string`)return[t];let i=t[r.key];if(Hf(i))return n===`solana_signAllTransactions`?i.map(e=>fd(e)):i;if(typeof i==`string`)return[i]}catch(e){this.client.logger.warn(e,`Error extracting tx hashes from result`)}return[]}}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,n]of Object.entries(t))for(let t of n)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,`processPendingMessageEvents failed`)}}isInitialized(){if(!this.initialized){let{message:e}=K(`NOT_INITIALIZED`,this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(CE.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:n,attestation:r,transportType:i}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(ID)?this.client.auth.authKeys.get(ID):{publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,n,{receiverPublicKey:a,encoding:i===DE.link_mode?Jd:qd});de(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:i,encryptedId:af(n)})):ye(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i})),await this.client.core.relayer.messages.ack(t,n)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(RE.expired,async e=>{let{topic:t,id:n}=Hu(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,K(`EXPIRED`),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,K(`EXPIRED`),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit(`session_expire`,{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit(`proposal_expire`,{id:n}))})}registerSubscriptionCleanup(){this.client.core.heartbeat.on(`heartbeat_pulse`,async()=>{if(!this.cleanupInProgress){this.cleanupInProgress=!0;try{await this.cleanupOrphanedSubscriptions()}catch(e){this.client.logger.warn(e)}finally{this.cleanupInProgress=!1}}})}registerPairingEvents(){this.client.core.pairing.events.on(PE.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(PE.delete,e=>{this.addToRecentlyDeleted(e.topic,`pairing`)})}isValidPairingTopic(e){if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=K(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!Gf(e,!1)){let{message:t}=K(`MISSING_OR_INVALID`,`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`session topic doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=K(`EXPIRED`,`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=K(`MISSING_OR_INVALID`,`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Gf(e,!1)){let{message:t}=K(`NO_MATCHING_KEY`,`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=K(`MISSING_OR_INVALID`,`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!dp(e)){let{message:t}=K(`MISSING_OR_INVALID`,`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=K(`NO_MATCHING_KEY`,`proposal id doesn't exist: ${e}`);throw Error(t)}if(Wu(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=K(`EXPIRED`,`proposal id: ${e}`);throw Error(t)}}validateRequestExpiry(e){if(e&&!wp(e,ED)){let{message:t}=K(`MISSING_OR_INVALID`,`request() expiry: ${e}. Expiry must be a number (in seconds) between ${ED.min} and ${ED.max}`);throw Error(t)}}},RD=class extends cD{constructor(e,t){super(e,t,bD,_D),this.core=e,this.logger=t}},zD=class extends cD{constructor(e,t){super(e,t,SD,_D),this.core=e,this.logger=t}},BD=class extends cD{constructor(e,t){super(e,t,kD,_D,e=>e.id),this.core=e,this.logger=t}},VD=class extends cD{constructor(e,t){super(e,t,MD,FD,()=>ID),this.core=e,this.logger=t}},HD=class extends cD{constructor(e,t){super(e,t,ND,FD),this.core=e,this.logger=t}},UD=class extends cD{constructor(e,t){super(e,t,PD,FD,e=>e.id),this.core=e,this.logger=t}},WD=class{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new VD(this.core,this.logger),this.pairingTopics=new HD(this.core,this.logger),this.requests=new UD(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},GD=class e extends kT{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=vD.name,this.events=new ot.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||vD.name,this.metadata=Ou(e?.metadata),this.signConfig=e?.signConfig;let t=Wp({logger:e?.logger||vD.logger,name:this.name});this.logger=t,this.core=e?.core||new hD(e),this.session=new zD(this.core,this.logger),this.proposal=new RD(this.core,this.logger),this.pendingRequest=new BD(this.core,this.logger),this.engine=new LD(this),this.auth=new WD(this.core,this.logger)}static async init(t){let n=new e(t);return await n.initialize(),n}get context(){return au(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace(`Initialized`);try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info(`SignClient Initialization Success`)}catch(e){throw this.logger.info(`SignClient Initialization Failure`),this.logger.error(e.message),e}}},KD=`WALLETCONNECT_DEEPLINK_CHOICE`,qD={isHttpUrl(e){return e.startsWith(`http://`)||e.startsWith(`https://`)},formatNativeUrl(e,t,n,r){if(qD.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let i=e.replaceAll(`/`,``).replaceAll(`:`,``);return qD.setWalletConnectDeepLink(i,r),`${i}://wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!qD.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;return e.endsWith(`/`)&&(r=e.slice(0,-1)),qD.setWalletConnectDeepLink(r,n),`${r}/wc?uri=${encodeURIComponent(t)}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t=`_self`){window.open(e,t,`noreferrer noopener`)},setWalletConnectDeepLink(e,t){localStorage.setItem(KD,JSON.stringify({href:e,name:t}))},removeWalletConnectDeepLink(){localStorage.removeItem(KD)}};_();var JD=`https://explorer-api.walletconnect.com`,YD=class{walletInfo;signClient;wcCloudInfo;actions;qrUrl;appUrl;pairings=[];sessions=[];emitter;logger;options;relayUrl;env;requiredNamespaces;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};constructor(e){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);this.walletInfo=e,this.qrUrl={state:U.Init},this.appUrl={state:U.Init},this.requiredNamespaces=e.walletconnect.requiredNamespaces}get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}get isMobile(){return this.env?.device===`mobile`}get wcName(){return this.walletInfo.walletconnect.name}get wcEncoding(){return this.walletInfo.walletconnect.encoding||`hex`}get wcProjectId(){return this.walletInfo.walletconnect.projectId}get wcMobile(){return this.walletInfo.walletconnect.mobile}get accounts(){let e=[];return this.sessions.forEach(t=>{Object.entries(t.namespaces).forEach(([,t])=>{t.accounts.forEach(t=>{let[n,r,i]=t.split(`:`);e.push({namespace:n,chainId:r,address:i})})})}),e}deleteSession(e){let t=[];this.sessions=this.sessions.filter(n=>n.topic===e?(n.namespaces.cosmos.accounts.forEach(e=>{let[,n]=e.split(`:`);t.push(n)}),!1):!0),this.emitter?.emit(`reset`,t),this.logger?.debug("[WALLET EVENT] Emit `reset`")}subscribeToEvents(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.signClient.on(`session_ping`,e=>{this.logger?.debug(`EVENT`,`session_ping`,e)}),this.signClient.on(`session_event`,async e=>{this.logger?.debug(`EVENT`,`session_event`,e)}),this.signClient.on(`session_update`,({topic:e,params:t})=>{this.logger?.debug(`EVENT`,`session_update`,{topic:e,params:t})}),this.signClient.on(`session_delete`,e=>{this.logger?.debug(`EVENT`,`session_delete`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_expire`,e=>{this.logger?.debug(`EVENT`,`session_expire`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_proposal`,e=>{this.logger?.debug(`EVENT`,`session_proposal`,e)}),this.signClient.on(`session_request`,e=>{this.logger?.debug(`EVENT`,`session_request`,e)}),this.signClient.on(`proposal_expire`,e=>{this.logger?.debug(`EVENT`,`proposal_expire`,e)})}async deleteInactivePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll({active:!1}))await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear inactive pairings.`}),this.logger?.debug(`Delete inactive pairing:`,e.topic)}async deleteAllPairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll())await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear pairings.`}),this.logger?.debug(`Delete pairing:`,e.topic)}restorePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.pairings=this.signClient.pairing.getAll({active:!0}).filter(e=>e.peerMetadata?.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED PAIRINGS: `,this.pairings)}get pairing(){return this.pairings[0]}restoreSessions(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.sessions=this.signClient.session.getAll().filter(e=>e.peer.metadata.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED SESSIONS: `,this.sessions)}async getSession(e,t){return this.signClient===void 0&&await this.init(),this.sessions.find(n=>n.namespaces[e]?.accounts?.find(n=>n.startsWith(`${e}:${t}`)))}get walletName(){return this.walletInfo.name}get dappProjectId(){return this.options?.signClient.projectId}setActions(e){this.actions=e}setQRState(e){this.qrUrl.state=e,this.actions?.qrUrl?.state(e)}setQRError(e){this.setQRState(U.Error),this.qrUrl.message=typeof e==`string`?e:e?.message,this.actions?.qrUrl?.message?.(this.qrUrl.message),typeof e!=`string`&&e?.stack&&this.logger?.error(e.stack)}async init(){await this.initSignClient(),this.isMobile&&await this.initAppUrl()}async initSignClient(){this.signClient&&this.relayUrl===this.options?.signClient.relayUrl||(this.signClient=await GD.init(this.options?.signClient),this.relayUrl=this.options?.signClient.relayUrl,this.logger?.debug(`CREATED CLIENT: `,this.signClient),this.logger?.debug(`relayerRegion `,this.options?.signClient.relayUrl),this.subscribeToEvents(),this.restorePairings(),this.restoreSessions())}async initWCCloudInfo(){let e=`${JD}/v3/wallets?projectId=${this.dappProjectId}&sdks=sign_v2&search=${this.wcName}`,t=await(await fetch(e)).json();this.wcCloudInfo=t.listings[this.walletInfo.walletconnect.projectId],this.logger?.debug(`WalletConnect Info:`,this.wcCloudInfo)}async initAppUrl(){this.appUrl.state=U.Pending,this.wcCloudInfo||await this.initWCCloudInfo();let e=this.wcCloudInfo.mobile.native||this.wcMobile?.native,t=this.wcCloudInfo.mobile.universal||this.wcMobile?.universal;this.appUrl.data={native:e,universal:t},this.appUrl.state=U.Done}get nativeUrl(){let e=this.appUrl.data?.native;if(typeof e==`string`||e===void 0)return e;{let{android:t,ios:n,macos:r,windows:i}=e;switch(this.env?.os){case`android`:return t;case`ios`:return n;case`macos`:return r;case`windows`:return i;default:throw Error(`Unknown os: ${this.env?.os}.`)}}}get universalUrl(){return this.appUrl.data?.universal}get redirectHref(){return this.nativeUrl||this.universalUrl}get redirectHrefWithWCUri(){let e;return this.nativeUrl?e=(this.walletInfo.walletconnect.formatNativeUrl||qD.formatNativeUrl)(this.nativeUrl,this.qrUrl.data,this.env?.os,this.walletName):this.universalUrl&&(e=(this.walletInfo.walletconnect.formatUniversalUrl||qD.formatUniversalUrl)(this.universalUrl,this.qrUrl.data,this.walletName)),e}get displayQRCode(){return!(this.pairing||this.redirect)}get redirect(){return!!(this.isMobile&&(this.nativeUrl||this.universalUrl))}openApp(e=!0){let t=e?this.redirectHrefWithWCUri:this.redirectHref;t?(this.logger?.debug(`Redirecting:`,t),qD.openHref(t)):this.logger?.error(`No redirecting href.`)}async connect(e,t){this.signClient===void 0&&await this.init(),this.qrUrl.state!==`Init`&&this.setQRState(U.Init);let n=typeof e==`string`?[`cosmos:${e}`]:e.map(e=>`cosmos:${e}`);this.restorePairings();let r=this.pairing;this.logger?.debug(`Restored active pairing topic is:`,r?.topic),this.displayQRCode&&this.setQRState(U.Pending);let i={cosmos:{methods:[`cosmos_getAccounts`,`cosmos_signAmino`,`cosmos_signDirect`,...this.requiredNamespaces?.methods??[]],chains:n,events:[`chainChanged`,`accountsChanged`,...this.requiredNamespaces?.events??[]]}},a;try{this.logger?.debug(`Connecting chains:`,n),a=await this.signClient.connect({pairingTopic:r?.topic,requiredNamespaces:i,...t}),this.qrUrl.data=a.uri,this.logger?.debug(`Using QR URI:`,a.uri),this.displayQRCode&&this.setQRState(U.Done)}catch(e){this.logger?.error(`Client connect error: `,e),this.displayQRCode&&this.setQRError(e);return}this.redirect&&this.openApp();try{let e=await a.approval();this.logger?.debug(`Established session:`,e),this.sessions.push(e),this.restorePairings()}catch(e){throw this.logger?.error(`Session approval error: `,e),await this.deleteInactivePairings(),e?e.code==5001?Xi:e:(this.displayQRCode&&this.setQRError(Zi),Error(`Proposal Expired`))}finally{!r&&this.qrUrl.message!==Zi.message&&this.setQRState(U.Init)}}async disconnect(e){if(this.signClient===void 0&&await this.init(),e?.walletconnect?.removeAllPairings===!0&&await this.deleteAllPairings(),this.sessions.length!==0){for(let e of this.sessions)try{this.logger?.debug(`Delete session:`,e);let{getSdkError:t}=await g(async()=>{let{getSdkError:e}=await import(`./dist-C582ZtDs.js`);return{getSdkError:e}},[]);await this.signClient.disconnect({topic:e.topic,reason:t(`USER_DISCONNECTED`)})}catch(t){this.logger?.error(`SignClient.disconnect session ${e.topic} failed:`,t)}this.sessions=[],this.emitter?.emit(`sync_disconnect`),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")}}async getSimpleAccount(e){let t=this.accounts.find(({chainId:t})=>t===e);if(!t)throw Error(`Chain ${e} is not connected yet, please check the session approval namespaces`);return t}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:(t,n)=>this.signAmino(e,t,n)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:(t,n)=>this.signDirect(e,t,n)}}async getOfflineSigner(e,t){return t===`amino`&&this.getOfflineSignerAmino?this.getOfflineSignerAmino(e):t===`direct`&&this.getOfflineSignerDirect?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino?this.getOfflineSignerAmino?.(e):this.getOfflineSignerDirect(e)}async _getAccount(e){let t=await this.getSession(`cosmos`,e);if(!t)throw Error(`Session for ${e} not established yet.`);let n=await this.signClient.request({topic:t.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_getAccounts`,params:{}}});return this.logger?.debug(`Response of cosmos_getAccounts`,n),n}async getAccount(e){let{address:t,algo:n,pubkey:r}=(await this._getAccount(e))[0];return{address:t,algo:n,pubkey:new Uint8Array(v.from(r,this.wcEncoding))}}async _signAmino(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);this.redirect&&this.openApp();let a=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signAmino`,params:{signerAddress:t,signDoc:n}}});return this.logger?.debug(`Response of cosmos_signAmino`,a),a}async signAmino(e,t,n,r){return await this._signAmino(e,t,n,r||this.defaultSignOptions)}async _signDirect(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);let a={signerAddress:t,signDoc:{chainId:n.chainId,bodyBytes:v.from(n.bodyBytes).toString(this.wcEncoding),authInfoBytes:v.from(n.authInfoBytes).toString(this.wcEncoding),accountNumber:n.accountNumber.toString()}};this.redirect&&this.openApp();let o=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signDirect`,params:a}});return this.logger?.debug(`Response of cosmos_signDirect`,o),o}async signDirect(e,t,n,r){let{signed:i,signature:a}=await this._signDirect(e,t,n,r||this.defaultSignOptions);return{signed:{chainId:i.chainId,accountNumber:BigInt(i.accountNumber),authInfoBytes:new Uint8Array(v.from(i.authInfoBytes,this.wcEncoding)),bodyBytes:new Uint8Array(v.from(i.bodyBytes,this.wcEncoding))},signature:a}}},XD=class extends Xp{WCClient;clientMutable={state:U.Init};constructor(e,t,n){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);super(e,t),this.WCClient=n}async initClient(e){if(!e){this.initClientError(Error("`walletconnectOptions` is not provided."));return}if(!e.signClient.projectId){this.initClientError(Error("`projectId` is not provided in `walletconnectOptions`."));return}this.initingClient();try{let t=new this.WCClient(this.walletInfo);t.logger=this.logger,t.emitter=this.emitter,t.env=this.env,t.options=e,this.initClientDone(t)}catch(e){this.initClientError(e)}}},ZD=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageRegistry=void 0,e.MessageRegistry=class{constructor(){this.registeredMsgType=new Map}registerMessage(e){if(this.registeredMsgType.has(e.type()))throw Error(`Already registered type ${e.type()}`);this.registeredMsgType.set(e.type(),e)}parseMessage(e){if(!e.type)throw Error(`Null type`);let t=this.registeredMsgType.get(e.type);if(!t)throw Error(`Unregistered msg type ${e.type}`);return Object.setPrototypeOf(e.msg,t.prototype)}}})),QD=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),$D=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSONUint8Array=void 0;var t=QD();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),eO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.Router=void 0;var n=ZD(),r=$D();e.Router=class{constructor(e){this.envProducer=e,this.msgRegistry=new n.MessageRegistry,this.registeredHandler=new Map,this.guards=[],this.port=``,this._isInitialized=!1}get isInitialized(){return this._isInitialized}registerMessage(e){this.msgRegistry.registerMessage(e)}addHandler(e,t){if(this.registeredHandler.has(e))throw Error(`Already registered type ${e}`);this.registeredHandler.set(e,t)}addGuard(e){this.guards.push(e)}listen(e,n){return t(this,void 0,void 0,function*(){if(this.port=e,this.attachHandler(),n){let e;this._initWaiter=new Promise(t=>{e=t}),yield n(),e()}this._isInitialized=!0})}unlisten(){this.port=``,this.detachHandler()}handleMessage(e,n){return t(this,void 0,void 0,function*(){this.isInitialized||(yield this._initWaiter);let t=this.msgRegistry.parseMessage(r.JSONUint8Array.unwrap(e)),i=this.envProducer(n,t.routerMeta??{});for(let e of this.guards)yield e(i,t,n);t.validateBasic();let a=t.route();if(!a)throw Error(`Null router`);let o=this.registeredHandler.get(a);if(!o)throw Error(`Can't get handler`);return r.JSONUint8Array.wrap(yield o(i,t))})}}})),tO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),rO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),iO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumProviderRpcError=e.KeplrError=void 0,e.KeplrError=class e extends Error{constructor(t,n,r){super(r),this.module=t,this.code=n,Object.setPrototypeOf(this,e.prototype)}},e.EthereumProviderRpcError=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}}})),aO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=void 0,e.Message=class{approveExternal(e,t){return!1}}})),oO=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WEBPAGE_PORT=e.APP_PORT=e.BACKGROUND_PORT=void 0,e.BACKGROUND_PORT=`background`,e.APP_PORT=`popup`,e.WEBPAGE_PORT=`webpage`})),sO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sendSimpleMessage=e.SimpleMessage=void 0;var n=aO(),r=Symbol(),i=Symbol(),a=class extends n.Message{constructor(e,t,n){super(),this[r]=e,this[i]=t;for(let e of Object.keys(n))this[e]=n[e]}route(){return this[r]}type(){return this[i]}validateBasic(){}approveExternal(){return!0}};e.SimpleMessage=a;function o(e,n,r,i,o){return t(this,void 0,void 0,function*(){return yield e.sendMessage(n,new a(r,i,o))})}e.sendSimpleMessage=o})),cO=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(eO(),e),n(tO(),e),n(nO(),e),n(rO(),e),n(iO(),e),n(aO(),e),n(oO(),e),n(ZD(),e),n(sO(),e),n($D(),e)})),lO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),uO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),dO=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Keplr=void 0;var r=cO(),i=lO(),a=uO(),o=n(at()),s=n(J()),c=A(),l=n(ee());e.Keplr=class{constructor(e,t,n){this.version=e,this.mode=t,this.requester=n,this.enigmaUtils=new Map,this.defaultOptions={},this.ethereum=new d(this,this.requester),this.starknet=new p(this,this.requester),this.bitcoin=new m(this,this.requester)}ping(){return t(this,void 0,void 0,function*(){yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`keplr-ping`,{})})}enable(e){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`enable-access`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})}isEnabled(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`is-enabled-access`,{chainIds:e})})}disable(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`permission-interactive`,`disable-access`,{chainIds:e??[]}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);if(e.gasPriceStep){let t=Object.assign({},e.gasPriceStep);for(let n of e.feeCurrencies)n.gasPriceStep||=t;delete e.gasPriceStep}return e.coinType&&delete e.coinType,new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`need-suggest-chain-info-interaction`,{chainInfo:e}).then(a=>{a||(i=!0),(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`suggest-chain-info`,{chainInfo:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})})}getKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return new Promise((e,t)=>{let n=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`get-chain-infos-without-endpoints`,{}).then(t=>e(t.chainInfos)).catch(t).finally(()=>n=!0),setTimeout(()=>{n||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`chains`,`get-chain-info-without-endpoints`,{chainId:e}).then(e=>t(e.chainInfo)).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}sendTx(e,n,i){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`background-tx`,`send-tx-to-background`,{chainId:e,tx:n,mode:i})})}signAmino(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino`,{chainId:e,signer:n,signDoc:i,signOptions:(0,o.default)(this.defaultOptions.sign??{},a)}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirect(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct`,{chainId:e,signer:n,signDoc:{bodyBytes:i.bodyBytes,authInfoBytes:i.authInfoBytes,chainId:i.chainId,accountNumber:i.accountNumber?i.accountNumber.toString():null},signOptions:(0,o.default)(this.defaultOptions.sign??{},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,authInfoBytes:e.signed.authInfoBytes,chainId:e.signed.chainId,accountNumber:s.default.fromString(e.signed.accountNumber)},signature:e.signature})).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirectAux(e,n,i,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct-aux`,{chainId:e,signer:n,signDoc:{bodyBytes:i.bodyBytes,publicKey:i.publicKey,chainId:i.chainId,accountNumber:i.accountNumber?i.accountNumber.toString():null,sequence:i.sequence?i.sequence.toString():null},signOptions:(0,o.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,publicKey:e.signed.publicKey,chainId:e.signed.chainId,accountNumber:s.default.fromString(e.signed.accountNumber),sequence:s.default.fromString(e.signed.sequence)},signature:e.signature})).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signArbitrary(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:typeof i==`string`?c.Buffer.from(i):i,signOptions:{isADR36WithString:typeof i==`string`}}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}verifyArbitrary(e,n,i,a){return t(this,void 0,void 0,function*(){return typeof i==`string`&&(i=c.Buffer.from(i)),new Promise((t,o)=>{let s=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`verify-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:i,signature:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signEthereum(e,n,i,a){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let s=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-ethereum`,`request-sign-ethereum`,{chainId:e,signer:n,message:typeof i==`string`?c.Buffer.from(i):i,signType:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signICNSAdr36(e,n,i,a,o){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-icns-adr-36-signatures-v2`,{chainId:e,contractAddress:n,owner:i,username:a,addressChainIds:o}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getOfflineSigner(e,t){return new a.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new a.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new a.CosmJSOfflineSignerOnlyAmino(e,this,n):new a.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-cw20`,`SuggestTokenMsg`,{chainId:e,contractAddress:n,viewingKey:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-cw20`,`get-secret20-viewing-key`,{chainId:e,contractAddress:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`get-pubkey-msg`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`get-tx-encryption-key-msg`,{chainId:e,nonce:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaEncrypt(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`request-encrypt-msg`,{chainId:e,contractCodeHash:n,msg:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaDecrypt(e,n,i){return t(this,void 0,void 0,function*(){return!n||n.length===0?new Uint8Array:new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`secret-wasm`,`request-decrypt-msg`,{chainId:e,cipherText:n,nonce:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new i.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,i,a,s={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`request-sign-eip-712-cosmos-tx-v0`,{chainId:e,signer:n,eip712:i,signDoc:a,signOptions:(0,o.default)(this.defaultOptions.sign??{},s)}).then(t).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`analytics`,`get-analytics-id`,{})})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-v2`,`change-keyring-name-interactive`,{defaultName:e,editable:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__privilageSignAminoWithdrawRewards(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoWithdrawRewards`,{chainId:e,signer:n,signDoc:i})})}__core__privilageSignAminoDelegate(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoDelegate`,{chainId:e,signer:n,signDoc:i})})}__core__privilageSignAminoExecuteCosmWasm(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoExecuteCosmWasm`,{chainId:e,signer:n,signDoc:i})})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`background-tx-ethereum`,`send-ethereum-tx-to-background`,{chainId:e,tx:n})})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`token-erc20`,`SuggestERC20TokenMsg`,{chainId:e,contractAddress:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`interaction`,`injected-webpage-closed`,{})})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetTx(e,n,i){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-tx`,{chainId:e,transactions:n,details:i}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,i)=>{let a=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-deploy-account-tx`,{chainId:e,transaction:n}).then(t).catch(i).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()})})})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-key`,{chainId:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let i=!1;(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>i=!0),setTimeout(()=>{i||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signPsbt(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbt`,{chainId:e,psbtHex:n,options:i})})}signPsbts(e,n,i){return t(this,void 0,void 0,function*(){return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbts`,{chainId:e,psbtsHexes:n,options:i})})}protectedTryOpenSidePanelIfEnabled(e=!1){return t(this,void 0,void 0,function*(){let t=!1;if(typeof window<`u`&&window.__keplr_content_script===!0&&(t=!0),t&&(yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`side-panel`,`GetSidePanelEnabledMsg`,{})).enabled)try{return yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`router-extension/src/router/extension.ts`,`tryOpenSidePanelIfEnabled`,{})}catch(t){if(!e&&t.message&&t.message.includes(`in response to a user gesture`)&&!document.getElementById(`__open_keplr_side_panel__`)){if(yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`interaction`,`ping-content-script-tab-has-opened-side-panel`,{}))return;let e=yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`keyring`,`GetIsLockedMsg`,{}),t=yield(0,r.sendSimpleMessage)(this.requester,r.BACKGROUND_PORT,`settings`,`GetThemeOptionMsg`,{}),n=`
|
|
24
24
|
@font-face {
|
|
25
25
|
font-family: 'Inter-SemiBold-Keplr';
|
|
26
26
|
src: url('${chrome.runtime.getURL(`/assets/Inter-SemiBold.ttf`)}') format('truetype');
|