@dcl/shop 0.1.0-29869835587.commit-e6e6578 → 0.1.0-29920979542.commit-4d76953

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.
Files changed (281) hide show
  1. package/assets/{AnimatedBackground-BvysF8a0.js → AnimatedBackground-CKOyKuq9.js} +1 -1
  2. package/assets/Assets-ByJM1y5V.js +758 -0
  3. package/assets/Assets.styles-DD1YIA0w.js +503 -0
  4. package/assets/Cart-gPQahIus.js +3 -0
  5. package/assets/{CircularProgress-Bf7cTa84.js → CircularProgress-CtItbytk.js} +5 -5
  6. package/assets/{Collection-BFUSn0Z_.js → Collection-CLdWIwei.js} +1 -1
  7. package/assets/{CollectionCarousel-BaK4BZqg.js → CollectionCarousel-B_IpHIiN.js} +1 -1
  8. package/assets/{ConstantsUtil-CJUlyS7R.js → ConstantsUtil-CPwpahR3.js} +1 -1
  9. package/assets/{ContentClient-B6BvDsXj.js → ContentClient-BjQkITL0.js} +1 -1
  10. package/assets/{Creator-CTfg9WAL.js → Creator-VHIhb2gU.js} +1 -1
  11. package/assets/{CssVarsProvider-DQXUaIP8.js → CssVarsProvider-jpijQ72F.js} +1 -1
  12. package/assets/{DeploymentBuilder-Cp9K3LCu.js → DeploymentBuilder-D-b1kMax.js} +1 -1
  13. package/assets/{ErrorNotice-C7soUjRV.js → ErrorNotice-DDr3KjIH.js} +1 -1
  14. package/assets/{ExchangeController-H99cRhIr.js → ExchangeController-Co5yzjlz.js} +1 -1
  15. package/assets/GetCredits-BpKdDGUc.js +1 -0
  16. package/assets/{HelpersUtil-CN9OoRaT.js → HelpersUtil-BcUQ676Q.js} +1 -1
  17. package/assets/ImportListings-B47G6K7L.js +5 -0
  18. package/assets/ItemDetail-BOp9RNpW.js +78 -0
  19. package/assets/{LoadMore-QYabEF53.js → LoadMore-kFcJ8c6R.js} +1 -1
  20. package/assets/MarketCheckout-CS9k9P56.js +3 -0
  21. package/assets/MyAssets-ag2xjktG.js +258 -0
  22. package/assets/{MyFavorites-CCbFgdqL.js → MyFavorites-DjUSaIK2.js} +1 -1
  23. package/assets/MyPurchases-CzDlMrSh.js +200 -0
  24. package/assets/{NetworkUtil-Xp0fNa8X.js → NetworkUtil-CM7JZPbs.js} +1 -1
  25. package/assets/{NotFound-ViHzr3Nr.js → NotFound-Bvrv72pX.js} +1 -1
  26. package/assets/PrimaryListModal-Dcjz3ZJl.js +1 -0
  27. package/assets/{StoreSettings-BnHjda9z.js → StoreSettings-Cin3qrlR.js} +5 -5
  28. package/assets/{Success-CbfD54bz.js → Success-nfqeCH24.js} +2 -2
  29. package/assets/{SwapController-Tfj7j5wZ.js → SwapController-CU_5jEa7.js} +1 -1
  30. package/assets/Tooltip-zQgqv_WS.js +48 -0
  31. package/assets/{TradeService-kxdTGO_i.js → TradeService-_0nAkSNj.js} +1 -1
  32. package/assets/{W3MFrameProviderSingleton-BWjqHbac.js → W3MFrameProviderSingleton-MS8QbMhJ.js} +3 -3
  33. package/assets/{WebCryptoP256-8HU24K3x.js → WebCryptoP256-CPTxXHRL.js} +1 -1
  34. package/assets/{basic-DX-B5_bS.js → basic-Tf3II1zc.js} +1 -1
  35. package/assets/biconomy-DZCRr_z3.js +1 -0
  36. package/assets/{browser-9oFjBwrz.js → browser-7Z6Tx7yC.js} +1 -1
  37. package/assets/{browser-ponyfill-DMgE6PM5.js → browser-ponyfill-C_hn4Jen.js} +1 -1
  38. package/assets/browser-ponyfill-iWQHRc9C.js +1 -0
  39. package/assets/buy-B9BIW0Jt.js +1 -0
  40. package/assets/buy-gasless-DbZJNUIF.js +1 -0
  41. package/assets/{cart-checkout-C3WNM4cy.js → cart-checkout-B7LsaJk_.js} +1 -1
  42. package/assets/{categories-DQ55lr2p.js → categories-BltWZ-Er.js} +33 -33
  43. package/assets/{ccip-CYEnvd4I.js → ccip-Cc36BWjI.js} +1 -1
  44. package/assets/ccip-Do2tH0oQ.js +1 -0
  45. package/assets/{chains-CpxWadaj.js → chains-DOpzCPsr.js} +1 -1
  46. package/assets/collection-D7CncqdI.js +1 -0
  47. package/assets/{common-l22vMua4.js → common-BO9A6Obt.js} +1 -1
  48. package/assets/controller-DCaEQPE3.js +2 -0
  49. package/assets/{core-BtRDOtev.js → core-_W1O6dAM.js} +4 -4
  50. package/assets/{custom-DiiPEfeO.js → custom-BjaMQzvQ.js} +1 -1
  51. package/assets/{data-capture-BFGedRFL.js → data-capture-Dpsgkm1n.js} +1 -1
  52. package/assets/decimals-8h3d0d0Q.js +1 -0
  53. package/assets/decimals-z4vOxece.js +1 -0
  54. package/assets/detectExtension-Cvy4AYwr.js +1 -0
  55. package/assets/{email-D8YhsjSC.js → email-BIl3hlZ2.js} +1 -1
  56. package/assets/{embedded-wallet-CIVu6rdk.js → embedded-wallet-CHCE_nfA.js} +1 -1
  57. package/assets/emotion-styled.browser.esm-DP-xjC5M.js +1 -0
  58. package/assets/engine-CbJiHKp8.js +1 -0
  59. package/assets/{errors-BLIsDEoc.js → errors-BrsnEff4.js} +1 -1
  60. package/assets/estimate-l1-fee-DEmTi_Xz.js +1 -0
  61. package/assets/eth_estimateGas-BhQqpdnq.js +1 -0
  62. package/assets/eth_getStorageAt-CqeWdstl.js +1 -0
  63. package/assets/eth_getTransactionCount-Ca9PbmYY.js +1 -0
  64. package/assets/eth_sendRawTransaction-DPdnXbFR.js +1 -0
  65. package/assets/{ethereum-CkPyqOMA.js → ethereum-C3MAoMFC.js} +1 -1
  66. package/assets/{ethers-BeFqf2KO.js → ethers-CeDRuWE-.js} +1 -1
  67. package/assets/execute-2c6JVbQ7.js +2 -0
  68. package/assets/extractIPFS-HvQvYdM-.js +1 -0
  69. package/assets/{features-CFz8G3yF.js → features-CxUBJMFm.js} +1 -1
  70. package/assets/fetchTokenMetadata-DS7xbFh8.js +2 -0
  71. package/assets/{fortmatic-DhmlcDbL.js → fortmatic-udOxQk4J.js} +1 -1
  72. package/assets/get-bytecode-mfFuNYuc.js +1 -0
  73. package/assets/get-ecosystem-wallet-info-CpGKVIMs.js +1 -0
  74. package/assets/getBalance-DVC-Vuqr.js +2 -0
  75. package/assets/getInstalledModules-BNHlcIGs.js +1 -0
  76. package/assets/getNFT-CSbrXFvE.js +2 -0
  77. package/assets/getNFT-qJLfFykV.js +1 -0
  78. package/assets/{getOverlayAlpha-B_CoLTSj.js → getOverlayAlpha-DOBThdqC.js} +1 -1
  79. package/assets/{hashTypedData-DHR5yJit.js → hashTypedData-B4_iMbvS.js} +1 -1
  80. package/assets/{hashTypedData-BYNsvxyc.js → hashTypedData-dhsewv5B.js} +1 -1
  81. package/assets/import-C5j6Wx_d.js +1 -0
  82. package/assets/in-app-1Ryel-eO.js +1 -0
  83. package/assets/in-app-wallet-calls-CffLwIeA.js +1 -0
  84. package/assets/{index-CaHcCfyv.js → index-4eD2NdIO.js} +1 -1
  85. package/assets/index-6RadCnK_.js +2 -0
  86. package/assets/{index-CwWLPHI8.js → index-8mbANljx.js} +1 -1
  87. package/assets/index-BA2L6eSl.css +1 -0
  88. package/assets/{index-BDfpUFpd.js → index-BOwlzThi.js} +1 -1
  89. package/assets/{index-Cr7q_wI-.js → index-BdfhcS1O.js} +1 -1
  90. package/assets/{index-DJsdR_Dh.js → index-BmVq_L-1.js} +1 -1
  91. package/assets/{index-DkfyzgR8.js → index-BoYovC-T.js} +1 -1
  92. package/assets/{index-QMzB_9kT.js → index-BpbWCyB4.js} +1 -1
  93. package/assets/index-BsWlzlq1.js +4 -0
  94. package/assets/index-BsYYLNpm.js +1 -0
  95. package/assets/{index-CcJuo_B4.js → index-BukPqvyW.js} +1 -1
  96. package/assets/{index-PGZV0u8x.js → index-Bv7ES646.js} +1 -1
  97. package/assets/{index-DfnBxBKK.js → index-C-5O3A8t.js} +2 -2
  98. package/assets/{index-CN5ZLDnc.js → index-C-P3yFpA.js} +1 -1
  99. package/assets/index-C-zT6j6Q.js +2 -0
  100. package/assets/{index-FUu8bz4c.js → index-C1RUJcK5.js} +4 -4
  101. package/assets/{index-BtmcJRGy.js → index-C8ZENK8t.js} +1 -1
  102. package/assets/{index-BmxotHif.js → index-CABKIgjm.js} +1 -1
  103. package/assets/{index-pbhVNuOA.js → index-CAp_8XyK.js} +1 -1
  104. package/assets/{index--JSSHFMQ.js → index-CFkKMhmf.js} +1 -1
  105. package/assets/{index-BCGZozX2.js → index-CGKFKFa5.js} +1 -1
  106. package/assets/{index-Cuf2In7m.js → index-CGtI8pSN.js} +1 -1
  107. package/assets/{index-CTwiT5J0.js → index-CHTy8tIL.js} +1 -1
  108. package/assets/{index-g3sxw2b2.js → index-COJ-kKXu.js} +2 -2
  109. package/assets/{index-DGOaB47n.js → index-CQbgtHPx.js} +1 -1
  110. package/assets/{index-Do7lLz-O.js → index-C_P8UXnh.js} +1 -1
  111. package/assets/{index-goSkKmOv.js → index-C_wB7Cn-.js} +1 -1
  112. package/assets/{index-Bk6ayCIs.js → index-CjTTlJEo.js} +1 -1
  113. package/assets/{index-CtzfdSwK.js → index-Co247DcD.js} +1 -1
  114. package/assets/{index-B3vzzuVP.js → index-CpetmNFi.js} +1 -1
  115. package/assets/{index-Dp3Py-Ws.js → index-Cq0eRfqs.js} +1 -1
  116. package/assets/{index-BMFRmVon.js → index-CtUSW-Bf.js} +1 -1
  117. package/assets/{index-CXYokVDz.js → index-CvPKxvVT.js} +1 -1
  118. package/assets/{index-tKIgdudq.js → index-CvUlVzEh.js} +1 -1
  119. package/assets/index-Cw_zTgKJ.js +289 -0
  120. package/assets/{index-dYP5cvK2.js → index-Cx_FuvLh.js} +1 -1
  121. package/assets/{index-fOZ3JG1l.js → index-D7-fYmTC.js} +1 -1
  122. package/assets/{index-Y6b_vUQr.js → index-DDH_k4kE.js} +1 -1
  123. package/assets/{index-Cuq6iGY1.js → index-DDcyCRGs.js} +1 -1
  124. package/assets/{index-B4p2eLga.js → index-DEDR_sJL.js} +1 -1
  125. package/assets/{index-BfnFZQqu.js → index-DJVoIGkn.js} +1 -1
  126. package/assets/{index-07n_zhYq.js → index-DJZlClFe.js} +1 -1
  127. package/assets/{index-Cmi7sq59.js → index-DNI-bcwo.js} +1 -1
  128. package/assets/{index-BSjx8-a9.js → index-DPhmZ0Is.js} +1 -1
  129. package/assets/{index-CdfmzGmf.js → index-DZ7nTG5K.js} +1 -1
  130. package/assets/index-DeN7zJP6.js +2 -0
  131. package/assets/{index-2yTqM9xZ.js → index-DhSzX-CI.js} +1 -1
  132. package/assets/{index-CWuMb79R.js → index-DhoYZdLQ.js} +3 -3
  133. package/assets/{index-IqrjnIQ9.js → index-Dj-dQr5B.js} +1 -1
  134. package/assets/{index-BQwZ_U1w.js → index-Dnt0S0mL.js} +1 -1
  135. package/assets/{index-Da6whmyR.js → index-DobQjFvC.js} +1 -1
  136. package/assets/{index-C7SiFPEi.js → index-Drt6Trho.js} +1 -1
  137. package/assets/{index-CI-AD5iw.js → index-DtQgf-Kz.js} +1 -1
  138. package/assets/{index-BufR0bxC.js → index-LAd_iywb.js} +1 -1
  139. package/assets/{index-BuMOiAUw.js → index-LE62Wpkl.js} +1 -1
  140. package/assets/{index-mfpj9mGL.js → index-QNpfh38n.js} +1 -1
  141. package/assets/index-SIMFr-pa.js +3 -0
  142. package/assets/{index-C7VPGrdO.js → index-ULH0loBs.js} +1 -1
  143. package/assets/{index-Cv6TsksD.js → index-VGkdjss0.js} +1 -1
  144. package/assets/{index-BDRB8FDm.js → index-dlW_0FAj.js} +1 -1
  145. package/assets/{index-htvE856q.js → index-fBrY7bRL.js} +1 -1
  146. package/assets/{index-B4OkjZ5Z.js → index-nWE7w6GR.js} +3 -3
  147. package/assets/{index-gvpjFbR1.js → index-yxsQFb8G.js} +1 -1
  148. package/assets/{index-C_jKIil3.js → index-zY0h-QLU.js} +1 -1
  149. package/assets/{index.es-BsTkmkjS.js → index.es-BqINDpai.js} +1 -1
  150. package/assets/{index.es-Dvmu0NoU.js → index.es-DT0e-8F6.js} +4 -4
  151. package/assets/index.es-aQzlORue.js +1 -0
  152. package/assets/linkAccount-Coo42zCf.js +1 -0
  153. package/assets/loader-logo-BzY9EKdC.js +1 -0
  154. package/assets/{localBatchGatewayRequest-Cej95COc.js → localBatchGatewayRequest-CW07fVpY.js} +1 -1
  155. package/assets/{mana-rate-Disk-ReT.js → mana-rate-zpYtmb1D.js} +1 -1
  156. package/assets/{native-BMBZUPnx.js → native-0dhyeu0o.js} +1 -1
  157. package/assets/{networks-Dapm2cWP.js → networks-h5NQDWsI.js} +1 -1
  158. package/assets/{onramp-DLQLHSLI.js → onramp-BX2NU_qB.js} +1 -1
  159. package/assets/openzeppelin-PtKZTHIi.js +1 -0
  160. package/assets/ownerOf-DZ5adWxQ.js +1 -0
  161. package/assets/parseNft-PrcFp1dy.js +2 -0
  162. package/assets/{parseSignature-BUx9b-zW.js → parseSignature-773UBBmK.js} +14 -14
  163. package/assets/{parseSignature-O3FZfUUc.js → parseSignature-CCoh-bOo.js} +1 -1
  164. package/assets/passkeys-BpPvCZon.js +1 -0
  165. package/assets/{pay-with-exchange-DaiVhZAg.js → pay-with-exchange-gDj4lADp.js} +1 -1
  166. package/assets/prepare-contract-call-C3igYCn_.js +26 -0
  167. package/assets/{qr-overlay-CGmkZvV0.js → qr-overlay-DtSlNNS5.js} +3 -3
  168. package/assets/{react-C51i12iP.js → react-BMZSDQJw.js} +1 -1
  169. package/assets/{receive-DVL3YCyE.js → receive-DSZFrYHX.js} +1 -1
  170. package/assets/resolveImplementation-CbU1L1Fc.js +1 -0
  171. package/assets/{rpc-q1fg-PaK.js → rpc-BDqeZL2i.js} +2 -2
  172. package/assets/{secp256k1-Dj-unqH_.js → secp256k1-BZe2znzk.js} +1 -1
  173. package/assets/secp256k1-CknJ3w21.js +1 -0
  174. package/assets/{secp256k1-DT5nTJQH.js → secp256k1-pNAGLswQ.js} +1 -1
  175. package/assets/{send-CjhoocaG.js → send-DRd_OEaR.js} +1 -1
  176. package/assets/send-batch-transaction-D7eoe7U7.js +1 -0
  177. package/assets/send-eip712-transaction-fOYbA_CA.js +2 -0
  178. package/assets/send-gasless-transaction-Cxhl4UgI.js +2 -0
  179. package/assets/send-transaction-BoSey3h6.js +2 -0
  180. package/assets/{sendRawTransaction-CxX-WJOv.js → sendRawTransaction-2HzfqXtJ.js} +3 -3
  181. package/assets/{sentry-DKBoGDXH.js → sentry-8SzFotJj.js} +1 -1
  182. package/assets/{serializeTransaction-KtBgxNjB.js → serializeTransaction-DehzIoon.js} +1 -1
  183. package/assets/session-proposal-CXtYJ600.js +1 -0
  184. package/assets/session-request-Bzoc3aWY.js +2 -0
  185. package/assets/sha256-CDuVPJMW.js +1 -0
  186. package/assets/signing-BuFUwBsg.js +5 -0
  187. package/assets/{socials-BqxUUXtR.js → socials-DzFO5cs6.js} +1 -1
  188. package/assets/{swaps-EDZta6zk.js → swaps-DDj52bDn.js} +1 -1
  189. package/assets/thirdweb-CLT7AbaR.js +27 -0
  190. package/assets/to-serializable-transaction-3rHBxT_2.js +2 -0
  191. package/assets/totalSupply-qMyfSB-2.js +1 -0
  192. package/assets/transaction-DiMmwD2W.js +1 -0
  193. package/assets/transactionReceipt-D2-apwad.js +1 -0
  194. package/assets/{transactions-CGvL3Aj1.js → transactions-BzNf4QDf.js} +1 -1
  195. package/assets/types-DC0Zmj1B.js +1 -0
  196. package/assets/useCreditPacks-CCExEWAo.js +1 -0
  197. package/assets/useInfiniteGrid-CpG_Ao97.js +1 -0
  198. package/assets/{useStore-CQIJvFZA.js → useStore-IaDRl00u.js} +2 -2
  199. package/assets/useTheme-Y_Ojpcr-.js +1 -0
  200. package/assets/useTheme-tg-omw8T.js +1 -0
  201. package/assets/{utils-CBfcEx8F.js → utils-DLyVQGg1.js} +1 -1
  202. package/assets/{verifyHash-2hJaw2xF.js → verifyHash-4UFZIpQG.js} +1 -1
  203. package/assets/{w3m-modal-DZpfNka8.js → w3m-modal-D0oIAAHh.js} +1 -1
  204. package/assets/{w3m-modal-CXTIrAhw.js → w3m-modal-DuWRb-89.js} +1 -1
  205. package/assets/wait-for-tx-receipt-4BEbGWQp.js +1 -0
  206. package/assets/wallet-kind-Cg4yayUr.js +1 -0
  207. package/assets/wallets-K1dHuOGH.js +13 -0
  208. package/assets/web-connector-6Dl638uy.js +9 -0
  209. package/assets/{writeContract-CJkUo9D7.js → writeContract-DO4OjsR8.js} +1 -1
  210. package/assets/{zora-sepolia-CKT05Lph.js → zora-sepolia-sSAsjV_j.js} +1 -1
  211. package/assets/{zoraTestnet-CRD_79WO.js → zoraTestnet-DTqS-Os0.js} +1 -1
  212. package/index.html +11 -11
  213. package/package.json +2 -2
  214. package/assets/Assets-DoUIRoSX.js +0 -503
  215. package/assets/Cart-Cyj_u0xP.js +0 -3
  216. package/assets/GetCredits-BqhYAHL0.js +0 -1
  217. package/assets/ImportListings-CCQDdZMF.js +0 -5
  218. package/assets/ItemDetail-C6EEFa3M.js +0 -78
  219. package/assets/MarketCheckout-B1QbAQBC.js +0 -50
  220. package/assets/MyAssets-FkZXy017.css +0 -1
  221. package/assets/MyAssets-gjvqMgx3.js +0 -7
  222. package/assets/MyPurchases-D04-_M8f.js +0 -3
  223. package/assets/PrimaryListModal-D6DU8-ZC.js +0 -1
  224. package/assets/biconomy-DIiiyQwz.js +0 -1
  225. package/assets/browser-ponyfill-Djb5Py6a.js +0 -1
  226. package/assets/buy-C5_gzZWJ.js +0 -1
  227. package/assets/buy-gasless-Cxx1jwuH.js +0 -1
  228. package/assets/ccip-BafcYzQ9.js +0 -1
  229. package/assets/collection-DHOETntw.js +0 -1
  230. package/assets/controller-B80HcZCL.js +0 -2
  231. package/assets/decimals-Cdn10TAV.js +0 -1
  232. package/assets/decimals-DCazhsdS.js +0 -1
  233. package/assets/detectExtension-BSAkQ0I6.js +0 -1
  234. package/assets/emotion-styled.browser.esm-ClqtCiJQ.js +0 -1
  235. package/assets/engine-DsQHyohE.js +0 -1
  236. package/assets/estimate-l1-fee-Cna0j8C0.js +0 -1
  237. package/assets/eth_estimateGas-A7dV8Dq8.js +0 -1
  238. package/assets/eth_getStorageAt-DVqXAuzZ.js +0 -1
  239. package/assets/eth_getTransactionCount-DLrwUt6V.js +0 -1
  240. package/assets/extractIPFS-Dq1wghef.js +0 -1
  241. package/assets/fetchTokenMetadata-BTRazXId.js +0 -2
  242. package/assets/get-ecosystem-wallet-info-B8H2bbhI.js +0 -1
  243. package/assets/getBalance-BewKvJ6T.js +0 -2
  244. package/assets/getInstalledModules-ByFUGStC.js +0 -1
  245. package/assets/getNFT-1nUsfQAJ.js +0 -1
  246. package/assets/getNFT-BuDjU8-b.js +0 -2
  247. package/assets/import-CWsWpkUA.js +0 -1
  248. package/assets/in-app-wallet-calls-Fj_OJpWi.js +0 -1
  249. package/assets/index-B04ndUbB.js +0 -2
  250. package/assets/index-BBuZMaWr.js +0 -231
  251. package/assets/index-CzDOjIXr.js +0 -2
  252. package/assets/index-DH3Yzbz3.js +0 -1
  253. package/assets/index-Dhu9IXc1.js +0 -3
  254. package/assets/index-PISx9bvm.css +0 -1
  255. package/assets/index-nRbKhfJe.js +0 -2
  256. package/assets/index.es-CiHN99GO.js +0 -1
  257. package/assets/loader-logo-CK-TcJ-S.js +0 -1
  258. package/assets/openzeppelin-B2ua0Itn.js +0 -1
  259. package/assets/ownerOf-DOppg2jR.js +0 -1
  260. package/assets/parseNft-D_8M9mfO.js +0 -2
  261. package/assets/passkeys-CW4jmTtA.js +0 -1
  262. package/assets/resolveImplementation-06H3horI.js +0 -1
  263. package/assets/secp256k1-D6rN1PGV.js +0 -1
  264. package/assets/send-batch-transaction-Bbiva6rb.js +0 -1
  265. package/assets/send-eip712-transaction-NxK7USDp.js +0 -2
  266. package/assets/send-gasless-transaction-x5mofsoE.js +0 -2
  267. package/assets/session-proposal-KoaDAo-a.js +0 -1
  268. package/assets/session-request-CSef7ndM.js +0 -2
  269. package/assets/sha256-DkPvB4om.js +0 -1
  270. package/assets/signing-B9F_g0GG.js +0 -30
  271. package/assets/thirdweb-D99mQjH-.js +0 -27
  272. package/assets/totalSupply-BhpAtMjH.js +0 -1
  273. package/assets/trade-encoding-CWytSFjw.js +0 -1
  274. package/assets/transactionReceipt-OilL7-NS.js +0 -1
  275. package/assets/useInfiniteGrid-CpiD11c4.js +0 -1
  276. package/assets/useTheme-6tr3eE7K.js +0 -1
  277. package/assets/useTheme-Dpdkvivv.js +0 -1
  278. package/assets/wait-for-tx-receipt-Dt-8wYDQ.js +0 -1
  279. package/assets/wallet-kind-B9P1TeIH.js +0 -1
  280. package/assets/wallets-v6YyPYY8.js +0 -15
  281. package/assets/web-connector-DBKfHuJF.js +0 -9
@@ -1,4 +1,4 @@
1
- import{C as l,E as g,R as h,o as m,S as w,b as c,r as E,t as _}from"./W3MFrameProviderSingleton-BWjqHbac.js";import{au as R}from"./NetworkUtil-Xp0fNa8X.js";import{i as b,b as y}from"./lit-element-B3y9oplH.js";import{n as d,o as O}from"./class-map-CxwNmq0D.js";import{c as v}from"./index-BQwZ_U1w.js";import{d as C,r as S,e as $}from"./index-B4OkjZ5Z.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function G(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=C`
1
+ import{C as l,E as g,R as h,o as m,S as w,b as c,r as E,t as _}from"./W3MFrameProviderSingleton-MS8QbMhJ.js";import{au as R}from"./NetworkUtil-CM7JZPbs.js";import{i as b,b as y}from"./lit-element-B3y9oplH.js";import{n as d,o as O}from"./class-map-CxwNmq0D.js";import{c as v}from"./index-Dnt0S0mL.js";import{d as C,r as S,e as $}from"./index-nWE7w6GR.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function G(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=C`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{i as m,b as f}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{c as l}from"./index-BQwZ_U1w.js";import{d as c}from"./index-B4OkjZ5Z.js";const p=c`
1
+ import{i as m,b as f}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{c as l}from"./index-Dnt0S0mL.js";import{d as c}from"./index-nWE7w6GR.js";const p=c`
2
2
  :host {
3
3
  display: block;
4
4
  background: linear-gradient(
@@ -1,4 +1,4 @@
1
- import{a as b,i as g,b as m}from"./lit-element-B3y9oplH.js";import{n as v,r as h}from"./class-map-CxwNmq0D.js";import{d as y}from"./index-B4OkjZ5Z.js";import{c as w}from"./index-BQwZ_U1w.js";import{j as x,e as $,i as R,p as T,R as C,M as P}from"./W3MFrameProviderSingleton-BWjqHbac.js";const s=T({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),_={state:s,subscribe(t){return R(s,()=>t(s))},subscribeKey(t,e){return $(s,t,e)},showTooltip({message:t,triggerRect:e,variant:o}){s.open=!0,s.message=t,s.triggerRect=e,s.variant=o},hide(){s.open=!1,s.message="",s.triggerRect={width:0,height:0,top:0,left:0}}},a=x(_),j=b`
1
+ import{a as b,i as g,b as m}from"./lit-element-B3y9oplH.js";import{n as v,r as h}from"./class-map-CxwNmq0D.js";import{d as y}from"./index-nWE7w6GR.js";import{c as w}from"./index-Dnt0S0mL.js";import{j as x,e as $,i as R,p as T,R as C,M as P}from"./W3MFrameProviderSingleton-MS8QbMhJ.js";const s=T({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),_={state:s,subscribe(t){return R(s,()=>t(s))},subscribeKey(t,e){return $(s,t,e)},showTooltip({message:t,triggerRect:e,variant:o}){s.open=!0,s.message=t,s.triggerRect=e,s.variant=o},hide(){s.open=!1,s.message="",s.triggerRect={width:0,height:0,top:0,left:0}}},a=x(_),j=b`
2
2
  :host {
3
3
  width: 100%;
4
4
  display: block;
@@ -0,0 +1,3 @@
1
+ import{B as N}from"./dcl-schemas-BICTSpB5.js";import{g as Lt}from"./react-BMZSDQJw.js";import{f as At}from"./signing-BuFUwBsg.js";import{aW as xt}from"./prepare-contract-call-C3igYCn_.js";import{B as we,_ as P,c as ne,h as Me,y as Mt}from"./hooks.module-C4R15-Vr.js";import{E as Rt}from"./index-BsYYLNpm.js";import"./utils-DLyVQGg1.js";import"./sentry-8SzFotJj.js";import"./index-Cw_zTgKJ.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./to-serializable-transaction-3rHBxT_2.js";import"./transaction-DiMmwD2W.js";import"./get-bytecode-mfFuNYuc.js";import"./index-COjgItKg.js";const Pt=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};class q{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let s=0;s<localStorage.length;s++){const r=localStorage.key(s);typeof r=="string"&&r.startsWith(e)&&n.push(r)}n.forEach(s=>localStorage.removeItem(s))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new q("CBWSDK").clear(),new q("walletlink").clear()}}const U={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},be={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},tt="Unspecified error message.",Tt="Unspecified server error.";function Ee(t,e=tt){if(t&&Number.isInteger(t)){const n=t.toString();if(ye(be,n))return be[n].message;if(nt(t))return Tt}return e}function Ot(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(be[e]||nt(t))}function Nt(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&ye(t,"code")&&Ot(t.code)){const s=t;n.code=s.code,s.message&&typeof s.message=="string"?(n.message=s.message,ye(s,"data")&&(n.data=s.data)):(n.message=Ee(n.code),n.data={originalError:Re(t)})}else n.code=U.rpc.internal,n.message=Pe(t,"message")?t.message:tt,n.data={originalError:Re(t)};return e&&(n.stack=Pe(t,"stack")?t.stack:void 0),n}function nt(t){return t>=-32099&&t<=-32e3}function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function ye(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Pe(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const L={rpc:{parse:t=>W(U.rpc.parse,t),invalidRequest:t=>W(U.rpc.invalidRequest,t),invalidParams:t=>W(U.rpc.invalidParams,t),methodNotFound:t=>W(U.rpc.methodNotFound,t),internal:t=>W(U.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return W(e,t)},invalidInput:t=>W(U.rpc.invalidInput,t),resourceNotFound:t=>W(U.rpc.resourceNotFound,t),resourceUnavailable:t=>W(U.rpc.resourceUnavailable,t),transactionRejected:t=>W(U.rpc.transactionRejected,t),methodNotSupported:t=>W(U.rpc.methodNotSupported,t),limitExceeded:t=>W(U.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>J(U.provider.userRejectedRequest,t),unauthorized:t=>J(U.provider.unauthorized,t),unsupportedMethod:t=>J(U.provider.unsupportedMethod,t),disconnected:t=>J(U.provider.disconnected,t),chainDisconnected:t=>J(U.provider.chainDisconnected,t),unsupportedChain:t=>J(U.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:s}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new rt(e,n,s)}}};function W(t,e){const[n,s]=st(e);return new it(t,n||Ee(t),s)}function J(t,e){const[n,s]=st(e);return new rt(t,n||Ee(t),s)}function st(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class it extends Error{constructor(e,n,s){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,s!==void 0&&(this.data=s)}}class rt extends it{constructor(e,n,s){if(!Dt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,s)}}function Dt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ce(){return t=>t}const re=Ce(),Ut=Ce(),jt=Ce();function V(t){return Math.floor(t)}const at=/^[0-9]*$/,ot=/^[a-f0-9]*$/;function Y(t){return Ie(crypto.getRandomValues(new Uint8Array(t)))}function Ie(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function oe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function se(t,e=!1){const n=t.toString("hex");return re(e?`0x${n}`:n)}function de(t){return se(ve(t),!0)}function K(t){return jt(t.toString(10))}function $(t){return re(`0x${BigInt(t).toString(16)}`)}function ct(t){return t.startsWith("0x")||t.startsWith("0X")}function Se(t){return ct(t)?t.slice(2):t}function dt(t){return ct(t)?`0x${t.slice(2)}`:`0x${t}`}function ce(t){if(typeof t!="string")return!1;const e=Se(t).toLowerCase();return ot.test(e)}function Ht(t,e=!1){if(typeof t=="string"){const n=Se(t).toLowerCase();if(ot.test(n))return re(e?`0x${n}`:n)}throw L.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function _e(t,e=!1){let n=Ht(t,!1);return n.length%2===1&&(n=re(`0${n}`)),e?re(`0x${n}`):n}function Z(t){if(typeof t=="string"){const e=Se(t).toLowerCase();if(ce(e)&&e.length===40)return Ut(dt(e))}throw L.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function ve(t){if(N.isBuffer(t))return t;if(typeof t=="string"){if(ce(t)){const e=_e(t,!1);return N.from(e,"hex")}return N.from(t,"utf8")}throw L.rpc.invalidParams(`Not binary data: ${String(t)}`)}function ie(t){if(typeof t=="number"&&Number.isInteger(t))return V(t);if(typeof t=="string"){if(at.test(t))return V(Number(t));if(ce(t))return V(Number(BigInt(_e(t,!0))))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function ee(t){if(t!==null&&(typeof t=="bigint"||Wt(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(ie(t));if(typeof t=="string"){if(at.test(t))return BigInt(t);if(ce(t))return BigInt(_e(t,!0))}throw L.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Bt(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw L.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function Wt(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}function qt(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,s=t?t.getAttribute("href"):null;return!s||s.startsWith("javascript:")||s.startsWith("vbscript:")?`${e}//${n}/favicon.ico`:s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")?s:s.startsWith("//")?e+s:`${e}//${n}${s}`}async function Kt(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Vt(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function zt(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:s}}async function Ft(t,{iv:e,cipherText:n}){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(s)}function lt(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function ht(t,e){const n=lt(t),s=await crypto.subtle.exportKey(n,e);return Ie(new Uint8Array(s))}async function ut(t,e){const n=lt(t),s=oe(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(s),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Zt(t,e){const n=JSON.stringify(t,(s,r)=>{if(!(r instanceof Error))return r;const i=r;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return zt(e,n)}async function Gt(t,e){return JSON.parse(await Ft(e,t))}const le={storageKey:"ownPrivateKey",keyType:"private"},he={storageKey:"ownPublicKey",keyType:"public"},ue={storageKey:"peerPublicKey",keyType:"public"};class $t{constructor(){this.storage=new q("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(he.storageKey),this.storage.removeItem(le.storageKey),this.storage.removeItem(ue.storageKey)}async generateKeyPair(){const e=await Kt();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(le,e.privateKey),await this.storeKey(he,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(le)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(he)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await Vt(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?ut(e.keyType,n):null}async storeKey(e,n){const s=await ht(e.keyType,n);this.storage.setItem(e.storageKey,s)}}const X="4.3.0",ft="@coinbase/wallet-sdk";async function Le(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":X,"X-Cbw-Sdk-Platform":ft}}),{result:r,error:i}=await s.json();if(i)throw i;return r}function Yt(){return globalThis.coinbaseWalletExtension}function Jt(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function pt({metadata:t,preference:e}){var n,s;const{appName:r,appLogoUrl:i,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const h=Yt();if(h)return(n=h.setAppInfo)===null||n===void 0||n.call(h,r,i,a,e),h}const o=Jt();if(o!=null&&o.isCoinbaseBrowser)return(s=o.setAppInfo)===null||s===void 0||s.call(o,r,i,a,e),o}function Qt(t){if(!t||typeof t!="object"||Array.isArray(t))throw L.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw L.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw L.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw L.provider.unsupportedMethod()}}const Te="accounts",Oe="activeChain",Ne="availableChains",De="walletCapabilities";class Xt{constructor(e){var n,s,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new $t,this.storage=new q("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(Te))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(Oe)||{id:(r=(s=e.metadata.appChainIds)===null||s===void 0?void 0:s[0])!==null&&r!==void 0?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,s,r,i;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const a=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(r=e.params)!==null&&r!==void 0?r:{})}}),o=await this.communicator.postRequestAndWaitForResponse(a);if("failure"in o.content)throw o.content.failure;const h=await ut("public",o.sender);await this.keyManager.setPeerPublicKey(h);const v=(await this.decryptResponseMessage(o)).result;if("error"in v)throw v.error;switch(e.method){case"eth_requestAccounts":{const k=v.value;this.accounts=k,this.storage.storeObject(Te,k),(i=this.callback)===null||i===void 0||i.call(this,"accountsChanged",k);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw L.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:$(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return $(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(De);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,s;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const r=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(r)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const s=e.params;if(!s||!(!((n=s[0])===null||n===void 0)&&n.chainId))throw L.rpc.invalidParams();const r=ie(s[0].chainId);if(this.updateChain(r))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(r),a}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw L.provider.unauthorized("No valid session found, try requestAccounts before other methods");const s=await Zt({action:e,chainId:this.chain.id},n),r=await this.createRequestMessage({encrypted:s});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const n=await ht("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,s;const r=e.content;if("failure"in r)throw r.failure;const i=await this.keyManager.getSharedSecret();if(!i)throw L.provider.unauthorized("Invalid session");const a=await Gt(r.encrypted,i),o=(n=a.data)===null||n===void 0?void 0:n.chains;if(o){const p=Object.entries(o).map(([v,k])=>({id:Number(v),rpcUrl:k}));this.storage.storeObject(Ne,p),this.updateChain(this.chain.id,p)}const h=(s=a.data)===null||s===void 0?void 0:s.capabilities;return h&&this.storage.storeObject(De,h),a}updateChain(e,n){var s;const r=n??this.storage.loadObject(Ne),i=r==null?void 0:r.find(a=>a.id===e);return i?(i!==this.chain&&(this.chain=i,this.storage.storeObject(Oe,i),(s=this.callback)===null||s===void 0||s.call(this,"chainChanged",$(i.id))),!0):!1}}var O={},G={},Ue;function gt(){if(Ue)return G;Ue=1,Object.defineProperty(G,"__esModule",{value:!0}),G.anumber=t,G.abytes=n,G.ahash=s,G.aexists=r,G.aoutput=i;function t(a){if(!Number.isSafeInteger(a)||a<0)throw new Error("positive integer expected, got "+a)}function e(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"}function n(a,...o){if(!e(a))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(a.length))throw new Error("Uint8Array expected of length "+o+", got length="+a.length)}function s(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(a.outputLen),t(a.blockLen)}function r(a,o=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(o&&a.finished)throw new Error("Hash#digest() has already been called")}function i(a,o){n(a);const h=o.outputLen;if(a.length<h)throw new Error("digestInto() expects output buffer of length at least "+h)}return G}var C={},je;function en(){if(je)return C;je=1,Object.defineProperty(C,"__esModule",{value:!0}),C.add5L=C.add5H=C.add4H=C.add4L=C.add3H=C.add3L=C.rotlBL=C.rotlBH=C.rotlSL=C.rotlSH=C.rotr32L=C.rotr32H=C.rotrBL=C.rotrBH=C.rotrSL=C.rotrSH=C.shrSL=C.shrSH=C.toBig=void 0,C.fromBig=n,C.split=s,C.add=A;const t=BigInt(2**32-1),e=BigInt(32);function n(g,f=!1){return f?{h:Number(g&t),l:Number(g>>e&t)}:{h:Number(g>>e&t)|0,l:Number(g&t)|0}}function s(g,f=!1){let m=new Uint32Array(g.length),d=new Uint32Array(g.length);for(let w=0;w<g.length;w++){const{h:_,l:R}=n(g[w],f);[m[w],d[w]]=[_,R]}return[m,d]}const r=(g,f)=>BigInt(g>>>0)<<e|BigInt(f>>>0);C.toBig=r;const i=(g,f,m)=>g>>>m;C.shrSH=i;const a=(g,f,m)=>g<<32-m|f>>>m;C.shrSL=a;const o=(g,f,m)=>g>>>m|f<<32-m;C.rotrSH=o;const h=(g,f,m)=>g<<32-m|f>>>m;C.rotrSL=h;const p=(g,f,m)=>g<<64-m|f>>>m-32;C.rotrBH=p;const v=(g,f,m)=>g>>>m-32|f<<64-m;C.rotrBL=v;const k=(g,f)=>f;C.rotr32H=k;const l=(g,f)=>g;C.rotr32L=l;const c=(g,f,m)=>g<<m|f>>>32-m;C.rotlSH=c;const u=(g,f,m)=>f<<m|g>>>32-m;C.rotlSL=u;const S=(g,f,m)=>f<<m-32|g>>>64-m;C.rotlBH=S;const E=(g,f,m)=>g<<m-32|f>>>64-m;C.rotlBL=E;function A(g,f,m,d){const w=(f>>>0)+(d>>>0);return{h:g+m+(w/2**32|0)|0,l:w|0}}const M=(g,f,m)=>(g>>>0)+(f>>>0)+(m>>>0);C.add3L=M;const D=(g,f,m,d)=>f+m+d+(g/2**32|0)|0;C.add3H=D;const y=(g,f,m,d)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0);C.add4L=y;const b=(g,f,m,d,w)=>f+m+d+w+(g/2**32|0)|0;C.add4H=b;const I=(g,f,m,d,w)=>(g>>>0)+(f>>>0)+(m>>>0)+(d>>>0)+(w>>>0);C.add5L=I;const x=(g,f,m,d,w,_)=>f+m+d+w+_+(g/2**32|0)|0;C.add5H=x;const T={fromBig:n,split:s,toBig:r,shrSH:i,shrSL:a,rotrSH:o,rotrSL:h,rotrBH:p,rotrBL:v,rotr32H:k,rotr32L:l,rotlSH:c,rotlSL:u,rotlBH:S,rotlBL:E,add:A,add3L:M,add3H:D,add4L:y,add4H:b,add5H:x,add5L:I};return C.default=T,C}var fe={},te={},He;function tn(){return He||(He=1,Object.defineProperty(te,"__esModule",{value:!0}),te.crypto=void 0,te.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),te}var Be;function nn(){return Be||(Be=1,(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=s,t.u8=r,t.u32=i,t.createView=a,t.rotr=o,t.rotl=h,t.byteSwap=p,t.byteSwap32=v,t.bytesToHex=c,t.hexToBytes=E,t.asyncLoop=M,t.utf8ToBytes=D,t.toBytes=y,t.concatBytes=b,t.checkOpts=x,t.wrapConstructor=T,t.wrapConstructorWithOpts=g,t.wrapXOFConstructorWithOpts=f,t.randomBytes=m;const e=tn(),n=gt();function s(d){return d instanceof Uint8Array||ArrayBuffer.isView(d)&&d.constructor.name==="Uint8Array"}function r(d){return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}function i(d){return new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4))}function a(d){return new DataView(d.buffer,d.byteOffset,d.byteLength)}function o(d,w){return d<<32-w|d>>>w}function h(d,w){return d<<w|d>>>32-w>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function p(d){return d<<24&4278190080|d<<8&16711680|d>>>8&65280|d>>>24&255}t.byteSwapIfBE=t.isLE?d=>d:d=>p(d);function v(d){for(let w=0;w<d.length;w++)d[w]=p(d[w])}const k=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",l=Array.from({length:256},(d,w)=>w.toString(16).padStart(2,"0"));function c(d){if((0,n.abytes)(d),k)return d.toHex();let w="";for(let _=0;_<d.length;_++)w+=l[d[_]];return w}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function S(d){if(d>=u._0&&d<=u._9)return d-u._0;if(d>=u.A&&d<=u.F)return d-(u.A-10);if(d>=u.a&&d<=u.f)return d-(u.a-10)}function E(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);if(k)return Uint8Array.fromHex(d);const w=d.length,_=w/2;if(w%2)throw new Error("hex string expected, got unpadded hex of length "+w);const R=new Uint8Array(_);for(let j=0,H=0;j<_;j++,H+=2){const Ae=S(d.charCodeAt(H)),xe=S(d.charCodeAt(H+1));if(Ae===void 0||xe===void 0){const _t=d[H]+d[H+1];throw new Error('hex string expected, got non-hex character "'+_t+'" at index '+H)}R[j]=Ae*16+xe}return R}const A=async()=>{};t.nextTick=A;async function M(d,w,_){let R=Date.now();for(let j=0;j<d;j++){_(j);const H=Date.now()-R;H>=0&&H<w||(await(0,t.nextTick)(),R+=H)}}function D(d){if(typeof d!="string")throw new Error("utf8ToBytes expected string, got "+typeof d);return new Uint8Array(new TextEncoder().encode(d))}function y(d){return typeof d=="string"&&(d=D(d)),(0,n.abytes)(d),d}function b(...d){let w=0;for(let R=0;R<d.length;R++){const j=d[R];(0,n.abytes)(j),w+=j.length}const _=new Uint8Array(w);for(let R=0,j=0;R<d.length;R++){const H=d[R];_.set(H,j),j+=H.length}return _}class I{clone(){return this._cloneInto()}}t.Hash=I;function x(d,w){if(w!==void 0&&{}.toString.call(w)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(d,w)}function T(d){const w=R=>d().update(y(R)).digest(),_=d();return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=()=>d(),w}function g(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function f(d){const w=(R,j)=>d(j).update(y(R)).digest(),_=d({});return w.outputLen=_.outputLen,w.blockLen=_.blockLen,w.create=R=>d(R),w}function m(d=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(d));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(d));throw new Error("crypto.getRandomValues must be defined")}})(fe)),fe}var We;function sn(){if(We)return O;We=1,Object.defineProperty(O,"__esModule",{value:!0}),O.shake256=O.shake128=O.keccak_512=O.keccak_384=O.keccak_256=O.keccak_224=O.sha3_512=O.sha3_384=O.sha3_256=O.sha3_224=O.Keccak=void 0,O.keccakP=E;const t=gt(),e=en(),n=nn(),s=[],r=[],i=[],a=BigInt(0),o=BigInt(1),h=BigInt(2),p=BigInt(7),v=BigInt(256),k=BigInt(113);for(let y=0,b=o,I=1,x=0;y<24;y++){[I,x]=[x,(2*I+3*x)%5],s.push(2*(5*x+I)),r.push((y+1)*(y+2)/2%64);let T=a;for(let g=0;g<7;g++)b=(b<<o^(b>>p)*k)%v,b&h&&(T^=o<<(o<<BigInt(g))-o);i.push(T)}const[l,c]=(0,e.split)(i,!0),u=(y,b,I)=>I>32?(0,e.rotlBH)(y,b,I):(0,e.rotlSH)(y,b,I),S=(y,b,I)=>I>32?(0,e.rotlBL)(y,b,I):(0,e.rotlSL)(y,b,I);function E(y,b=24){const I=new Uint32Array(10);for(let x=24-b;x<24;x++){for(let f=0;f<10;f++)I[f]=y[f]^y[f+10]^y[f+20]^y[f+30]^y[f+40];for(let f=0;f<10;f+=2){const m=(f+8)%10,d=(f+2)%10,w=I[d],_=I[d+1],R=u(w,_,1)^I[m],j=S(w,_,1)^I[m+1];for(let H=0;H<50;H+=10)y[f+H]^=R,y[f+H+1]^=j}let T=y[2],g=y[3];for(let f=0;f<24;f++){const m=r[f],d=u(T,g,m),w=S(T,g,m),_=s[f];T=y[_],g=y[_+1],y[_]=d,y[_+1]=w}for(let f=0;f<50;f+=10){for(let m=0;m<10;m++)I[m]=y[f+m];for(let m=0;m<10;m++)y[f+m]^=~I[(m+2)%10]&I[(m+4)%10]}y[0]^=l[x],y[1]^=c[x]}I.fill(0)}class A extends n.Hash{constructor(b,I,x,T=!1,g=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=b,this.suffix=I,this.outputLen=x,this.enableXOF=T,this.rounds=g,(0,t.anumber)(x),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}keccak(){n.isLE||(0,n.byteSwap32)(this.state32),E(this.state32,this.rounds),n.isLE||(0,n.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(b){(0,t.aexists)(this);const{blockLen:I,state:x}=this;b=(0,n.toBytes)(b);const T=b.length;for(let g=0;g<T;){const f=Math.min(I-this.pos,T-g);for(let m=0;m<f;m++)x[this.pos++]^=b[g++];this.pos===I&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:b,suffix:I,pos:x,blockLen:T}=this;b[x]^=I,(I&128)!==0&&x===T-1&&this.keccak(),b[T-1]^=128,this.keccak()}writeInto(b){(0,t.aexists)(this,!1),(0,t.abytes)(b),this.finish();const I=this.state,{blockLen:x}=this;for(let T=0,g=b.length;T<g;){this.posOut>=x&&this.keccak();const f=Math.min(x-this.posOut,g-T);b.set(I.subarray(this.posOut,this.posOut+f),T),this.posOut+=f,T+=f}return b}xofInto(b){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(b)}xof(b){return(0,t.anumber)(b),this.xofInto(new Uint8Array(b))}digestInto(b){if((0,t.aoutput)(b,this),this.finished)throw new Error("digest() was already called");return this.writeInto(b),this.destroy(),b}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(b){const{blockLen:I,suffix:x,outputLen:T,rounds:g,enableXOF:f}=this;return b||(b=new A(I,x,T,f,g)),b.state32.set(this.state32),b.pos=this.pos,b.posOut=this.posOut,b.finished=this.finished,b.rounds=g,b.suffix=x,b.outputLen=T,b.enableXOF=f,b.destroyed=this.destroyed,b}}O.Keccak=A;const M=(y,b,I)=>(0,n.wrapConstructor)(()=>new A(b,y,I));O.sha3_224=M(6,144,224/8),O.sha3_256=M(6,136,256/8),O.sha3_384=M(6,104,384/8),O.sha3_512=M(6,72,512/8),O.keccak_224=M(1,144,224/8),O.keccak_256=M(1,136,256/8),O.keccak_384=M(1,104,384/8),O.keccak_512=M(1,72,512/8);const D=(y,b,I)=>(0,n.wrapXOFConstructorWithOpts)((x={})=>new A(b,y,x.dkLen===void 0?I:x.dkLen,!0));return O.shake128=D(31,168,128/8),O.shake256=D(31,136,256/8),O}var pe,qe;function mt(){if(qe)return pe;qe=1;const{keccak_256:t}=sn();function e(c){return N.allocUnsafe(c).fill(0)}function n(c){return c.toString(2).length}function s(c,u){let S=c.toString(16);S.length%2!==0&&(S="0"+S);const E=S.match(/.{1,2}/g).map(A=>parseInt(A,16));for(;E.length<u;)E.unshift(0);return N.from(E)}function r(c,u){const S=c<0n;let E;if(S){const A=(1n<<BigInt(u))-1n;E=(~c&A)+1n}else E=c;return E&=(1n<<BigInt(u))-1n,E}function i(c,u,S){const E=e(u);return c=o(c),S?c.length<u?(c.copy(E),E):c.slice(0,u):c.length<u?(c.copy(E,u-c.length),E):c.slice(-u)}function a(c,u){return i(c,u,!0)}function o(c){if(!N.isBuffer(c))if(Array.isArray(c))c=N.from(c);else if(typeof c=="string")k(c)?c=N.from(v(l(c)),"hex"):c=N.from(c);else if(typeof c=="number")c=intToBuffer(c);else if(c==null)c=N.allocUnsafe(0);else if(typeof c=="bigint")c=s(c);else if(c.toArray)c=N.from(c.toArray());else throw new Error("invalid type");return c}function h(c){return c=o(c),"0x"+c.toString("hex")}function p(c,u){if(c=o(c),u||(u=256),u!==256)throw new Error("unsupported");return N.from(t(new Uint8Array(c)))}function v(c){return c.length%2?"0"+c:c}function k(c){return typeof c=="string"&&c.match(/^0x[0-9A-Fa-f]*$/)}function l(c){return typeof c=="string"&&c.startsWith("0x")?c.slice(2):c}return pe={zeros:e,setLength:i,setLengthRight:a,isHexString:k,stripHexPrefix:l,toBuffer:o,bufferToHex:h,keccak:p,bitLengthFromBigInt:n,bufferBEFromBigInt:s,twosFromBigInt:r},pe}var ge,Ke;function rn(){if(Ke)return ge;Ke=1;const t=mt();function e(l){return l.startsWith("int[")?"int256"+l.slice(3):l==="int"?"int256":l.startsWith("uint[")?"uint256"+l.slice(4):l==="uint"?"uint256":l.startsWith("fixed[")?"fixed128x128"+l.slice(5):l==="fixed"?"fixed128x128":l.startsWith("ufixed[")?"ufixed128x128"+l.slice(6):l==="ufixed"?"ufixed128x128":l}function n(l){return Number.parseInt(/^\D+(\d+)$/.exec(l)[1],10)}function s(l){var c=/^\D+(\d+)x(\d+)$/.exec(l);return[Number.parseInt(c[1],10),Number.parseInt(c[2],10)]}function r(l){var c=l.match(/(.*)\[(.*?)\]$/);return c?c[2]===""?"dynamic":Number.parseInt(c[2],10):null}function i(l){var c=typeof l;if(c==="string"||c==="number")return BigInt(l);if(c==="bigint")return l;throw new Error("Argument is not a number")}function a(l,c){var u,S,E,A;if(l==="address")return a("uint160",i(c));if(l==="bool")return a("uint8",c?1:0);if(l==="string")return a("bytes",new N(c,"utf8"));if(h(l)){if(typeof c.length>"u")throw new Error("Not an array?");if(u=r(l),u!=="dynamic"&&u!==0&&c.length>u)throw new Error("Elements exceed array size: "+u);E=[],l=l.slice(0,l.lastIndexOf("[")),typeof c=="string"&&(c=JSON.parse(c));for(A in c)E.push(a(l,c[A]));if(u==="dynamic"){var M=a("uint256",c.length);E.unshift(M)}return N.concat(E)}else{if(l==="bytes")return c=new N(c),E=N.concat([a("uint256",c.length),c]),c.length%32!==0&&(E=N.concat([E,t.zeros(32-c.length%32)])),E;if(l.startsWith("bytes")){if(u=n(l),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);return t.setLengthRight(c,32)}else if(l.startsWith("uint")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+D);if(S<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(S,32)}else if(l.startsWith("int")){if(u=n(l),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(c);const D=t.bitLengthFromBigInt(S);if(D>u)throw new Error("Supplied int exceeds width: "+u+" vs "+D);const y=t.twosFromBigInt(S,256);return t.bufferBEFromBigInt(y,32)}else if(l.startsWith("ufixed")){if(u=s(l),S=i(c),S<0)throw new Error("Supplied ufixed is negative");return a("uint256",S*BigInt(2)**BigInt(u[1]))}else if(l.startsWith("fixed"))return u=s(l),a("int256",i(c)*BigInt(2)**BigInt(u[1]))}throw new Error("Unsupported or invalid type: "+l)}function o(l){return l==="string"||l==="bytes"||r(l)==="dynamic"}function h(l){return l.lastIndexOf("]")===l.length-1}function p(l,c){var u=[],S=[],E=32*l.length;for(var A in l){var M=e(l[A]),D=c[A],y=a(M,D);o(M)?(u.push(a("uint256",E)),S.push(y),E+=y.length):u.push(y)}return N.concat(u.concat(S))}function v(l,c){if(l.length!==c.length)throw new Error("Number of types are not matching the values");for(var u,S,E=[],A=0;A<l.length;A++){var M=e(l[A]),D=c[A];if(M==="bytes")E.push(D);else if(M==="string")E.push(new N(D,"utf8"));else if(M==="bool")E.push(new N(D?"01":"00","hex"));else if(M==="address")E.push(t.setLength(D,20));else if(M.startsWith("bytes")){if(u=n(M),u<1||u>32)throw new Error("Invalid bytes<N> width: "+u);E.push(t.setLengthRight(D,u))}else if(M.startsWith("uint")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid uint<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied uint exceeds width: "+u+" vs "+y);E.push(t.bufferBEFromBigInt(S,u/8))}else if(M.startsWith("int")){if(u=n(M),u%8||u<8||u>256)throw new Error("Invalid int<N> width: "+u);S=i(D);const y=t.bitLengthFromBigInt(S);if(y>u)throw new Error("Supplied int exceeds width: "+u+" vs "+y);const b=t.twosFromBigInt(S,u);E.push(t.bufferBEFromBigInt(b,u/8))}else throw new Error("Unsupported or invalid type: "+M)}return N.concat(E)}function k(l,c){return t.keccak(v(l,c))}return ge={rawEncode:p,solidityPack:v,soliditySHA3:k},ge}var me,Ve;function an(){if(Ve)return me;Ve=1;const t=mt(),e=rn(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},s={encodeData(i,a,o,h=!0){const p=["bytes32"],v=[this.hashType(i,o)];if(h){const k=(l,c,u)=>{if(o[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(c,u,o,h))];if(u===void 0)throw new Error(`missing value for field ${l} of type ${c}`);if(c==="bytes")return["bytes32",t.keccak(u)];if(c==="string")return typeof u=="string"&&(u=N.from(u,"utf8")),["bytes32",t.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const S=c.slice(0,c.lastIndexOf("[")),E=u.map(A=>k(l,S,A));return["bytes32",t.keccak(e.rawEncode(E.map(([A])=>A),E.map(([,A])=>A)))]}return[c,u]};for(const l of o[i]){const[c,u]=k(l.name,l.type,a[l.name]);p.push(c),v.push(u)}}else for(const k of o[i]){let l=a[k.name];if(l!==void 0)if(k.type==="bytes")p.push("bytes32"),l=t.keccak(l),v.push(l);else if(k.type==="string")p.push("bytes32"),typeof l=="string"&&(l=N.from(l,"utf8")),l=t.keccak(l),v.push(l);else if(o[k.type]!==void 0)p.push("bytes32"),l=t.keccak(this.encodeData(k.type,l,o,h)),v.push(l);else{if(k.type.lastIndexOf("]")===k.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");p.push(k.type),v.push(l)}}return e.rawEncode(p,v)},encodeType(i,a){let o="",h=this.findTypeDependencies(i,a).filter(p=>p!==i);h=[i].concat(h.sort());for(const p of h){if(!a[p])throw new Error("No type definition specified: "+p);o+=p+"("+a[p].map(({name:k,type:l})=>l+" "+k).join(",")+")"}return o},findTypeDependencies(i,a,o=[]){if(i=i.match(/^\w*/)[0],o.includes(i)||a[i]===void 0)return o;o.push(i);for(const h of a[i])for(const p of this.findTypeDependencies(h.type,a,o))!o.includes(p)&&o.push(p);return o},hashStruct(i,a,o,h=!0){return t.keccak(this.encodeData(i,a,o,h))},hashType(i,a){return t.keccak(this.encodeType(i,a))},sanitizeData(i){const a={};for(const o in n.properties)i[o]&&(a[o]=i[o]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(i,a=!0){const o=this.sanitizeData(i),h=[N.from("1901","hex")];return h.push(this.hashStruct("EIP712Domain",o.domain,o.types,a)),o.primaryType!=="EIP712Domain"&&h.push(this.hashStruct(o.primaryType,o.message,o.types,a)),t.keccak(N.concat(h))}};me={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:s,hashForSignTypedDataLegacy:function(i){return r(i.data)},hashForSignTypedData_v3:function(i){return s.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return s.hash(i.data)}};function r(i){const a=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw a;const o=i.map(function(v){return v.type==="bytes"?t.toBuffer(v.value):v.value}),h=i.map(function(v){return v.type}),p=i.map(function(v){if(!v.name)throw a;return v.type+" "+v.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(i.length).fill("string"),p),e.soliditySHA3(h,o)])}return me}var on=an();const ae=Lt(on),cn="walletUsername",ke="Addresses",dn="AppVersion";function B(t){return t.errorMessage!==void 0}class ln{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},r,i.encode(e)),o=16,h=a.slice(a.byteLength-o),p=a.slice(0,a.byteLength-o),v=new Uint8Array(h),k=new Uint8Array(p),l=new Uint8Array([...s,...v,...k]);return Ie(l)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((s,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",oe(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=oe(e),o=a.slice(0,12),h=a.slice(12,28),p=a.slice(28),v=new Uint8Array([...p,...h]),k={name:"AES-GCM",iv:new Uint8Array(o)};try{const l=await window.crypto.subtle.decrypt(k,i,v),c=new TextDecoder;s(c.decode(l))}catch(l){r(l)}})()})}}class hn{constructor(e,n,s){this.linkAPIUrl=e,this.sessionId=n;const r=`${n}:${s}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:s,error:r}=await n.json();if(r)throw new Error(`Check unseen events failed: ${r}`);const i=(e=s==null?void 0:s.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${n.status}`)}}var F;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(F||(F={}));class un{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var s;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(i){n(i);return}(s=this.connectionStateListener)===null||s===void 0||s.call(this,F.CONNECTING),r.onclose=i=>{var a;this.clearWebSocket(),n(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.DISCONNECTED)},r.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,F.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},r.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,F.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const ze=1e4,fn=6e4;class pn{constructor({session:e,linkAPIUrl:n,listener:s}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=V(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=i=>{if(!i)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>i.JsonRpcUrl&&this.handleChainUpdated(o,i.JsonRpcUrl)]]).forEach((o,h)=>{const p=i[h];p!==void 0&&o(p)})},this.handleDestroyed=i=>{var a;i==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async i=>{var a;const o=await this.cipher.decrypt(i);(a=this.listener)===null||a===void 0||a.accountUpdated(o)},this.handleMetadataUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.metadataUpdated(i,h)},this.handleWalletUsernameUpdated=async i=>{this.handleMetadataUpdated(cn,i)},this.handleAppVersionUpdated=async i=>{this.handleMetadataUpdated(dn,i)},this.handleChainUpdated=async(i,a)=>{var o;const h=await this.cipher.decrypt(i),p=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.chainUpdated(h,p)},this.session=e,this.cipher=new ln(e.secret),this.listener=s;const r=new un(`${n}/rpc`,WebSocket);r.setConnectionStateListener(async i=>{let a=!1;switch(i){case F.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(h=>setTimeout(h,5e3)),this.destroyed||r.connect().catch(()=>{o()})};o()}break;case F.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},ze),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case F.CONNECTING:break}this.connected!==a&&(this.connected=a)}),r.setIncomingDataListener(i=>{var a;switch(i.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=i.type==="IsLinkedOK"?i.linked:void 0;this.linked=o||i.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(i.metadata);break}case"Event":{this.handleIncomingEvent(i);break}}i.id!==void 0&&((a=this.requestResolutions.get(i.id))===null||a===void 0||a(i))}),this.ws=r,this.http=new hn(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,s;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const s=await this.cipher.decrypt(e.data),r=JSON.parse(s);if(r.type!=="WEB3_RESPONSE")return;const{id:i,response:a}=r;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(i,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,s=!1){const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:V(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:s};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>ze*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:fn}){const s=e.id;this.sendData(e);let r;return Promise.race([new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error(`request ${s} timed out`))},n.timeout)}),new Promise(i=>{this.requestResolutions.set(s,a=>{clearTimeout(r),i(a),this.requestResolutions.delete(s)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:V(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:V(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:V(this.nextReqId++),sessionId:this.session.id}),!0)}}class gn{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=dt(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const Fe="session:id",Ze="session:secret",Ge="session:linked";class Q{constructor(e,n,s,r=!1){this.storage=e,this.id=n,this.secret=s,this.key=xt(At(`${n}, ${s} WalletLink`)),this._linked=!!r}static create(e){const n=Y(16),s=Y(32);return new Q(e,n,s).save()}static load(e){const n=e.getItem(Fe),s=e.getItem(Ge),r=e.getItem(Ze);return n&&r?new Q(e,n,r,s==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(Fe,this.id),this.storage.setItem(Ze,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(Ge,this._linked?"1":"0")}}function mn(){try{return window.frameElement!==null}catch{return!1}}function wn(){try{return mn()&&window.top?window.top.location:window.location}catch{return window.location}}function bn(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function wt(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const yn='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function bt(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(yn)),document.documentElement.appendChild(t)}const vn=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",kn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",En="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class Cn{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=wt()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&we(P("div",null,P(yt,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>P(In,Object.assign({},n,{key:e}))))),this.root)}}const yt=t=>P("div",{class:ne("-cbwsdk-snackbar-container")},P("style",null,vn),P("div",{class:"-cbwsdk-snackbar"},t.children)),In=({autoExpand:t,message:e,menuItems:n})=>{const[s,r]=Me(!0),[i,a]=Me(t??!1);Mt(()=>{const h=[window.setTimeout(()=>{r(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{h.forEach(window.clearTimeout)}});const o=()=>{a(!i)};return P("div",{class:ne("-cbwsdk-snackbar-instance",s&&"-cbwsdk-snackbar-instance-hidden",i&&"-cbwsdk-snackbar-instance-expanded")},P("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},P("img",{src:kn,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",P("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),P("div",{class:"-gear-container"},!i&&P("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),P("img",{src:En,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&P("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((h,p)=>P("div",{class:ne("-cbwsdk-snackbar-instance-menu-item",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:h.onClick,key:p},P("svg",{width:h.svgWidth,height:h.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P("path",{"fill-rule":h.defaultFillRule,"clip-rule":h.defaultClipRule,d:h.path,fill:"#AAAAAA"})),P("span",{class:ne("-cbwsdk-snackbar-instance-menu-item-info",h.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},h.info)))))};class Sn{constructor(){this.attached=!1,this.snackbar=new Cn}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,bt()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}}const _n=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class Ln{constructor(){this.root=null,this.darkMode=wt()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),bt()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(we(null,this.root),e&&we(P(An,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const An=({title:t,buttonText:e,darkMode:n,onButtonClick:s,onDismiss:r})=>{const i=n?"dark":"light";return P(yt,{darkMode:n},P("div",{class:"-cbwsdk-redirect-dialog"},P("style",null,_n),P("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:r}),P("div",{class:ne("-cbwsdk-redirect-dialog-box",i)},P("p",null,t),P("button",{onClick:s},e))))},xn="https://keys.coinbase.com/connect",Mn="http://rpc.wallet.coinbase.com",$e="https://www.walletlink.org",Rn="https://go.cb-w.com/walletlink";class Ye{constructor(){this.attached=!1,this.redirectDialog=new Ln}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(Rn);n.searchParams.append("redirect_url",wn().href),e&&n.searchParams.append("wl_url",e);const s=document.createElement("a");s.target="cbw-opener",s.href=n.href,s.rel="noreferrer noopener",s.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class z{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=bn(),this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(ke);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),h=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!h&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(i,10)))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),z.accountRequestCallbackIds.size>0&&(Array.from(z.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[i]})}),z.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:s,connection:r}=this.subscribe();this._session=n,this.connection=r,this.relayEventManager=new gn,this.ui=s,this.ui.attach()}subscribe(){const e=Q.load(this.storage)||Q.create(this.storage),{linkAPIUrl:n}=this,s=new pn({session:e,linkAPIUrl:n,listener:this}),r=this.isMobileWeb?new Ye:new Sn;return s.connect(),{session:e,ui:r,connection:s}}resetAndReload(){this.connection.destroy().then(()=>{const e=Q.load(this.storage);(e==null?void 0:e.id)===this._session.id&&q.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?K(e.gasPriceInWei):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:K(e.weiValue),data:se(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?K(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?K(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?K(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?K(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:se(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const s=Y(8),r=i=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,e.method,i),n==null||n()};return new Promise((i,a)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(s,o=>{if(n==null||n(),B(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,e)})}publishWeb3RequestEvent(e,n){const s={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",s,!0).then(r=>{}).catch(r=>{this.handleWeb3ResponseMessage(s.id,{method:n.method,errorMessage:r.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Ye)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,s){return this.connection.publishEvent(e,n,s)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){z.accountRequestCallbackIds.forEach(s=>this.invokeCallback(s,n)),z.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,s){var r;const i=(r=s==null?void 0:s.message)!==null&&r!==void 0?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:i})}invokeCallback(e,n){const s=this.relayEventManager.callbacks.get(e);s&&(s(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,s={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},r=Y(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(r,o=>{if(B(o))return a(new Error(o.errorMessage));i(o)}),z.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,s)})}watchAsset(e,n,s,r,i,a){const o={method:"watchAsset",params:{type:e,options:{address:n,symbol:s,decimals:r,image:i},chainId:a}};let h=null;const p=Y(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}addEthereumChain(e,n,s,r,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:r,chainName:i,iconUrls:s,nativeCurrency:a}};let h=null;const p=Y(8),v=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,k),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(h==null||h(),B(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,o)})}switchEthereumChain(e,n){const s={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let r=null;const i=Y(8),a=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,o),r==null||r()};return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((o,h)=>{this.relayEventManager.callbacks.set(i,p=>{if(r==null||r(),B(p)&&p.errorCode)return h(L.provider.custom({code:p.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(B(p))return h(new Error(p.errorMessage));o(p)}),this.publishWeb3RequestEvent(i,s)})}}z.accountRequestCallbackIds=new Set;const Je="DefaultChainId",Qe="DefaultJsonRpcUrl";class vt{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new q("walletlink",$e),this.callback=e.callback||null;const n=this._storage.getItem(ke);if(n){const s=n.split(" ");s[0]!==""&&(this._addresses=s.map(r=>Z(r)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:s}=e.getWalletLinkSession();return{id:n,secret:s}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Qe))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Qe,e)}updateProviderInfo(e,n){var s;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(Je,n.toString(10)),ie(n)!==r&&((s=this.callback)===null||s===void 0||s.call(this,"chainChanged",$(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw L.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw L.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw L.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw L.rpc.invalidParams("Address is required");const s=this.getChainId(),{address:r,symbol:i,image:a,decimals:o}=n.options,p=await this.initializeRelay().watchAsset(n.type,r,i,o,a,s==null?void 0:s.toString());return B(p)?!1:!!p.result}async addEthereumChain(e){var n,s;const r=e[0];if(((n=r.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw L.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||r.chainName.trim()==="")throw L.rpc.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw L.rpc.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(r.chainId,16);if(i===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:h=[],chainName:p,iconUrls:v=[],nativeCurrency:k}=r,l=await a.addEthereumChain(i.toString(),o,v,h,p,k);if(B(l))return!1;if(((s=l.result)===null||s===void 0?void 0:s.isApproved)===!0)return this.updateProviderInfo(o[0],i),null;throw L.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],s=Number.parseInt(n.chainId,16),i=await this.initializeRelay().switchEthereumChain(s.toString(10),this.selectedAddress||void 0);if(B(i))throw i;const a=i.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,s),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var s;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>Z(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",r),this._storage.setItem(ke,r.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return $(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw L.rpc.internal("No RPC URL set for chain");return Le(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=Z(e);if(!this._addresses.map(r=>Z(r)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?Z(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const s=e.to?Z(e.to):null,r=e.value!=null?ee(e.value):BigInt(0),i=e.data?ve(e.data):N.alloc(0),a=e.nonce!=null?ie(e.nonce):null,o=e.gasPrice!=null?ee(e.gasPrice):null,h=e.maxFeePerGas!=null?ee(e.maxFeePerGas):null,p=e.maxPriorityFeePerGas!=null?ee(e.maxPriorityFeePerGas):null,v=e.gas!=null?ee(e.gas):null,k=e.chainId?ie(e.chainId):this.getChainId();return{fromAddress:n,toAddress:s,weiValue:r,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:h,maxPriorityFeePerGas:p,gasLimit:v,chainId:k}}async ecRecover(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const i=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:de(s[0]),signature:de(s[1]),addPrefix:n==="personal_ecRecover"}});if(B(i))throw i;return i.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(Je))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:$(this.getChainId())}),this._addresses;const r=await this.initializeRelay().requestEthereumAccounts();if(B(r))throw r;if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:$(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw L.rpc.invalidParams();const n=e[1],s=e[0];this._ensureKnownAddress(n);const i=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(n),message:de(s),addPrefix:!0,typedDataJson:null}});if(B(i))throw i;return i.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signEthereumTransaction(n);if(B(r))throw r;return r.result}async _eth_sendRawTransaction(e){const n=ve(e[0]),r=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(B(r))throw r;return r.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(B(r))throw r;return r.result}async signTypedData(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw L.rpc.invalidParams();const r=p=>{const v={eth_signTypedData_v1:ae.hashForSignTypedDataLegacy,eth_signTypedData_v3:ae.hashForSignTypedData_v3,eth_signTypedData_v4:ae.hashForSignTypedData_v4,eth_signTypedData:ae.hashForSignTypedData_v4};return se(v[n]({data:Bt(p)}),!0)},i=s[n==="eth_signTypedData_v1"?1:0],a=s[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(i);const h=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:Z(i),message:r(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(B(h))throw h;return h.result}initializeRelay(){return this._relay||(this._relay=new z({linkAPIUrl:$e,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const kt="SignerType",Et=new q("CBWSDK","SignerConfigurator");function Pn(){return Et.getItem(kt)}function Tn(t){Et.setItem(kt,t)}async function On(t){const{communicator:e,metadata:n,handshakeRequest:s,callback:r}=t;Dn(e,n,r).catch(()=>{});const i={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:s})},{data:a}=await e.postRequestAndWaitForResponse(i);return a}function Nn(t){const{signerType:e,metadata:n,communicator:s,callback:r}=t;switch(e){case"scw":return new Xt({metadata:n,callback:r,communicator:s});case"walletlink":return new vt({metadata:n,callback:r})}}async function Dn(t,e,n){await t.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const s=new vt({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:s.getSession()}}),await s.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Un=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
2
+
3
+ Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,jn=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const s=n.headers.get("Cross-Origin-Opener-Policy");t=s??"null",t==="same-origin"&&console.error(Un)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:Ct,getCrossOriginOpenerPolicy:Hn}=jn(),Xe=420,et=540;function Bn(t){const e=(window.innerWidth-Xe)/2+window.screenX,n=(window.innerHeight-et)/2+window.screenY;qn(t);const s=`wallet_${crypto.randomUUID()}`,r=window.open(t,s,`width=${Xe}, height=${et}, left=${e}, top=${n}`);if(r==null||r.focus(),!r)throw L.rpc.internal("Pop up window failed to open");return r}function Wn(t){t&&!t.closed&&t.close()}function qn(t){const e={sdkName:ft,sdkVersion:X,origin:window.location.origin,coop:Hn()};for(const[n,s]of Object.entries(e))t.searchParams.append(n,s.toString())}class Kn{constructor({url:e=xn,metadata:n,preference:s}){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const i=this.onMessage(({requestId:a})=>a===r.id);return this.postMessage(r),await i},this.onMessage=async r=>new Promise((i,a)=>{const o=h=>{if(h.origin!==this.url.origin)return;const p=h.data;r(p)&&(i(p),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:a})}),this.disconnect=()=>{Wn(this.popup),this.popup=null,this.listeners.forEach(({reject:r},i)=>{r(L.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",i)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=Bn(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:X,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw L.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=s}}function Vn(t){const e=Nt(zn(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",X),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function zn(t){var e;if(typeof t=="string")return{message:t,code:U.rpc.internal};if(B(t)){const n=t.errorMessage,s=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?U.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:s,data:{method:t.method}})}return t}class Fn extends Rt{}var Zn=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n};class It extends Fn{constructor(e){var{metadata:n}=e,s=e.preference,{keysUrl:r}=s,i=Zn(s,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=n,this.preference=i,this.communicator=new Kn({url:r,metadata:n,preference:i});const a=Pn();a&&(this.signer=this.initSigner(a))}async request(e){try{if(Qt(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const n=await this.requestSignerSelection(e),s=this.initSigner(n);await s.handshake(e),this.signer=s,Tn(n);break}case"wallet_sendCalls":{const n=this.initSigner("scw");await n.handshake({method:"handshake"});const s=await n.request(e);return await n.cleanup(),s}case"wallet_getCallsStatus":return Le(e,Mn);case"net_version":return 1;case"eth_chainId":return $(1);default:throw L.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(n){const{code:s}=n;return s===U.provider.unauthorized&&this.disconnect(),Promise.reject(Vn(n))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,q.clearAll(),this.emit("disconnect",L.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return On({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return Nn({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function St(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}class hs{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||qt(),appChainIds:e.appChainIds||[]},this.storeLatestVersion(),Ct()}makeWeb3Provider(e={options:"all"}){var n;St(e);const s={metadata:this.metadata,preference:e};return(n=pt(s))!==null&&n!==void 0?n:new It(s)}getCoinbaseWalletLogo(e,n=240){return Pt(e,n)}storeLatestVersion(){new q("CBWSDK").setItem("VERSION",X)}}function Gn(t){var e;const n={metadata:t.metadata,preference:t.preference};return(e=pt(n))!==null&&e!==void 0?e:new It(n)}const $n={options:"all"};function us(t){var e;new q("CBWSDK").setItem("VERSION",X),Ct();const s={metadata:{appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||"",appChainIds:t.appChainIds||[]},preference:Object.assign($n,(e=t.preference)!==null&&e!==void 0?e:{})};St(s.preference);let r=null;return{getProvider:()=>(r||(r=Gn(s)),r)}}export{hs as CoinbaseWalletSDK,us as createCoinbaseWalletSDK,hs as default};
@@ -1,4 +1,4 @@
1
- import{e as ot}from"./index-nRbKhfJe.js";import{e as nn}from"./react-C51i12iP.js";import{p as Se,g as ge}from"./sentry-DKBoGDXH.js";import{c as on}from"./index-Bk6ayCIs.js";var Pe={};/*! *****************************************************************************
1
+ import{e as ot}from"./index-DeN7zJP6.js";import{e as nn}from"./react-BMZSDQJw.js";import{p as Se,g as ge}from"./sentry-8SzFotJj.js";import{c as on}from"./index-CjTTlJEo.js";var Pe={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1 +1 @@
1
- import{at as n,au as t}from"./index-BBuZMaWr.js";const e="https://wearable-preview.decentraland.zone",a="https://decentraland.zone/account",o="https://decentraland.zone/profile",_="https://decentraland.zone/marketplace",R="https://decentraland.zone/builder",c="https://decentraland.zone/dao",s="https://decentraland.zone/governance",d="https://decentraland.zone/events",L="https://decentraland.zone/places",E="https://decentraland.org/create/",U="https://docs.decentraland.org/player/",r="https://decentraland.zone/download/creator-hub/",l="https://decentraland.zone/download/",O="https://decentraland.zone/download_success/",A="ea2ybdmmn1kv",T="master",N="18g1DzIyBxvu0steSwKyQr",p="https://cms.decentraland.org",S="https://decentraland.zone/marketplace/names/claim",C="https://decentraland.zone/marketplace/lands",h="https://decentraland.zone/marketplace/account",D="https://decentraland.zone/create/",I="https://studios.decentraland.zone/",g="https://decentraland.zone/builder/collections",$="https://decentraland.zone/builder/names",P="https://decentraland.zone/builder/worlds?tab=dcl",i="https://decentraland.zone/builder/land",m="https://decentraland.zone/events/me/",B="https://decentraland.zone/places/favorites/",M="https://docs.decentraland.org/player/",V="https://docs.decentraland.org/creator/",y="https://decentraland.zone/blog/",G="https://docs.decentraland.org/contributor/",u="https://decentraland.zone/governance/transparency/",F="https://decentraland.zone/governance/proposals/",b="https://decentraland.zone/dao/grants/",K="https://decentraland.zone/governance/projects/",Y="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",v="https://decentraland.zone/marketplace/settings",z="https://dcl.gg/discord",f="https://reddit.com/r/decentraland",w="https://github.com/decentraland",W="https://x.com/decentraland",k="https://instagram.com/decentraland_foundation/",H="https://youtube.com/@decentraland_foundation",x="https://tiktok.com/@decentraland_fdn",j="https://linkedin.com/company/decentralandorg",Q="https://decentraland.zone/privacy",J="https://decentraland.zone/terms",X="https://decentraland.zone/content",q="https://decentraland.zone/ethics",Z="https://decentraland.org/help",tt="mailto:hello@decentraland.org",nt="https://docs.decentraland.org/faqs/decentraland-101",et="https://docs.decentraland.org",at="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",ot="https://download-gateway.decentraland.zone",_t="https://decentraland.zone/top-scenes",Rt="https://testflight.apple.com/join/KF4r3jlU",ct="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",st={WEARABLE_PREVIEW_URL:e,ACCOUNT_URL:a,PROFILE_URL:o,MARKETPLACE_URL:_,BUILDER_URL:R,DAO_URL:c,GOVERNANCE_URL:s,EVENTS_URL:d,PLACES_URL:L,CREATE_URL:E,LEARN_URL:U,CREATOR_HUB_URL:r,DOWNLOAD_URL:l,DOWNLOAD_SUCCESS_URL:O,CONTENTFUL_SPACE_ID:A,CONTENTFUL_ENV:T,CONTENTFUL_NAVBAR_ENTRY_ID:N,CONTENTFUL_CONTENTFUL_CDN_URL:p,MARKETPLACE_NAMES_URL:S,MARKETPLACE_LANDS_URL:C,MARKETPLACE_MY_ASSETS_URL:h,LANDING_CREATORS_URL:D,STUDIOS_URL:I,BUILDER_WEARABLE_EMOTES_URL:g,BUILDER_NAMES_URL:$,BUILDER_WORLDS_URL:P,BUILDER_LAND_URL:i,EVENTS_MY_EVENTS:m,PLACES_MY_FAVORITE_URL:B,DOCS_ABOUT_URL:M,DOCS_CREATORS_URL:V,BLOG_URL:y,DOCS_CONTRIBUTOR_URL:G,GOVERNANCE_TRANSPARENCY_URL:u,GOVERNANCE_PROPOSALS_URL:F,DAO_GRANTS_URL:b,GOVERNANCE_PROJECTS_URL:K,DOCS_DAO_URL:Y,MARKETPLACE_SETTINGS_URL:v,DISCORD_URL:z,REDDIT_URL:f,GITHUB_URL:w,X_URL:W,INSTAGRAM_URL:k,YOUTUBE_URL:H,TIKTOK_URL:x,LINKEDIN_URL:j,PRIVACY_POLICY_URL:Q,TERMS_OF_USE_URL:J,CONTENT_POLICY_URL:X,CODE_OF_ETHICS_URL:q,SUPPORT_URL:Z,EMAIL_HELLO_URL:tt,FAQ_URL:nt,DOCS_URL:et,BEEHIV_SUBSCRIPTION_URL:at,AUTO_SIGNING_BASE_URL:ot,TOP_SCENES_URL:_t,IOS_STORE_URL:Rt,ANDROID_STORE_URL:ct},dt="https://wearable-preview.decentraland.org",Lt="https://decentraland.org/account",Et="https://decentraland.org/profile",Ut="https://decentraland.org/marketplace",rt="https://decentraland.org/builder",lt="https://decentraland.org/dao",Ot="https://decentraland.org/governance",At="https://decentraland.org/events",Tt="https://decentraland.org/places",Nt="https://decentraland.org/create/",pt="https://docs.decentraland.org/player/",St="https://decentraland.org/download/creator-hub/",Ct="https://decentraland.org/download/",ht="https://decentraland.org/download_success/",Dt="ea2ybdmmn1kv",It="master",gt="18g1DzIyBxvu0steSwKyQr",$t="https://cms.decentraland.org",Pt="https://decentraland.org/marketplace/names/claim",it="https://decentraland.org/marketplace/lands",mt="https://decentraland.org/marketplace/account",Bt="https://decentraland.org/create/",Mt="https://studios.decentraland.org/",Vt="https://decentraland.org/builder/collections",yt="https://decentraland.org/builder/names",Gt="https://decentraland.org/builder/worlds?tab=dcl",ut="https://decentraland.org/builder/land",Ft="https://decentraland.org/events/me/",bt="https://decentraland.org/places/favorites/",Kt="https://docs.decentraland.org/player/",Yt="https://docs.decentraland.org/creator/",vt="https://decentraland.org/blog/",zt="https://docs.decentraland.org/contributor/",ft="https://decentraland.org/governance/transparency/",wt="https://decentraland.org/governance/proposals/",Wt="https://decentraland.org/dao/grants/",kt="https://decentraland.org/governance/projects/",Ht="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",xt="https://decentraland.org/marketplace/settings",jt="https://dcl.gg/discord",Qt="https://reddit.com/r/decentraland",Jt="https://github.com/decentraland",Xt="https://x.com/decentraland",qt="https://instagram.com/decentraland_foundation/",Zt="https://youtube.com/@decentraland_foundation",tn="https://tiktok.com/@decentraland_fdn",nn="https://linkedin.com/company/decentralandorg",en="https://decentraland.org/privacy",an="https://decentraland.org/terms",on="https://decentraland.org/content",_n="https://decentraland.org/ethics",Rn="https://decentraland.org/help",cn="mailto:hello@decentraland.org",sn="https://docs.decentraland.org/faqs/decentraland-101",dn="https://docs.decentraland.org",Ln="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",En="https://download-gateway.decentraland.org",Un="https://decentraland.org/top-scenes",rn="https://testflight.apple.com/join/KF4r3jlU",ln="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",On={WEARABLE_PREVIEW_URL:dt,ACCOUNT_URL:Lt,PROFILE_URL:Et,MARKETPLACE_URL:Ut,BUILDER_URL:rt,DAO_URL:lt,GOVERNANCE_URL:Ot,EVENTS_URL:At,PLACES_URL:Tt,CREATE_URL:Nt,LEARN_URL:pt,CREATOR_HUB_URL:St,DOWNLOAD_URL:Ct,DOWNLOAD_SUCCESS_URL:ht,CONTENTFUL_SPACE_ID:Dt,CONTENTFUL_ENV:It,CONTENTFUL_NAVBAR_ENTRY_ID:gt,CONTENTFUL_CONTENTFUL_CDN_URL:$t,MARKETPLACE_NAMES_URL:Pt,MARKETPLACE_LANDS_URL:it,MARKETPLACE_MY_ASSETS_URL:mt,LANDING_CREATORS_URL:Bt,STUDIOS_URL:Mt,BUILDER_WEARABLE_EMOTES_URL:Vt,BUILDER_NAMES_URL:yt,BUILDER_WORLDS_URL:Gt,BUILDER_LAND_URL:ut,EVENTS_MY_EVENTS:Ft,PLACES_MY_FAVORITE_URL:bt,DOCS_ABOUT_URL:Kt,DOCS_CREATORS_URL:Yt,BLOG_URL:vt,DOCS_CONTRIBUTOR_URL:zt,GOVERNANCE_TRANSPARENCY_URL:ft,GOVERNANCE_PROPOSALS_URL:wt,DAO_GRANTS_URL:Wt,GOVERNANCE_PROJECTS_URL:kt,DOCS_DAO_URL:Ht,MARKETPLACE_SETTINGS_URL:xt,DISCORD_URL:jt,REDDIT_URL:Qt,GITHUB_URL:Jt,X_URL:Xt,INSTAGRAM_URL:qt,YOUTUBE_URL:Zt,TIKTOK_URL:tn,LINKEDIN_URL:nn,PRIVACY_POLICY_URL:en,TERMS_OF_USE_URL:an,CONTENT_POLICY_URL:on,CODE_OF_ETHICS_URL:_n,SUPPORT_URL:Rn,EMAIL_HELLO_URL:cn,FAQ_URL:sn,DOCS_URL:dn,BEEHIV_SUBSCRIPTION_URL:Ln,AUTO_SIGNING_BASE_URL:En,TOP_SCENES_URL:Un,IOS_STORE_URL:rn,ANDROID_STORE_URL:ln},An="https://wearable-preview.decentraland.today",Tn="https://decentraland.today/account",Nn="https://decentraland.today/profile",pn="https://decentraland.today/marketplace",Sn="https://decentraland.today/builder",Cn="https://decentraland.today/dao",hn="https://decentraland.today/governance",Dn="https://decentraland.zone/events",In="https://decentraland.zone/places",gn="https://decentraland.today/create/",$n="https://docs.decentraland.org/player/",Pn="https://decentraland.today/download/creator-hub/",mn="https://decentraland.today/download/",Bn="https://decentraland.today/download_success/",Mn="ea2ybdmmn1kv",Vn="master",yn="18g1DzIyBxvu0steSwKyQr",Gn="https://cms.decentraland.org",un="https://decentraland.today/marketplace/names/claim",Fn="https://decentraland.today/marketplace/lands",bn="https://decentraland.today/marketplace/account",Kn="https://decentraland.today/create/",Yn="https://studios.decentraland.today/",vn="https://decentraland.today/builder/collections",zn="https://decentraland.today/builder/names",fn="https://decentraland.today/builder/worlds?tab=dcl",wn="https://decentraland.today/builder/land",Wn="https://decentraland.today/events/me/",kn="https://decentraland.today/places/favorites/",Hn="https://docs.decentraland.org/player/",xn="https://docs.decentraland.org/creator/",jn="https://decentraland.today/blog/",Qn="https://docs.decentraland.org/contributor/",Jn="https://decentraland.today/governance/transparency/",Xn="https://decentraland.today/governance/proposals/",qn="https://decentraland.today/dao/grants/",Zn="https://decentraland.today/governance/projects/",te="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",ne="https://decentraland.today/marketplace/settings",ee="https://dcl.gg/discord",ae="https://reddit.com/r/decentraland",oe="https://github.com/decentraland",_e="https://x.com/decentraland",Re="https://instagram.com/decentraland_foundation/",ce="https://youtube.com/@decentraland_foundation",se="https://tiktok.com/@decentraland_fdn",de="https://linkedin.com/company/decentralandorg",Le="https://decentraland.org/privacy",Ee="https://decentraland.org/terms",Ue="https://decentraland.org/content",re="https://decentraland.org/ethics",le="https://decentraland.org/help",Oe="mailto:hello@decentraland.org",Ae="https://docs.decentraland.org/faqs/decentraland-101",Te="https://docs.decentraland.org",Ne="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",pe="https://download-gateway.decentraland.zone",Se="https://decentraland.zone/top-scenes",Ce="https://testflight.apple.com/join/KF4r3jlU",he="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",De={WEARABLE_PREVIEW_URL:An,ACCOUNT_URL:Tn,PROFILE_URL:Nn,MARKETPLACE_URL:pn,BUILDER_URL:Sn,DAO_URL:Cn,GOVERNANCE_URL:hn,EVENTS_URL:Dn,PLACES_URL:In,CREATE_URL:gn,LEARN_URL:$n,CREATOR_HUB_URL:Pn,DOWNLOAD_URL:mn,DOWNLOAD_SUCCESS_URL:Bn,CONTENTFUL_SPACE_ID:Mn,CONTENTFUL_ENV:Vn,CONTENTFUL_NAVBAR_ENTRY_ID:yn,CONTENTFUL_CONTENTFUL_CDN_URL:Gn,MARKETPLACE_NAMES_URL:un,MARKETPLACE_LANDS_URL:Fn,MARKETPLACE_MY_ASSETS_URL:bn,LANDING_CREATORS_URL:Kn,STUDIOS_URL:Yn,BUILDER_WEARABLE_EMOTES_URL:vn,BUILDER_NAMES_URL:zn,BUILDER_WORLDS_URL:fn,BUILDER_LAND_URL:wn,EVENTS_MY_EVENTS:Wn,PLACES_MY_FAVORITE_URL:kn,DOCS_ABOUT_URL:Hn,DOCS_CREATORS_URL:xn,BLOG_URL:jn,DOCS_CONTRIBUTOR_URL:Qn,GOVERNANCE_TRANSPARENCY_URL:Jn,GOVERNANCE_PROPOSALS_URL:Xn,DAO_GRANTS_URL:qn,GOVERNANCE_PROJECTS_URL:Zn,DOCS_DAO_URL:te,MARKETPLACE_SETTINGS_URL:ne,DISCORD_URL:ee,REDDIT_URL:ae,GITHUB_URL:oe,X_URL:_e,INSTAGRAM_URL:Re,YOUTUBE_URL:ce,TIKTOK_URL:se,LINKEDIN_URL:de,PRIVACY_POLICY_URL:Le,TERMS_OF_USE_URL:Ee,CONTENT_POLICY_URL:Ue,CODE_OF_ETHICS_URL:re,SUPPORT_URL:le,EMAIL_HELLO_URL:Oe,FAQ_URL:Ae,DOCS_URL:Te,BEEHIV_SUBSCRIPTION_URL:Ne,AUTO_SIGNING_BASE_URL:pe,TOP_SCENES_URL:Se,IOS_STORE_URL:Ce,ANDROID_STORE_URL:he},ge=n({[t.DEVELOPMENT]:st,[t.STAGING]:De,[t.PRODUCTION]:On});export{ge as c};
1
+ import{ar as n,as as t}from"./index-Cw_zTgKJ.js";const e="https://wearable-preview.decentraland.zone",a="https://decentraland.zone/account",o="https://decentraland.zone/profile",_="https://decentraland.zone/marketplace",R="https://decentraland.zone/builder",c="https://decentraland.zone/dao",s="https://decentraland.zone/governance",d="https://decentraland.zone/events",L="https://decentraland.zone/places",E="https://decentraland.org/create/",U="https://docs.decentraland.org/player/",r="https://decentraland.zone/download/creator-hub/",l="https://decentraland.zone/download/",O="https://decentraland.zone/download_success/",A="ea2ybdmmn1kv",T="master",N="18g1DzIyBxvu0steSwKyQr",p="https://cms.decentraland.org",S="https://decentraland.zone/marketplace/names/claim",C="https://decentraland.zone/marketplace/lands",h="https://decentraland.zone/marketplace/account",D="https://decentraland.zone/create/",I="https://studios.decentraland.zone/",g="https://decentraland.zone/builder/collections",$="https://decentraland.zone/builder/names",P="https://decentraland.zone/builder/worlds?tab=dcl",i="https://decentraland.zone/builder/land",m="https://decentraland.zone/events/me/",B="https://decentraland.zone/places/favorites/",M="https://docs.decentraland.org/player/",V="https://docs.decentraland.org/creator/",y="https://decentraland.zone/blog/",G="https://docs.decentraland.org/contributor/",u="https://decentraland.zone/governance/transparency/",F="https://decentraland.zone/governance/proposals/",b="https://decentraland.zone/dao/grants/",K="https://decentraland.zone/governance/projects/",Y="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",v="https://decentraland.zone/marketplace/settings",z="https://dcl.gg/discord",f="https://reddit.com/r/decentraland",w="https://github.com/decentraland",W="https://x.com/decentraland",k="https://instagram.com/decentraland_foundation/",H="https://youtube.com/@decentraland_foundation",x="https://tiktok.com/@decentraland_fdn",j="https://linkedin.com/company/decentralandorg",Q="https://decentraland.zone/privacy",J="https://decentraland.zone/terms",X="https://decentraland.zone/content",q="https://decentraland.zone/ethics",Z="https://decentraland.org/help",tt="mailto:hello@decentraland.org",nt="https://docs.decentraland.org/faqs/decentraland-101",et="https://docs.decentraland.org",at="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",ot="https://download-gateway.decentraland.zone",_t="https://decentraland.zone/top-scenes",Rt="https://testflight.apple.com/join/KF4r3jlU",ct="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",st={WEARABLE_PREVIEW_URL:e,ACCOUNT_URL:a,PROFILE_URL:o,MARKETPLACE_URL:_,BUILDER_URL:R,DAO_URL:c,GOVERNANCE_URL:s,EVENTS_URL:d,PLACES_URL:L,CREATE_URL:E,LEARN_URL:U,CREATOR_HUB_URL:r,DOWNLOAD_URL:l,DOWNLOAD_SUCCESS_URL:O,CONTENTFUL_SPACE_ID:A,CONTENTFUL_ENV:T,CONTENTFUL_NAVBAR_ENTRY_ID:N,CONTENTFUL_CONTENTFUL_CDN_URL:p,MARKETPLACE_NAMES_URL:S,MARKETPLACE_LANDS_URL:C,MARKETPLACE_MY_ASSETS_URL:h,LANDING_CREATORS_URL:D,STUDIOS_URL:I,BUILDER_WEARABLE_EMOTES_URL:g,BUILDER_NAMES_URL:$,BUILDER_WORLDS_URL:P,BUILDER_LAND_URL:i,EVENTS_MY_EVENTS:m,PLACES_MY_FAVORITE_URL:B,DOCS_ABOUT_URL:M,DOCS_CREATORS_URL:V,BLOG_URL:y,DOCS_CONTRIBUTOR_URL:G,GOVERNANCE_TRANSPARENCY_URL:u,GOVERNANCE_PROPOSALS_URL:F,DAO_GRANTS_URL:b,GOVERNANCE_PROJECTS_URL:K,DOCS_DAO_URL:Y,MARKETPLACE_SETTINGS_URL:v,DISCORD_URL:z,REDDIT_URL:f,GITHUB_URL:w,X_URL:W,INSTAGRAM_URL:k,YOUTUBE_URL:H,TIKTOK_URL:x,LINKEDIN_URL:j,PRIVACY_POLICY_URL:Q,TERMS_OF_USE_URL:J,CONTENT_POLICY_URL:X,CODE_OF_ETHICS_URL:q,SUPPORT_URL:Z,EMAIL_HELLO_URL:tt,FAQ_URL:nt,DOCS_URL:et,BEEHIV_SUBSCRIPTION_URL:at,AUTO_SIGNING_BASE_URL:ot,TOP_SCENES_URL:_t,IOS_STORE_URL:Rt,ANDROID_STORE_URL:ct},dt="https://wearable-preview.decentraland.org",Lt="https://decentraland.org/account",Et="https://decentraland.org/profile",Ut="https://decentraland.org/marketplace",rt="https://decentraland.org/builder",lt="https://decentraland.org/dao",Ot="https://decentraland.org/governance",At="https://decentraland.org/events",Tt="https://decentraland.org/places",Nt="https://decentraland.org/create/",pt="https://docs.decentraland.org/player/",St="https://decentraland.org/download/creator-hub/",Ct="https://decentraland.org/download/",ht="https://decentraland.org/download_success/",Dt="ea2ybdmmn1kv",It="master",gt="18g1DzIyBxvu0steSwKyQr",$t="https://cms.decentraland.org",Pt="https://decentraland.org/marketplace/names/claim",it="https://decentraland.org/marketplace/lands",mt="https://decentraland.org/marketplace/account",Bt="https://decentraland.org/create/",Mt="https://studios.decentraland.org/",Vt="https://decentraland.org/builder/collections",yt="https://decentraland.org/builder/names",Gt="https://decentraland.org/builder/worlds?tab=dcl",ut="https://decentraland.org/builder/land",Ft="https://decentraland.org/events/me/",bt="https://decentraland.org/places/favorites/",Kt="https://docs.decentraland.org/player/",Yt="https://docs.decentraland.org/creator/",vt="https://decentraland.org/blog/",zt="https://docs.decentraland.org/contributor/",ft="https://decentraland.org/governance/transparency/",wt="https://decentraland.org/governance/proposals/",Wt="https://decentraland.org/dao/grants/",kt="https://decentraland.org/governance/projects/",Ht="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",xt="https://decentraland.org/marketplace/settings",jt="https://dcl.gg/discord",Qt="https://reddit.com/r/decentraland",Jt="https://github.com/decentraland",Xt="https://x.com/decentraland",qt="https://instagram.com/decentraland_foundation/",Zt="https://youtube.com/@decentraland_foundation",tn="https://tiktok.com/@decentraland_fdn",nn="https://linkedin.com/company/decentralandorg",en="https://decentraland.org/privacy",an="https://decentraland.org/terms",on="https://decentraland.org/content",_n="https://decentraland.org/ethics",Rn="https://decentraland.org/help",cn="mailto:hello@decentraland.org",sn="https://docs.decentraland.org/faqs/decentraland-101",dn="https://docs.decentraland.org",Ln="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",En="https://download-gateway.decentraland.org",Un="https://decentraland.org/top-scenes",rn="https://testflight.apple.com/join/KF4r3jlU",ln="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",On={WEARABLE_PREVIEW_URL:dt,ACCOUNT_URL:Lt,PROFILE_URL:Et,MARKETPLACE_URL:Ut,BUILDER_URL:rt,DAO_URL:lt,GOVERNANCE_URL:Ot,EVENTS_URL:At,PLACES_URL:Tt,CREATE_URL:Nt,LEARN_URL:pt,CREATOR_HUB_URL:St,DOWNLOAD_URL:Ct,DOWNLOAD_SUCCESS_URL:ht,CONTENTFUL_SPACE_ID:Dt,CONTENTFUL_ENV:It,CONTENTFUL_NAVBAR_ENTRY_ID:gt,CONTENTFUL_CONTENTFUL_CDN_URL:$t,MARKETPLACE_NAMES_URL:Pt,MARKETPLACE_LANDS_URL:it,MARKETPLACE_MY_ASSETS_URL:mt,LANDING_CREATORS_URL:Bt,STUDIOS_URL:Mt,BUILDER_WEARABLE_EMOTES_URL:Vt,BUILDER_NAMES_URL:yt,BUILDER_WORLDS_URL:Gt,BUILDER_LAND_URL:ut,EVENTS_MY_EVENTS:Ft,PLACES_MY_FAVORITE_URL:bt,DOCS_ABOUT_URL:Kt,DOCS_CREATORS_URL:Yt,BLOG_URL:vt,DOCS_CONTRIBUTOR_URL:zt,GOVERNANCE_TRANSPARENCY_URL:ft,GOVERNANCE_PROPOSALS_URL:wt,DAO_GRANTS_URL:Wt,GOVERNANCE_PROJECTS_URL:kt,DOCS_DAO_URL:Ht,MARKETPLACE_SETTINGS_URL:xt,DISCORD_URL:jt,REDDIT_URL:Qt,GITHUB_URL:Jt,X_URL:Xt,INSTAGRAM_URL:qt,YOUTUBE_URL:Zt,TIKTOK_URL:tn,LINKEDIN_URL:nn,PRIVACY_POLICY_URL:en,TERMS_OF_USE_URL:an,CONTENT_POLICY_URL:on,CODE_OF_ETHICS_URL:_n,SUPPORT_URL:Rn,EMAIL_HELLO_URL:cn,FAQ_URL:sn,DOCS_URL:dn,BEEHIV_SUBSCRIPTION_URL:Ln,AUTO_SIGNING_BASE_URL:En,TOP_SCENES_URL:Un,IOS_STORE_URL:rn,ANDROID_STORE_URL:ln},An="https://wearable-preview.decentraland.today",Tn="https://decentraland.today/account",Nn="https://decentraland.today/profile",pn="https://decentraland.today/marketplace",Sn="https://decentraland.today/builder",Cn="https://decentraland.today/dao",hn="https://decentraland.today/governance",Dn="https://decentraland.zone/events",In="https://decentraland.zone/places",gn="https://decentraland.today/create/",$n="https://docs.decentraland.org/player/",Pn="https://decentraland.today/download/creator-hub/",mn="https://decentraland.today/download/",Bn="https://decentraland.today/download_success/",Mn="ea2ybdmmn1kv",Vn="master",yn="18g1DzIyBxvu0steSwKyQr",Gn="https://cms.decentraland.org",un="https://decentraland.today/marketplace/names/claim",Fn="https://decentraland.today/marketplace/lands",bn="https://decentraland.today/marketplace/account",Kn="https://decentraland.today/create/",Yn="https://studios.decentraland.today/",vn="https://decentraland.today/builder/collections",zn="https://decentraland.today/builder/names",fn="https://decentraland.today/builder/worlds?tab=dcl",wn="https://decentraland.today/builder/land",Wn="https://decentraland.today/events/me/",kn="https://decentraland.today/places/favorites/",Hn="https://docs.decentraland.org/player/",xn="https://docs.decentraland.org/creator/",jn="https://decentraland.today/blog/",Qn="https://docs.decentraland.org/contributor/",Jn="https://decentraland.today/governance/transparency/",Xn="https://decentraland.today/governance/proposals/",qn="https://decentraland.today/dao/grants/",Zn="https://decentraland.today/governance/projects/",te="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",ne="https://decentraland.today/marketplace/settings",ee="https://dcl.gg/discord",ae="https://reddit.com/r/decentraland",oe="https://github.com/decentraland",_e="https://x.com/decentraland",Re="https://instagram.com/decentraland_foundation/",ce="https://youtube.com/@decentraland_foundation",se="https://tiktok.com/@decentraland_fdn",de="https://linkedin.com/company/decentralandorg",Le="https://decentraland.org/privacy",Ee="https://decentraland.org/terms",Ue="https://decentraland.org/content",re="https://decentraland.org/ethics",le="https://decentraland.org/help",Oe="mailto:hello@decentraland.org",Ae="https://docs.decentraland.org/faqs/decentraland-101",Te="https://docs.decentraland.org",Ne="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",pe="https://download-gateway.decentraland.zone",Se="https://decentraland.zone/top-scenes",Ce="https://testflight.apple.com/join/KF4r3jlU",he="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",De={WEARABLE_PREVIEW_URL:An,ACCOUNT_URL:Tn,PROFILE_URL:Nn,MARKETPLACE_URL:pn,BUILDER_URL:Sn,DAO_URL:Cn,GOVERNANCE_URL:hn,EVENTS_URL:Dn,PLACES_URL:In,CREATE_URL:gn,LEARN_URL:$n,CREATOR_HUB_URL:Pn,DOWNLOAD_URL:mn,DOWNLOAD_SUCCESS_URL:Bn,CONTENTFUL_SPACE_ID:Mn,CONTENTFUL_ENV:Vn,CONTENTFUL_NAVBAR_ENTRY_ID:yn,CONTENTFUL_CONTENTFUL_CDN_URL:Gn,MARKETPLACE_NAMES_URL:un,MARKETPLACE_LANDS_URL:Fn,MARKETPLACE_MY_ASSETS_URL:bn,LANDING_CREATORS_URL:Kn,STUDIOS_URL:Yn,BUILDER_WEARABLE_EMOTES_URL:vn,BUILDER_NAMES_URL:zn,BUILDER_WORLDS_URL:fn,BUILDER_LAND_URL:wn,EVENTS_MY_EVENTS:Wn,PLACES_MY_FAVORITE_URL:kn,DOCS_ABOUT_URL:Hn,DOCS_CREATORS_URL:xn,BLOG_URL:jn,DOCS_CONTRIBUTOR_URL:Qn,GOVERNANCE_TRANSPARENCY_URL:Jn,GOVERNANCE_PROPOSALS_URL:Xn,DAO_GRANTS_URL:qn,GOVERNANCE_PROJECTS_URL:Zn,DOCS_DAO_URL:te,MARKETPLACE_SETTINGS_URL:ne,DISCORD_URL:ee,REDDIT_URL:ae,GITHUB_URL:oe,X_URL:_e,INSTAGRAM_URL:Re,YOUTUBE_URL:ce,TIKTOK_URL:se,LINKEDIN_URL:de,PRIVACY_POLICY_URL:Le,TERMS_OF_USE_URL:Ee,CONTENT_POLICY_URL:Ue,CODE_OF_ETHICS_URL:re,SUPPORT_URL:le,EMAIL_HELLO_URL:Oe,FAQ_URL:Ae,DOCS_URL:Te,BEEHIV_SUBSCRIPTION_URL:Ne,AUTO_SIGNING_BASE_URL:pe,TOP_SCENES_URL:Se,IOS_STORE_URL:Ce,ANDROID_STORE_URL:he},ge=n({[t.DEVELOPMENT]:st,[t.STAGING]:De,[t.PRODUCTION]:On});export{ge as c};
@@ -1 +1 @@
1
- import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-CxX-WJOv.js";import{c as I,e as q}from"./hashTypedData-BYNsvxyc.js";import"./NetworkUtil-Xp0fNa8X.js";import"./sentry-DKBoGDXH.js";import"./react-C51i12iP.js";import"./index-BBuZMaWr.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!S(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class O{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class T{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===V}catch{return!1}}calculateMessageHash(e){return I(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return q({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),S(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}j([M()],T.prototype,"requestAddressBook",null);class J{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const Q=m.Operation,X=m.TokenType,Y=m.TransactionStatus,Z=m.TransferDirection;export{g as MessageFormatter,r as Methods,Q as Operation,c as RPC_CALLS,f as RestrictedMethods,X as TokenType,Y as TransactionStatus,Z as TransferDirection,J as default,v as getSDKVersion,S as isObjectEIP712TypedData};
1
+ import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-2HzfqXtJ.js";import{c as I,e as q}from"./hashTypedData-dhsewv5B.js";import"./NetworkUtil-CM7JZPbs.js";import"./sentry-8SzFotJj.js";import"./react-BMZSDQJw.js";import"./index-Cw_zTgKJ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!S(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class O{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class T{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===V}catch{return!1}}calculateMessageHash(e){return I(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return q({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),S(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}j([M()],T.prototype,"requestAddressBook",null);class J{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const Q=m.Operation,X=m.TokenType,Y=m.TransactionStatus,Z=m.TransferDirection;export{g as MessageFormatter,r as Methods,Q as Operation,c as RPC_CALLS,f as RestrictedMethods,X as TokenType,Y as TransactionStatus,Z as TransferDirection,J as default,v as getSDKVersion,S as isObjectEIP712TypedData};