@dcl/shop 0.1.0-30279564518.commit-0ea36ab → 0.1.0-30341633105.commit-bfa7613

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 (233) hide show
  1. package/assets/{Activity-CjKP24SM.js → Activity-DUQW_Z22.js} +4 -4
  2. package/assets/{AnimatedBackground-D2jsXv_Q.js → AnimatedBackground-D5TaGH4y.js} +1 -1
  3. package/assets/{Assets-DjrlGGuo.js → Assets-B4NCA-FL.js} +54 -54
  4. package/assets/{Assets.styles-DKu0M-fo.js → Assets.styles-CE4c2s9w.js} +1 -1
  5. package/assets/{Authorizations-DfNkZpjD.js → Authorizations-FSevrZuz.js} +1 -1
  6. package/assets/{Button-DUuwMw2g.js → Button-CVXKA5VS.js} +2 -2
  7. package/assets/Cart-Bwa3a9Hp.js +1 -0
  8. package/assets/{CircularProgress-BOITSQXA.js → CircularProgress-B7WalF_4.js} +1 -1
  9. package/assets/{Collection-0X39SWqr.js → Collection-DdHzXaav.js} +1 -1
  10. package/assets/CollectionCarousel-BLfBmiC7.js +292 -0
  11. package/assets/{ConstantsUtil-DTrOBzCe.js → ConstantsUtil-CqaPdSAF.js} +1 -1
  12. package/assets/{ContentClient-jyMKirlf.js → ContentClient-0BEnf6CP.js} +1 -1
  13. package/assets/{Creator-BjoPunwO.js → Creator-B9a3v2rB.js} +1 -1
  14. package/assets/{DeploymentBuilder-j08uBP-r.js → DeploymentBuilder-Df9ZJakk.js} +1 -1
  15. package/assets/{ErrorNotice-BG40E5Ff.js → ErrorNotice-D_Z5OVFI.js} +1 -1
  16. package/assets/{ExchangeController--3J53YgS.js → ExchangeController-DTUPu5lZ.js} +1 -1
  17. package/assets/{GetCredits-BcZpGmti.js → GetCredits-CEruTT5O.js} +6 -6
  18. package/assets/{HelpersUtil-DWI18gI9.js → HelpersUtil-DY1hA3MT.js} +1 -1
  19. package/assets/{ImportListings-DNcnjuRU.js → ImportListings-CUNQkt5i.js} +2 -2
  20. package/assets/ItemDetail-gPIjOR_D.js +2406 -0
  21. package/assets/{LoadMore-Cv8ieNqf.js → LoadMore-K8EfO7If.js} +1 -1
  22. package/assets/MarketCheckout-BlfeUpjX.js +3 -0
  23. package/assets/{MenuList-Dpn2ZgKk.js → MenuList-DPrUOTQw.js} +1 -1
  24. package/assets/{MyAssets-yXg0a1Zj.js → MyAssets-qLOA_5tD.js} +1 -1
  25. package/assets/{MyFavorites-C6oOSvkj.js → MyFavorites-C1SUs-Jy.js} +1 -1
  26. package/assets/{NetworkUtil-C1aEwuOK.js → NetworkUtil-DQZGJzap.js} +1 -1
  27. package/assets/{NotFound-BMCYiONc.js → NotFound-hEgIvZDQ.js} +1 -1
  28. package/assets/{NotificationsBell-5E6mEGEn.js → NotificationsBell-BPdngTao.js} +1 -1
  29. package/assets/{StoreSettings-DbdH6mzE.js → StoreSettings-BvrwDCuq.js} +5 -5
  30. package/assets/{Success-D7KdjdBY.js → Success-DfPUnbUp.js} +2 -2
  31. package/assets/{SwapController-C0FvCHWq.js → SwapController-Cvanu67b.js} +1 -1
  32. package/assets/{Tooltip-DSEH6tal.js → Tooltip-8SR8hseo.js} +5 -5
  33. package/assets/{TradeService-CbFSATer.js → TradeService-DH4vjiAB.js} +1 -1
  34. package/assets/{W3MFrameProviderSingleton-CCVyEXOJ.js → W3MFrameProviderSingleton-DtrTVFth.js} +3 -3
  35. package/assets/{WebCryptoP256-CxdV7gm_.js → WebCryptoP256-B_JP0jDJ.js} +1 -1
  36. package/assets/{authorizations-Bt-yiKpU.js → authorizations-Dtu8Ye0y.js} +1 -1
  37. package/assets/{basic-1GkOUAUg.js → basic-DljOvbvB.js} +1 -1
  38. package/assets/{biconomy-CEgRNCV3.js → biconomy-ik7MjMyj.js} +1 -1
  39. package/assets/{browser-CTzRZpIE.js → browser-BgOlLsTO.js} +1 -1
  40. package/assets/{browser-ponyfill-CI1-rMvf.js → browser-ponyfill-CMZ3i8tY.js} +1 -1
  41. package/assets/browser-ponyfill-lfpnveOA.js +1 -0
  42. package/assets/{builder-ChMzGlEf.js → builder-BsAwBvGZ.js} +1 -1
  43. package/assets/{buy-C8thJCOQ.js → buy-CyhVI8ih.js} +1 -1
  44. package/assets/buy-gasless-D6tjB5nW.js +1 -0
  45. package/assets/{cart-checkout-DtChJ5jV.js → cart-checkout-Bp3fmOrE.js} +1 -1
  46. package/assets/{categories-CQDU6eKt.js → categories-Jh3tfbEa.js} +1 -1
  47. package/assets/{ccip-DHMKr_5U.js → ccip-Dn5CKGMr.js} +1 -1
  48. package/assets/{ccip-D0x94rIy.js → ccip-fs__7FtW.js} +1 -1
  49. package/assets/{chains-Znt1BTfw.js → chains-Bk8fyLPj.js} +1 -1
  50. package/assets/collection-Cbl5FMco.js +1 -0
  51. package/assets/{common-D9tSChDa.js → common-CI-kmbOq.js} +1 -1
  52. package/assets/{controller-BkyUM4Zl.js → controller-CFA_t_aX.js} +2 -2
  53. package/assets/{core-xNSXcK8v.js → core-bscEUkDr.js} +4 -4
  54. package/assets/{custom-DbKBJS0m.js → custom-CBNtVqpj.js} +1 -1
  55. package/assets/{data-capture-DDPGGwVG.js → data-capture-OumUBjqI.js} +1 -1
  56. package/assets/{decimals-C4nLn1ac.js → decimals-CIbX1tiW.js} +1 -1
  57. package/assets/decimals-CS6j__sw.js +1 -0
  58. package/assets/{detectExtension-BgMIFAUw.js → detectExtension-DObVoAzH.js} +1 -1
  59. package/assets/{email-Bdh6R3aN.js → email-Psj4ILkk.js} +1 -1
  60. package/assets/{embedded-wallet-D6Oykct7.js → embedded-wallet-8Rn02F-5.js} +1 -1
  61. package/assets/{emotion-styled.browser.esm-D7LnnFGM.js → emotion-styled.browser.esm-D1IYcc-A.js} +1 -1
  62. package/assets/{engine-DKBZ9rvO.js → engine-FKONhXUm.js} +1 -1
  63. package/assets/{errors-CGr_h4qk.js → errors-C_tFJwwX.js} +1 -1
  64. package/assets/estimate-l1-fee-CQQK05Yj.js +1 -0
  65. package/assets/eth_estimateGas-D2jEM0E-.js +1 -0
  66. package/assets/{eth_getStorageAt--oQrWy0Q.js → eth_getStorageAt-y8U-lfEv.js} +1 -1
  67. package/assets/eth_getTransactionCount-CME439qZ.js +1 -0
  68. package/assets/{ethereum-3zUUm4Pr.js → ethereum-D72JFjbG.js} +1 -1
  69. package/assets/{ethers-CtVvB8eG.js → ethers-BteKixT0.js} +1 -1
  70. package/assets/{execute-BNAgRbv2.js → execute-DvgHhaNY.js} +2 -2
  71. package/assets/{extractIPFS-BmriCqG8.js → extractIPFS-BVwwoxM1.js} +1 -1
  72. package/assets/{features-yBnE0kv6.js → features-C_I0ed0g.js} +1 -1
  73. package/assets/{fetchTokenMetadata-BgTzU1uv.js → fetchTokenMetadata-DXP5pKit.js} +2 -2
  74. package/assets/{fortmatic-DM_o40Lo.js → fortmatic-uodRBNqF.js} +1 -1
  75. package/assets/{get-bytecode-C6TlbHJu.js → get-bytecode-PhqNpgKV.js} +1 -1
  76. package/assets/get-ecosystem-wallet-info-CojUzYKW.js +1 -0
  77. package/assets/{getBalance-Ck3AgdKh.js → getBalance-Bi0yMf6a.js} +2 -2
  78. package/assets/{getInstalledModules-BLQxYEXn.js → getInstalledModules-DS4FSkHX.js} +1 -1
  79. package/assets/{getNFT-Ticzp8Hs.js → getNFT-CebGWsfS.js} +2 -2
  80. package/assets/getNFT-uBr4IPr-.js +1 -0
  81. package/assets/getThemeProps-D9znDKcF.js +1 -0
  82. package/assets/{hashTypedData-vyJGLMpP.js → hashTypedData-CmwGgOTV.js} +1 -1
  83. package/assets/{hashTypedData-D-QtOqRa.js → hashTypedData-CvnET0ek.js} +1 -1
  84. package/assets/{import-DaK3l2L4.js → import-5htnR-24.js} +1 -1
  85. package/assets/{in-app-VsfJDWao.js → in-app-CXNVMtY6.js} +1 -1
  86. package/assets/{in-app-wallet-calls-Cc6TEySq.js → in-app-wallet-calls-CL_h73Vx.js} +1 -1
  87. package/assets/{index-BvrGtJes.js → index-5PxxT_Hi.js} +1 -1
  88. package/assets/{index-m5R1RgvV.js → index-9s4_sQX7.js} +1 -1
  89. package/assets/{index-Bek4_t_L.js → index-B8HPZU8G.js} +1 -1
  90. package/assets/{index-DNoUzleZ.js → index-BBFf3j9R.js} +1 -1
  91. package/assets/{index-DEKVNi4L.js → index-BEwgqhCL.js} +1 -1
  92. package/assets/{index-CJxmpG1K.js → index-BF0jg5eX.js} +1 -1
  93. package/assets/{index-D_DMIRz9.js → index-BUuFv1bp.js} +1 -1
  94. package/assets/{index-Cpv_qKx8.js → index-BZVhR8G8.js} +1 -1
  95. package/assets/{index--P2VwVy3.js → index-BaeTuT24.js} +1 -1
  96. package/assets/{index-BYz2fOpG.js → index-BjJBV4qL.js} +1 -1
  97. package/assets/{index-BCx0SxC7.js → index-BksD36hR.js} +1 -1
  98. package/assets/{index-DGwlKYP1.js → index-BofIoUki.js} +1 -1
  99. package/assets/{index-CKwiZFh4.js → index-BqdSTJ_h.js} +1 -1
  100. package/assets/{index-Bx2U1tYr.js → index-BwVcZ3vw.js} +1 -1
  101. package/assets/{index-L08mwnOc.js → index-C-3NWHgA.js} +1 -1
  102. package/assets/{index-CWzvA55Z.js → index-C-dFvnUH.js} +1 -1
  103. package/assets/{index-Bxhq99ht.js → index-C1Tsxo3r.js} +1 -1
  104. package/assets/{index-C8RikeW4.js → index-C1UJcewJ.js} +1 -1
  105. package/assets/{index-BG7lZdfP.js → index-C3SS5bz4.js} +1 -1
  106. package/assets/{index-BVMw5QjZ.js → index-C4GKDkj4.js} +1 -1
  107. package/assets/{index-B56Mz2YS.js → index-C5V5wALq.js} +1 -1
  108. package/assets/{index-jsB1K3Ty.js → index-CAPIrEyl.js} +1 -1
  109. package/assets/{index-C9AUsopd.js → index-CBgD93CB.js} +1 -1
  110. package/assets/{index-BzD7Ebgn.js → index-CFnxUGBP.js} +1 -1
  111. package/assets/{index-z80r03Cx.js → index-CIRaZxV0.js} +1 -1
  112. package/assets/{index-BDwWglvl.js → index-CJIwpbLW.js} +1 -1
  113. package/assets/{index-7KtzBMW3.js → index-CLiiVHBN.js} +1 -1
  114. package/assets/{index-BZ6S4-Qy.js → index-CMYPEZgT.js} +1 -1
  115. package/assets/{index-SvOsIc3H.js → index-CSdulB00.js} +3 -3
  116. package/assets/{index-tFmbSlHL.js → index-CVi7PdPM.js} +1 -1
  117. package/assets/{index-B2DUxMjO.js → index-CdccZQ_A.js} +1 -1
  118. package/assets/{index-DiGXPxzb.js → index-CjxT1gx4.js} +1 -1
  119. package/assets/{index-B13clZOY.js → index-CkYGCiA-.js} +1 -1
  120. package/assets/{index-Cmu7kehM.js → index-Cp-efrxt.js} +2 -2
  121. package/assets/{index-DdJ_OK_4.js → index-Cq9m0rf1.js} +1 -1
  122. package/assets/{index-ColsJYiD.js → index-CvxSD2TZ.js} +1 -1
  123. package/assets/{index-DbSgqncZ.js → index-D-BpvO4i.js} +1 -1
  124. package/assets/{index-DUxDUxur.js → index-D3MkM_Ow.js} +2 -2
  125. package/assets/{index-CSZuXP_O.js → index-D7uajZIF.js} +1 -1
  126. package/assets/{index-Bf27DWaL.js → index-D9zmC2OF.js} +1 -1
  127. package/assets/{index-DHxeKfAR.js → index-DTjLQDJj.js} +3 -3
  128. package/assets/{index-Ceh4tqVd.js → index-DVCrh7RP.js} +1 -1
  129. package/assets/{index-Cf5UQJ_k.js → index-DXqFhRIG.js} +2 -2
  130. package/assets/{index-ehEPbUUu.js → index-D_GOecnW.js} +1 -1
  131. package/assets/{index-32dihjZM.js → index-Dcx57z9h.js} +1 -1
  132. package/assets/{index-n-ml-ClE.js → index-De5m0zpT.js} +1 -1
  133. package/assets/{index-BTV13rXH.js → index-Ded3SJr4.js} +1 -1
  134. package/assets/{index-8eIQG8Kl.js → index-DhbTDQu0.js} +1 -1
  135. package/assets/{index-BIgVkoHN.js → index-DiarXSIn.js} +1 -1
  136. package/assets/{index-DB0uJXc-.js → index-Dlw2S5cF.js} +3 -3
  137. package/assets/index-DpPUc0sl.js +1 -0
  138. package/assets/{index-DGZZiECR.js → index-Ds0rGqyb.js} +1 -1
  139. package/assets/{index-unwNWDy6.js → index-Ds6dHrLZ.js} +1 -1
  140. package/assets/{index-Dcg9IkwS.js → index-DsV59IEv.js} +1 -1
  141. package/assets/{index-CEUqEDHj.js → index-VchcND_n.js} +11 -11
  142. package/assets/{index-DsgKSUtS.js → index-VdY2qv1p.js} +1 -1
  143. package/assets/{index-Bd6gPKw4.js → index-aP6PSm0J.js} +1 -1
  144. package/assets/{index-CZQ2_otu.js → index-lJWah8De.js} +1 -1
  145. package/assets/{index-CkWJ4sTo.js → index-nJZkl4yb.js} +1 -1
  146. package/assets/{index-6uEdFIR0.js → index-sW-sKm0x.js} +2 -2
  147. package/assets/{index-COEkUMH9.js → index-scsn5pcE.js} +1 -1
  148. package/assets/{index-C6PL2Fdt.js → index-tf9y--bx.js} +1 -1
  149. package/assets/{index-jX2jQJPr.js → index-zLpiSX4V.js} +2 -2
  150. package/assets/{index.es-DI7x2TJx.js → index.es-9B4hUsAR.js} +1 -1
  151. package/assets/{index.es-BZebHuYA.js → index.es-9Zrxu-nr.js} +4 -4
  152. package/assets/{index.es-DpokeYPv.js → index.es-BwS14sFg.js} +1 -1
  153. package/assets/{linkAccount-BR5_llhd.js → linkAccount-6BFCh5cx.js} +1 -1
  154. package/assets/{localBatchGatewayRequest-B9Ybd7dg.js → localBatchGatewayRequest-BHik-cdx.js} +1 -1
  155. package/assets/{mana-rate-D7GRB_Ot.js → mana-rate-CY9tOCr1.js} +1 -1
  156. package/assets/{native-BSpg_u0K.js → native-15jVjX8Y.js} +1 -1
  157. package/assets/{networks-fMdVA1sr.js → networks-Ddkp84aU.js} +1 -1
  158. package/assets/{onramp-B2Q3gTV8.js → onramp-CeSaj6Aa.js} +1 -1
  159. package/assets/{openzeppelin-Dfbjq166.js → openzeppelin-CDpkjcS1.js} +1 -1
  160. package/assets/{ownerOf-D9UDfElT.js → ownerOf-CFrKicrH.js} +1 -1
  161. package/assets/{parseNft-D4L1MnwK.js → parseNft-ChsA4Coa.js} +2 -2
  162. package/assets/{parseSignature-B2YsV13I.js → parseSignature--QSaxzyZ.js} +3 -3
  163. package/assets/{parseSignature-Ch8Ikh9R.js → parseSignature-DFSq1jun.js} +1 -1
  164. package/assets/{passkeys-CRQs5lh-.js → passkeys-CUsQnAGE.js} +1 -1
  165. package/assets/{pay-with-exchange-DwcPixRd.js → pay-with-exchange-DD3fWFhp.js} +1 -1
  166. package/assets/{prepare-contract-call-CHrp3EL4.js → prepare-contract-call-DUVOtgM0.js} +1 -1
  167. package/assets/{qr-overlay-WecOYNdc.js → qr-overlay-FXDRFg86.js} +3 -3
  168. package/assets/{react-BW1xvPTF.js → react-B36MyIP_.js} +1 -1
  169. package/assets/{receive-r6itEu_X.js → receive-YGf7MQMM.js} +1 -1
  170. package/assets/{resolveImplementation-DuORFImi.js → resolveImplementation-ChZxSPSt.js} +1 -1
  171. package/assets/{rpc--KkC2qWz.js → rpc-DcocuHbv.js} +1 -1
  172. package/assets/{secp256k1-7vUkF5ib.js → secp256k1-2n6IN3fh.js} +1 -1
  173. package/assets/{secp256k1-CSfTjZp_.js → secp256k1-B6R4GN3D.js} +1 -1
  174. package/assets/{secp256k1-DRVSRXu6.js → secp256k1-Da2UK_yU.js} +1 -1
  175. package/assets/{send-BRRQlzci.js → send-DM7q2CKX.js} +1 -1
  176. package/assets/{send-batch-transaction-BASQMYYn.js → send-batch-transaction-BQiw5Eds.js} +1 -1
  177. package/assets/{send-eip712-transaction-Cb0e5jgJ.js → send-eip712-transaction-D9_VwAnb.js} +2 -2
  178. package/assets/send-gasless-transaction-fl9Lqf73.js +2 -0
  179. package/assets/{send-transaction-URhXksgR.js → send-transaction-lapcUIfe.js} +2 -2
  180. package/assets/{sendMetaTransaction-DnNlMy1f.js → sendMetaTransaction-CydgYVdt.js} +1 -1
  181. package/assets/{sendRawTransaction-Cp9PwWbz.js → sendRawTransaction-CkQeCcPa.js} +3 -3
  182. package/assets/{sentry-BV_ZSgtd.js → sentry-gZJVwIqQ.js} +1 -1
  183. package/assets/{serializeTransaction-D6bPY-5e.js → serializeTransaction-CiKWV5oi.js} +1 -1
  184. package/assets/{session-proposal-CO8C9FgE.js → session-proposal-C1hZCkvv.js} +1 -1
  185. package/assets/{session-request-CU3My76o.js → session-request-BTvx34S0.js} +2 -2
  186. package/assets/{sha256-BImz_UXn.js → sha256-DDEIajFz.js} +1 -1
  187. package/assets/{signing-C1foQi87.js → signing-clXGZp7N.js} +3 -3
  188. package/assets/{socials-Bsjh-kcj.js → socials-Djo-_tRh.js} +1 -1
  189. package/assets/{swaps-D4LpMI-N.js → swaps-BwoxWJmp.js} +1 -1
  190. package/assets/{thirdweb-D1z-XTZ-.js → thirdweb-DIYiKqri.js} +3 -3
  191. package/assets/{to-serializable-transaction-B7zKZp3o.js → to-serializable-transaction-_IYF-b5r.js} +2 -2
  192. package/assets/{totalSupply-D4j1WOYW.js → totalSupply-CGOKYv2C.js} +1 -1
  193. package/assets/trade-encoding-DbssSNOL.js +1 -0
  194. package/assets/{transaction-BOS1fhp8.js → transaction-C_LVUDbA.js} +1 -1
  195. package/assets/{transactionReceipt-TiskXrB6.js → transactionReceipt-dAN1T4b9.js} +1 -1
  196. package/assets/{transactions-B5kAYK1L.js → transactions-V175lLd8.js} +1 -1
  197. package/assets/useCreditPacks-B8su_g3G.js +1 -0
  198. package/assets/{useInfiniteGrid-CiDuQRnP.js → useInfiniteGrid-S2Upf1Ae.js} +1 -1
  199. package/assets/useManaRate-CCWK1pxl.js +1 -0
  200. package/assets/{useStore-BF0NEfcO.js → useStore-BEtv4alq.js} +2 -2
  201. package/assets/useTheme-BoNUL1hb.js +1 -0
  202. package/assets/{utils-B7rjkjB1.js → utils-swuB5ZX6.js} +1 -1
  203. package/assets/{verifyHash-BLnnKj_-.js → verifyHash-CSBAlIiR.js} +1 -1
  204. package/assets/{w3m-modal-D2jSpmw2.js → w3m-modal-CXjKWsrV.js} +1 -1
  205. package/assets/{w3m-modal-CRKh97nT.js → w3m-modal-DVav-Ijf.js} +1 -1
  206. package/assets/{wait-for-tx-receipt-CUP8flYl.js → wait-for-tx-receipt-CRuc-ylw.js} +1 -1
  207. package/assets/{wallets-CBncd5Al.js → wallets-C2Qy7KSV.js} +5 -5
  208. package/assets/{web-connector-BbbFAPbG.js → web-connector-D4itPEVN.js} +3 -3
  209. package/assets/{writeContract-DeZcPQuU.js → writeContract-BR9KO0Ok.js} +1 -1
  210. package/assets/{zora-sepolia-CVS3owSi.js → zora-sepolia-BltAzWAs.js} +1 -1
  211. package/assets/{zoraTestnet-Dea0RHqm.js → zoraTestnet-VaouiZC2.js} +1 -1
  212. package/index.html +11 -11
  213. package/package.json +2 -2
  214. package/assets/Cart-DYkqiuyJ.js +0 -1
  215. package/assets/CollectionCarousel-B0A1YOX-.js +0 -292
  216. package/assets/ItemDetail-By9hJU7O.js +0 -2406
  217. package/assets/MarketCheckout-B7kj-ofT.js +0 -3
  218. package/assets/browser-ponyfill-6L1OGOLN.js +0 -1
  219. package/assets/buy-gasless-kzWGfidX.js +0 -1
  220. package/assets/collection-4qJRowPN.js +0 -1
  221. package/assets/decimals-Bmvg-V50.js +0 -1
  222. package/assets/estimate-l1-fee-CoGVlirt.js +0 -1
  223. package/assets/eth_estimateGas-JYqF9U1i.js +0 -1
  224. package/assets/eth_getTransactionCount-BEhAgz2O.js +0 -1
  225. package/assets/get-ecosystem-wallet-info-DCVnaTdL.js +0 -1
  226. package/assets/getNFT-v9ULC-Df.js +0 -1
  227. package/assets/getThemeProps-BcAfOiiP.js +0 -1
  228. package/assets/index-B6MKNzS8.js +0 -1
  229. package/assets/send-gasless-transaction-TLFFm8L4.js +0 -2
  230. package/assets/trade-encoding-rbwEO5I2.js +0 -1
  231. package/assets/useCreditPacks-DPTBuCyg.js +0 -1
  232. package/assets/useManaRate-WxBKKUcB.js +0 -1
  233. package/assets/useTheme-BhK6j6Fd.js +0 -1
@@ -1 +1 @@
1
- import{u as z,j as e,L as re,d as se,b as te,r as j}from"./react-BW1xvPTF.js";import{aC as oe,aD as ce,z as le,t as a,aE as E,B as ne,ay as D,u as ie,az as K,I,m as de,x as me,M as ue,as as he,aF as ge,e as xe}from"./index-CEUqEDHj.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-4qJRowPN.js";import{u as be,L as fe}from"./useStore-BF0NEfcO.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-CQDU6eKt.js";import{L as B}from"./LoadMore-Cv8ieNqf.js";import{u as R}from"./useInfiniteGrid-CiDuQRnP.js";import{E as T}from"./ErrorNotice-BG40E5Ff.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=z(),{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)||K(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 Oe(){const{address:t}=se(),r=z(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?K(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{Oe as Creator,Oe as default};
1
+ import{a as D,j as e,L as re,d as se,b as te,r as j}from"./react-B36MyIP_.js";import{aC as oe,aD as ce,l as le,t as a,aE as E,B as ne,ay as K,e as ie,az as z,I,c as de,h as me,M as ue,as as he,aF as ge,b as xe}from"./index-VchcND_n.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-Cbl5FMco.js";import{u as be,L as fe}from"./useStore-BEtv4alq.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-Jh3tfbEa.js";import{L as B}from"./LoadMore-K8EfO7If.js";import{u as R}from"./useInfiniteGrid-S2Upf1Ae.js";import{E as T}from"./ErrorNotice-D_Z5OVFI.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=D(),{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}=K(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)||z(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 Oe(){const{address:t}=se(),r=D(),[o]=te(),n=o.has("collections"),{data:m}=K(t),g=(m==null?void 0:m.name)||(t?z(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{Oe as Creator,Oe as default};
@@ -1,3 +1,3 @@
1
- import{g as M}from"./react-BW1xvPTF.js";import{r as O}from"./index-BTV13rXH.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-B36MyIP_.js";import{r as O}from"./index-Ded3SJr4.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-BW1xvPTF.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-B36MyIP_.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-CCVyEXOJ.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DB0uJXc-.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-DtrTVFth.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Dlw2S5cF.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,4 +1,4 @@
1
- import{u as ae,b as de,r as c,j as t}from"./react-BW1xvPTF.js";import{s as i,K as e,R,x as ce,t as r,u as le,b as pe,j as g,an as xe,e as l,J as G,k as H,I as J,C as Z,f as ue}from"./index-CEUqEDHj.js";import{R as M}from"./resume-buy-Bf0zIH7y.js";import{R as ge}from"./cart-checkout-DtChJ5jV.js";import{l as he}from"./loader-logo-BzY9EKdC.js";import{u as fe,p as me,c as be,i as we}from"./useCreditPacks-DPTBuCyg.js";import{C as ye}from"./CircularProgress-BOITSQXA.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";const j="https://cdn.decentraland.org/@dcl/shop/0.1.0-30279564518.commit-0ea36ab/assets/pack-coins-BDh1ZDbh.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-30279564518.commit-0ea36ab/assets/pack-stacks-D-V2jSHW.webp",te="https://cdn.decentraland.org/@dcl/shop/0.1.0-30279564518.commit-0ea36ab/assets/pack-chest-BX_j84xW.webp",ke="https://cdn.decentraland.org/@dcl/shop/0.1.0-30279564518.commit-0ea36ab/assets/credit-coin-CmcTCd5i.webp",Ce="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",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30279564518.commit-0ea36ab/assets/packs-backdrop-BcXiUPeP.webp",N="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",$e=i.div`
1
+ import{a as ae,b as de,r as c,j as t}from"./react-B36MyIP_.js";import{n as i,K as e,R,h as ce,t as r,e as le,x as pe,E as g,an as xe,b as l,J as G,F as H,I as J,k as Z,z as ue}from"./index-VchcND_n.js";import{R as M}from"./resume-buy-Bf0zIH7y.js";import{R as ge}from"./cart-checkout-Bp3fmOrE.js";import{l as he}from"./loader-logo-BzY9EKdC.js";import{u as fe,p as me,c as be,i as we}from"./useCreditPacks-B8su_g3G.js";import{C as ye}from"./CircularProgress-B7WalF_4.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";const j="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/pack-coins-BDh1ZDbh.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/pack-stacks-D-V2jSHW.webp",te="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/pack-chest-BX_j84xW.webp",ke="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/credit-coin-CmcTCd5i.webp",Ce="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",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30341633105.commit-bfa7613/assets/packs-backdrop-BcXiUPeP.webp",N="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",$e=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -75,7 +75,7 @@ import{u as ae,b as de,r as c,j as t}from"./react-BW1xvPTF.js";import{s as i,K a
75
75
  ${e.media.down("mobile")} {
76
76
  font-size: 16px;
77
77
  }
78
- `,Be=i.a`
78
+ `,Ee=i.a`
79
79
  display: inline-flex;
80
80
  align-items: center;
81
81
  gap: 2px;
@@ -109,7 +109,7 @@ import{u as ae,b as de,r as c,j as t}from"./react-BW1xvPTF.js";import{s as i,K a
109
109
  height: 18px;
110
110
  }
111
111
  }
112
- `,Ee=i.p`
112
+ `,Be=i.p`
113
113
  margin: 0;
114
114
  padding: 10px 16px;
115
115
  border-radius: ${e.radius.btn};
@@ -281,13 +281,13 @@ import{u as ae,b as de,r as c,j as t}from"./react-BW1xvPTF.js";import{s as i,K a
281
281
  height: 29.79px;
282
282
  color: ${e.colors.softWhite};
283
283
  }
284
- `,Ie=i.span`
284
+ `,Fe=i.span`
285
285
  font-family: ${e.font.sans};
286
286
  font-size: 40px;
287
287
  font-weight: 800;
288
288
  line-height: 30px;
289
289
  color: ${e.colors.white};
290
- `,Fe=i.span`
290
+ `,Ie=i.span`
291
291
  font-family: ${e.font.sans};
292
292
  font-size: 20px;
293
293
  font-weight: 500;
@@ -608,4 +608,4 @@ import{u as ae,b as de,r as c,j as t}from"./react-BW1xvPTF.js";import{s as i,K a
608
608
  margin: 0;
609
609
  font-family: ${e.font.sans};
610
610
  color: ${e.colors.err};
611
- `,k=we()?"mock":"stripe",q=[j,j,ee,te],ut={pack_5:j,pack_10:j,pack_25:ee,pack_50:te};function gt(p,s){return ut[p.id]??q[s%q.length]}const ht="https://docs.decentraland.org";function Q(p){const s=p;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const h=((s==null?void 0:s.message)??"").toLowerCase();return h.includes("sign in")?r("getCredits.errorSignIn",{currency:l.name}):h.includes("timed out")?r("getCredits.errorTimeout",{currency:l.name}):r("getCredits.errorGeneric")}function _t(){ce({title:r("nav.getCredits",{currency:l.name}),noindex:!0});const p=ae(),{session:s,signIn:h}=le(),d=pe(),[b,A]=de(),{packs:ie,isLoading:re}=fe(),[f,x]=c.useState("select"),[a,B]=c.useState(null),[E,T]=c.useState(null),[ne,w]=c.useState(null),[se,$]=c.useState(!1),v=c.useRef(null);c.useEffect(()=>()=>{var n;return(n=v.current)==null?void 0:n.abort()},[]);const L=c.useCallback(()=>{A(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[A]),S=c.useCallback(async n=>{x("processing");const o=new AbortController;v.current=o;try{const u=await me(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(u.status==="credited"){const m=u.creditsGranted??(a==null?void 0:a.credits)??0;T(m>0?m:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(a==null?void 0:a.usd)??null,credits:m>0?m:null,provider:k}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ge)){const C={resumeCheckout:!0,...m>0?{creditsAdded:m}:{}};p("/cart",{state:C});return}}catch{}try{const C=sessionStorage.getItem(M);if(C){sessionStorage.removeItem(M);const I=JSON.parse(C),F=xe(I);if(F){p(F,{state:{item:I,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),w(u.error??r("getCredits.errorGrant",{currency:l.name})),x("error"))}catch(u){G(u,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:H(u),pack_usd:(a==null?void 0:a.usd)??null}),w(Q(u)),x("error")}},[a,s,d,p]),oe=c.useCallback(async n=>{if(!s){h();return}w(null),$(!1),B(n),x(k==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:k});try{const o=await be(n.id,{address:s.address,identity:s.identity});if(o.mock)S(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:k}),g("Shop Buy Credits Failed",{step:"checkout",error_code:H(o),pack_usd:n.usd}),w(Q(o)),x("error")}},[s,h,S]),P=c.useRef(!1);c.useEffect(()=>{if(P.current)return;const n=b.get("order");if(b.get("canceled")!=null){P.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:k}),L(),$(!0),x("select");return}n&&(x("processing"),s&&(P.current=!0,L(),S(n)))},[b,s]);function _(){var n;(n=v.current)==null||n.abort(),x("select"),B(null),T(null),w(null),$(!1)}return t.jsxs($e,{children:[f==="select"&&t.jsxs(ve,{"data-testid":"credits-hero",children:[t.jsx(Se,{"aria-hidden":!0}),t.jsxs(Pe,{children:[t.jsxs(_e,{children:[t.jsx(Re,{children:r("getCredits.title",{currency:l.name})}),t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.subtitle",{currency:l.nameSingular})}),t.jsxs(Be,{href:ht,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(J,{name:"link-out"})]})]})]}),se&&t.jsx(Ee,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(ft,{packs:ie,loading:re,onSelect:n=>void oe(n)})]})]}),f==="redirecting"&&t.jsxs(De,{role:"status","aria-live":"polite",children:[t.jsx(ye,{size:32}),t.jsx(V,{children:r("getCredits.redirecting")})]}),f==="processing"&&t.jsxs(Ve,{role:"status","aria-live":"polite",children:[t.jsx(We,{src:he,alt:"",width:61,height:61}),t.jsxs(Ye,{children:[t.jsxs(Xe,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(qe,{"aria-hidden":!0,children:[t.jsx(Je,{children:t.jsx(Ze,{})}),t.jsx(et,{children:"1/1"})]})]})]}),f==="success"&&t.jsxs(tt,{role:"status","aria-live":"polite",children:[t.jsxs(it,{children:[t.jsx(rt,{src:Ce,alt:"",width:60,height:60}),t.jsxs(nt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:l.name})]})]}),E!=null&&t.jsx(st,{children:t.jsxs(ot,{children:[t.jsx(at,{src:ke,alt:"",width:93,height:93}),t.jsxs(dt,{children:[t.jsx(Z,{}),t.jsxs("span",{children:[t.jsx(ct,{children:r("getCredits.creditsAmount",{credits:E,currency:l.name})})," ",t.jsx(lt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(pt,{children:[t.jsx(y,{"data-variant":"outline",onClick:_,children:r("getCredits.buyMore",{currency:l.name})}),t.jsx(y,{onClick:()=>p("/assets"),children:r("getCredits.startShopping")})]})]}),f==="pending"&&t.jsxs(W,{role:"status","aria-live":"polite",children:[t.jsx(Y,{children:r("getCredits.pendingTitle",{currency:l.name})}),t.jsx(V,{children:r("getCredits.pendingBody")}),t.jsxs(X,{children:[t.jsx(y,{onClick:()=>p("/assets"),children:r("getCredits.startShopping")}),t.jsx(y,{"data-variant":"outline",onClick:_,children:r("getCredits.done")})]})]}),f==="error"&&t.jsxs(W,{role:"alert",children:[t.jsx(Y,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(xt,{children:ne}),t.jsx(X,{children:t.jsx(y,{onClick:_,children:r("getCredits.tryAgain")})})]})]})}function ft({packs:p,loading:s,onSelect:h}){return s?t.jsx(U,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:l.name}),children:[0,1,2,3].map(d=>t.jsxs(K,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(D,{children:[t.jsx(O,{children:t.jsx(Ne,{})}),t.jsx(Ue,{})]}),t.jsx(Ke,{})]},d))}):t.jsx(U,{children:p.map((d,b)=>t.jsxs(K,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>h(d),"aria-label":r("getCredits.packAria",{amount:ue(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Te,{children:[t.jsx(J,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(D,{children:[t.jsxs(O,{children:[t.jsxs(Le,{children:[t.jsx(Z,{}),t.jsx(Ie,{children:d.credits})]}),t.jsx(Fe,{children:r("getCredits.packUnit",{currency:l.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:gt(d,b),alt:"",loading:"lazy",width:507,height:507})})]}),t.jsxs(He,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{_t as GetCredits,_t as default};
611
+ `,k=we()?"mock":"stripe",q=[j,j,ee,te],ut={pack_5:j,pack_10:j,pack_25:ee,pack_50:te};function gt(p,s){return ut[p.id]??q[s%q.length]}const ht="https://docs.decentraland.org";function Q(p){const s=p;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const h=((s==null?void 0:s.message)??"").toLowerCase();return h.includes("sign in")?r("getCredits.errorSignIn",{currency:l.name}):h.includes("timed out")?r("getCredits.errorTimeout",{currency:l.name}):r("getCredits.errorGeneric")}function _t(){ce({title:r("nav.getCredits",{currency:l.name}),noindex:!0});const p=ae(),{session:s,signIn:h}=le(),d=pe(),[b,A]=de(),{packs:ie,isLoading:re}=fe(),[f,x]=c.useState("select"),[a,E]=c.useState(null),[B,T]=c.useState(null),[ne,w]=c.useState(null),[se,$]=c.useState(!1),v=c.useRef(null);c.useEffect(()=>()=>{var n;return(n=v.current)==null?void 0:n.abort()},[]);const L=c.useCallback(()=>{A(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[A]),S=c.useCallback(async n=>{x("processing");const o=new AbortController;v.current=o;try{const u=await me(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(u.status==="credited"){const m=u.creditsGranted??(a==null?void 0:a.credits)??0;T(m>0?m:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(a==null?void 0:a.usd)??null,credits:m>0?m:null,provider:k}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ge)){const C={resumeCheckout:!0,...m>0?{creditsAdded:m}:{}};p("/cart",{state:C});return}}catch{}try{const C=sessionStorage.getItem(M);if(C){sessionStorage.removeItem(M);const F=JSON.parse(C),I=xe(F);if(I){p(I,{state:{item:F,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),w(u.error??r("getCredits.errorGrant",{currency:l.name})),x("error"))}catch(u){G(u,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:H(u),pack_usd:(a==null?void 0:a.usd)??null}),w(Q(u)),x("error")}},[a,s,d,p]),oe=c.useCallback(async n=>{if(!s){h();return}w(null),$(!1),E(n),x(k==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:k});try{const o=await be(n.id,{address:s.address,identity:s.identity});if(o.mock)S(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:k}),g("Shop Buy Credits Failed",{step:"checkout",error_code:H(o),pack_usd:n.usd}),w(Q(o)),x("error")}},[s,h,S]),P=c.useRef(!1);c.useEffect(()=>{if(P.current)return;const n=b.get("order");if(b.get("canceled")!=null){P.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:k}),L(),$(!0),x("select");return}n&&(x("processing"),s&&(P.current=!0,L(),S(n)))},[b,s]);function _(){var n;(n=v.current)==null||n.abort(),x("select"),E(null),T(null),w(null),$(!1)}return t.jsxs($e,{children:[f==="select"&&t.jsxs(ve,{"data-testid":"credits-hero",children:[t.jsx(Se,{"aria-hidden":!0}),t.jsxs(Pe,{children:[t.jsxs(_e,{children:[t.jsx(Re,{children:r("getCredits.title",{currency:l.name})}),t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.subtitle",{currency:l.nameSingular})}),t.jsxs(Ee,{href:ht,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(J,{name:"link-out"})]})]})]}),se&&t.jsx(Be,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(ft,{packs:ie,loading:re,onSelect:n=>void oe(n)})]})]}),f==="redirecting"&&t.jsxs(De,{role:"status","aria-live":"polite",children:[t.jsx(ye,{size:32}),t.jsx(V,{children:r("getCredits.redirecting")})]}),f==="processing"&&t.jsxs(Ve,{role:"status","aria-live":"polite",children:[t.jsx(We,{src:he,alt:"",width:61,height:61}),t.jsxs(Ye,{children:[t.jsxs(Xe,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(qe,{"aria-hidden":!0,children:[t.jsx(Je,{children:t.jsx(Ze,{})}),t.jsx(et,{children:"1/1"})]})]})]}),f==="success"&&t.jsxs(tt,{role:"status","aria-live":"polite",children:[t.jsxs(it,{children:[t.jsx(rt,{src:Ce,alt:"",width:60,height:60}),t.jsxs(nt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:l.name})]})]}),B!=null&&t.jsx(st,{children:t.jsxs(ot,{children:[t.jsx(at,{src:ke,alt:"",width:93,height:93}),t.jsxs(dt,{children:[t.jsx(Z,{}),t.jsxs("span",{children:[t.jsx(ct,{children:r("getCredits.creditsAmount",{credits:B,currency:l.name})})," ",t.jsx(lt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(pt,{children:[t.jsx(y,{"data-variant":"outline",onClick:_,children:r("getCredits.buyMore",{currency:l.name})}),t.jsx(y,{onClick:()=>p("/assets"),children:r("getCredits.startShopping")})]})]}),f==="pending"&&t.jsxs(W,{role:"status","aria-live":"polite",children:[t.jsx(Y,{children:r("getCredits.pendingTitle",{currency:l.name})}),t.jsx(V,{children:r("getCredits.pendingBody")}),t.jsxs(X,{children:[t.jsx(y,{onClick:()=>p("/assets"),children:r("getCredits.startShopping")}),t.jsx(y,{"data-variant":"outline",onClick:_,children:r("getCredits.done")})]})]}),f==="error"&&t.jsxs(W,{role:"alert",children:[t.jsx(Y,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(xt,{children:ne}),t.jsx(X,{children:t.jsx(y,{onClick:_,children:r("getCredits.tryAgain")})})]})]})}function ft({packs:p,loading:s,onSelect:h}){return s?t.jsx(U,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:l.name}),children:[0,1,2,3].map(d=>t.jsxs(K,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(D,{children:[t.jsx(O,{children:t.jsx(Ne,{})}),t.jsx(Ue,{})]}),t.jsx(Ke,{})]},d))}):t.jsx(U,{children:p.map((d,b)=>t.jsxs(K,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>h(d),"aria-label":r("getCredits.packAria",{amount:ue(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Te,{children:[t.jsx(J,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(D,{children:[t.jsxs(O,{children:[t.jsxs(Le,{children:[t.jsx(Z,{}),t.jsx(Fe,{children:d.credits})]}),t.jsx(Ie,{children:r("getCredits.packUnit",{currency:l.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:gt(d,b),alt:"",loading:"lazy",width:507,height:507})})]}),t.jsxs(He,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{_t as GetCredits,_t 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-CKwiZFh4.js";import{d as g,r as v}from"./index-DB0uJXc-.js";import{C as c}from"./ConstantsUtil-DTrOBzCe.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CCVyEXOJ.js";import{au as y}from"./NetworkUtil-C1aEwuOK.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-BqdSTJ_h.js";import{d as g,r as v}from"./index-Dlw2S5cF.js";import{C as c}from"./ConstantsUtil-CqaPdSAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DtrTVFth.js";import{au as y}from"./NetworkUtil-DQZGJzap.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,5 +1,5 @@
1
- import{u as R,r as h,j as e,L as B}from"./react-BW1xvPTF.js";import{y as U,t as s,e as S,B as k,C as L,j as $,J as Q,x as P,u as W,b as O,n as z,s as F,U as J}from"./index-CEUqEDHj.js";import{i as Y,R as D,f as G}from"./import-DaK3l2L4.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./buy-C8thJCOQ.js";import"./authorizations-Bt-yiKpU.js";import"./sendMetaTransaction-DnNlMy1f.js";import"./trade-encoding-rbwEO5I2.js";import"./mana-rate-D7GRB_Ot.js";function H({queue:n,session:T,onClose:j,onDone:o}){const N=R(),d=U(T.providerType),[m,f]=h.useState(()=>n.map(()=>"pending")),[I,M]=h.useState("running"),w=h.useRef(!1);h.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(u=>u.map((g,p)=>p===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(u=>u.map((g,p)=>p===r?"done":g))}catch(u){if(u instanceof D)Q(u,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((p,b)=>b===r?"unlisted":p));else{const g=u,p=g.code===4001||/reject|denied|cancel/i.test(g.message??"");p||Q(u,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?p?"skipped":"failed":a))}}}t||M("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(){o(),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:S.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:()=>{o(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{o(),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 A=F(k)`
1
+ import{a as R,r as h,j as e,L as B}from"./react-B36MyIP_.js";import{j as U,t as s,b as S,B as k,k as C,E as $,J as Q,h as P,e as W,x as O,u as z,n as F,U as J}from"./index-VchcND_n.js";import{i as Y,R as D,f as G}from"./import-5htnR-24.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./buy-CyhVI8ih.js";import"./authorizations-Dtu8Ye0y.js";import"./sendMetaTransaction-CydgYVdt.js";import"./trade-encoding-DbssSNOL.js";import"./mana-rate-CY9tOCr1.js";function H({queue:n,session:T,onClose:j,onDone:o}){const N=R(),d=U(T.providerType),[m,f]=h.useState(()=>n.map(()=>"pending")),[I,E]=h.useState("running"),w=h.useRef(!1);h.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(u=>u.map((g,p)=>p===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(u=>u.map((g,p)=>p===r?"done":g))}catch(u){if(u instanceof D)Q(u,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((p,b)=>b===r?"unlisted":p));else{const g=u,p=g.code===4001||/reject|denied|cancel/i.test(g.message??"");p||Q(u,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?p?"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(){o(),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:S.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:()=>{o(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{o(),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(C,{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 A=F(k)`
2
2
  margin-top: 10px;
3
3
  `,V=F(k)`
4
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 me(){P({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:T,restore:j}=W(),o=O(),N=n==null?void 0:n.address;h.useEffect(()=>{j()},[j]);const{data:d,isLoading:m}=z({queryKey:["importable",N],queryFn:()=>G(N),enabled:!!N}),[f,I]=h.useState({}),[M,w]=h.useState(new Set),[_,v]=h.useState(null),x=h.useMemo(()=>[...(d==null?void 0:d.creations)??[],...(d==null?void 0:d.owned)??[]],[d]);h.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=>!M.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 u(a,l){const i=l.replace(/[^\d]/g,"");I(C=>({...C,[a]:i===""?0:parseInt(i,10)}))}function g(a){w(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function p(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function b(){o.invalidateQueries({queryKey:["importable"]}),o.invalidateQueries({queryKey:["shop-items"]}),o.invalidateQueries({queryKey:["catalog-items"]}),o.invalidateQueries({queryKey:["overview-listings"]}),o.invalidateQueries({queryKey:["upsell-listings"]}),o.invalidateQueries({queryKey:["my-assets"]}),o.invalidateQueries({queryKey:["collection-sale-state"]}),J.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(A,{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:S.name})})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",s("importListings.rate",{currency:S.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),K=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:E=>u(i.oldTradeId,E.target.value),"aria-label":s("importListings.priceAria",{currency:S.name,name:i.name})})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(C*.1).toFixed(2)]}),K?e.jsxs("button",{className:"imp-price__reset",onClick:()=>I(E=>({...E,[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(p([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(p(c)),children:s("importListings.listAll",{count:c.length})})]})}),_&&n?e.jsx(H,{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(A,{variant:"purple",onClick:()=>T(),children:s("storeSettings.signIn")})]})}export{me as ImportListings};
5
+ `,X=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub"}];function me(){P({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:T,restore:j}=W(),o=O(),N=n==null?void 0:n.address;h.useEffect(()=>{j()},[j]);const{data:d,isLoading:m}=z({queryKey:["importable",N],queryFn:()=>G(N),enabled:!!N}),[f,I]=h.useState({}),[E,w]=h.useState(new Set),[_,v]=h.useState(null),x=h.useMemo(()=>[...(d==null?void 0:d.creations)??[],...(d==null?void 0:d.owned)??[]],[d]);h.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 u(a,l){const i=l.replace(/[^\d]/g,"");I(L=>({...L,[a]:i===""?0:parseInt(i,10)}))}function g(a){w(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function p(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function b(){o.invalidateQueries({queryKey:["importable"]}),o.invalidateQueries({queryKey:["shop-items"]}),o.invalidateQueries({queryKey:["catalog-items"]}),o.invalidateQueries({queryKey:["overview-listings"]}),o.invalidateQueries({queryKey:["upsell-listings"]}),o.invalidateQueries({queryKey:["my-assets"]}),o.invalidateQueries({queryKey:["collection-sale-state"]}),J.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(A,{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:S.name})})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(C,{className:"ccy-mark imp__diamond"})," ",s("importListings.rate",{currency:S.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 L=t(i),K=L!==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(C,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input","data-testid":"imp-price-input",inputMode:"numeric",value:L.toLocaleString(),onChange:M=>u(i.oldTradeId,M.target.value),"aria-label":s("importListings.priceAria",{currency:S.name,name:i.name})})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(L*.1).toFixed(2)]}),K?e.jsxs("button",{className:"imp-price__reset",onClick:()=>I(M=>({...M,[i.oldTradeId]:i.suggestedCredits})),children:[s("importListings.resetTo")," ",e.jsx(C,{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(p([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(C,{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(p(c)),children:s("importListings.listAll",{count:c.length})})]})}),_&&n?e.jsx(H,{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(A,{variant:"purple",onClick:()=>T(),children:s("storeSettings.signIn")})]})}export{me as ImportListings};