@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 +1 @@
1
- import{g as ee}from"./react-C51i12iP.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-pbhVNuOA.js";import{p as N}from"./sentry-DKBoGDXH.js";import{r as ne}from"./browser-ponyfill-DMgE6PM5.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
1
+ import{g as ee}from"./react-BMZSDQJw.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-CAp_8XyK.js";import{p as N}from"./sentry-8SzFotJj.js";import{r as ne}from"./browser-ponyfill-C_hn4Jen.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
@@ -1 +1 @@
1
- import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-C51i12iP.js";import{ax as oe,ay as ce,an as le,t as a,az as E,B as ne,a3 as z,b as ie,I,g as de,u as me,A as ue,ar as he,aA as ge,h as xe}from"./index-BBuZMaWr.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DHOETntw.js";import{u as be,L as fe}from"./useStore-CQIJvFZA.js";import{s as D}from"./address-DrURAr9O.js";import{S as $,C as ve,c as w,F as Ce,e as we,d as ke}from"./categories-DQ55lr2p.js";import{L as B}from"./LoadMore-QYabEF53.js";import{u as R}from"./useInfiniteGrid-CpiD11c4.js";import{E as T}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=z(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||D(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=z(t),g=(m==null?void 0:m.name)||(t?D(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,O]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:O,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
1
+ import{u as K,j as e,L as re,d as se,a as te,r as j}from"./react-BMZSDQJw.js";import{av as oe,aw as ce,am as le,t as a,ax as E,B as ne,ab as D,g as ie,I,c as de,u as me,A as ue,aq as he,ay as ge,C as xe}from"./index-Cw_zTgKJ.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-D7CncqdI.js";import{u as be,L as fe}from"./useStore-IaDRl00u.js";import{s as O}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-BltWZ-Er.js";import{L as B}from"./LoadMore-kFcJ8c6R.js";import{u as R}from"./useInfiniteGrid-CpG_Ao97.js";import{E as T}from"./ErrorNotice-DDr3KjIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,z]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:q,isFetchingNextPage:F,fetchNextPage:W}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function Z(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:Z,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:q,isFetching:F,onLoadMore:()=>void W()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
@@ -1,4 +1,4 @@
1
- import{b9 as U,ba as Ue,E as C,bb as qe,bc as Ye,O as Qe,bd as Je,aY as Xe,D as R,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-BBuZMaWr.js";import{R as rt,g as ot}from"./getOverlayAlpha-B_CoLTSj.js";import{j as T,r as y}from"./react-C51i12iP.js";import{u as nt,a as Be}from"./useTheme-6tr3eE7K.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
1
+ import{b9 as U,ba as Ue,M as C,bb as qe,bc as Ye,W as Qe,bd as Je,aY as Xe,L as R,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-Cw_zTgKJ.js";import{R as rt,g as ot}from"./getOverlayAlpha-DOBThdqC.js";import{j as T,r as y}from"./react-BMZSDQJw.js";import{u as nt,a as Be}from"./useTheme-Y_Ojpcr-.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
2
2
  try {
3
3
  var mode = localStorage.getItem('${s}') || '${o}';
4
4
  var colorScheme = '';
@@ -1,3 +1,3 @@
1
- import{g as M}from"./react-C51i12iP.js";import{r as O}from"./index-pbhVNuOA.js";import{r as _}from"./dcl-schemas-BICTSpB5.js";function C(u,w){for(var m=0;m<w.length;m++){const f=w[m];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in u)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(u,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var d={},F;function P(){if(F)return d;F=1,Object.defineProperty(d,"__esModule",{value:!0}),d.getHashesByKey=d.buildEntityWithoutNewFiles=d.buildEntity=d.buildEntityAndFile=void 0;const u=O(),w=_();async function m({type:n,pointers:t,timestamp:e,content:a,metadata:r}){var i;if(t.length===0)throw new Error("All entities must have at least one pointer.");const l={version:"v3",type:n,pointers:t,timestamp:e,content:a,metadata:r};if(a){const s=new Set;for(const b of a){const E=b.file.toLowerCase();if(s.has(E))throw new Error(`Error creating the deployable entity: Decentraland's file system is case insensitive, the file ${JSON.stringify(b.file)} is repeated`);s.add(E)}}const c=new TextEncoder().encode(JSON.stringify(l)),o={id:await(0,u.hashV1)(c),...l};if(!w.Entity.validate(o))throw new Error(`Generated entity is not valid:
1
+ import{g as M}from"./react-BMZSDQJw.js";import{r as O}from"./index-CAp_8XyK.js";import{r as _}from"./dcl-schemas-BICTSpB5.js";function C(u,w){for(var m=0;m<w.length;m++){const f=w[m];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in u)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(u,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var d={},F;function P(){if(F)return d;F=1,Object.defineProperty(d,"__esModule",{value:!0}),d.getHashesByKey=d.buildEntityWithoutNewFiles=d.buildEntity=d.buildEntityAndFile=void 0;const u=O(),w=_();async function m({type:n,pointers:t,timestamp:e,content:a,metadata:r}){var i;if(t.length===0)throw new Error("All entities must have at least one pointer.");const l={version:"v3",type:n,pointers:t,timestamp:e,content:a,metadata:r};if(a){const s=new Set;for(const b of a){const E=b.file.toLowerCase();if(s.has(E))throw new Error(`Error creating the deployable entity: Decentraland's file system is case insensitive, the file ${JSON.stringify(b.file)} is repeated`);s.add(E)}}const c=new TextEncoder().encode(JSON.stringify(l)),o={id:await(0,u.hashV1)(c),...l};if(!w.Entity.validate(o))throw new Error(`Generated entity is not valid:
2
2
  `+((i=w.Entity.validate.errors)===null||i===void 0?void 0:i.map(s=>s.message).join(`
3
3
  `)));return{entity:o,entityFile:c}}d.buildEntityAndFile=m;async function f({type:n,pointers:t,files:e,metadata:a,timestamp:r}){const i=Array.from(e||[]).map(([o,s])=>({key:o,content:s})),l=await Promise.all(i.map(async({key:o,content:s})=>({key:o,content:s,hash:await(0,u.hashV1)(s)}))),c=new Map(l.map(({hash:o,key:s})=>[s,o])),y=new Map(l.map(({hash:o,content:s})=>[o,s]));return v(n,t,{hashesByKey:c,filesByHash:y,metadata:a,timestamp:r})}d.buildEntity=f;async function h(n,{contentUrl:t,type:e,pointers:a,hashesByKey:r,metadata:i,timestamp:l}){const c=r??i?p(i):void 0;if(c&&A(e,c)){const y=await D(n,t,c),o=await H(y,i);return f({type:e,pointers:a,files:y,metadata:o,timestamp:l})}return v(e,a,{hashesByKey:r,metadata:i,timestamp:l})}d.buildEntityWithoutNewFiles=h;async function v(n,t,e){if(t.length===0)throw new Error("All entities must have at least one pointer.");const a=e!=null&&e.hashesByKey?e==null?void 0:e.hashesByKey:new Map,r=Array.from(a.entries()).map(([o,s])=>({file:o,hash:s})),i=e!=null&&e.timestamp?e==null?void 0:e.timestamp:Date.now(),{entity:l,entityFile:c}=await m({type:n,pointers:t,timestamp:i,content:r,metadata:e==null?void 0:e.metadata}),y=e!=null&&e.filesByHash?e.filesByHash:new Map;return y.set(l.id,c),{files:y,entityId:l.id}}function A(n,t){return n===w.EntityType.PROFILE&&Array.from(t).some(([,e])=>e.toLowerCase().startsWith("qm"))}async function g(n,t){const a=await(await n.fetch(t)).arrayBuffer();return new Uint8Array(a)}async function D(n,t,e){const a=e.get("body.png"),r=e.get("face256.png"),i=new URL(`${t}/contents/${a}`).toString(),l=new URL(`${t}/contents/${r}`).toString(),[c,y]=await Promise.all([g(n,i),g(n,l)]);return new Map([["body.png",c],["face256.png",y]])}async function H(n,t){return t&&(t.avatars=await Promise.all(t.avatars.map(async e=>{const a={face256:"",body:""},r=n.get("face256.png");r&&(a.face256=await(0,u.hashV1)(r));const i=n.get("body.png");return i&&(a.body=await(0,u.hashV1)(i)),e.avatar.snapshots=a,e})),t)}function p(n){const t=n.avatars[0];if(t.avatar.snapshots)return new Map([["body.png",t.avatar.snapshots.body],["face256.png",t.avatar.snapshots.face256]])}return d.getHashesByKey=p,d}var B=P();const N=M(B),I=C({__proto__:null,default:N},[B]);export{I as D};
@@ -1 +1 @@
1
- import{j as r}from"./react-C51i12iP.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx("svg",{className:"error-notice__ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2 1 21h22L12 2zm0 6a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1zm0 8.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"})}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-BMZSDQJw.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx("svg",{className:"error-notice__ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2 1 21h22L12 2zm0 6a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1zm0 8.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"})}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BWjqHbac.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-B4OkjZ5Z.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-MS8QbMhJ.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-nWE7w6GR.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -0,0 +1 @@
1
+ import{u as Y,a as $,r as i,j as e}from"./react-BMZSDQJw.js";import{u as H,t as s,g as Q,j as V,q as g,C as d,x as P,r as I,l as W,m as z}from"./index-Cw_zTgKJ.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-B7LsaJk_.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-CCExEWAo.js";import{C as te}from"./CircularProgress-CtItbytk.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29920979542.commit-4d76953/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29920979542.commit-4d76953/assets/credit-coin-CmcTCd5i.webp",ae="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",C=se()?"mock":"stripe",ce={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function M(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=Y(),{session:r,signIn:m}=Q(),n=V(),[k,S]=$(),{packs:F,isLoading:T}=Z(),[p,l]=i.useState("select"),[c,w]=i.useState(null),[E,R]=i.useState(null),[U,_]=i.useState(null),[K,N]=i.useState(!1),f=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=i.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=i.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const j=u.creditsGranted??(c==null?void 0:c.credits)??0;R(j>0?j:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:j>0?j:null,provider:C}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const A=sessionStorage.getItem(G);if(A){sessionStorage.removeItem(G);const h=JSON.parse(A),B=h.tokenId??h.itemId;if(h.contractAddress&&B){o(`/item/${h.contractAddress}/${B}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),_(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),_(M(u)),l("error")}},[c,r,n,o]),q=i.useCallback(async t=>{if(!r){m();return}_(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await ee(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),_(M(a)),l("error")}},[r,m,b]),y=i.useRef(!1);i.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),_(null),N(!1)}const O=p==="select";return e.jsxs("div",{className:"getcredits",children:[O&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void q(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:v,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:o,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:o.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BQwZ_U1w.js";import{d as g,r as v}from"./index-B4OkjZ5Z.js";import{C as c}from"./ConstantsUtil-CJUlyS7R.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BWjqHbac.js";import{au as y}from"./NetworkUtil-Xp0fNa8X.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-Dnt0S0mL.js";import{d as g,r as v}from"./index-nWE7w6GR.js";import{C as c}from"./ConstantsUtil-CPwpahR3.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-MS8QbMhJ.js";import{au as y}from"./NetworkUtil-CM7JZPbs.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -0,0 +1,5 @@
1
+ import{u as K,r as u,j as e,L as B}from"./react-BMZSDQJw.js";import{t as s,C as w,B as k,l as L,q as $,x as A,u as P,g as U,j as W,e as O,s as Q,E as z}from"./index-Cw_zTgKJ.js";import{i as Y,R as D,f as G}from"./import-C5j6Wx_d.js";import{s as H}from"./wallet-kind-Cg4yayUr.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./buy-B9BIW0Jt.js";import"./index-HN6Rk25C.js";import"./mana-rate-zpYtmb1D.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,E]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await Y(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof D)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||E("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
2
+ margin-top: 10px;
3
+ `,V=Q(k)`
4
+ padding: 13px 24px;
5
+ `,X=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub"}];function de(){P({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:T,restore:j}=U(),h=W(),N=n==null?void 0:n.address;u.useEffect(()=>{j()},[j]);const{data:d,isLoading:m}=O({queryKey:["importable",N],queryFn:()=>G(N),enabled:!!N}),[f,I]=u.useState({}),[E,S]=u.useState(new Set),[_,v]=u.useState(null),x=u.useMemo(()=>[...(d==null?void 0:d.creations)??[],...(d==null?void 0:d.owned)??[]],[d]);u.useEffect(()=>{x.length&&I(a=>{const l={...a};for(const i of x)l[i.oldTradeId]==null&&(l[i.oldTradeId]=i.suggestedCredits);return l})},[x]);const y=a=>!E.has(a),t=a=>f[a.oldTradeId]??a.suggestedCredits,c=x.filter(a=>y(a.oldTradeId)),r=c.reduce((a,l)=>a+t(l),0);function p(a,l){const i=l.replace(/[^\d]/g,"");I(C=>({...C,[a]:i===""?0:parseInt(i,10)}))}function g(a){S(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function o(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function b(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["unified-listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),z.success(s("importListings.toastUpdated"))}return n?!m&&x.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:s("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:s("importListings.emptyBody")}),e.jsx(F,{as:B,to:"/my-assets",variant:"purple",children:s("importListings.goToMyAssets")})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:s("importListings.eyebrow")}),e.jsxs("h1",{className:"imp__title",children:[s("importListings.titleLead")," ",e.jsx("span",{className:"imp__grad",children:s("importListings.titleAccent")})]}),e.jsx("p",{className:"imp__lede",children:s("importListings.lede",{currency:w.name})})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",s("importListings.rate",{currency:w.nameSingular})]}),m?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):X.map(a=>{const l=(d==null?void 0:d[a.key])??[];return l.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:s(a.title)}),e.jsx("span",{className:"imp__section-sub",children:s(a.sub)})]}),e.jsx("div",{className:"imp__list",children:l.map(i=>{const C=t(i),R=C!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${y(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:y(i.oldTradeId),onChange:()=>g(i.oldTradeId),"aria-label":s("importListings.includeItem",{name:i.name})}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||s("importListings.itemFallback")}),e.jsx("span",{className:"imp-chip",children:i.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(L,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input","data-testid":"imp-price-input",inputMode:"numeric",value:C.toLocaleString(),onChange:M=>p(i.oldTradeId,M.target.value),"aria-label":s("importListings.priceAria",{currency:w.name,name:i.name})})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(C*.1).toFixed(2)]}),R?e.jsxs("button",{className:"imp-price__reset",onClick:()=>I(M=>({...M,[i.oldTradeId]:i.suggestedCredits})),children:[s("importListings.resetTo")," ",e.jsx(L,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx(k,{size:"sm",className:"imp-row__list",disabled:!y(i.oldTradeId),onClick:()=>v(o([i])),children:s("importListings.list")})})]},i.oldTradeId)})})]},a.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",r.toLocaleString()]}),e.jsx("div",{className:"imp-dock__sub",children:s("importListings.selectedSummary",{count:c.length,usd:(r*.1).toFixed(2)})})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsx(V,{variant:"purple",disabled:c.length===0,onClick:()=>v(o(c)),children:s("importListings.listAll",{count:c.length})})]})}),_&&n?e.jsx(J,{queue:_,session:n,onClose:()=>v(null),onDone:b}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:s("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:s("importListings.signInBody")}),e.jsx(F,{variant:"purple",onClick:()=>T(),children:s("storeSettings.signIn")})]})}export{de as ImportListings};
@@ -0,0 +1,78 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Co247DcD.js","assets/react-BMZSDQJw.js","assets/dcl-schemas-BICTSpB5.js","assets/index-Cw_zTgKJ.js","assets/sentry-8SzFotJj.js","assets/ethers-CeDRuWE-.js","assets/intl-CBcMB1D2.js","assets/index-BA2L6eSl.css","assets/emotion-styled.browser.esm-DP-xjC5M.js","assets/useTheme-Y_Ojpcr-.js","assets/CircularProgress-CtItbytk.js","assets/index-C-5O3A8t.js","assets/useTheme-tg-omw8T.js","assets/CssVarsProvider-jpijQ72F.js","assets/getOverlayAlpha-DOBThdqC.js","assets/index-BOwlzThi.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
2
+ import{u as pe,r as c,j as e,d as ha,b as _a,L as ya}from"./react-BMZSDQJw.js";import{g as Y,h as pa,j as Ge,t,ao as fa,i as ba,b as xa,o as ja,k as ie,q as W,r as Re,v as _e,ap as va,x as le,l as M,al as ne,_ as ye,ab as ga,ae as Na,ad as wa,aC as ka,ah as Ia,c as fe,aD as Ca,a2 as He,e as R,aE as Aa,I as F,y as O,s as z,aF as Sa,aG as Ma,aH as Pa,z as Ea,aj as qe,a as $e,aI as Fa,aJ as La,aK as Da,aL as Ta,aM as Ba,ak as Ra,u as qa,aN as $a,aO as Oa,aP as za,am as Ka,aQ as Oe,aR as Va,B as be,f as Wa,E as Qa,at as Ua,aS as Ga,aT as Ha,au as Ja,aU as Ya,aV as Za}from"./index-Cw_zTgKJ.js";import{d as Q}from"./dcl-schemas-BICTSpB5.js";import{b as ze,c as Xa}from"./buy-B9BIW0Jt.js";import{S as et,P as at,f as tt}from"./PrimaryListModal-Dcjz3ZJl.js";import{g as st,b as it,w as rt,S as nt,G as lt}from"./buy-gasless-DbZJNUIF.js";import{u as dt,c as ot}from"./useCreditPacks-CCExEWAo.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as ct,f as Ve,i as mt}from"./errors-BrsnEff4.js";import{E as xe}from"./ErrorNotice-DDr3KjIH.js";import{l as ut}from"./loader-logo-BzY9EKdC.js";import{C as ht}from"./CircularProgress-CtItbytk.js";import{u as _t,M as yt}from"./MarketCheckout-CS9k9P56.js";import{s as pt}from"./address-DrURAr9O.js";import{C as ft}from"./CollectionCarousel-B_IpHIiN.js";import{T as Je}from"./Tooltip-zQgqv_WS.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./wallet-kind-Cg4yayUr.js";import"./index-HN6Rk25C.js";import"./mana-rate-zpYtmb1D.js";import"./emotion-CSxEP8yM.js";function bt({item:s,onClose:n,resume:r=!1}){var X,ee;const{session:d}=Y(),{data:o}=pa(d),h=Ge(),g=pe(),j=dt().packs.slice(0,3),[m,l]=c.useState("loading"),[a,N]=c.useState(null),[p,w]=c.useState(""),[L,b]=c.useState(s.priceCredits),[f,D]=c.useState(null),P=c.useRef(null),A=(f==null?void 0:f.credits)??L,Z=(o==null?void 0:o.credits)??0;c.useEffect(()=>{let u=!1;if(!d){l("error"),N(t("buyModal.signInToCheckout"));return}const k=_=>{const I=_-((o==null?void 0:o.credits)??0),x=j.find(T=>T.credits>=I)??j[j.length-1];w(x.id),W("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,I)}),l("nofunds")};return(async()=>{var _,I;try{const x=await fa(s);if(!x)throw new Error("not for sale");if(ba(x,d.address))throw new Error("You can't buy your own listing.");const T=xa((I=(_=x.received)==null?void 0:_[0])==null?void 0:I.amount);if(!Number.isFinite(T)||T<=0)throw new Error("price unavailable");const K=Math.ceil(T/10);if(u)return;if(b(K),o!=null&&o.credits<K){k(K);return}try{const{credit:C,maxCreditedValue:G,usdCents:$}=await ja(d.identity,T,x.id);if(u){ie(d.identity,[C.id]).catch(()=>{});return}P.current=C.id;const ae=Math.ceil($/10);b(ae);const V={trade:x,credit:C,maxCreditedValue:G,usdCents:$,credits:ae};D(V),r?U(V):l("ready")}catch(C){if(u)return;if(ct(C)){k(K);return}throw C}}catch(x){if(u)return;W(_e(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Re(x)}),l("error"),N(Ve(x,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{u=!0,P.current&&d&&(ie(d.identity,[P.current]).catch(()=>{}),P.current=null)}},[]);async function U(u=f){if(!d||!u)return;l("processing"),N(null);let k=!1;try{const _={trade:u.trade,buyer:d.address,signer:d.signer,credits:[u.credit],maxCreditedValue:u.maxCreditedValue};let I;if(st())try{I=await it(_),await rt(I),k=!0}catch(x){if(x instanceof nt)k=!0;else if(x instanceof lt)I=await ze(_);else throw x}else I=await ze(_);P.current=null,W("Shop Completed Purchase",{...va([s]),payment_type:"credits",no_crypto_step:k,transaction_hash:I??null}),h.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){_e(_)||le(_,{flow:"buy",step:"submit",gasless:k}),ie(d.identity,[u.credit.id]).catch(()=>{}),P.current=null,W(_e(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Re(_)}),h.invalidateQueries({queryKey:["usd-balance"]}),N(Ve(_,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function de(){if(!(!p||!d)){try{sessionStorage.setItem(Ke,JSON.stringify(s))}catch{}f&&ie(d.identity,[f.credit.id]).catch(()=>{}),P.current=null,l("loading");try{const u=await ot(p,{address:d.address,identity:d.identity});if(u.url){window.location.href=u.url;return}g("/credits")}catch(u){le(u,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}N(t("buyModal.error.creditsCheckout")),l("error")}}}const q=m==="processing",E=m==="complete"?t("buyModal.titleComplete"):m==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:s.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:q?void 0:n,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${m==="processing"||m==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:E}),!q&&e.jsx("button",{className:"buy-modal__x",onClick:n,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:m==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ne(Z)})]})]}),m==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ht,{size:44})}),m==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(xe,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:n,children:t("buyModal.close")})})]}),m==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,A-Z)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(We,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__packs",children:j.map(u=>{const k=u.credits,_=u.id===p;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>w(u.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ne(k)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",u.usd.toFixed(2),")"]})]},u.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(M,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ne(((X=j.find(u=>u.id===p))==null?void 0:X.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((ee=j.find(u=>u.id===p))==null?void 0:ee.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:n,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void de(),children:t("buyModal.buy")})]})]}),m==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(We,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void U(),children:t("buyModal.buy")})})]}),m==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ut,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:r?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),m==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>g("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:n,children:[t("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function We({item:s,priceCredits:n}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:s.name,children:s.name||t("buyModal.itemFallback")}),s.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:s.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ne(n)})]})]})]})}const xt=c.lazy(async()=>{const[{EmoteControls:s},{Experimental_CssVarsProvider:n},{light:r}]=await Promise.all([ye(()=>import("./index-Co247DcD.js").then(d=>d.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ye(()=>import("./index-C-5O3A8t.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ye(()=>import("./index-BOwlzThi.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:d=>e.jsx(n,{theme:r,children:e.jsx(s,{...d})})}});function jt(s){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(xt,{...s})})}function vt({item:s}){const n=Y(f=>{var D;return(D=f.session)==null?void 0:D.address}),{data:r,isLoading:d}=ga(n),o=n&&r?n:"default",h=s.category==="emote",[g,j]=c.useState("item"),m=!h&&g==="item",l=m||!d,[a,N]=c.useState(!0);c.useEffect(()=>{N(!0)},[s.id,m]);const p=!!n&&!!r,w=p&&Na(s,wa(r)),L=ka(s)[0],b=p&&!w&&!h;return e.jsxs(e.Fragment,{children:[l?e.jsx(Ia,{id:"shop-item-preview",contractAddress:s.contractAddress,tokenId:s.tokenId??void 0,itemId:s.tokenId?void 0:s.itemId??void 0,profile:m?void 0:w?o:"default",bodyShape:m||w?void 0:L,type:h?void 0:m?Q.PreviewType.WEARABLE:Q.PreviewType.AVATAR,emote:h||m?void 0:Q.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:h?1.5:void 0,wheelStart:h?100:void 0,dev:fe.chainId===80002,onLoad:()=>N(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,b&&!m?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:Ca(L)})}):null,h?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(jt,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:g==="avatar"?"is-active":"","aria-pressed":g==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>j("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:g==="item"?"is-active":"","aria-pressed":g==="item","aria-label":t("itemPreview.item"),onClick:()=>j("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.item")})]})]})]})}function Ye(){return fe.shopServerUrl||(typeof window<"u"?window.location.origin:"")}async function gt(s,n,r){const d=new URLSearchParams({contractAddress:s,itemId:n}),o=`${Ye()}/notify-requests?${d.toString()}`,h=await He(o,{method:"GET",identity:r,metadata:{}});if(!h.ok)throw new Error(`getNotifyRequest ${h.status}`);return h.json()}async function Nt(s,n){const r=`${Ye()}/notify-requests`,d=await He(r,{method:"POST",identity:n,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok)throw new Error(`createNotifyRequest ${d.status}: ${await d.text()}`);await d.json().catch(()=>{})}function Qe(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function wt({item:s}){const n=Y(b=>b.session),r=Y(b=>b.signIn),[d,o]=c.useState(""),[h,g]=c.useState(!1),[j,m]=c.useState(!1),[l,a]=c.useState(null),N=!!n&&!!s.contractAddress&&!!s.itemId,{data:p}=R({queryKey:["notify-request",s.contractAddress,s.itemId,n==null?void 0:n.address],enabled:N,queryFn:()=>gt(s.contractAddress,s.itemId,n.identity)});c.useEffect(()=>{p!=null&&p.email&&o(b=>b||p.email)},[p==null?void 0:p.email]),c.useEffect(()=>{if(!n)return;let b=!1;return Aa().then(f=>{!b&&f&&o(D=>D||f)}),()=>{b=!0}},[n]);const w=j||!!(p!=null&&p.subscribed);async function L(b){if(b.preventDefault(),!(!n||!s.itemId||!Qe(d)||h)){g(!0),a(null);try{await Nt({contractAddress:s.contractAddress,itemId:s.itemId,chainId:s.chainId,email:d.trim()},n.identity),m(!0)}catch(f){le(f,{flow:"notify-me",contractAddress:s.contractAddress,itemId:s.itemId}),a(t("notifyMe.error"))}finally{g(!1)}}}return n?w?e.jsxs("div",{className:"notify notify__done","data-testid":"notify-subscribed",children:[e.jsx("span",{className:"notify__done-check","aria-hidden":!0,children:e.jsx(F,{name:"check",size:12})}),e.jsx("span",{className:"notify__done-text",children:t("notifyMe.subscribedBody")})]}):e.jsxs("form",{className:"notify",onSubmit:L,"data-testid":"notify",children:[e.jsx("label",{className:"notify__label",htmlFor:"notify-email",children:t("notifyMe.label")}),e.jsxs("div",{className:"notify__row",children:[e.jsx("input",{id:"notify-email",className:"notify__input",type:"email",inputMode:"email",autoComplete:"email",placeholder:t("notifyMe.placeholder"),value:d,onChange:b=>o(b.target.value),"data-testid":"notify-email"}),e.jsx("button",{type:"submit",className:"notify__btn",disabled:!Qe(d)||h,"data-testid":"notify-submit",children:h?t("notifyMe.working"):t("notifyMe.cta")})]}),e.jsx(xe,{message:l})]}):e.jsx("div",{className:"notify","data-testid":"notify",children:e.jsx("button",{type:"button",className:"notify__signin",onClick:r,"data-testid":"notify-signin",children:t("notifyMe.signInCta")})})}const kt=z.button`
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ gap: 8px;
7
+ width: 100%;
8
+ height: 40px;
9
+ padding: 0 12px;
10
+ border: 2px solid #c640cd;
11
+ border-radius: 8px;
12
+ background: transparent;
13
+ color: ${O.colors.accent};
14
+ font-family: ${O.font.sans};
15
+ font-weight: 600;
16
+ font-size: 15px;
17
+ line-height: 24px;
18
+ letter-spacing: 0.46px;
19
+ text-transform: uppercase;
20
+ cursor: not-allowed;
21
+ opacity: 0.55;
22
+ transition: opacity 0.15s ease;
23
+
24
+ &:hover,
25
+ &:focus-visible {
26
+ opacity: 0.75;
27
+ }
28
+ &:focus-visible {
29
+ outline: 2px solid ${O.colors.accent};
30
+ outline-offset: 2px;
31
+ }
32
+ `;function It({item:s}){return e.jsx(Je,{block:!0,content:t("makeOffer.comingSoon"),onShow:()=>W("Shop Make Offer Tooltip Shown",{contractAddress:s.contractAddress,itemId:s.itemId}),children:e.jsxs(kt,{type:"button","aria-disabled":!0,onClick:n=>n.preventDefault(),"data-testid":"make-offer",children:[e.jsx(F,{name:"offer",size:20,"aria-hidden":!0}),e.jsx("span",{children:t("makeOffer.cta")})]})})}const Ct=z(Sa)`
33
+ display: flex;
34
+ flex-direction: column;
35
+ overflow: hidden;
36
+ gap: 1px;
37
+ background: ${O.colors.lineStrong};
38
+ `;function At({contractAddress:s,name:n,items:r,className:d}){const o=pe();if(!s||!n)return null;const h=(r??[]).map(m=>m.thumbnail).filter(m=>!!m).slice(0,4),g=h.slice(0,2),j=h.slice(2,4);return e.jsxs(Ma,{as:"button","data-link":!0,className:d,"data-testid":"creator",onClick:m=>{m.stopPropagation(),o(`/collection/${s}`)},children:[h.length>0?e.jsxs(Ct,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${j.length===0?" collection-collage__row--full":""}`,children:g.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}),j.length>0?e.jsx("span",{className:"collection-collage__row",children:j.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}):null]}):null,e.jsx(Pa,{"data-testid":"creator-name",children:Ea(n)})]})}const St=z(be)`
39
+ margin-top: 6px;
40
+ `,re=z(be)`
41
+ && {
42
+ width: 100%;
43
+ height: 48px;
44
+ font-size: 15px;
45
+ font-weight: 600;
46
+ letter-spacing: 0.46px;
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ gap: 8px;
51
+ }
52
+
53
+ ${O.media.down("lg")} {
54
+ .item-detail__ctas--dual && {
55
+ flex: 1 1 auto;
56
+ width: auto;
57
+ }
58
+ }
59
+ `,Mt=z("div")`
60
+ display: flex;
61
+ flex-direction: column;
62
+ gap: 10px;
63
+ width: 100%;
64
+ `,Pt=z(be)`
65
+ && {
66
+ width: 100%;
67
+ height: 44px;
68
+ }
69
+ `,Et=z("p")`
70
+ margin: 4px 0 0;
71
+ font-size: 13px;
72
+ color: ${O.colors.muted};
73
+
74
+ a {
75
+ color: ${O.colors.accent};
76
+ font-weight: 600;
77
+ }
78
+ `;function Ft(s){return Object.values(Q.Rarity).includes(s)}function Lt(s){return s==="male"?t("itemDetail.genderMale"):s==="female"?t("itemDetail.genderFemale"):s==="unisex"?t("itemDetail.genderUnisex"):null}function Ue(s){return s.wearableCategory?s.wearableCategory.replace(/_/g," "):s.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function ns(){var Te;const{contractAddress:s,tokenId:n}=ha(),{state:r}=_a(),d=pe(),o=!!(r!=null&&r.market),h=(r==null?void 0:r.marketPriceCredits)??null,g=qe(i=>i.add),j=qe(i=>i.items),m=$e(i=>i.toggle),{session:l}=Y(),[a,N]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${s}-${n}`,name:"",creator:"",contractAddress:s??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[p,w]=c.useState(!1),[L,b]=c.useState(!!(r!=null&&r.resumeBuy));c.useEffect(()=>{r!=null&&r.resumeBuy&&w(!0)},[r==null?void 0:r.resumeBuy]);const{data:f=[],isFetched:D}=R({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>Ua(a.contractAddress,{first:20}).then(i=>i.items)}),P=a.available==null&&!a.tokenId,{data:A,isLoading:Z}=R({queryKey:["shop-item",a.contractAddress,n],enabled:!o&&!!a.contractAddress&&!!n&&(!(r!=null&&r.item)||P),queryFn:()=>Ga(a.contractAddress,n)});c.useEffect(()=>{A&&N(i=>i.tradeId?i.available!=null&&i.wearableCategory?i:{...i,available:i.available??A.available,wearableCategory:i.wearableCategory??A.wearableCategory}:{...A})},[A]);const[U,de]=c.useState(!1),{data:q=""}=R({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Ha(a.contractAddress,a.itemId)}),{data:E}=R({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Ja(a.contractAddress)});c.useEffect(()=>{if(a.name||A||f.length===0)return;const i=n&&f.find(v=>v.tokenId===n||v.itemId===n)||f.find(v=>v.contractAddress===a.contractAddress);i&&N(v=>({...i,tradeId:v.tradeId??i.tradeId}))},[f,A]);const X=c.useMemo(()=>{const i=new Set,v=[];for(const S of f){if(S.id===a.id||a.itemId&&S.itemId===a.itemId||a.tokenId&&S.tokenId===a.tokenId)continue;const Be=`${S.contractAddress}-${S.itemId??S.tokenId??S.id}`;i.has(Be)||(i.add(Be),v.push(S))}return v},[f,a.id,a.itemId,a.tokenId]),{data:ee,isLoading:u}=R({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const i=await Ya(a.contractAddress,a.itemId);return(i==null?void 0:i.id)??null}return null}}),k=a.tradeId??ee??void 0,_=!!k,{data:I}=_t(o),x=c.useMemo(()=>{if(!o||!(r!=null&&r.item))return null;const i=r.item;return i.manaWei?{tradeId:i.tradeId??i.id,listingType:"primary",contractAddress:i.contractAddress,itemId:i.itemId??"",name:i.name,thumbnail:i.thumbnail,rarity:i.rarity,category:i.category,wearableCategory:i.wearableCategory??null,creator:i.creator,manaWei:i.manaWei,available:1,network:i.network,chainId:i.chainId,createdAt:0}:null},[o,r==null?void 0:r.item]),T=o&&h!=null&&!!I&&!!x,K=Fa({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),C=c.useMemo(()=>({...a,tradeId:k,id:k??a.id}),[a,k]),G=j.some(i=>i.id===C.id),$=!C.tokenId,ae=((Te=j.find(i=>i.id===C.id))==null?void 0:Te.quantity)??0,V=$&&typeof a.available=="number"&&ae>=a.available,B=$e(i=>!!i.items[a.id]),je=c.useRef(null);c.useEffect(()=>{!a.name||u||je.current===a.id||(je.current=a.id,W("Shop Viewed Item",{...La(a),for_sale:_}),Da(a))},[a.id,a.name,u,_]);const te=`${s}/${n}`,ve=c.useRef(te);c.useEffect(()=>{ve.current!==te&&(ve.current=te,r!=null&&r.item&&N({...r.item,tradeId:r.tradeId??r.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[te]);function Ze(){!_||ce||u||!$&&G||V||g(C,"item_detail")}const oe=Ft(a.rarity)?a.rarity:Q.Rarity.COMMON,ge=Lt(a.gender),Ne=Ta(a),we=Ba(a.gender),Xe=_&&K,ea=t("itemDetail.moreFromCollection"),ce=Ra(a,l==null?void 0:l.address),se=Ge(),[aa,ke]=c.useState(!1),[ta,Ie]=c.useState(!1),[H,Ce]=c.useState(!1),[sa,Ae]=c.useState(null),{data:y,isLoading:ia}=R({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!o&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Za(l.address,a.contractAddress,a.tokenId):null});c.useEffect(()=>{y&&N(i=>i.name?i.issuedId?i:{...i,issuedId:y.issuedId}:{id:y.id,name:y.name,creator:"",contractAddress:y.contractAddress,itemId:y.itemId,category:y.category,rarity:y.rarity??"common",network:y.network,chainId:y.chainId,thumbnail:y.image,priceCredits:y.listingPrice??0,gender:null,isSmart:!1,tokenId:y.tokenId,issuedId:y.issuedId,tradeId:y.tradeId})},[y]);const{data:me}=R({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:ce&&!!l&&!!a.itemId,queryFn:async()=>l?(await tt(l.address,l.identity)).find(v=>v.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&v.blockchainItemId===a.itemId)??null:null}),J=!!y,ue=!o&&(ce||J),ra=J?!!(y!=null&&y.isOnSale):_,he=J?y==null?void 0:y.tradeId:k,Se=J?!!y:!!me;async function Me(){await Promise.all([se.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),se.invalidateQueries({queryKey:["detail-trade"]}),se.invalidateQueries({queryKey:["shop-item"]}),se.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Pe(i={}){if(!l||!he)return!1;Ae(null),Ce(!0);try{const v=await Wa(he);return await Xa({trade:v,signer:l.signer}),i.silent||Qa.success(t("myAssets.removedFromSale",{name:a.name})),await Me(),!0}catch(v){const S=mt(v);return S||le(v,{flow:"remove-listing",tradeId:he}),Ae(S?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{Ce(!1)}}function Ee(){J?ke(!0):Ie(!0)}async function na(){await Pe({silent:!0})&&Ee()}function Fe(){ke(!1),Ie(!1),Me()}const Le=_?u?t("itemDetail.checking"):V?t("itemDetail.maxInCart"):!$&&G?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),la=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!o,da=!o&&!a.tokenId&&a.available===0,oa=!ue&&_&&!o,ca=o||!ue,ma=Z||!!a.contractAddress&&!D||!a.name&&ia,De=!a.name&&!ma,ua=/^https?:\/\//i.test(a.thumbnail);return qa(De?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:q||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ue(a),creator:pt(a.creator)}),image:ua?a.thumbnail:void 0,type:"product"}:{}),De?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(F,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(St,{variant:"purple",onClick:()=>d("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>d("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(vt,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:za(oe),color:Oa(oe)},title:$a(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[Ne?e.jsx(F,{name:Ne,size:18,color:"var(--text-2)"}):null,Ue(a)]}),ge?e.jsxs("span",{className:"chip item-detail__chip",children:[we?e.jsx(F,{name:we,size:18,color:"var(--text-2)"}):null,ge]}):null,a.issuedId?e.jsxs("span",{className:"chip item-detail__chip","data-testid":"detail-issued",children:["#",a.issuedId]}):null]}),q?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${U?" is-expanded":""}`,children:q}),q.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>de(i=>!i),children:U?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||E!=null&&E.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.creator")}),e.jsx(Ka,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,E!=null&&E.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(At,{contractAddress:a.contractAddress,name:E.name,items:f,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[o||_?e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}):null,o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:h==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:h})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):_?Xe?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(M,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),Oe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:Oe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Va,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsxs("div",{className:"item-detail__price item-detail__price--none",children:[e.jsx("span",{children:t("itemDetail.notForSale")}),e.jsx(Je,{content:t("itemDetail.notForSaleHint"),children:e.jsx("span",{className:"item-detail__price-info",tabIndex:0,role:"img","aria-label":t("itemDetail.notForSaleHint"),children:e.jsx(F,{name:"info",size:14})})})]})]}),la?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",Q.Rarity.getMaxSupply(oe).toLocaleString()]})]}):da?e.jsx("div",{className:"item-detail__stock-col",children:e.jsx("div",{className:"item-detail__stock-value item-detail__stock-value--out","data-testid":"out-of-stock",children:t("itemDetail.outOfStock")})}):null]})}),e.jsx("div",{className:`item-detail__ctas${ca?" item-detail__ctas--buttons":""}${oa?" item-detail__ctas--dual":""}`,children:o?e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),h!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),h]}):null]}):ue?e.jsxs(Mt,{"data-testid":"manage-actions",children:[e.jsx(xe,{message:sa}),ra?e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"purple",onClick:()=>void na(),disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:H?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(Pt,{variant:"ghost",onClick:()=>void Pe(),disabled:H,children:H?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(re,{variant:"purple",onClick:Ee,disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(Et,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ya,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):_?e.jsxs(e.Fragment,{children:[e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:u,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}),e.jsxs("button",{className:"item-detail__addcart",onClick:Ze,disabled:u||($?V:G),"aria-label":Le,children:[e.jsx(F,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Le})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(wt,{item:a}),e.jsx(It,{item:a})]})})]}):e.jsx(Dt,{})})]}),e.jsx(ft,{title:ea,items:X,onViewAll:a.contractAddress?()=>d(`/collection/${a.contractAddress}`):void 0}),p&&o&&x&&I?e.jsx(yt,{listing:x,rate:I,onClose:()=>w(!1),onSold:()=>w(!1)}):p&&!o?e.jsx(bt,{item:C,resume:L,onClose:()=>{w(!1),b(!1)}}):null,aa&&y&&l?e.jsx(et,{asset:y,session:l,onClose:Fe}):null,ta&&me&&l?e.jsx(at,{item:me,session:l,onClose:Fe}):null]})}function Dt(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{ns as ItemDetail,ns as default};
@@ -1,4 +1,4 @@
1
- import{r as l,j as c}from"./react-C51i12iP.js";import{s as u,B as p,t as d}from"./index-BBuZMaWr.js";const a=u.div`
1
+ import{r as l,j as c}from"./react-BMZSDQJw.js";import{s as u,B as p,t as d}from"./index-Cw_zTgKJ.js";const a=u.div`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  padding: 28px 0 8px;
@@ -0,0 +1,3 @@
1
+ import{e as O,c as S,g as V,h as Y,j as H,t,k as h,l as x,m as M,n as $,C as j,f as D,i as J,o as X,q as y,r as F,v as R,s as Z,B as ee}from"./index-Cw_zTgKJ.js";import{r as re,a as b}from"./mana-rate-zpYtmb1D.js";import{u as ae,r as m,j as r}from"./react-BMZSDQJw.js";import{b as A}from"./buy-B9BIW0Jt.js";import{g as te,b as se,w as ie,S as ce,G as ne}from"./buy-gasless-DbZJNUIF.js";import{i as de}from"./errors-BrsnEff4.js";import{E as oe}from"./ErrorNotice-DDr3KjIH.js";function pe(e=!0){return O({queryKey:["mana-rate",S.chainId],queryFn:()=>re(S.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const B=Z(ee)`
2
+ flex: 1;
3
+ `;function U(e){if(de(e))return t("errors.rejected");const n=(e.message??"").toLowerCase();return n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:j.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("errors.cantBuyOwn"):t("marketCheckout.error.generic")}function le(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function Ce({listing:e,rate:n,onClose:q,onSold:W}){const{session:i}=V(),{data:d,isError:T}=Y(i),w=H(),g=ae(),[N,k]=m.useState("confirm"),[p,I]=m.useState(t("marketCheckout.lockingPrice")),[G,f]=m.useState(null),[a,L]=m.useState(null),o=m.useRef(null),Q=Math.ceil(b(e.manaWei,n)/10);m.useEffect(()=>{let l=!1;if(!i){k("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await D(e.tradeId);if(!s)throw new Error("not found");if(J(s,i.address))throw new Error("You can't buy your own listing.");const u=b(e.manaWei,n);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:v,maxCreditedValue:K,usdCents:P}=await X(i.identity,u,e.tradeId);if(l){h(i.identity,[v.id]).catch(()=>{});return}o.current=v.id,L({trade:s,credit:v,maxCreditedValue:K,usdCents:P,credits:Math.ceil(P/10)}),I("")}catch(s){if(l)return;console.error("[market] authorize failed",s),y(R(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:F(s),value_usd:Math.round(b(e.manaWei,n))/100}),k("error"),f(U(s))}})(),()=>{l=!0,o.current&&i&&(h(i.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const C=!!a&&d!=null&&d.credits<a.credits;async function z(){if(!i||!a)return;if(C){y("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,g("/credits");return}k("working"),f(null);let l=!1;try{I(t("marketCheckout.confirming"));const c={trade:a.trade,buyer:i.address,signer:i.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(te())try{s=await se(c),await ie(s),l=!0}catch(u){if(u instanceof ce)l=!0;else if(u instanceof ne)s=await A(c);else throw u}else s=await A(c);o.current=null,y("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),w.invalidateQueries({queryKey:["usd-balance"]}),g("/success",{state:{items:[le(e)],txHash:s}})}catch(c){console.error("[market] buy now failed",c),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,y(R(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:F(c),value_usd:a.usdCents/100}),w.invalidateQueries({queryKey:["usd-balance"]}),f(U(c)),k("error");const s=(c.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&W()}}function E(){i&&a&&h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,q()}const _=N==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:_?void 0:E,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),M(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),M(Q)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),i?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",$(d,T)]}):null,C?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:j.name})}):null,p&&N==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,r.jsx(oe,{message:G,className:"mkt-modal__note"}),r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx(B,{variant:"ghost",onClick:E,disabled:_,children:t("buyModal.cancel")}),r.jsx(B,{variant:"purple",onClick:()=>void z(),disabled:_||!a,children:_?t("marketCheckout.buying"):C?t("nav.getCredits",{currency:j.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{Ce as M,pe as u};