@dcl/shop 1.11.3-33155570552.commit-80e7685 → 1.11.3

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 (227) hide show
  1. package/_assets/{Activity-BQ4cNZJq.js → Activity-BEOVOdVV.js} +6 -6
  2. package/_assets/{AnimatedBackground-BlItZE4F.js → AnimatedBackground-wAz9Odt0.js} +2 -2
  3. package/_assets/{Assets-D-AYQR5O.js → Assets-P4H-lV4U.js} +3 -3
  4. package/_assets/{Authorizations-D3TFOLc0.js → Authorizations-BUN1TioY.js} +2 -2
  5. package/_assets/{Cart-6PT2o0XO.js → Cart-CUPHFj39.js} +2 -2
  6. package/_assets/{Collection-DmKa8SBy.js → Collection-BHRp_9DS.js} +2 -2
  7. package/_assets/{CollectionCarousel-xKmRjdjJ.js → CollectionCarousel-7w9vcOQY.js} +3 -3
  8. package/_assets/{Confetti-Z8v6OTnK.js → Confetti-CYh3a_SI.js} +4 -4
  9. package/_assets/{ConstantsUtil-BPwpv-BJ.js → ConstantsUtil-DblXIgum.js} +2 -2
  10. package/_assets/{ContentClient-CwaFAxk9.js → ContentClient-BgeGbQMc.js} +2 -2
  11. package/_assets/{Creator-CJ1EuxZi.js → Creator-DHomo97d.js} +2 -2
  12. package/_assets/{DeploymentBuilder-Zh0Cr-vJ.js → DeploymentBuilder-j66rJfGs.js} +2 -2
  13. package/_assets/{EmotePlaybackBar-Cfp2UVtr.js → EmotePlaybackBar-BERHYvEN.js} +3 -3
  14. package/_assets/{ErrorNotice-4SblVCJ8.js → ErrorNotice-AmLNAAkn.js} +2 -2
  15. package/_assets/{ExchangeController-FowBnqTh.js → ExchangeController-CxJiKrmf.js} +2 -2
  16. package/_assets/{Faq-DWg1l4FJ.js → Faq-B-2IAlN1.js} +2 -2
  17. package/_assets/{GetCredits-Crj7O7kG.js → GetCredits-ncUz7MSF.js} +2 -2
  18. package/_assets/{Grow-ClQLtYgl.js → Grow-BrH_WQ15.js} +2 -2
  19. package/_assets/{HelpersUtil-C9WqS0ra.js → HelpersUtil-PZUZTOEJ.js} +2 -2
  20. package/_assets/{ItemDetail-DXkjmRlh.js → ItemDetail-CTfaTNRb.js} +2 -2
  21. package/_assets/{LoadMore-BaRjyF39.js → LoadMore-DscEf3Fk.js} +2 -2
  22. package/_assets/{ManaPricingBanner.styles-DJ7bjK0l.js → ManaPricingBanner.styles-D9T4JSll.js} +2 -2
  23. package/_assets/{MyAssets-DWg2lKw9.js → MyAssets-D-0qpt_J.js} +2 -2
  24. package/_assets/{MyFavorites-B-2ArPlw.js → MyFavorites-BM0Fy0t_.js} +2 -2
  25. package/_assets/{NetworkUtil-aMprsRwC.js → NetworkUtil-CcWpYyVE.js} +2 -2
  26. package/_assets/{NotFound-BNX73CrT.js → NotFound-DngznS1a.js} +2 -2
  27. package/_assets/{NotificationsBell-B0enWd7a.js → NotificationsBell-DlvSN7Il.js} +2 -2
  28. package/_assets/{OutfitDetail-BjKXVLQi.js → OutfitDetail-DASkQM6x.js} +2 -2
  29. package/_assets/{OutfitPreview-Dwy7hPo7.js → OutfitPreview-CuWTYpJV.js} +2 -2
  30. package/_assets/{OutfitStudio-BPSa9mCN.js → OutfitStudio-CI-08PA0.js} +2 -2
  31. package/_assets/{StoreSettings-CNfXo7Kp.js → StoreSettings-CrnV-oDS.js} +22 -22
  32. package/_assets/{Success-DRyL1YJL.js → Success-CuN1jEku.js} +2 -2
  33. package/_assets/{SwapController-C6MSYEZI.js → SwapController-CD6bIKjn.js} +2 -2
  34. package/_assets/{TradeService-C-dm6LM0.js → TradeService-BBCk0RYw.js} +2 -2
  35. package/_assets/{W3MFrameProviderSingleton-naTr0B5v.js → W3MFrameProviderSingleton-35iFXIWF.js} +4 -4
  36. package/_assets/{WebCryptoP256-BvKVlBTt.js → WebCryptoP256-Cf-XLLKK.js} +2 -2
  37. package/_assets/{authorizations-DxGdOyfi.js → authorizations-BYnIZF10.js} +2 -2
  38. package/_assets/{basic-BQfHF2z7.js → basic-Kurqa6Hg.js} +2 -2
  39. package/_assets/{biconomy-CR1wJ3NW.js → biconomy-DGTyqkE9.js} +2 -2
  40. package/_assets/{browseLayout.styles-CQilLRye.js → browseLayout.styles-C3O3rJ6E.js} +2 -2
  41. package/_assets/{browser-d5kVYj7V.js → browser-CKLQ1qFk.js} +2 -2
  42. package/_assets/{browser-ponyfill-DrgqR3Jn.js → browser-ponyfill-DiBM5SBC.js} +2 -2
  43. package/_assets/{builder-BSxR3UB0.js → builder-Db2C6JNf.js} +2 -2
  44. package/_assets/{buy-wWHknAve.js → buy-Tscnuj8P.js} +2 -2
  45. package/_assets/{buy-gasless-IWvDnyE1.js → buy-gasless-C1ToktQG.js} +2 -2
  46. package/_assets/{categories-DeaLeWRX.js → categories-B1BKLZKW.js} +2 -2
  47. package/_assets/{ccip-B90xCZHf.js → ccip-05aiYT-K.js} +2 -2
  48. package/_assets/{ccip-Cz-KmXKk.js → ccip-CNYS3aQW.js} +2 -2
  49. package/_assets/{chains-oGtQSZCV.js → chains-ZAiL12Bm.js} +2 -2
  50. package/_assets/{collectionPage.styles-CghU1BDG.js → collectionPage.styles-CUZMIu19.js} +7 -7
  51. package/_assets/{common-DC3tU0GR.js → common-jIM0_xX0.js} +2 -2
  52. package/_assets/{controller-BDXczEFY.js → controller-Qvm0QW2h.js} +3 -3
  53. package/_assets/{core-BFeA5TIQ.js → core-DANcYiPS.js} +5 -5
  54. package/_assets/{createSvgIcon-aMKGf-Vs.js → createSvgIcon-DqIhLrW2.js} +2 -2
  55. package/_assets/{custom-CxtAUMyW.js → custom-DTxuVuIB.js} +2 -2
  56. package/_assets/{data-capture-CJg0LXBB.js → data-capture-DD7sCiZr.js} +2 -2
  57. package/_assets/{dcl-schemas-DhyZEUTb.js → dcl-schemas-BHtFmNb-.js} +2 -2
  58. package/_assets/{decimals-Dp_m_LUh.js → decimals-CjF-BdSX.js} +2 -2
  59. package/_assets/{decimals-CyyfypTD.js → decimals-Ckn9cRy4.js} +2 -2
  60. package/_assets/{detectExtension-BaIhULKE.js → detectExtension-Gnu7LiZD.js} +2 -2
  61. package/_assets/{disposePreview-BCeOgBsa.js → disposePreview-BtvqOg7t.js} +2 -2
  62. package/_assets/{email-BXyiCzx4.js → email-DaxW64cs.js} +2 -2
  63. package/_assets/{embedded-wallet-D_DeRhdX.js → embedded-wallet-B0Fwgs2K.js} +2 -2
  64. package/_assets/{emotion-styled.browser.esm-CQmMziER.js → emotion-styled.browser.esm-BxkApjMl.js} +2 -2
  65. package/_assets/{engine-Bv55PPW4.js → engine-JThGOFXd.js} +2 -2
  66. package/_assets/{errors-C7o97G4M.js → errors-C8Iz-trA.js} +2 -2
  67. package/_assets/{estimate-l1-fee-CDmNUoNh.js → estimate-l1-fee-Dbvud_Cw.js} +2 -2
  68. package/_assets/{eth_estimateGas-CWaRS4NL.js → eth_estimateGas-rS25vqwZ.js} +2 -2
  69. package/_assets/{eth_getStorageAt-Dg9ISDGi.js → eth_getStorageAt-Dfz80jyN.js} +2 -2
  70. package/_assets/{eth_getTransactionCount-LEq9UY5X.js → eth_getTransactionCount-T_shF7-r.js} +2 -2
  71. package/_assets/{ethereum-Cmptxtln.js → ethereum-CJCFASug.js} +2 -2
  72. package/_assets/{ethers-ByWI-eMv.js → ethers-DgOG59Su.js} +2 -2
  73. package/_assets/{events-D_1RveUS.js → events-DibVD_t7.js} +2 -2
  74. package/_assets/{execute-DnJxddQK.js → execute-CNwyt0G_.js} +3 -3
  75. package/_assets/{extractIPFS-B1bRbvds.js → extractIPFS-C9dhUG6w.js} +2 -2
  76. package/_assets/{features-SrcqXGig.js → features-ol0SSx5c.js} +2 -2
  77. package/_assets/{fetchTokenMetadata-VIsnBrpd.js → fetchTokenMetadata-lhSHn6xi.js} +3 -3
  78. package/_assets/{field.styles-D1op8emw.js → field.styles-B41qYJoU.js} +2 -2
  79. package/_assets/{fortmatic-DTk-9yYD.js → fortmatic-uL_s0OSn.js} +2 -2
  80. package/_assets/{get-bytecode-C8AHhRd1.js → get-bytecode-BOwL4NWW.js} +2 -2
  81. package/_assets/{get-ecosystem-wallet-info-Be98mpat.js → get-ecosystem-wallet-info-u8rFPFzM.js} +2 -2
  82. package/_assets/{getBalance-B-8cmr-h.js → getBalance-ZoN1tP3C.js} +3 -3
  83. package/_assets/{getInstalledModules-DK4sLWwT.js → getInstalledModules-B4P_9Ec-.js} +2 -2
  84. package/_assets/{getNFT-kD4plCPE.js → getNFT-UlaoLDKl.js} +3 -3
  85. package/_assets/{getNFT-Cx3ber2r.js → getNFT-xR-ZGgUx.js} +2 -2
  86. package/_assets/{grid.styles-BIwLaIPU.js → grid.styles-Bfq3tOD5.js} +2 -2
  87. package/_assets/{hashTypedData-XHY2qZ4b.js → hashTypedData-KzAb0OXw.js} +2 -2
  88. package/_assets/{hashTypedData-2dskM5dw.js → hashTypedData-qEav_ih0.js} +2 -2
  89. package/_assets/{in-app-BWFH8lGO.js → in-app-DsTcp9g1.js} +2 -2
  90. package/_assets/{in-app-wallet-calls-A2e2hrZw.js → in-app-wallet-calls-BHDyG_Hm.js} +2 -2
  91. package/_assets/{index-CYODi4De.js → index-B7wtabS1.js} +2 -2
  92. package/_assets/{index-BOp8R4FG.js → index-BB63hriw.js} +2 -2
  93. package/_assets/{index-DQpwRCf7.js → index-BDoxreOH.js} +2 -2
  94. package/_assets/{index-C3A5Huo_.js → index-BEPvT81m.js} +2 -2
  95. package/_assets/{index-BVX6XXgW.js → index-BSUctRYP.js} +2 -2
  96. package/_assets/{index-BZny5glp.js → index-BSiVr0DD.js} +2 -2
  97. package/_assets/{index-D9RX6H64.js → index-BTGqCcTp.js} +2 -2
  98. package/_assets/{index-DcxgoxVS.js → index-BX5k8Ia-.js} +2 -2
  99. package/_assets/{index-D3CuF5hF.js → index-BY7ZDgU3.js} +2 -2
  100. package/_assets/{index-BuqzfES3.js → index-B_oRHv6S.js} +2 -2
  101. package/_assets/{index-aVZCrQgK.js → index-Ba6ZjOcU.js} +12 -12
  102. package/_assets/{index-y36xxLzP.js → index-Be1NJYDT.js} +3 -3
  103. package/_assets/{index-BivdeeqA.js → index-Bh1_eNVo.js} +2 -2
  104. package/_assets/{index-Y3Y-bbNA.js → index-Bmjs-VA2.js} +2 -2
  105. package/_assets/{index-C1LgB3lX.js → index-BvHOSZKj.js} +4 -4
  106. package/_assets/{index-BzKWexAG.js → index-C-Jqa8tU.js} +2 -2
  107. package/_assets/{index-DfGK8WsI.js → index-C-Vm4vxE.js} +2 -2
  108. package/_assets/{index-Cy3Oonq3.js → index-CAJOEhqU.js} +2 -2
  109. package/_assets/{index-qqle_e-t.js → index-CF0TwWos.js} +2 -2
  110. package/_assets/{index-Dzfu0CWL.js → index-CFSE-4g9.js} +4 -4
  111. package/_assets/{index-DNyHNZwr.js → index-CTVBoJue.js} +2 -2
  112. package/_assets/{index-Dpn1ciOW.js → index-CUe36oKW.js} +2 -2
  113. package/_assets/{index-Bbp7woDG.js → index-CXi4JrFW.js} +2 -2
  114. package/_assets/{index-Kxc39maL.js → index-CbK4PiBW.js} +2 -2
  115. package/_assets/{index-I_d93jfN.js → index-Ce4Edp7-.js} +3 -3
  116. package/_assets/{index-Bl3CX05h.js → index-CkpRws4w.js} +2 -2
  117. package/_assets/{index-B119MHsD.js → index-ClTFdTLe.js} +2 -2
  118. package/_assets/{index-CQcYIbmA.js → index-CmH_zvOx.js} +2 -2
  119. package/_assets/{index-CHOXNIZU.js → index-CpepHIup.js} +2 -2
  120. package/_assets/{index-BOFayr-1.js → index-CrE3Fjux.js} +2 -2
  121. package/_assets/{index-CFjvSI9V.js → index-CrawRT0o.js} +2 -2
  122. package/_assets/{index-Bv52y23u.js → index-CskSOnyZ.js} +2 -2
  123. package/_assets/{index-DSycTKsm.js → index-CvYt90O2.js} +2 -2
  124. package/_assets/{index-BgR0fN2n.js → index-CyyRHdbc.js} +3 -3
  125. package/_assets/{index-DAjo0IeM.js → index-D-peO4dU.js} +2 -2
  126. package/_assets/{index-D4zFooZK.js → index-D3fQaxNZ.js} +2 -2
  127. package/_assets/{index-CayZJ1KW.js → index-DDo55DDH.js} +2 -2
  128. package/_assets/{index-DDcGOvgn.js → index-DF6WG3qn.js} +2 -2
  129. package/_assets/{index-CCo-gXU1.js → index-DMAEUsQc.js} +2 -2
  130. package/_assets/{index-FFpfUhvw.js → index-DNnRMWE4.js} +2 -2
  131. package/_assets/{index-ChSQKVK4.js → index-DVjQDdLu.js} +4 -4
  132. package/_assets/{index-CsfKDkju.js → index-DW3ULbU6.js} +2 -2
  133. package/_assets/{index-10pmvfcK.js → index-DZJvVVBz.js} +2 -2
  134. package/_assets/{index-CEWHjElK.js → index-Dana8qUZ.js} +2 -2
  135. package/_assets/{index-Dqje5rD7.js → index-DclRc8UN.js} +2 -2
  136. package/_assets/{index-BY17flxD.js → index-DdQvxv6H.js} +2 -2
  137. package/_assets/{index-BF4nzAgt.js → index-DeldA2Me.js} +2 -2
  138. package/_assets/{index-z6_sFHO_.js → index-DiQlp13b.js} +2 -2
  139. package/_assets/{index-CKJbILwX.js → index-DtVc4xk5.js} +2 -2
  140. package/_assets/{index-D28ZG5tn.js → index-DvWRa5G-.js} +2 -2
  141. package/_assets/{index-BCuiMQGB.js → index-DwM-JZSi.js} +2 -2
  142. package/_assets/{index-CsF6xXM_.js → index-GKtnnyfC.js} +2 -2
  143. package/_assets/{index-B6mDQ71Q.js → index-KBa4w5_b.js} +2 -2
  144. package/_assets/{index-OnthK0Vi.js → index-McPhRhdX.js} +2 -2
  145. package/_assets/{index-KKcoIzB6.js → index-XKm4O5jb.js} +2 -2
  146. package/_assets/{index-DjtZc-pt.js → index-XkbNngUP.js} +2 -2
  147. package/_assets/{index-DbcMBgHZ.js → index-YkV_OCpx.js} +2 -2
  148. package/_assets/{index-CtCVPVKq.js → index-bPrjbeDi.js} +2 -2
  149. package/_assets/{index-pycwlDzM.js → index-btSRhLw4.js} +2 -2
  150. package/_assets/{index-DOAfbRmZ.js → index-fmt3aBMt.js} +2 -2
  151. package/_assets/{index-C3XWYmll.js → index-lZ0PPqQV.js} +2 -2
  152. package/_assets/{index-BYq6qdHu.js → index-mkHeSqYe.js} +2 -2
  153. package/_assets/{index-DIHPQBX2.js → index-oAZ1ZU-c.js} +3 -3
  154. package/_assets/{index--zfsMLjb.js → index-ozHAxPgl.js} +2 -2
  155. package/_assets/{index-BXB-Q7JK.js → index-vA8IIEKD.js} +2 -2
  156. package/_assets/{index-CWW8I3cM.js → index-wfbbVR0C.js} +2 -2
  157. package/_assets/{index-BSjqMBr9.js → index-yeutDs-n.js} +2 -2
  158. package/_assets/{index.es-ByQSPL6O.js → index.es-7_2j1y1c.js} +2 -2
  159. package/_assets/{index.es--QATjUsF.js → index.es-CX2yBV9N.js} +2 -2
  160. package/_assets/{index.es-rjHK-XCJ.js → index.es-DiYQfgia.js} +2 -2
  161. package/_assets/{index.es-G4zCLjwI.js → index.es-Uf1O-fY2.js} +5 -5
  162. package/_assets/items-empty-Di8AuNKB.js +2 -0
  163. package/_assets/{jump-5JL_cP03.js → jump-DKhwghhc.js} +2 -2
  164. package/_assets/{linkAccount-CETMoRWS.js → linkAccount-CI2WbmeE.js} +2 -2
  165. package/_assets/{localBatchGatewayRequest-CgHNgytM.js → localBatchGatewayRequest-CfRrj7XF.js} +2 -2
  166. package/_assets/{native-vpRrA4Cn.js → native-Do2B-Qxb.js} +2 -2
  167. package/_assets/{networks-cWf4ZboA.js → networks-Dqe7-N6R.js} +2 -2
  168. package/_assets/{onramp-DgsjYxjT.js → onramp-gJypUnb8.js} +2 -2
  169. package/_assets/{openzeppelin-DNp3wLOb.js → openzeppelin-CqvwIh1K.js} +2 -2
  170. package/_assets/{ownerOf-1LYSCOJn.js → ownerOf-CSaLDIRi.js} +2 -2
  171. package/_assets/{parseNft-BcxHCtSx.js → parseNft-Abg8wFVh.js} +3 -3
  172. package/_assets/{parseSignature-D_DzESq3.js → parseSignature-BMAMdfMY.js} +4 -4
  173. package/_assets/{parseSignature-ePfokuCi.js → parseSignature-BkC3FKxl.js} +2 -2
  174. package/_assets/{passkeys-DJo48zPj.js → passkeys-BMA2Vzjg.js} +2 -2
  175. package/_assets/{pay-with-exchange-fixKZ9cy.js → pay-with-exchange-BbaFUQ7y.js} +2 -2
  176. package/_assets/{prepare-contract-call-BdgAhwyh.js → prepare-contract-call-CTis3Ksb.js} +2 -2
  177. package/_assets/{qr-overlay-D-9ykAbc.js → qr-overlay-C1Y4nmkc.js} +4 -4
  178. package/_assets/{react-BY3vVwvc.js → react-DyPiTXWH.js} +2 -2
  179. package/_assets/{receive-CfqOxXtt.js → receive-BC-Faqrt.js} +2 -2
  180. package/_assets/{resolveImplementation-CMOZuCS0.js → resolveImplementation-C7gGuPZF.js} +2 -2
  181. package/_assets/{resume-buy-C08YaHUW.js → resume-buy-CrOe5wve.js} +2 -2
  182. package/_assets/{rpc-VPqDooml.js → rpc-EFTC3eie.js} +2 -2
  183. package/_assets/{sales-empty-CiZXbQ-u.js → sales-empty-B90K0W8H.js} +2 -2
  184. package/_assets/{search-empty-CjwjsYp3.js → search-empty-GvvlNANs.js} +2 -2
  185. package/_assets/{secp256k1-DsYYocSz.js → secp256k1-CSKPyg7G.js} +2 -2
  186. package/_assets/{secp256k1-BjzlNiqc.js → secp256k1-Cth-fPBi.js} +2 -2
  187. package/_assets/{secp256k1-Bqz600sq.js → secp256k1-DruP3eGK.js} +2 -2
  188. package/_assets/{send-OqWYJzei.js → send-CSn4ZY-1.js} +2 -2
  189. package/_assets/{send-batch-transaction-DxplOsBV.js → send-batch-transaction-BJtaWfLS.js} +2 -2
  190. package/_assets/{send-eip712-transaction-DLUlA6U2.js → send-eip712-transaction-C4Sq8ViN.js} +3 -3
  191. package/_assets/{send-gasless-transaction-TcSr0Wcm.js → send-gasless-transaction-6SwFGxtl.js} +3 -3
  192. package/_assets/{send-transaction-CCxtzvcs.js → send-transaction-BS3sJtZU.js} +3 -3
  193. package/_assets/{sendMetaTransaction-BojzaFVf.js → sendMetaTransaction-DdKlulxU.js} +2 -2
  194. package/_assets/{sendRawTransaction-Bb_nKhdW.js → sendRawTransaction-CoNlS87a.js} +4 -4
  195. package/_assets/{sentry-DTXXLFvs.js → sentry-wjuCVNXH.js} +3 -3
  196. package/_assets/{serializeTransaction-9MYeYe7S.js → serializeTransaction-Be5yK09O.js} +2 -2
  197. package/_assets/{session-proposal-CPMewqWU.js → session-proposal-Cr1bW3vR.js} +2 -2
  198. package/_assets/{session-request-qY4rCbGM.js → session-request-C7XtyHpP.js} +3 -3
  199. package/_assets/{sha256-DiEOOsO8.js → sha256-UiFg1E6a.js} +2 -2
  200. package/_assets/{signing-Be6vrTAY.js → signing-B6MLGmUe.js} +4 -4
  201. package/_assets/{skeleton.styles-3JcIR00U.js → skeleton.styles-DGb4Vags.js} +2 -2
  202. package/_assets/{socials-CG-rf6ye.js → socials-B1QMNGq2.js} +2 -2
  203. package/_assets/{styled-VFTp7jt7.js → styled-Bgmkc9S2.js} +2 -2
  204. package/_assets/{swaps-Cva-BDUb.js → swaps-DII4kYq8.js} +2 -2
  205. package/_assets/{thirdweb-Zfbo-V64.js → thirdweb-B1YDVAJI.js} +4 -4
  206. package/_assets/{to-serializable-transaction-DNoF4797.js → to-serializable-transaction-D2a8RSyu.js} +3 -3
  207. package/_assets/{totalSupply-CQfJBYH9.js → totalSupply-Cz_d9KgH.js} +2 -2
  208. package/_assets/{transaction-CX2qr19N.js → transaction-CSbiSCR6.js} +2 -2
  209. package/_assets/{transactionReceipt-NOc_gzSn.js → transactionReceipt-Cs2L3s90.js} +2 -2
  210. package/_assets/{transactions-ByOmVv0V.js → transactions-BM0AB6rD.js} +2 -2
  211. package/_assets/{useCreditPacks-6QkfHH0T.js → useCreditPacks-oQYk8AXU.js} +2 -2
  212. package/_assets/{useInfiniteGrid-B1PlvGpx.js → useInfiniteGrid-BKQ811RA.js} +2 -2
  213. package/_assets/{useStore-C8GZa7as.js → useStore-Dvc10vNY.js} +3 -3
  214. package/_assets/{useTheme-B9wRZIaP.js → useTheme-kL3HtKAH.js} +2 -2
  215. package/_assets/{utils-Bi-qMQUk.js → utils-6qnhg71x.js} +2 -2
  216. package/_assets/{verifyHash-DDixZPU8.js → verifyHash-CHp_1dkh.js} +2 -2
  217. package/_assets/{w3m-modal-B9dFmjTc.js → w3m-modal-BidasrnU.js} +2 -2
  218. package/_assets/{w3m-modal-DIyfW9yy.js → w3m-modal-D-YLR-nS.js} +2 -2
  219. package/_assets/{wait-for-tx-receipt-D7fvkTOZ.js → wait-for-tx-receipt-CuAEC_h9.js} +2 -2
  220. package/_assets/{wallets-CArhlSUA.js → wallets-IqNjjBUC.js} +6 -6
  221. package/_assets/{web-connector-BvNhhIkF.js → web-connector-B6ZK-KnR.js} +4 -4
  222. package/_assets/{writeContract-y8T-A4Sn.js → writeContract-BhYblJOj.js} +2 -2
  223. package/_assets/{zora-sepolia-CTDvR1LG.js → zora-sepolia-MBZVLRHn.js} +2 -2
  224. package/_assets/{zoraTestnet-SPU8ZmJ1.js → zoraTestnet-z1EEFkWs.js} +2 -2
  225. package/index.html +11 -11
  226. package/package.json +1 -1
  227. package/_assets/items-empty-cgLqKc9S.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-KKcoIzB6.js","_assets/react-BY3vVwvc.js","_assets/index-aVZCrQgK.js","_assets/dcl-schemas-DhyZEUTb.js","_assets/sentry-DTXXLFvs.js","_assets/ethers-ByWI-eMv.js","_assets/intl-AKLEHPeO.js","_assets/index-CKGO8NWe.css","_assets/sales-empty-CiZXbQ-u.js","_assets/buy-wWHknAve.js","_assets/authorizations-DxGdOyfi.js","_assets/sendMetaTransaction-BojzaFVf.js","_assets/ManaPricingBanner.styles-DJ7bjK0l.js","_assets/Faq-DWg1l4FJ.js","_assets/field.styles-D1op8emw.js"])))=>i.map(i=>d[i]);
2
- import{U as we,bG as Ie,o as U,l as A,bH as Ae,t as o,s as l,m as Ee,n as Le,b as r,J as Ne,I as T,bI as se,bJ as ne,bK as $e,_ as Pe,L as Te,q as E,ao as K,bL as Se,r as Ce,bl as B,E as Fe,bM as De,w as N,bN as Me,bO as Q}from"./index-aVZCrQgK.js";import{r as g,u as He,j as t,e as qe,L as Oe}from"./react-BY3vVwvc.js";import{u as Re,s as _e}from"./sales-empty-CiZXbQ-u.js";import{L as ze}from"./LoadMore-BaRjyF39.js";import{u as $}from"./useInfiniteGrid-B1PlvGpx.js";import{m as de}from"./mana-matic-CEqvSwrJ.js";import{n as We}from"./name-glyph-aUugT8vq.js";import"./dcl-schemas-DhyZEUTb.js";import"./sentry-DTXXLFvs.js";import"./ethers-ByWI-eMv.js";import"./intl-AKLEHPeO.js";import"./buy-wWHknAve.js";import"./authorizations-DxGdOyfi.js";import"./sendMetaTransaction-BojzaFVf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="5e04a679-6817-410c-a91e-7684cdf4d206",e._sentryDebugIdIdentifier="sentry-dbid-5e04a679-6817-410c-a91e-7684cdf4d206")}catch{}})();const Ge=15e3;function Ue(e,s){return e.txHash&&s.txHash?e.txHash===s.txHash:e.txHash||s.txHash?!1:e.status===s.status&&Math.abs(e.createdAt-s.createdAt)<=Ge}function Ke(e){const s=[...e].sort((i,d)=>d.createdAt-i.createdAt),n=[];for(const i of s){const d=n[n.length-1];d&&Ue(d[d.length-1],i)?d.push(i):n.push([i])}return n.map(i=>{var d;return{id:((d=i.find(a=>a.txHash))==null?void 0:d.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(a=>a.createdAt)),status:Be(i),totalCredits:i.reduce((a,h)=>a+h.credits,0),lines:i}})}function Be(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Qe(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Xe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Ve(e){const s=[],n=new Map;for(const i of e){const d=Xe(i);if(!d){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const a=n.get(d);if(a){a.quantity+=1,a.credits+=i.credits;continue}const h={key:d,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};n.set(d,h),s.push(h)}return s}function Je(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?we(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Ye(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function Ze(e){const n=Ke(e.purchases.filter(Ye)).map(c=>({kind:"purchase",id:`purchase:${c.id}`,createdAt:c.createdAt,order:c})),i=e.sales.map(c=>{const m=Je(c,e.rate);return{kind:"sale",id:`sale:${m.id}`,createdAt:m.createdAt,sale:m}}),d=(e.creditOrders??[]).filter(c=>c.status!=="failed"&&c.status!=="abandoned").map(c=>({kind:"credit",id:`credit:${c.id}`,createdAt:c.createdAt,order:c})),a=new Set(e.purchases.filter(c=>c.txHash).map(c=>c.txHash.toLowerCase())),h=(e.manaPurchases??[]).filter(c=>!a.has(c.txHash.toLowerCase())).map(c=>({kind:"mana-purchase",id:`mana-purchase:${c.id}`,createdAt:c.createdAt,sale:c}));return[...n,...i,...d,...h].sort((c,m)=>m.createdAt-c.createdAt||(c.id<m.id?-1:1))}function et(e,s){return s==="all"?e:s==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const ce=e=>e.trim().toLowerCase();function tt(e){const s=new Map;for(const n of e??[]){const i=ce(n.txHash??"");if(!i)continue;const d=s.get(i);d?d.push(n):s.set(i,[n])}return s}function it(e,s,n=Date.now()){const i=s.txHash?e.get(ce(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const d=i.length===1?st(i[0].netCents):null,a=i.filter(c=>!c.available&&c.availableAt>n);if(a.length===0)return{kind:"credited",credits:d};const h=a.reduce((c,m)=>Math.max(c,m.availableAt),0);return{kind:"pending",credits:d,availableAt:h}}function st(e){return Ie(e)}function nt(){const e=U(i=>{var d;return(d=i.session)==null?void 0:d.address}),{data:s,isLoading:n}=A({queryKey:["listing-count",e],queryFn:()=>Ae({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const at="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/credits-product-vs4Q6u6l.svg",X=Ee`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-XKm4O5jb.js","_assets/react-DyPiTXWH.js","_assets/index-Ba6ZjOcU.js","_assets/dcl-schemas-BHtFmNb-.js","_assets/sentry-wjuCVNXH.js","_assets/ethers-DgOG59Su.js","_assets/intl-AKLEHPeO.js","_assets/index-CKGO8NWe.css","_assets/sales-empty-B90K0W8H.js","_assets/buy-Tscnuj8P.js","_assets/authorizations-BYnIZF10.js","_assets/sendMetaTransaction-DdKlulxU.js","_assets/ManaPricingBanner.styles-D9T4JSll.js","_assets/Faq-B-2IAlN1.js","_assets/field.styles-B41qYJoU.js"])))=>i.map(i=>d[i]);
2
+ import{U as we,bG as Ie,o as U,l as A,bH as Ae,t as o,s as l,m as Ee,n as Le,b as r,J as Ne,I as T,bI as se,bJ as ne,bK as $e,_ as Pe,L as Te,q as E,ao as K,bL as Se,r as Ce,bl as B,E as Fe,bM as De,w as N,bN as Me,bO as Q}from"./index-Ba6ZjOcU.js";import{r as g,u as He,j as t,e as qe,L as Oe}from"./react-DyPiTXWH.js";import{u as Re,s as _e}from"./sales-empty-B90K0W8H.js";import{L as ze}from"./LoadMore-DscEf3Fk.js";import{u as $}from"./useInfiniteGrid-BKQ811RA.js";import{m as de}from"./mana-matic-CEqvSwrJ.js";import{n as We}from"./name-glyph-aUugT8vq.js";import"./dcl-schemas-BHtFmNb-.js";import"./sentry-wjuCVNXH.js";import"./ethers-DgOG59Su.js";import"./intl-AKLEHPeO.js";import"./buy-Tscnuj8P.js";import"./authorizations-BYnIZF10.js";import"./sendMetaTransaction-DdKlulxU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="a226c21c-31e3-4830-a261-b749e3612d02",e._sentryDebugIdIdentifier="sentry-dbid-a226c21c-31e3-4830-a261-b749e3612d02")}catch{}})();const Ge=15e3;function Ue(e,s){return e.txHash&&s.txHash?e.txHash===s.txHash:e.txHash||s.txHash?!1:e.status===s.status&&Math.abs(e.createdAt-s.createdAt)<=Ge}function Ke(e){const s=[...e].sort((i,d)=>d.createdAt-i.createdAt),n=[];for(const i of s){const d=n[n.length-1];d&&Ue(d[d.length-1],i)?d.push(i):n.push([i])}return n.map(i=>{var d;return{id:((d=i.find(a=>a.txHash))==null?void 0:d.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(a=>a.createdAt)),status:Be(i),totalCredits:i.reduce((a,h)=>a+h.credits,0),lines:i}})}function Be(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Qe(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Xe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Ve(e){const s=[],n=new Map;for(const i of e){const d=Xe(i);if(!d){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const a=n.get(d);if(a){a.quantity+=1,a.credits+=i.credits;continue}const h={key:d,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};n.set(d,h),s.push(h)}return s}function Je(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?we(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Ye(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function Ze(e){const n=Ke(e.purchases.filter(Ye)).map(c=>({kind:"purchase",id:`purchase:${c.id}`,createdAt:c.createdAt,order:c})),i=e.sales.map(c=>{const x=Je(c,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),d=(e.creditOrders??[]).filter(c=>c.status!=="failed"&&c.status!=="abandoned").map(c=>({kind:"credit",id:`credit:${c.id}`,createdAt:c.createdAt,order:c})),a=new Set(e.purchases.filter(c=>c.txHash).map(c=>c.txHash.toLowerCase())),h=(e.manaPurchases??[]).filter(c=>!a.has(c.txHash.toLowerCase())).map(c=>({kind:"mana-purchase",id:`mana-purchase:${c.id}`,createdAt:c.createdAt,sale:c}));return[...n,...i,...d,...h].sort((c,x)=>x.createdAt-c.createdAt||(c.id<x.id?-1:1))}function et(e,s){return s==="all"?e:s==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const ce=e=>e.trim().toLowerCase();function tt(e){const s=new Map;for(const n of e??[]){const i=ce(n.txHash??"");if(!i)continue;const d=s.get(i);d?d.push(n):s.set(i,[n])}return s}function it(e,s,n=Date.now()){const i=s.txHash?e.get(ce(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const d=i.length===1?st(i[0].netCents):null,a=i.filter(c=>!c.available&&c.availableAt>n);if(a.length===0)return{kind:"credited",credits:d};const h=a.reduce((c,x)=>Math.max(c,x.availableAt),0);return{kind:"pending",credits:d,availableAt:h}}function st(e){return Ie(e)}function nt(){const e=U(i=>{var d;return(d=i.session)==null?void 0:d.address}),{data:s,isLoading:n}=A({queryKey:["listing-count",e],queryFn:()=>Ae({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const at="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/credits-product-vs4Q6u6l.svg",X=Ee`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,rt=l.section`
@@ -188,7 +188,7 @@ import{U as we,bG as Ie,o as U,l as A,bH as Ae,t as o,s as l,m as Ee,n as Le,b a
188
188
  background: ${o.colors.line};
189
189
  color: ${o.colors.muted};
190
190
  }
191
- `,mt=l.button`
191
+ `,xt=l.button`
192
192
  font-size: 11px;
193
193
  font-weight: 700;
194
194
  text-transform: uppercase;
@@ -230,7 +230,7 @@ import{U as we,bG as Ie,o as U,l as A,bH as Ae,t as o,s as l,m as Ee,n as Le,b a
230
230
  width: 16px;
231
231
  height: 16px;
232
232
  vertical-align: -0.15em;
233
- `,xt=l.span`
233
+ `,mt=l.span`
234
234
  display: inline-flex;
235
235
  align-items: center;
236
236
  cursor: pointer;
@@ -385,5 +385,5 @@ import{U as we,bG as Ie,o as U,l as A,bH as Ae,t as o,s as l,m as Ee,n as Le,b a
385
385
  height: 26px;
386
386
  object-fit: contain;
387
387
  }
388
- `,Z=L.withComponent(Oe),wt=g.lazy(()=>Pe(()=>import("./index-KKcoIzB6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],W="section",oe="listings",G="view",At="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function me(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function xe({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),d=()=>{var h;const a=(h=s.current)==null?void 0:h.getBoundingClientRect();a&&i({top:a.bottom+8,left:a.left+a.width/2})};return t.jsxs(xt,{ref:s,tabIndex:0,onMouseEnter:d,onMouseLeave:()=>i(null),onFocus:d,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(gt,{style:{top:n.top,left:n.left},role:"tooltip",children:r("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:d}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Me(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),a=n&&d,h=(i==null?void 0:i.name)??r("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",m=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[a?t.jsx(J,{}):t.jsx(O,{children:c?t.jsx("img",{src:c,alt:h}):t.jsx(T,{name:"cart",size:20})}),t.jsxs(R,{children:[a?t.jsx(Y,{}):t.jsx(_,{title:h,children:h}),e.quantity>1?t.jsx(z,{children:r("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return m?t.jsx(Z,{to:m,"data-link":"true",children:f}):t.jsx(L,{children:f})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(L,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:We,alt:""})}),t.jsxs(R,{children:[t.jsx(_,{title:s,children:s}),t.jsx(z,{children:r("activity.nameRegistration")})]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Ve(e.lines),n=s.reduce((a,h)=>a+h.quantity,0),i=Qe(e.status),d=i==="SETTLED"?r("activity.completed"):i==="FAILED"?r("activity.failed"):r("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.purchaseLabel")," · ",r("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":i,children:d}),t.jsxs(k,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(ft,{children:r("activity.purchaseFailedNote")}):null,t.jsx(V,{children:s.map(a=>a.registeredName?t.jsx(Lt,{item:a},a.key):t.jsx(Et,{item:a},a.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??r("activity.itemFallback"),d=(s==null?void 0:s.thumbnail)??"",a=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,h=t.jsxs(t.Fragment,{children:[n?t.jsx(J,{}):t.jsx(O,{children:d?t.jsx("img",{src:d,alt:i}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(R,{children:[n?t.jsx(Y,{}):t.jsx(_,{title:i,children:i}),t.jsx(z,{children:r("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":"SETTLED",children:r("activity.completed")}),t.jsxs(k,{children:[me(e.manaWei)," ",t.jsx(xe,{children:t.jsx(ue,{src:de,alt:"MANA"})})]})]})]}),t.jsx(V,{children:a?t.jsx(Z,{to:a,"data-link":"true",children:h}):t.jsx(L,{children:h})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),d=(n==null?void 0:n.name)??r("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",h=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,c=t.jsxs(t.Fragment,{children:[i?t.jsx(J,{}):t.jsx(O,{children:a?t.jsx("img",{src:a,alt:d}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(R,{children:[i?t.jsx(Y,{}):t.jsx(_,{title:d,children:d}),t.jsxs(z,{children:[r("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${r("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?r("activity.payoutPending"):r("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",me(e.manaWei)," ",t.jsx(xe,{children:t.jsx(ue,{src:de,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(E,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(k,{"data-kind":"income",children:r("activity.payoutCredited")})]})]}),t.jsx(V,{children:h?t.jsx(Z,{to:h,"data-link":"true",children:c}):t.jsx(L,{children:c})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Se(e.status),i=n==="SETTLED"?r("activity.completed"):n==="FAILED"?r("activity.failed"):n==="UNFINISHED"?r("activity.unfinished"):r("activity.processing"),d=U(p=>p.session),a=Ce(),[h,c]=g.useState(!1),m=e.status==="initiated"&&!!d;g.useEffect(()=>{const p=()=>c(!1);return window.addEventListener("pageshow",p),()=>window.removeEventListener("pageshow",p)},[]);async function f(){if(!(!d||h)){c(!0);try{const p=await De(e.id,d.identity);if(p.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(p.url)){window.location.href=p.url;return}N.error(r("activity.resumeUnavailable"))}else p.kind==="expired"?(N.info(r("activity.resumeExpired")),a.invalidateQueries({queryKey:["credit-orders"]})):p.kind==="paid"?(N.success(r("activity.resumePaid")),a.invalidateQueries({queryKey:["credit-orders"]})):N.error(r("activity.resumeUnavailable"));c(!1)}catch{c(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(pt,{children:t.jsx("img",{src:at,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.creditPurchaseLabel")," · ",r("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[m?t.jsx(mt,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?r("activity.resuming"):r("activity.resume")}):null,t.jsx(q,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:r("activity.emptyAllBody"),purchases:r("activity.emptyPurchasesBody"),sales:r("activity.emptySalesBody")}[e];return t.jsx(yt,{children:t.jsx(Te,{testId:`activity-empty-${e}`,icon:_e,title:r("activity.emptyTitle"),body:s,cta:{label:r("assets.empty.cta"),to:"/items"}})})}function Bt(){const{session:e}=U(),[s,n]=g.useState("all"),[i,d]=He(),a=i.get(W)===oe||i.get(G)===At;Le({title:a?r("seo.import.title"):r("nav.activity"),noindex:!0});const{count:h}=Re(),{count:c}=nt(),f=h!==void 0&&c!==void 0&&(h>0||c>0||a),p=!!e&&!a&&s!=="sales",x=!!e&&!a&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],u=>$e(e.address,e.identity,{first:P,skip:u}),{enabled:p}),b=$(["sales",e==null?void 0:e.address],u=>se(e.address,{role:"seller",first:P,skip:u}),{enabled:x}),v=$(["credit-orders",e==null?void 0:e.address],u=>ne(e.address,e.identity,{first:P,skip:u}),{enabled:p}),j=$(["mana-purchases",e==null?void 0:e.address],u=>se(e.address,{role:"buyer",first:P,skip:u}),{enabled:p}),{data:ee}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:x,staleTime:6e4}),ge=g.useMemo(()=>tt(ee),[ee]),{data:fe}=Ne(x);if(!e)return t.jsxs(bt,{children:[t.jsx(T,{name:"clock",size:40,color:o.colors.muted2}),t.jsx(vt,{children:r("activity.signInTitle")}),t.jsx(jt,{children:r("activity.signInBody")})]});const te=et(Ze({purchases:p?y.items:[],sales:x?b.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:fe}),s),ye=p&&(y.isLoading||v.isLoading||j.isLoading)||x&&b.isLoading,ie=p&&(y.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||x&&b.isFetchingNextPage,be=p&&(y.hasNextPage||v.hasNextPage||j.hasNextPage)||x&&b.hasNextPage;function ve(){p&&y.hasNextPage&&y.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(u){if(n(u),!a)return;const w=new URLSearchParams(i);w.delete(W),w.delete(G),d(w,{replace:!0})}function ke(){const u=new URLSearchParams(i);u.set(W,oe),u.delete(G),d(u,{replace:!0})}return t.jsxs(rt,{children:[t.jsx(ot,{children:t.jsx(dt,{children:r("nav.activity")})}),t.jsxs(ct,{role:"tablist","aria-label":r("nav.activity"),children:[It.map(u=>t.jsx(le,{type:"button",role:"tab","aria-selected":!a&&s===u,"data-active":!a&&s===u,"data-testid":`activity-filter-${u}`,onClick:()=>je(u),children:r(`activity.filter.${u}`)},u)),f?t.jsxs(lt,{type:"button",role:"tab","aria-selected":a,"data-active":a,"data-testid":"activity-filter-migrate","aria-label":h?r("activity.migrate.chipAria",{count:h}):void 0,onClick:ke,children:[r("activity.migrate.chip"),h?t.jsx(ut,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),a?t.jsx(g.Suspense,{fallback:t.jsx(ht,{"aria-busy":"true"}),children:t.jsx(wt,{})}):ye?t.jsx(ae,{children:Array.from({length:5}).map((u,w)=>t.jsx(re,{},w))}):te.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(ae,{children:[te.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:it(ge,u.sale)},u.id)),ie?t.jsx(re,{}):null]}),t.jsx(ze,{hasNextPage:be,isFetching:ie,onLoadMore:ve})]})]})}export{Bt as Activity};
389
- //# sourceMappingURL=Activity-BQ4cNZJq.js.map
388
+ `,Z=L.withComponent(Oe),wt=g.lazy(()=>Pe(()=>import("./index-XKm4O5jb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],W="section",oe="listings",G="view",At="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function me({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),d=()=>{var h;const a=(h=s.current)==null?void 0:h.getBoundingClientRect();a&&i({top:a.bottom+8,left:a.left+a.width/2})};return t.jsxs(mt,{ref:s,tabIndex:0,onMouseEnter:d,onMouseLeave:()=>i(null),onFocus:d,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(gt,{style:{top:n.top,left:n.left},role:"tooltip",children:r("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:d}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Me(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),a=n&&d,h=(i==null?void 0:i.name)??r("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",x=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[a?t.jsx(J,{}):t.jsx(O,{children:c?t.jsx("img",{src:c,alt:h}):t.jsx(T,{name:"cart",size:20})}),t.jsxs(R,{children:[a?t.jsx(Y,{}):t.jsx(_,{title:h,children:h}),e.quantity>1?t.jsx(z,{children:r("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return x?t.jsx(Z,{to:x,"data-link":"true",children:f}):t.jsx(L,{children:f})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(L,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:We,alt:""})}),t.jsxs(R,{children:[t.jsx(_,{title:s,children:s}),t.jsx(z,{children:r("activity.nameRegistration")})]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Ve(e.lines),n=s.reduce((a,h)=>a+h.quantity,0),i=Qe(e.status),d=i==="SETTLED"?r("activity.completed"):i==="FAILED"?r("activity.failed"):r("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.purchaseLabel")," · ",r("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":i,children:d}),t.jsxs(k,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(ft,{children:r("activity.purchaseFailedNote")}):null,t.jsx(V,{children:s.map(a=>a.registeredName?t.jsx(Lt,{item:a},a.key):t.jsx(Et,{item:a},a.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??r("activity.itemFallback"),d=(s==null?void 0:s.thumbnail)??"",a=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,h=t.jsxs(t.Fragment,{children:[n?t.jsx(J,{}):t.jsx(O,{children:d?t.jsx("img",{src:d,alt:i}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(R,{children:[n?t.jsx(Y,{}):t.jsx(_,{title:i,children:i}),t.jsx(z,{children:r("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":"SETTLED",children:r("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]})]})]}),t.jsx(V,{children:a?t.jsx(Z,{to:a,"data-link":"true",children:h}):t.jsx(L,{children:h})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),d=(n==null?void 0:n.name)??r("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",h=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,c=t.jsxs(t.Fragment,{children:[i?t.jsx(J,{}):t.jsx(O,{children:a?t.jsx("img",{src:a,alt:d}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(R,{children:[i?t.jsx(Y,{}):t.jsx(_,{title:d,children:d}),t.jsxs(z,{children:[r("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${r("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(q,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?r("activity.payoutPending"):r("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(E,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(k,{"data-kind":"income",children:r("activity.payoutCredited")})]})]}),t.jsx(V,{children:h?t.jsx(Z,{to:h,"data-link":"true",children:c}):t.jsx(L,{children:c})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Se(e.status),i=n==="SETTLED"?r("activity.completed"):n==="FAILED"?r("activity.failed"):n==="UNFINISHED"?r("activity.unfinished"):r("activity.processing"),d=U(p=>p.session),a=Ce(),[h,c]=g.useState(!1),x=e.status==="initiated"&&!!d;g.useEffect(()=>{const p=()=>c(!1);return window.addEventListener("pageshow",p),()=>window.removeEventListener("pageshow",p)},[]);async function f(){if(!(!d||h)){c(!0);try{const p=await De(e.id,d.identity);if(p.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(p.url)){window.location.href=p.url;return}N.error(r("activity.resumeUnavailable"))}else p.kind==="expired"?(N.info(r("activity.resumeExpired")),a.invalidateQueries({queryKey:["credit-orders"]})):p.kind==="paid"?(N.success(r("activity.resumePaid")),a.invalidateQueries({queryKey:["credit-orders"]})):N.error(r("activity.resumeUnavailable"));c(!1)}catch{c(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(pt,{children:t.jsx("img",{src:at,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.creditPurchaseLabel")," · ",r("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[x?t.jsx(xt,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?r("activity.resuming"):r("activity.resume")}):null,t.jsx(q,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:r("activity.emptyAllBody"),purchases:r("activity.emptyPurchasesBody"),sales:r("activity.emptySalesBody")}[e];return t.jsx(yt,{children:t.jsx(Te,{testId:`activity-empty-${e}`,icon:_e,title:r("activity.emptyTitle"),body:s,cta:{label:r("assets.empty.cta"),to:"/items"}})})}function Bt(){const{session:e}=U(),[s,n]=g.useState("all"),[i,d]=He(),a=i.get(W)===oe||i.get(G)===At;Le({title:a?r("seo.import.title"):r("nav.activity"),noindex:!0});const{count:h}=Re(),{count:c}=nt(),f=h!==void 0&&c!==void 0&&(h>0||c>0||a),p=!!e&&!a&&s!=="sales",m=!!e&&!a&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],u=>$e(e.address,e.identity,{first:P,skip:u}),{enabled:p}),b=$(["sales",e==null?void 0:e.address],u=>se(e.address,{role:"seller",first:P,skip:u}),{enabled:m}),v=$(["credit-orders",e==null?void 0:e.address],u=>ne(e.address,e.identity,{first:P,skip:u}),{enabled:p}),j=$(["mana-purchases",e==null?void 0:e.address],u=>se(e.address,{role:"buyer",first:P,skip:u}),{enabled:p}),{data:ee}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:m,staleTime:6e4}),ge=g.useMemo(()=>tt(ee),[ee]),{data:fe}=Ne(m);if(!e)return t.jsxs(bt,{children:[t.jsx(T,{name:"clock",size:40,color:o.colors.muted2}),t.jsx(vt,{children:r("activity.signInTitle")}),t.jsx(jt,{children:r("activity.signInBody")})]});const te=et(Ze({purchases:p?y.items:[],sales:m?b.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:fe}),s),ye=p&&(y.isLoading||v.isLoading||j.isLoading)||m&&b.isLoading,ie=p&&(y.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||m&&b.isFetchingNextPage,be=p&&(y.hasNextPage||v.hasNextPage||j.hasNextPage)||m&&b.hasNextPage;function ve(){p&&y.hasNextPage&&y.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),m&&b.hasNextPage&&b.fetchNextPage()}function je(u){if(n(u),!a)return;const w=new URLSearchParams(i);w.delete(W),w.delete(G),d(w,{replace:!0})}function ke(){const u=new URLSearchParams(i);u.set(W,oe),u.delete(G),d(u,{replace:!0})}return t.jsxs(rt,{children:[t.jsx(ot,{children:t.jsx(dt,{children:r("nav.activity")})}),t.jsxs(ct,{role:"tablist","aria-label":r("nav.activity"),children:[It.map(u=>t.jsx(le,{type:"button",role:"tab","aria-selected":!a&&s===u,"data-active":!a&&s===u,"data-testid":`activity-filter-${u}`,onClick:()=>je(u),children:r(`activity.filter.${u}`)},u)),f?t.jsxs(lt,{type:"button",role:"tab","aria-selected":a,"data-active":a,"data-testid":"activity-filter-migrate","aria-label":h?r("activity.migrate.chipAria",{count:h}):void 0,onClick:ke,children:[r("activity.migrate.chip"),h?t.jsx(ut,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),a?t.jsx(g.Suspense,{fallback:t.jsx(ht,{"aria-busy":"true"}),children:t.jsx(wt,{})}):ye?t.jsx(ae,{children:Array.from({length:5}).map((u,w)=>t.jsx(re,{},w))}):te.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(ae,{children:[te.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:it(ge,u.sale)},u.id)),ie?t.jsx(re,{}):null]}),t.jsx(ze,{hasNextPage:be,isFetching:ie,onLoadMore:ve})]})]})}export{Bt as Activity};
389
+ //# sourceMappingURL=Activity-BEOVOdVV.js.map
@@ -1,4 +1,4 @@
1
- import{r as u,j as d}from"./react-BY3vVwvc.js";import{s as f}from"./index-aVZCrQgK.js";import"./dcl-schemas-DhyZEUTb.js";import"./sentry-DTXXLFvs.js";import"./ethers-ByWI-eMv.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="7719f677-f7ca-4be2-ae33-3ef248c4ff9a",e._sentryDebugIdIdentifier="sentry-dbid-7719f677-f7ca-4be2-ae33-3ef248c4ff9a")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
1
+ import{r as u,j as d}from"./react-DyPiTXWH.js";import{s as f}from"./index-Ba6ZjOcU.js";import"./dcl-schemas-BHtFmNb-.js";import"./sentry-wjuCVNXH.js";import"./ethers-DgOG59Su.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="ae991de1-d0e8-4fc8-9b9c-dd40e1a13bad",e._sentryDebugIdIdentifier="sentry-dbid-ae991de1-d0e8-4fc8-9b9c-dd40e1a13bad")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -95,4 +95,4 @@ void main() {
95
95
  width: 100%;
96
96
  height: 100%;
97
97
  `;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const m=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),w=t.getUniformLocation(i,"u_resolution"),b=t.getUniformLocation(i,"u_overlayTex"),A=t.getUniformLocation(i,"u_overlayTiling"),v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);let g=!1;const h=F(t,P,()=>g),S=()=>{const l=window.devicePixelRatio||1,E=o.clientWidth*l,x=o.clientHeight*l;(o.width!==E||o.height!==x)&&(o.width=E,o.height=x)},U=performance.now()/1e3,y=()=>{S(),t.viewport(0,0,o.width,o.height),t.useProgram(i),t.uniform1f(R,performance.now()/1e3-U),t.uniform2f(w,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(b,0),t.enableVertexAttribArray(m),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(m,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),n.current=requestAnimationFrame(y)},T=l=>{l.preventDefault(),cancelAnimationFrame(n.current),o.style.opacity="0"};return o.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(n.current),o.removeEventListener("webglcontextlost",T),t.deleteProgram(i),t.deleteShader(c),t.deleteShader(s),t.deleteBuffer(v),t.deleteTexture(h)}},[]),d.jsxs(C,{"aria-hidden":!0,children:[d.jsx(k,{style:{backgroundImage:`url(${D})`}}),d.jsx(V,{ref:a})]})}export{K as default};
98
- //# sourceMappingURL=AnimatedBackground-BlItZE4F.js.map
98
+ //# sourceMappingURL=AnimatedBackground-wAz9Odt0.js.map
@@ -1,4 +1,4 @@
1
- import{r as m,b as He,j as e,u as tt}from"./react-BY3vVwvc.js";import{u as nt,s as st}from"./search-empty-CjwjsYp3.js";import{u as it,t as Ie,R as ot,j as rt,k as at,l as lt,m as ct,n as dt,o as ht,p as pt,v as ut,q as ft,r as mt,M as xt,s as gt}from"./browseLayout.styles-CQilLRye.js";import{c as q,R as bt,bv as yt,br as wt,aA as vt,a as jt,l as Ct,cw as $t,cx as kt,s as i,t,o as Oe,bf as St,r as Et,E as ve,b as n,p as Tt,I as E,q as O,cy as le,bd as Rt,ad as oe,bn as Le,bu as _t,bt as It,n as De,J as Ge,U as qe,V as Lt,ar as Nt,L as At,S as Ne,M as J,aI as zt,bE as Mt}from"./index-aVZCrQgK.js";import{L as Wt}from"./LoadMore-BaRjyF39.js";import{u as Bt}from"./useInfiniteGrid-B1PlvGpx.js";import{n as Pt,S as Ft}from"./categories-DeaLeWRX.js";import{E as Ut}from"./ErrorNotice-4SblVCJ8.js";import{d as Ht}from"./dcl-schemas-DhyZEUTb.js";import{s as Ot,G as Dt,w as Gt,S as qt}from"./buy-gasless-IWvDnyE1.js";import{s as Vt,o as Zt}from"./buy-wWHknAve.js";import{f as Qt}from"./errors-C7o97G4M.js";import{J as Kt,C as Jt,B as je}from"./ethers-ByWI-eMv.js";import{n as Xt}from"./name-glyph-aUugT8vq.js";import{G as Yt}from"./grid.styles-BIwLaIPU.js";import"./skeleton.styles-3JcIR00U.js";import"./sentry-DTXXLFvs.js";import"./intl-AKLEHPeO.js";import"./authorizations-DxGdOyfi.js";import"./sendMetaTransaction-BojzaFVf.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="f72f41dc-16dd-4a40-8bc6-e824ccfcfdd3",s._sentryDebugIdIdentifier="sentry-dbid-f72f41dc-16dd-4a40-8bc6-e824ccfcfdd3")}catch{}})();function X(s){const o=s.source??"item",r=s.tradeId||`${s.contractAddress}-${s.tokenId??s.itemId??""}`;return`${o}:${r}`}const V="100000000000000000000",Ve=2,re=15,en=/^[a-zA-Z0-9]+$/;function Ae(s){const o=s.trim();return o.length===0?{ok:!1,reason:"empty"}:en.test(o)?o.length<Ve?{ok:!1,reason:"too-short"}:o.length>re?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function tn(s){return s.replace(/[^a-zA-Z0-9]/g,"").slice(0,re)}const nn=["function available(string _subdomain) view returns (bool)"],ze={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function sn(){return q.chainId===Number(Ht.ChainId.MATIC_MAINNET)?ze.mainnet:ze.sepolia}async function on(s,o={}){var u;const{rpc:r,address:d}=sn(),h=new Kt(r),x=new Jt(d,nn,h);console.info(`[names] availability check → DCLRegistrar(${d}).available("${s}") on ${r}`);const l=await x.available(s);if((u=o.signal)!=null&&u.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${s}" available=${l}`),l?"available":"taken"}const rn="https://app.across.to/api";class ke extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ce extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class $e extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function an(s){return vt(V,s)}async function ln(s,o,r={}){var u;const d=r.chainId??q.chainId,h=r.provider??"across",x=`${q.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${d}&provider=${h}`,l=await jt(x,{method:"GET",identity:s,metadata:{}});if(!l.ok){let c;try{c=(u=await l.json())==null?void 0:u.code}catch{}throw c==="ROUTE_COST_TOO_HIGH"?new ke:new Error(`fetchNameCreditRoute ${l.status}`)}return l.json()}function cn(s,o){const r=je.from(s.availableAmount),h=je.from(V).sub(r);return{credits:[{value:s.amount,expiresAt:Number(s.expiresAt),salt:Zt(s.id)}],creditsSignatures:[s.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:h.isNegative()?"0":h.toString(),maxCreditedValue:V}}async function dn(s,o={}){const r=rn,d=o.intervalMs??1e4,h=o.maxAttempts??60;let x={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let l=0;l<h;l++){try{const u=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${s}`);if(u.ok){const c=await u.json(),p=(c.status??"pending").toLowerCase(),f=c.fillTx??c.fillTxnRef??null,w=typeof c.actionsSucceeded=="boolean"?c.actionsSucceeded:null;if(p==="filled")return{status:"filled",destinationTxHash:f,actionsSucceeded:w};if(p==="refunded"||p==="expired")return{status:p,destinationTxHash:null,actionsSucceeded:!1};x={status:"pending",destinationTxHash:f,actionsSucceeded:w}}}catch{}l<h-1&&await new Promise(u=>setTimeout(u,d))}return x}async function hn(s){const{name:o,identity:r,signer:d}=s,h=f=>{var w;try{(w=s.onProgress)==null||w.call(s,f)}catch{}},x=s.chainId??q.chainId,l=s.provider??"across",u=(s.beneficiary??await d.getAddress()).toLowerCase();let c=null,p="unconfirmed";console.info("[names] register start",{name:o,buyer:u,chainId:x,provider:l}),h("preparing");try{const f=await bt(x),w=an(f);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:f});const j=await ln(r,o,{chainId:x,provider:l});console.info("[names] step 2/6 route fetched",{target:j.externalCall.target,selector:j.externalCall.selector,provider:j.provider,quoteId:j.quoteId});const $=await yt(r,w,void 0,void 0,o);if(c=$.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:$.credit.id,maxCreditedValue:$.maxCreditedValue}),je.from($.maxCreditedValue).lt(V))throw new Error("Credit under-sized for the name price");h("awaiting-confirmation");const C=cn($.credit,j);let g;try{g=await Ot({chainId:x,buyer:u,signer:d,args:C})}catch(b){if(!(b instanceof Dt))throw b;if(b.reason==="relayer-unreachable"){p="unobservable";const S=new $e;throw S.cause=b,S}g=await Vt(x,C,d)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),h("confirming"),await Gt(g),p="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),l==="across"){h("registering");const b=await dn(g,s.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status==="filled"&&b.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:g}),{status:"pending",originTxHash:g};if(b.status!=="filled"||b.actionsSucceeded!==!0)throw new Ce;return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(f){if(console.error("[names] register failed — raw error:",f,{name:o,buyer:u,originState:p}),f instanceof qt)return{status:"pending",originTxHash:f.txHash};if(c&&p==="unconfirmed"&&await wt(r,[c]).catch(()=>{}),f instanceof ke||f instanceof Ce||f instanceof $e)throw f;const w=new Error(Qt(f,"Couldn't register the name. Please try again.",{sale:!0}));throw w.cause=f,w}}function pn(){const{data:s}=Ct({queryKey:["feature-flag","shop-names"],queryFn:()=>$t(kt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return s===!0}const un=60,fn=700,mn=25;function xn(s){if(!s)return[];const o=[];for(let r=1;r<=s.length;r++)o.push({text:s.slice(0,r),delay:un});o[o.length-1]={text:s,delay:fn};for(let r=s.length-1;r>=1;r--)o.push({text:s.slice(0,r),delay:mn});return o}function gn(s){return s.flatMap(xn)}function bn(s,o){const r=m.useMemo(()=>gn(s),[s]),[d,h]=m.useState(0);return m.useEffect(()=>{if(!o||r.length===0)return;const x=setTimeout(()=>h(l=>(l+1)%r.length),r[d%r.length].delay);return()=>clearTimeout(x)},[d,o,r]),!o||r.length===0?"":r[d%r.length].text}const yn="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/name-verified-oGwQ3ntb.svg",wn="#34fee6",vn=i.div`
1
+ import{r as m,b as He,j as e,u as tt}from"./react-DyPiTXWH.js";import{u as nt,s as st}from"./search-empty-GvvlNANs.js";import{u as it,t as Ie,R as ot,j as rt,k as at,l as lt,m as ct,n as dt,o as ht,p as pt,v as ut,q as ft,r as mt,M as xt,s as gt}from"./browseLayout.styles-C3O3rJ6E.js";import{c as q,R as bt,bv as yt,br as wt,aA as vt,a as jt,l as Ct,cw as $t,cx as kt,s as i,t,o as Oe,bf as St,r as Et,E as ve,b as n,p as Tt,I as E,q as O,cy as le,bd as Rt,ad as oe,bn as Le,bu as _t,bt as It,n as De,J as Ge,U as qe,V as Lt,ar as Nt,L as At,S as Ne,M as J,aI as zt,bE as Mt}from"./index-Ba6ZjOcU.js";import{L as Wt}from"./LoadMore-DscEf3Fk.js";import{u as Bt}from"./useInfiniteGrid-BKQ811RA.js";import{n as Pt,S as Ft}from"./categories-B1BKLZKW.js";import{E as Ut}from"./ErrorNotice-AmLNAAkn.js";import{d as Ht}from"./dcl-schemas-BHtFmNb-.js";import{s as Ot,G as Dt,w as Gt,S as qt}from"./buy-gasless-C1ToktQG.js";import{s as Vt,o as Zt}from"./buy-Tscnuj8P.js";import{f as Qt}from"./errors-C8Iz-trA.js";import{J as Kt,C as Jt,B as je}from"./ethers-DgOG59Su.js";import{n as Xt}from"./name-glyph-aUugT8vq.js";import{G as Yt}from"./grid.styles-Bfq3tOD5.js";import"./skeleton.styles-DGb4Vags.js";import"./sentry-wjuCVNXH.js";import"./intl-AKLEHPeO.js";import"./authorizations-BYnIZF10.js";import"./sendMetaTransaction-DdKlulxU.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="7bc74190-06b2-44de-a3ac-c913dfb4d49d",s._sentryDebugIdIdentifier="sentry-dbid-7bc74190-06b2-44de-a3ac-c913dfb4d49d")}catch{}})();function X(s){const o=s.source??"item",r=s.tradeId||`${s.contractAddress}-${s.tokenId??s.itemId??""}`;return`${o}:${r}`}const V="100000000000000000000",Ve=2,re=15,en=/^[a-zA-Z0-9]+$/;function Ae(s){const o=s.trim();return o.length===0?{ok:!1,reason:"empty"}:en.test(o)?o.length<Ve?{ok:!1,reason:"too-short"}:o.length>re?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function tn(s){return s.replace(/[^a-zA-Z0-9]/g,"").slice(0,re)}const nn=["function available(string _subdomain) view returns (bool)"],ze={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function sn(){return q.chainId===Number(Ht.ChainId.MATIC_MAINNET)?ze.mainnet:ze.sepolia}async function on(s,o={}){var u;const{rpc:r,address:d}=sn(),h=new Kt(r),x=new Jt(d,nn,h);console.info(`[names] availability check → DCLRegistrar(${d}).available("${s}") on ${r}`);const l=await x.available(s);if((u=o.signal)!=null&&u.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${s}" available=${l}`),l?"available":"taken"}const rn="https://app.across.to/api";class ke extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ce extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class $e extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function an(s){return vt(V,s)}async function ln(s,o,r={}){var u;const d=r.chainId??q.chainId,h=r.provider??"across",x=`${q.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${d}&provider=${h}`,l=await jt(x,{method:"GET",identity:s,metadata:{}});if(!l.ok){let c;try{c=(u=await l.json())==null?void 0:u.code}catch{}throw c==="ROUTE_COST_TOO_HIGH"?new ke:new Error(`fetchNameCreditRoute ${l.status}`)}return l.json()}function cn(s,o){const r=je.from(s.availableAmount),h=je.from(V).sub(r);return{credits:[{value:s.amount,expiresAt:Number(s.expiresAt),salt:Zt(s.id)}],creditsSignatures:[s.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:h.isNegative()?"0":h.toString(),maxCreditedValue:V}}async function dn(s,o={}){const r=rn,d=o.intervalMs??1e4,h=o.maxAttempts??60;let x={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let l=0;l<h;l++){try{const u=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${s}`);if(u.ok){const c=await u.json(),p=(c.status??"pending").toLowerCase(),f=c.fillTx??c.fillTxnRef??null,w=typeof c.actionsSucceeded=="boolean"?c.actionsSucceeded:null;if(p==="filled")return{status:"filled",destinationTxHash:f,actionsSucceeded:w};if(p==="refunded"||p==="expired")return{status:p,destinationTxHash:null,actionsSucceeded:!1};x={status:"pending",destinationTxHash:f,actionsSucceeded:w}}}catch{}l<h-1&&await new Promise(u=>setTimeout(u,d))}return x}async function hn(s){const{name:o,identity:r,signer:d}=s,h=f=>{var w;try{(w=s.onProgress)==null||w.call(s,f)}catch{}},x=s.chainId??q.chainId,l=s.provider??"across",u=(s.beneficiary??await d.getAddress()).toLowerCase();let c=null,p="unconfirmed";console.info("[names] register start",{name:o,buyer:u,chainId:x,provider:l}),h("preparing");try{const f=await bt(x),w=an(f);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:f});const j=await ln(r,o,{chainId:x,provider:l});console.info("[names] step 2/6 route fetched",{target:j.externalCall.target,selector:j.externalCall.selector,provider:j.provider,quoteId:j.quoteId});const $=await yt(r,w,void 0,void 0,o);if(c=$.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:$.credit.id,maxCreditedValue:$.maxCreditedValue}),je.from($.maxCreditedValue).lt(V))throw new Error("Credit under-sized for the name price");h("awaiting-confirmation");const C=cn($.credit,j);let g;try{g=await Ot({chainId:x,buyer:u,signer:d,args:C})}catch(b){if(!(b instanceof Dt))throw b;if(b.reason==="relayer-unreachable"){p="unobservable";const S=new $e;throw S.cause=b,S}g=await Vt(x,C,d)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),h("confirming"),await Gt(g),p="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),l==="across"){h("registering");const b=await dn(g,s.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status==="filled"&&b.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:g}),{status:"pending",originTxHash:g};if(b.status!=="filled"||b.actionsSucceeded!==!0)throw new Ce;return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(f){if(console.error("[names] register failed — raw error:",f,{name:o,buyer:u,originState:p}),f instanceof qt)return{status:"pending",originTxHash:f.txHash};if(c&&p==="unconfirmed"&&await wt(r,[c]).catch(()=>{}),f instanceof ke||f instanceof Ce||f instanceof $e)throw f;const w=new Error(Qt(f,"Couldn't register the name. Please try again.",{sale:!0}));throw w.cause=f,w}}function pn(){const{data:s}=Ct({queryKey:["feature-flag","shop-names"],queryFn:()=>$t(kt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return s===!0}const un=60,fn=700,mn=25;function xn(s){if(!s)return[];const o=[];for(let r=1;r<=s.length;r++)o.push({text:s.slice(0,r),delay:un});o[o.length-1]={text:s,delay:fn};for(let r=s.length-1;r>=1;r--)o.push({text:s.slice(0,r),delay:mn});return o}function gn(s){return s.flatMap(xn)}function bn(s,o){const r=m.useMemo(()=>gn(s),[s]),[d,h]=m.useState(0);return m.useEffect(()=>{if(!o||r.length===0)return;const x=setTimeout(()=>h(l=>(l+1)%r.length),r[d%r.length].delay);return()=>clearTimeout(x)},[d,o,r]),!o||r.length===0?"":r[d%r.length].text}const yn="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/name-verified-oGwQ3ntb.svg",wn="#34fee6",vn=i.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -458,7 +458,7 @@ import{r as m,b as He,j as e,u as tt}from"./react-BY3vVwvc.js";import{u as nt,s
458
458
  color: ${t.colors.accent};
459
459
  }
460
460
  }
461
- `;function qn({name:s,priceCredits:o,onClose:r}){const{session:d}=Oe(),{data:h,isError:x}=St(d),l=Et(),u=He(),[c,p]=m.useState("confirm"),[f,w]=m.useState(""),[j,$]=m.useState(null),[C,g]=m.useState(!1),[b,S]=m.useState("preparing"),L=m.useRef(!1),T=f.trim().toLowerCase()===s.toLowerCase(),k=c==="completing",W=o!=null?ve(o):"—",B=o==null,z=h==null?void 0:h.credits,P=o!=null&&z!=null?o-z:0,N=P>0,A=B?n("names.priceUnavailable"):N?n("names.insufficientCredits",{credits:ve(P)}):null;m.useEffect(()=>{const y=D=>{D.key==="Escape"&&!k&&r()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[k,r]);async function F(){if(!(!d||!T||B||N||L.current)){L.current=!0,p("completing"),$(null),S("preparing");try{const y=await hn({name:s,identity:d.identity,signer:d.signer,onProgress:S});oe("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Le(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:Le(o??0),transaction_hash:y.originTxHash??null,settlement:y.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),p(y.status==="registered"?"success":"pending")}catch(y){oe(It(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:_t(y),purchase_type:"name"});const U=y instanceof Ce,D=y instanceof $e;$(y instanceof ke?n("names.errorRouteCost"):U?n("names.errorNotRegistered"):D?n("names.errorSettlementUnknown"):(y==null?void 0:y.message)||n("names.errorGeneric")),g(U||D),p("error")}finally{L.current=!1}}}const R=c!=="success"&&c!=="pending",v=Tt(d==null?void 0:d.providerType),I=v?2:1,M=v&&(b==="preparing"||b==="awaiting-confirmation"),_=M?1:I,ae=M?n("names.confirming"):n("names.completing"),Z=b==="registering"?n("names.processingRegistering"):null;return e.jsx(vn,{onClick:k?void 0:r,role:"presentation",children:e.jsxs(jn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[R&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:c==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(he,{onClick:r,disabled:k,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(Me,{"aria-hidden":!0,children:"@"}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),C?e.jsx(ye,{onClick:r,children:n("names.errorSpentDismiss")}):e.jsx(ye,{onClick:()=>p("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(En,{children:[e.jsx(Tn,{children:n("names.confirmTitle")}),e.jsx(Rn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Vn(s)}</b>`})}}),e.jsxs(_n,{children:[e.jsx(In,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:f,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Nn,{children:".dcl.eth"})]})]}),A?e.jsxs(we,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsx("span",{children:A})]}):null,e.jsx(ye,{onClick:()=>void F(),disabled:!T||!d||B||N,children:n("names.buyCta")})]})]}),c==="completing"&&e.jsxs(An,{children:[e.jsx(zn,{src:Rt,alt:"",width:61,height:61}),e.jsxs(Mn,{children:[e.jsx(Wn,{children:ae}),e.jsxs(Pn,{children:[e.jsx(Fn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Un,{"data-testid":"name-progress-count",children:`${_}/${I}`})]}),Z?e.jsx(Bn,{children:Z}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:n("names.pendingHeaderTitle")}),e.jsx(he,{onClick:r,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{}),e.jsxs(we,{"data-tone":"info",children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(fe,{style:{marginTop:20},children:[e.jsx(Me,{"aria-hidden":!0,children:"@"}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),e.jsx(We,{children:e.jsx(Be,{onClick:()=>{r(),u("/my-items")},children:n("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:n("names.successHeaderTitle")}),e.jsx(he,{onClick:r,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{}),e.jsxs(Hn,{children:[e.jsx(On,{"aria-hidden":!0,children:e.jsx(E,{name:"check"})}),e.jsxs(Dn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(fe,{style:{marginTop:20},children:[e.jsxs(Cn,{"data-testid":"name-success-tile",children:[e.jsx($n,{src:Xt,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(kn,{children:[e.jsx("span",{"aria-hidden":!0,children:s}),e.jsx(Sn,{src:yn,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),e.jsxs(We,{children:[e.jsx(Be,{onClick:()=>{r(),u("/my-items")},children:n("names.myItems")}),e.jsx(Gn,{href:q.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Vn(s){return s.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const Zn="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/identity-icon-C8yAW_Gq.svg",Qn="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/world-icon-6xQ-PmmW.svg",Kn="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/invite-icon-Bz6lCTuB.svg",Jn="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",Xn=i.div`
461
+ `;function qn({name:s,priceCredits:o,onClose:r}){const{session:d}=Oe(),{data:h,isError:x}=St(d),l=Et(),u=He(),[c,p]=m.useState("confirm"),[f,w]=m.useState(""),[j,$]=m.useState(null),[C,g]=m.useState(!1),[b,S]=m.useState("preparing"),L=m.useRef(!1),T=f.trim().toLowerCase()===s.toLowerCase(),k=c==="completing",W=o!=null?ve(o):"—",B=o==null,z=h==null?void 0:h.credits,P=o!=null&&z!=null?o-z:0,N=P>0,A=B?n("names.priceUnavailable"):N?n("names.insufficientCredits",{credits:ve(P)}):null;m.useEffect(()=>{const y=D=>{D.key==="Escape"&&!k&&r()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[k,r]);async function F(){if(!(!d||!T||B||N||L.current)){L.current=!0,p("completing"),$(null),S("preparing");try{const y=await hn({name:s,identity:d.identity,signer:d.signer,onProgress:S});oe("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Le(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:Le(o??0),transaction_hash:y.originTxHash??null,settlement:y.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),p(y.status==="registered"?"success":"pending")}catch(y){oe(It(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:_t(y),purchase_type:"name"});const U=y instanceof Ce,D=y instanceof $e;$(y instanceof ke?n("names.errorRouteCost"):U?n("names.errorNotRegistered"):D?n("names.errorSettlementUnknown"):(y==null?void 0:y.message)||n("names.errorGeneric")),g(U||D),p("error")}finally{L.current=!1}}}const R=c!=="success"&&c!=="pending",v=Tt(d==null?void 0:d.providerType),I=v?2:1,M=v&&(b==="preparing"||b==="awaiting-confirmation"),_=M?1:I,ae=M?n("names.confirming"):n("names.completing"),Z=b==="registering"?n("names.processingRegistering"):null;return e.jsx(vn,{onClick:k?void 0:r,role:"presentation",children:e.jsxs(jn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[R&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:c==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(he,{onClick:r,disabled:k,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(Me,{"aria-hidden":!0,children:"@"}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),C?e.jsx(ye,{onClick:r,children:n("names.errorSpentDismiss")}):e.jsx(ye,{onClick:()=>p("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(En,{children:[e.jsx(Tn,{children:n("names.confirmTitle")}),e.jsx(Rn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Vn(s)}</b>`})}}),e.jsxs(_n,{children:[e.jsx(In,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:f,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Nn,{children:".dcl.eth"})]})]}),A?e.jsxs(we,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsx("span",{children:A})]}):null,e.jsx(ye,{onClick:()=>void F(),disabled:!T||!d||B||N,children:n("names.buyCta")})]})]}),c==="completing"&&e.jsxs(An,{children:[e.jsx(zn,{src:Rt,alt:"",width:61,height:61}),e.jsxs(Mn,{children:[e.jsx(Wn,{children:ae}),e.jsxs(Pn,{children:[e.jsx(Fn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Un,{"data-testid":"name-progress-count",children:`${_}/${I}`})]}),Z?e.jsx(Bn,{children:Z}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:n("names.pendingHeaderTitle")}),e.jsx(he,{onClick:r,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{}),e.jsxs(we,{"data-tone":"info",children:[e.jsx(E,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(fe,{style:{marginTop:20},children:[e.jsx(Me,{"aria-hidden":!0,children:"@"}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),e.jsx(We,{children:e.jsx(Be,{onClick:()=>{r(),u("/my-items")},children:n("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:n("names.successHeaderTitle")}),e.jsx(he,{onClick:r,"aria-label":n("buyModal.close"),children:e.jsx(E,{name:"close"})})]}),e.jsxs(pe,{children:[n("names.myCreditsBalance")," ",e.jsx(O,{})," ",le(h,x)]}),e.jsx(ue,{}),e.jsxs(Hn,{children:[e.jsx(On,{"aria-hidden":!0,children:e.jsx(E,{name:"check"})}),e.jsxs(Dn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(fe,{style:{marginTop:20},children:[e.jsxs(Cn,{"data-testid":"name-success-tile",children:[e.jsx($n,{src:Xt,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(kn,{children:[e.jsx("span",{"aria-hidden":!0,children:s}),e.jsx(Sn,{src:yn,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(me,{children:[e.jsxs(xe,{children:[s,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ge,{children:n("names.subtitle")})]}),e.jsxs(be,{children:[e.jsx(O,{}),W]})]}),e.jsxs(We,{children:[e.jsx(Be,{onClick:()=>{r(),u("/my-items")},children:n("names.myItems")}),e.jsx(Gn,{href:q.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Vn(s){return s.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const Zn="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/identity-icon-C8yAW_Gq.svg",Qn="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/world-icon-6xQ-PmmW.svg",Kn="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/invite-icon-Bz6lCTuB.svg",Jn="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",Xn=i.div`
462
462
  width: 100%;
463
463
  min-width: 0;
464
464
  `,Yn=i.nav`
@@ -935,4 +935,4 @@ import{r as m,b as He,j as e,u as tt}from"./react-BY3vVwvc.js";import{u as nt,s
935
935
  color: ${t.colors.err};
936
936
  }
937
937
  `,Ue=48,Ns=["all","on_sale","not_for_sale"],As=s=>s?"all":"on_sale";function ti(){const[s]=tt(),o=He(),r=(s.get("q")??"").trim().toLowerCase(),d=(s.get("q")??"").trim();De({title:d?n("seo.collectibles.searchTitle",{query:d}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const h=As(!!r),x=m.useMemo(()=>({category:"all",status:h,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[h]),[l,u]=nt(x),{subCategory:c,rarities:p,priceMin:f,priceMax:w,smart:j,sort:$}=l,C=l.category,g=Ns.includes(l.status)?l.status:h;it(`${C}:${c??""}`);const[b,S]=m.useState(!1);m.useEffect(()=>{if(!b)return;const a=K=>{K.key==="Escape"&&S(!1)};document.addEventListener("keydown",a);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",a),document.body.style.overflow=H}},[b]);const L=g==="on_sale",T=f&&!Number.isNaN(Number(f))?Number(f):void 0,k=w&&!Number.isNaN(Number(w))?Number(w):void 0,W=Lt(),B=c?Ft[c]:void 0,z=(Ie.find(a=>a.key===$)??Ie[0]).server,P={category:C,rarities:p.length?p:void 0,wearableCategories:B,minPriceCredits:T,maxPriceCredits:k,search:r||void 0,sortBy:z,isSmart:j||void 0,onSale:!0,listingType:W?void 0:"primary"},N={category:C,rarities:p.length?p:void 0,wearableCategories:B,search:r||void 0,sortBy:z,isWearableSmart:j||void 0,isOnSale:g==="not_for_sale"?!1:void 0},{items:A,total:F,isLoading:R,isPlaceholderData:v,error:I,hasNextPage:M,isFetchingNextPage:_,isFetchNextPageError:ae,fetchNextPage:Z}=Bt(L?["shop-items",P]:["catalog-items",N],a=>L?zt({...P,first:Ue,skip:a}):Mt({...N,first:Ue,skip:a}),{enabled:C!=="names"}),y=F,{data:U,isError:D,isPending:Ke}=Ge(),Je=a=>U&&a.manaWei?qe(a.manaWei,U):null,Xe=L&&Ke&&A.some(a=>a.source==="legacy"),Se=R||v||Xe,Ye=R?15:Math.max(A.length,1),Ee=m.useRef(null);m.useEffect(()=>{R||v||!r||Ee.current===r||(Ee.current=r,oe("Shop Searched",{query:r,result_count:y}))},[r,R,v,y]);const Q=m.useRef("__init__");m.useEffect(()=>{if(R||v)return;const a=JSON.stringify({category:C,subCategory:c,rarities:p,min:T,max:k,sort:$,status:g,smart:j});if(Q.current==="__init__"||Q.current===a){Q.current=a;return}Q.current=a,oe("Shop Applied Filter",{filters:{category:C,sub_category:c,rarities:p,min_price_credits:T??null,max_price_credits:k??null,status:g,smart:j,sort:$},result_count:y})},[C,c,p,T,k,$,g,j,R,v,y]);function Te(a){u({category:a,subCategory:null})}function Re(a){u({status:a})}function _e(a){u({rarities:p.includes(a)?p.filter(H=>H!==a):[...p,a]})}function et(){u(x)}const G=[];(T!=null||k!=null)&&G.push({key:"price",label:n("filter.price"),onRemove:()=>{u({priceMin:"",priceMax:""})}});for(const a of ot)p.includes(a)&&G.push({key:`rarity-${a}`,label:Nt(a),onRemove:()=>_e(a)});return j&&G.push({key:"smart",label:n("filter.smart"),onRemove:()=>u({smart:!1})}),g!==h&&G.push({key:"status",label:g==="all"?n("filter.statusAll"):g==="on_sale"?n("filter.onSale"):n("filter.notForSale"),onRemove:()=>Re(h)}),e.jsxs(rt,{"data-testid":"browse",children:[C!=="names"&&e.jsxs(e.Fragment,{children:[b?e.jsx(at,{onClick:()=>S(!1),"aria-hidden":!0}):null,e.jsxs(lt,{"data-open":b||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ct,{children:[e.jsx(dt,{children:n("assets.filters")}),e.jsx(ht,{onClick:()=>S(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(pt,{children:e.jsx(ut,{category:C,subCategory:c,onCategory:Te,onSub:a=>u({subCategory:a}),priceMin:f,priceMax:w,onPriceMin:a=>u({priceMin:a}),onPriceMax:a=>u({priceMax:a}),rarities:p,onToggleRarity:_e,status:g,onStatus:Re,smart:j,onSmart:a=>u({smart:a})})}),e.jsx(ft,{children:e.jsx(mt,{type:"button",onClick:()=>S(!1),children:n("assets.showItems")})})]})]}),e.jsx(xt,{children:C==="names"?e.jsx(Is,{onBack:()=>Te("all")}):e.jsxs(e.Fragment,{children:[e.jsx(gt,{sort:$,onSort:a=>u({sort:a}),total:F,loading:R||v,query:r,onOpenFilters:()=>S(!0),chips:G,onClearChips:et}),D&&L&&A.some(a=>a.source==="legacy")?e.jsx(Ls,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,I?e.jsx(Ut,{message:n("assets.loadError"),testId:"browse-error"}):null,!Se&&A.length===0&&!I?e.jsx(At,{testId:"browse-empty",icon:st,title:n("assets.empty.title"),body:d?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:d}),n("assets.empty.searchAfter")]}):n("assets.empty.filters"),cta:{label:n("assets.empty.cta"),onClick:()=>o("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(Yt,{"data-testid":"grid",children:Se?e.jsx(Ne,{count:Ye}):e.jsxs(e.Fragment,{children:[A.map(a=>{if(!L)return e.jsx(J,{item:a,mode:"view"},X(a));const H=a;if(H.source!=="legacy")return e.jsx(J,{item:a},X(a));const K=Je(H);return K==null?e.jsx(J,{item:a,mode:"view"},X(a)):e.jsx(J,{item:{...H,priceCredits:K}},X(a))}),_?e.jsx(Ne,{count:6}):null]})}),e.jsx(Wt,{hasNextPage:M,isFetching:_,isError:ae,onLoadMore:()=>void Z()})]})]})})]})}export{ti as Assets};
938
- //# sourceMappingURL=Assets-D-AYQR5O.js.map
938
+ //# sourceMappingURL=Assets-P4H-lV4U.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,L as W,r as P}from"./react-BY3vVwvc.js";import{t as o,s as n,B,m as R,n as F,b as i,o as G,p as O,I as z,q as K,l as w,r as Q,c as H,v as X,w as A,h as Z,x as J,y as I}from"./index-aVZCrQgK.js";import{a as U,b as V,c as Y,d as tt,s as et,e as it}from"./authorizations-DxGdOyfi.js";import{f as ot}from"./builder-BSxR3UB0.js";import{m as at}from"./mana-matic-CEqvSwrJ.js";import{f as nt}from"./errors-C7o97G4M.js";import"./dcl-schemas-DhyZEUTb.js";import"./sentry-DTXXLFvs.js";import"./ethers-ByWI-eMv.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-BojzaFVf.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="c2ec6301-beed-4385-8d18-7f5357a4a2c4",t._sentryDebugIdIdentifier="sentry-dbid-c2ec6301-beed-4385-8d18-7f5357a4a2c4")}catch{}})();const st=R`
1
+ import{j as e,L as W,r as P}from"./react-DyPiTXWH.js";import{t as o,s as n,B,m as R,n as F,b as i,o as G,p as O,I as z,q as K,l as w,r as Q,c as H,v as X,w as A,h as Z,x as J,y as I}from"./index-Ba6ZjOcU.js";import{a as U,b as V,c as Y,d as tt,s as et,e as it}from"./authorizations-BYnIZF10.js";import{f as ot}from"./builder-Db2C6JNf.js";import{m as at}from"./mana-matic-CEqvSwrJ.js";import{f as nt}from"./errors-C8Iz-trA.js";import"./dcl-schemas-BHtFmNb-.js";import"./sentry-wjuCVNXH.js";import"./ethers-DgOG59Su.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-DdKlulxU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="c2ec6301-beed-4385-8d18-7f5357a4a2c4",t._sentryDebugIdIdentifier="sentry-dbid-c2ec6301-beed-4385-8d18-7f5357a4a2c4")}catch{}})();const st=R`
2
2
  to { transform: rotate(360deg); }
3
3
  `,rt=R`
4
4
  to { background-position: -200% 0; }
@@ -189,4 +189,4 @@ import{j as e,L as W,r as P}from"./react-BY3vVwvc.js";import{t as o,s as n,B,m a
189
189
  `,M=n(B)`
190
190
  margin-top: 12px;
191
191
  `;function j({descriptor:t,owner:s,signer:r,name:a,description:c,image:l,icon:p}){const v=Q(),[h,y]=P.useState(!1),{data:u,isLoading:g,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function m(){if(h||g)return;const b=!u;y(!0);try{await et({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?i("authorizations.toastActivated",{name:a}):i("authorizations.toastDeactivated",{name:a}))}catch(C){Z(C,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(nt(C,i("authorizations.errorGeneric")))}finally{y(!1)}}const N=g?i("authorizations.checking"):u?i("authorizations.active"):i("authorizations.inactive");return e.jsxs(ht,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[e.jsx(gt,{children:l?e.jsx("img",{src:l,alt:""}):p}),e.jsxs(mt,{children:[e.jsx(ft,{title:a,children:a}),e.jsx(xt,{children:c})]}),e.jsxs(bt,{children:[e.jsx(yt,{"data-active":!!u,children:N}),h?e.jsx(jt,{"aria-label":i("authorizations.working")}):e.jsx(zt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?i("authorizations.deactivateAria",{name:a}):i("authorizations.activateAria",{name:a}),disabled:g,onClick:()=>void m()})]})]})}const x=500,q=10,vt=x*q;async function _(t,s){const r=await I(t,{category:s,first:x}),a=Math.min(Math.ceil(r.total/x),q),c=await Promise.all(Array.from({length:Math.max(0,a-1)},(l,p)=>I(t,{category:s,first:x,skip:(p+1)*x})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>vt}}function kt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([_(t,"wearable"),_(t,"emote")]),a=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();a.has(l)||a.set(l,c)}return{collections:[...a.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function $t(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:J})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const a=X(t);return a===t?i("authorizations.collectionFallback"):a}function At(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await ot(t,s),a=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();a.has(l)||a.set(l,c)}return[...a.values()]}})}function Wt(){F({title:i("authorizations.title"),noindex:!0});const{session:t,signIn:s}=G(),r=H.chainId,a=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=kt(a?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=$t(!!a&&!!(t!=null&&t.address)),{data:h,isLoading:y}=At(a?t==null?void 0:t.address:void 0,a?t==null?void 0:t.identity:void 0);if(!t)return e.jsxs(D,{children:[e.jsx(z,{name:"info",size:40,color:o.colors.muted2}),e.jsx(S,{children:i("authorizations.signInTitle")}),e.jsx(L,{children:i("authorizations.signInBody")}),e.jsx(M,{variant:"white",onClick:()=>s(),children:i("storeSettings.signIn")})]});if(!a)return e.jsxs(D,{children:[e.jsx(z,{name:"check",size:40,color:o.colors.ok}),e.jsx(S,{children:i("authorizations.managedTitle")}),e.jsx(L,{children:i("authorizations.managedBody")}),e.jsx(M,{as:W,to:"/items",variant:"white",children:i("authorizations.managedCta")})]});const u=U(r),g=V(r);return e.jsxs(ct,{children:[e.jsxs(lt,{children:[e.jsx(dt,{children:i("authorizations.title")}),e.jsx(ut,{children:i("authorizations.intro")})]}),e.jsxs(k,{children:[e.jsx($,{children:i("authorizations.buyingTitle")}),e.jsxs(f,{children:[e.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:e.jsx(K,{className:"ccy-mark"})}),e.jsx(j,{descriptor:g,owner:t.address,signer:t.signer,name:i("authorizations.manaName"),description:i("authorizations.manaDesc"),icon:e.jsx(pt,{src:at,alt:"","aria-hidden":!0})})]})]}),e.jsxs(k,{children:[e.jsx($,{children:i("authorizations.sellingTitle")}),c!=null&&c.truncated?e.jsx(wt,{"data-testid":"authorizations-selling-truncated",children:i("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?e.jsx(f,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((d,m)=>e.jsx(E,{"aria-hidden":!0},m))}):c&&c.collections.length>0?e.jsx(f,{children:c.collections.map(d=>e.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:i("authorizations.sellingDesc"),image:d.image,icon:e.jsx(z,{name:"pen",size:18})},d.contractAddress))}):e.jsx(T,{children:i("authorizations.sellingEmpty")})]}),e.jsxs(k,{children:[e.jsx($,{children:i("authorizations.mintingTitle")}),y?e.jsx(f,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((d,m)=>e.jsx(E,{"aria-hidden":!0},m))}):h&&h.length>0?e.jsx(f,{children:h.map(d=>e.jsx(j,{descriptor:tt(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||i("authorizations.collectionFallback"),description:i("authorizations.mintingDesc"),icon:e.jsx(z,{name:"pen",size:18})},d.contractAddress))}):e.jsx(T,{children:i("authorizations.mintingEmpty")})]})]})}export{Wt as Authorizations};
192
- //# sourceMappingURL=Authorizations-D3TFOLc0.js.map
192
+ //# sourceMappingURL=Authorizations-BUN1TioY.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,L as Ut,r as T,b as fa,a as ma}from"./react-BY3vVwvc.js";import{s as i,t as E,b as a,q as Ie,E as ae,bc as Fe,C as Me,bd as ya,D as Le,be as ba,z as va,I as Y,A as Xe,n as wa,ab as O,H as jt,o as Ca,V as ja,l as ka,bf as $a,r as Sa,bg as Ma,J as Ta,bh as Ia,bi as kt,L as Pa,bj as Aa,bk as za,bl as Ea,ao as Ke,p as Ra,bm as $t,ad as V,bn as St,bo as Ba,h as re,R as qa,c as Mt,bp as _a,bq as Wa,br as Ne,W as Fa,bs as we,bt as Ce,bu as Tt,bv as La,g as It,f as Pt,bw as Ka}from"./index-aVZCrQgK.js";import{m as Te,M as Na,S as Qa,C as Ua,H as Ga,a as Ha,T as Oa,X as Da,b as Va,B as Ya,c as Ja,d as At,e as Xa,f as Pe,g as Za,h as es,i as ts,j as as,k as Je,l as pe,L as ss,P as ns,n as zt,o as Et,W as is,p as rs,q as os,r as cs,A as ls,s as ds,t as us,u as hs,v as ps,w as gs,x as xs,y as fs,z as ms,D as ys,E as bs,F as vs,G as ws,I as Cs,J as js,K as ks,N as $s,O as Qe,Q as Ss,R as Ms,U as Ts,V as Rt,Y as Bt,Z as Is,_ as Ps,$ as As,a0 as zs,a1 as qt,a2 as Es}from"./CollectionCarousel-xKmRjdjJ.js";import{k as Rs,l as Bs,e as qs,n as _s,f as Ws,A as Fs}from"./authorizations-DxGdOyfi.js";import{p as _t,g as Ls,h as Ue}from"./buy-wWHknAve.js";import{w as Ks,S as Ge,b as Ns,G as Qs}from"./buy-gasless-IWvDnyE1.js";import{u as Us,M as Gs,R as je,r as Hs,c as Os,g as Ds,a as Vs,p as Wt,b as He}from"./useCreditPacks-6QkfHH0T.js";import{i as Ys,a as Js}from"./errors-C7o97G4M.js";import{E as Xs}from"./ErrorNotice-4SblVCJ8.js";import"./dcl-schemas-DhyZEUTb.js";import"./sentry-DTXXLFvs.js";import"./ethers-ByWI-eMv.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-BojzaFVf.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new r.Error().stack;d&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[d]="114aeeec-407a-4490-a588-1fdc1dc08445",r._sentryDebugIdIdentifier="sentry-dbid-114aeeec-407a-4490-a588-1fdc1dc08445")}catch{}})();const Zs=i.div`
1
+ import{j as e,L as Ut,r as T,b as fa,a as ma}from"./react-DyPiTXWH.js";import{s as i,t as E,b as a,q as Ie,E as ae,bc as Fe,C as Me,bd as ya,D as Le,be as ba,z as va,I as Y,A as Xe,n as wa,ab as O,H as jt,o as Ca,V as ja,l as ka,bf as $a,r as Sa,bg as Ma,J as Ta,bh as Ia,bi as kt,L as Pa,bj as Aa,bk as za,bl as Ea,ao as Ke,p as Ra,bm as $t,ad as V,bn as St,bo as Ba,h as re,R as qa,c as Mt,bp as _a,bq as Wa,br as Ne,W as Fa,bs as we,bt as Ce,bu as Tt,bv as La,g as It,f as Pt,bw as Ka}from"./index-Ba6ZjOcU.js";import{m as Te,M as Na,S as Qa,C as Ua,H as Ga,a as Ha,T as Oa,X as Da,b as Va,B as Ya,c as Ja,d as At,e as Xa,f as Pe,g as Za,h as es,i as ts,j as as,k as Je,l as pe,L as ss,P as ns,n as zt,o as Et,W as is,p as rs,q as os,r as cs,A as ls,s as ds,t as us,u as hs,v as ps,w as gs,x as xs,y as fs,z as ms,D as ys,E as bs,F as vs,G as ws,I as Cs,J as js,K as ks,N as $s,O as Qe,Q as Ss,R as Ms,U as Ts,V as Rt,Y as Bt,Z as Is,_ as Ps,$ as As,a0 as zs,a1 as qt,a2 as Es}from"./CollectionCarousel-7w9vcOQY.js";import{k as Rs,l as Bs,e as qs,n as _s,f as Ws,A as Fs}from"./authorizations-BYnIZF10.js";import{p as _t,g as Ls,h as Ue}from"./buy-Tscnuj8P.js";import{w as Ks,S as Ge,b as Ns,G as Qs}from"./buy-gasless-C1ToktQG.js";import{u as Us,M as Gs,R as je,r as Hs,c as Os,g as Ds,a as Vs,p as Wt,b as He}from"./useCreditPacks-oQYk8AXU.js";import{i as Ys,a as Js}from"./errors-C8Iz-trA.js";import{E as Xs}from"./ErrorNotice-AmLNAAkn.js";import"./dcl-schemas-BHtFmNb-.js";import"./sentry-wjuCVNXH.js";import"./ethers-DgOG59Su.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-DdKlulxU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new r.Error().stack;d&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[d]="114aeeec-407a-4490-a588-1fdc1dc08445",r._sentryDebugIdIdentifier="sentry-dbid-114aeeec-407a-4490-a588-1fdc1dc08445")}catch{}})();const Zs=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -745,4 +745,4 @@ import{j as e,L as Ut,r as T,b as fa,a as ma}from"./react-BY3vVwvc.js";import{s
745
745
  margin-top: 0;
746
746
  }
747
747
  `;function Ve(r){if(Ys(r))return a("errors.rejected");const d=(r.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Me.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const si=12e4;function ni(r){const d=[];return r.unavailable.length&&d.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&d.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=r=>r.reduce((d,k)=>d+k.priceCredits*k.quantity,0),Se=r=>r.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function bi(){var Ct;wa({title:a("nav.cart"),noindex:!0});const r=O(t=>t.items),d=O(t=>t.remove),k=O(t=>t.increment),$=O(t=>t.decrement),R=O(t=>t.clear),U=O(t=>t.restore),H=O(t=>t.setFittingOpen),A=jt(t=>t.items),J=jt(t=>t.toggle),{session:n,signIn:G}=Ca(),Jt=ja(),ge=Us().packs.slice(0,Gs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Xt=r.some(t=>t.category!=="emote"),{data:Ae}=ka({queryKey:["upsell-listings"],queryFn:()=>Ka({first:40}),staleTime:6e4}),{data:j}=$a(n),b=Sa(),X=fa(),{state:B}=ma(),[Zt,le]=T.useState(null),[Ze,xe]=T.useState(null),[ea,q]=T.useState(!1),[_,D]=T.useState(null),et=T.useRef(0),[h,S]=T.useState(null),{data:fe}=Ma(n),{data:de}=Ta(!0),[ze,tt]=T.useState(""),ue=T.useRef(null),at=Ia(r),st=t=>$t(at[t.id]),Ee=r.filter(st),nt=r.length>0&&Ee.length===0,ta=Ee.reduce((t,s)=>t+s.priceCredits*s.quantity,0),aa=r.reduce((t,s)=>t+s.quantity,0),sa=Ee.reduce((t,s)=>t+s.quantity,0),it=_?_.liveTotalCredits:ta,na=new Set(r.map(t=>t.id)),rt=((Ae==null?void 0:Ae.items)??[]).filter(t=>!na.has(t.id)).slice(0,12),ia=new Map(_==null?void 0:_.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=it*10,ra=de?kt(Re,de):0n,Be=Qe({priceCents:Re,priceManaWei:ra,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n}),oa=t=>t.flatMap(s=>{const c=He(s);return c.kind==="store"?[c.mint]:[]}),ca=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),la=Ba,da=t=>_a(t.contractAddress,String(t.itemId));function ye(t){t(),D(null),xe(null),le(null)}function ua(){S(null),q(!1)}function ot(t){const s=Ye(t),c=Math.max(0,s-me),o=ge.find(u=>u.credits>=c)??ge[ge.length-1];tt(o.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:c}),S({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:c}),q(!1)}async function qe(t){if(!n||t.length===0)return;const s=Se(t),c=s.map(m=>({...m.item,priceCredits:m.priceCredits})),o=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),u=[];let v="authorize";const g=new Set,M=new Set,L=new Set,W=[];let w=!1;S({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],z=Ds(s,_t);let K=0;for(const p of z){S({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:f,maxCreditedValue:y}=await Wa(n.identity,p.units.map(Vs));p.units.forEach((Q,ie)=>{u.push({salt:f.id,itemId:Q.item.id}),m.push({...p.drafts[ie],credits:[f],maxCreditedValue:y})}),K+=p.units.length}catch(f){if(Js(f)){if(u.length){try{await Ne(n.identity,[...new Set(u.map(y=>y.salt))])}catch(y){re(y,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}ot(t);return}throw f}}u.length&&b.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Ls(m).length,te=p=>N>1?{current:p,total:N}:void 0,F=(p,f)=>S({phase:"processing",stage:p,step:s.length,total:s.length,signatures:te(f)}),C=p=>p<N?F("awaiting-signature",p+1):F("settling",N);F("awaiting-signature",1);let x=[];const I=new Map,se=async p=>{const f=await Promise.allSettled(p.map(y=>Ks(y)));return f.forEach((y,Q)=>{const ie=I.get(p[Q])??[];y.status==="fulfilled"?(ie.forEach(We=>M.add(We)),W.push(p[Q])):y.reason instanceof Ge||ie.forEach(We=>L.add(We))}),f.flatMap(y=>y.status==="rejected"?[y.reason]:[])};if(Rs())try{let p=0;x=await Ns({purchases:m,buyer:n.address,signer:n.signer,identity:n.identity,onSigned:()=>F("settling",Math.min(p+1,N)),onBroadcast:({txHash:y,salts:Q})=>{p+=1,I.set(y,Q),Q.forEach(ie=>g.add(ie))},onGroupSettling:({settled:y})=>F("settling",y)});const f=await se(x);if(f.length&&!f.some(y=>y instanceof Ge))throw f[0];w=!0}catch(p){if(p instanceof Ge)throw await se([...I.keys()]),p;if(!(p instanceof Qs)||!Fa(n.providerType))throw p;x=await Ue({purchases:m,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:f})=>f.forEach(y=>g.add(y)),onSettled:({txHash:f,salts:y})=>{y.forEach(Q=>M.add(Q)),W.push(f)},onReverted:({salts:f})=>f.forEach(y=>L.add(y))})}else x=await Ue({purchases:m,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(f=>g.add(f)),onSettled:({txHash:p,salts:f})=>{f.forEach(y=>M.add(y)),W.push(p)},onReverted:({salts:p})=>p.forEach(f=>L.add(f))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"credits",no_crypto_step:w,transaction_hash:x[0]??null}),Bt(b);const ve=ue.current;ue.current=null,S(null),q(!1);const ne={items:o,txHash:x[0]??void 0,txHashes:x,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:ne,replace:!0})}catch(m){Ce(m)||re(m,{flow:"cart_checkout",step:v,cart_size:t.length});const z=new Set([...g].filter(x=>!L.has(x))),{toRelease:K,boughtItemIds:N}=Wt({reservations:u,spent:z,settled:M}),te=[...z].some(x=>!M.has(x)),F=c.filter(x=>N.includes(x.id)),C=c.filter(x=>!N.includes(x.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Tt(m),value_usd:St(C.reduce((x,I)=>x+I.priceCredits,0)),cart_size:s.length,partial:F.length>0}),K.length)try{await Ne(n.identity,K)}catch(x){re(x,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),F.length>0){N.forEach(x=>d(x)),D(null),Bt(b),V("Shop Completed Purchase",{...we(F),payment_type:"credits",no_crypto_step:w,transaction_hash:W[0]??null,partial:!0}),S({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:te}),q(!1);return}S({phase:"error",message:te?void 0:Ve(m),heldCredits:te})}}function ct(t,s){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const c=ue.current;ue.current=null,S(null),q(!1);const o={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...c?{creditsAdded:c}:{}};X("/success",{state:o,replace:!0})}function lt(t,s){Ce(t)||re(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Tt(t)}),S({phase:"error",message:Ve(t)}),q(!1)}async function ha(t,s,c){const o=It(Pt.MANAToken,s),u=It(Pt.CreditsManager,s);await Ws({auth:{kind:Fs.Allowance,contractAddress:o.address,spenderAddress:u.address,chainId:s},signer:t,requiredWei:c})}async function dt(){if(de)return de;try{return await b.fetchQuery({queryKey:["mana-rate",Mt.chainId],queryFn:()=>qa(Mt.chainId),staleTime:6e4})}catch{return}}async function pa(t){const s=Se(t).reduce((v,g)=>v+g.usdCents,0),o=(fe??0n)>0n?await dt():de,u=o?kt(s,o):0n;return{totalCents:s,manaWei:u}}async function ut(t,s){const c=Ye(t),{totalCents:o,manaWei:u}=await pa(t),v=Qe({priceCents:o,priceManaWei:u,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n});if(s&&v.options.some(g=>g.method===s)){if(s==="credits"){qe(t);return}const g=xt(v,s);await pt(ht(s,t),g,()=>s==="mana"?void ft(t,g):void mt(t,o,u));return}if(v.options.some(g=>g.method==="mana"||g.method==="combined")){S({phase:"choose",lines:t,totalCents:o,manaWei:u}),q(!1);return}if(j!=null&&j.credits<c){ot(t);return}qe(t)}function _e(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n})}const[he,be]=T.useState(null);function ht(t,s){const c=new Map;for(const o of s){const u=Is(t,He(o));c.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...c.values()]}async function pt(t,s,c){const o=[];for(const{spender:u,chainId:v}of t){const g=Bs(v,u),M=n?await qs(g,n.address,s).catch(()=>!0):!0;_s(n==null?void 0:n.providerType,M)&&o.push(g)}if(o.length===0){c();return}q(!1),gt(o,0,c)}function gt(t,s,c){be({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?gt(t,s+1,c):c()})}function xt(t,s){var c;return((c=t.options.find(o=>o.method===s))==null?void 0:c.manaWei)??0n}function ga(t){if((h==null?void 0:h.phase)!=="choose")return;const{lines:s,totalCents:c,manaWei:o}=h;if(t==="credits"){qe(s);return}const u=xt(_e(h),t);pt(ht(t,s),u,()=>t==="mana"?void ft(s,u):void mt(s,c,o))}async function ft(t,s){if(!n||t.length===0)return;const c=Se(t),o=c.map(g=>({...g.item,priceCredits:g.priceCredits})),u=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),v=()=>S({phase:"processing",stage:"settling",step:c.length,total:c.length});S({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});try{const g=await Ps({trades:ca(c),mints:oa(c),buyer:n.address,signer:n.signer,onSigned:v,manaWei:s});t.forEach(M=>d(M.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"mana",transaction_hash:g[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),ct(u,g)}catch(g){lt(g,"buy_cart_mana")}}async function mt(t,s,c){if(!n||t.length===0)return;const o=Se(t),u=o.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),g=As(o.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),M=[],L=new Set,W=new Set;S({phase:"processing",stage:"reserving",step:1,total:o.length});try{const w=o.map(He),m=[],z=new Map,K=new Map;for(let C=0;C<o.length;C++){const x=o[C],I=w[C],se=g[C],ve=zs(Math.max(0,x.usdCents-se),s,c);let ne;if(se<=0)ne=qt(I,[],"0");else{S({phase:"processing",stage:"reserving",step:C+1,total:o.length});const f=x.item,{credit:y,maxCreditedValue:Q}=await La(n.identity,se,I.kind==="trade"?I.trade.id:void 0,f.contractAddress&&f.itemId!=null?{contractAddress:f.contractAddress,itemId:String(f.itemId)}:void 0);M.push({salt:y.id,itemId:f.id}),ne=qt(I,[y],Q)}const p=_t(ne);z.set(p,(z.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(ne)}M.length&&b.invalidateQueries({queryKey:["usd-balance"]});for(const[C,x]of z){const I=K.get(C);I==null||x<=0n||(m[I]={...m[I],maxCreditedValue:(BigInt(m[I].maxCreditedValue)+x).toString()})}const N=[...z.values()].reduce((C,x)=>C+x,0n);await ha(n.signer,Es(w[0]),N);const te=()=>S({phase:"processing",stage:"settling",step:o.length,total:o.length});S({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});const F=await Ue({purchases:m,buyer:n.address,signer:n.signer,onSigned:te,onBroadcast:({salts:C})=>C.forEach(x=>L.add(x)),onReverted:({salts:C})=>C.forEach(x=>W.add(x))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(u),payment_type:"credits_and_mana",transaction_hash:F[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),ct(v,F)}catch(w){const{toRelease:m}=Wt({reservations:M,spent:new Set([...L].filter(z=>!W.has(z))),settled:new Set});m.length&&Ne(n.identity,m).catch(()=>{}),M.length&&b.invalidateQueries({queryKey:["usd-balance"]}),lt(w,"buy_cart_combined")}}async function Z(t){if(!n){Rt({type:"cart-checkout"}),G();return}const s=O.getState().items.filter(st);if(s.length===0)return;le(null),xe(null),q(!0);const c=s.reduce((o,u)=>o+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:c,cart_value_usd:St(c),has_sufficient_credits:me>=c});try{const o=await Hs(s,n.address,la,await dt(),da),u=[...o.unavailable,...o.own];if(u.length&&(u.forEach(v=>d(v.id)),xe(ni(o))),o.buyable.length===0){le(a("cart.error.noneAvailable")),D(null);return}if(o.orderChanged){D(o),et.current=Date.now();return}await ut(o.buyable,t)}catch(o){re(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),le(Ve(o))}finally{q(!1)}}async function yt(){if(_){if(!n){Rt({type:"cart-checkout"}),G();return}if(Date.now()-et.current>si){D(null),xe(null),await Z();return}le(null),ut(_.buyable)}}async function xa(){if(ze){try{sessionStorage.setItem(je,JSON.stringify(O.getState().items))}catch{}q(!0);try{const t=await Os(ze,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(je)}catch{}re(t,{flow:"cart_buy_credits"}),S({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const bt=T.useRef(!1);T.useEffect(()=>{if(!n||bt.current||!Ss("cart-checkout"))return;bt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const vt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||vt.current)return;vt.current=!0,ue.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const c=JSON.parse(s);Array.isArray(c)&&c.length&&U(c)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const wt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||wt.current)return;wt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const ee=ea||(h==null?void 0:h.phase)==="processing";return r.length===0&&!h?e.jsx(Lt,{children:e.jsxs(Nt,{children:[e.jsxs(Kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(bn,{children:e.jsx(Pa,{variant:"light",testId:"cart-empty",icon:Aa,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})}):e.jsxs(Lt,{children:[e.jsxs(Nt,{children:[e.jsxs(Kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(xn,{children:[e.jsxs(fn,{children:[e.jsxs(mn,{children:[e.jsx(vn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx(wn,{children:a("cart.panelTitle",{count:aa})}),Xt?e.jsxs(Cn,{onClick:()=>H(!0),disabled:ee,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(yn,{children:[e.jsx(jn,{children:r.map(t=>{const s=ia.get(t.id),c=s?s.priceCredits:t.priceCredits,o=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,v=t.quantity,g=typeof t.available=="number"&&v>=t.available,M=c*v,L=za(t),W=!!L&&!!A[L],w=Ea(t),m=at[t.id],z=!$t(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(kn,{"data-unavailable":z||void 0,children:[e.jsxs($n,{"data-thumb":!0,children:[w?e.jsx(Sn,{to:w,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Mn,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Tn,{children:[e.jsxs(In,{"data-desc":!0,children:[w?e.jsx(An,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Pn,{title:t.name,children:t.name}),t.creator?e.jsx(zn,{address:t.creator,linkToProfile:!0}):null,Jt&&u?e.jsxs(Nn,{"data-testid":"cart-creator-tag",children:[e.jsx(Qn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(En,{children:z?e.jsxs(Ln,{children:[e.jsx(Kn,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Rn,{children:[e.jsx(Qt,{onClick:()=>ye(()=>$(t.id)),disabled:ee||v<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(Bn,{children:v}),e.jsx(Qt,{onClick:()=>ye(()=>k(t.id)),disabled:ee||g,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(qn,{children:[e.jsx(_n,{})," ",e.jsx(Ke,{credits:M}),o?e.jsx(Wn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Fn,{children:[L?e.jsx(Un,{"data-on":W||void 0,onClick:()=>J(t),"aria-label":W?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:W?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:W?"heart-solid":"heart"})}):null,e.jsx(Gn,{onClick:()=>ye(()=>d(t.id)),disabled:ee,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Hn,{children:e.jsx("button",{className:"link",onClick:()=>ye(R),disabled:ee,children:a("cart.clearCart")})})]})]}),e.jsxs(On,{children:[e.jsx(Dn,{children:a("cart.purchaseSummary")}),e.jsxs(Vn,{children:[e.jsxs(Yn,{children:[e.jsx(Jn,{children:a("cart.totalItems",{count:sa})}),e.jsx(Zn,{children:e.jsxs(Xn,{children:[e.jsx(ei,{})," ",e.jsx(Ke,{credits:it})]})})]}),e.jsx(Ht,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:_?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:ee||nt,onPay:t=>void(_?yt():Z(t)),creditsFallback:{label:ee?a("cart.working"):_?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(_?yt():Z())}}),nt?e.jsx($e,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx($e,{className:"muted",children:a("cart.signInHint")}),_?e.jsx($e,{className:"muted",children:a("cart.priceChanged")}):null,Ze?e.jsx($e,{className:"muted",children:Ze}):null,e.jsx(ti,{message:Zt})]})]})]})]}),rt.length>0?e.jsx(ai,{children:e.jsx(Ms,{title:a("cart.youMightAlsoLike"),items:rt})}):null,he&&n?e.jsx(Ts,{auth:he.auth,signer:n.signer,step:{index:he.index,total:he.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Te,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=he;be(null),t()},onCancel:()=>be(null),onClose:()=>be(null)}):null,h?e.jsx(un,{phase:h.phase,balanceCredits:me,heldCreditsCount:((Ct=j==null?void 0:j.held)==null?void 0:Ct.credits)??null,onClose:ua,stage:h.phase==="processing"?h.stage:void 0,step:h.phase==="processing"?h.step:void 0,total:h.phase==="processing"?h.total:void 0,isSelfCustody:Ra(n==null?void 0:n.providerType),signatures:h.phase==="processing"?h.signatures:void 0,options:h.phase==="choose"?_e(h).options:void 0,shortfall:h.phase==="choose"?_e(h).manaShortfall:void 0,onPay:ga,totalCents:h.phase==="choose"?h.totalCents:void 0,totalManaWei:h.phase==="choose"?h.manaWei:void 0,totalCredits:h.phase==="choose"?Ye(h.lines):void 0,lines:h.phase==="nofunds"?h.lines:void 0,shortfallCredits:h.phase==="nofunds"?h.shortfall:void 0,packs:ge,selectedPack:ze,onSelectPack:tt,onBuyPacks:()=>void xa(),message:h.phase==="error"?h.message:void 0,heldCredits:h.phase==="error"&&!!h.heldCredits,onRetry:()=>void Z()}):null]})}export{bi as Cart};
748
- //# sourceMappingURL=Cart-6PT2o0XO.js.map
748
+ //# sourceMappingURL=Cart-CUPHFj39.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,r as h,d as te,b as oe}from"./react-BY3vVwvc.js";import{t as b,s as u,h as se,I as re,m as ae,b as r,Z as q,v as F,bC as ie,bD as ne,c as le,l as ce,n as de,ar as ue,L as me,S as W,M as pe,bE as fe,bR as he}from"./index-aVZCrQgK.js";import{E as xe}from"./ErrorNotice-4SblVCJ8.js";import{d as be,P as ge,C as ye,a as N,b as ve,S as je}from"./collectionPage.styles-CghU1BDG.js";import{u as we}from"./useStore-C8GZa7as.js";import{u as Ce,t as G,R as ke,j as Se,k as $e,l as Ee,m as Ne,n as Me,o as Fe,p as Ie,v as Re,q as Te,r as _e,M as Ae,s as Pe}from"./browseLayout.styles-CQilLRye.js";import{L as De}from"./LoadMore-BaRjyF39.js";import{u as Le}from"./useInfiniteGrid-B1PlvGpx.js";import{u as Be,s as ze}from"./search-empty-CjwjsYp3.js";import{S as Oe}from"./categories-DeaLeWRX.js";import{G as We}from"./grid.styles-BIwLaIPU.js";import"./dcl-schemas-DhyZEUTb.js";import"./sentry-DTXXLFvs.js";import"./ethers-ByWI-eMv.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-3JcIR00U.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="0b51f0a5-f416-4607-b62f-12653d11d4c8",s._sentryDebugIdIdentifier="sentry-dbid-0b51f0a5-f416-4607-b62f-12653d11d4c8")}catch{}})();const Ge=u.section`
1
+ import{j as e,r as h,d as te,b as oe}from"./react-DyPiTXWH.js";import{t as b,s as u,h as se,I as re,m as ae,b as r,Z as q,v as F,bC as ie,bD as ne,c as le,l as ce,n as de,ar as ue,L as me,S as W,M as pe,bE as fe,bR as he}from"./index-Ba6ZjOcU.js";import{E as xe}from"./ErrorNotice-AmLNAAkn.js";import{d as be,P as ge,C as ye,a as N,b as ve,S as je}from"./collectionPage.styles-CUZMIu19.js";import{u as we}from"./useStore-Dvc10vNY.js";import{u as Ce,t as G,R as ke,j as Se,k as $e,l as Ee,m as Ne,n as Me,o as Fe,p as Ie,v as Re,q as Te,r as _e,M as Ae,s as Pe}from"./browseLayout.styles-C3O3rJ6E.js";import{L as De}from"./LoadMore-DscEf3Fk.js";import{u as Le}from"./useInfiniteGrid-BKQ811RA.js";import{u as Be,s as ze}from"./search-empty-GvvlNANs.js";import{S as Oe}from"./categories-B1BKLZKW.js";import{G as We}from"./grid.styles-Bfq3tOD5.js";import"./dcl-schemas-BHtFmNb-.js";import"./sentry-wjuCVNXH.js";import"./ethers-DgOG59Su.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-DGb4Vags.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new s.Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="0b51f0a5-f416-4607-b62f-12653d11d4c8",s._sentryDebugIdIdentifier="sentry-dbid-0b51f0a5-f416-4607-b62f-12653d11d4c8")}catch{}})();const Ge=u.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -131,4 +131,4 @@ import{j as e,r as h,d as te,b as oe}from"./react-BY3vVwvc.js";import{t as b,s a
131
131
  background: ${j.blackBtn};
132
132
  }
133
133
  `;function it({address:s}){var d,n;const{data:o}=q(s);if(!s)return null;const i=(o==null?void 0:o.name)||F(s),l=(n=(d=o==null?void 0:o.avatar)==null?void 0:d.snapshots)==null?void 0:n.face256,a=`${le.profileUrl}/${s}`,m=ie(ne({name:o==null?void 0:o.name,hasClaimedName:o==null?void 0:o.hasClaimedName,ethAddress:(o==null?void 0:o.ethAddress)??s}));return e.jsxs(st,{"data-testid":"creator-card",children:[l?e.jsx(U,{src:l,alt:"",loading:"eager",style:{backgroundColor:m}}):e.jsx(U,{as:"span","aria-hidden":!0,style:{backgroundColor:m}}),e.jsx(rt,{title:i,children:i}),e.jsx(tt,{value:s,label:r("collection.copyAddress"),flow:"copy_creator_address",testId:"creator-card-copy",children:e.jsx("span",{children:F(s)})}),e.jsx(at,{"data-testid":"creator-card-view",href:a,target:"_blank",rel:"noopener noreferrer",children:r("collection.viewProfile")})]})}const nt=48,lt=["all","on_sale","not_for_sale"];function St(){var O;const{contractAddress:s}=te(),o=oe(),i=h.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[l,a]=Be(i),{category:m,subCategory:d,rarities:n,priceMin:x,priceMax:f,smart:C,sort:I}=l,g=lt.includes(l.status)?l.status:"all",R=t=>a({status:t});Ce(`${m}:${d??""}`);const[w,y]=h.useState(!1);h.useEffect(()=>{if(!w)return;const t=ee=>{ee.key==="Escape"&&y(!1)};document.addEventListener("keydown",t);const E=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=E}},[w]);const T=x&&!Number.isNaN(Number(x))?Number(x):void 0,_=f&&!Number.isNaN(Number(f))?Number(f):void 0,H=d?Oe[d]:void 0,K=(G.find(t=>t.key===I)??G[0]).server,A={contractAddress:s,category:m,rarities:n.length?n:void 0,wearableCategories:H,minPriceCredits:T,maxPriceCredits:_,isWearableSmart:C||void 0,isOnSale:g==="all"?void 0:g==="on_sale",sortBy:K},{items:k,total:Z,isLoading:S,error:P,hasNextPage:Q,isFetchingNextPage:D,isFetchNextPageError:V,fetchNextPage:J}=Le(["collection-page",A],t=>fe({...A,first:nt,skip:t}),{enabled:!!s}),{data:c}=ce({queryKey:["collection-meta",s],queryFn:()=>he(s),enabled:!!s,staleTime:5*6e4}),L=(c==null?void 0:c.name)||r("collection.fallbackTitle");de({title:c==null?void 0:c.name,description:c!=null&&c.name?r("seo.collection.description",{name:c.name}):void 0});const p=(c==null?void 0:c.creator)||((O=k[0])==null?void 0:O.creator),{data:$}=q(p),X=($==null?void 0:$.name)||(p?F(p):"");function Y(t){a({category:t,subCategory:null})}function B(t){a({rarities:n.includes(t)?n.filter(E=>E!==t):[...n,t]})}function z(){a(i)}const v=[];(T!=null||_!=null)&&v.push({key:"price",label:r("filter.price"),onRemove:()=>{a({priceMin:"",priceMax:""})}});for(const t of ke)n.includes(t)&&v.push({key:`rarity-${t}`,label:ue(t),onRemove:()=>B(t)});return C&&v.push({key:"smart",label:r("filter.smart"),onRemove:()=>a({smart:!1})}),g!=="all"&&v.push({key:"status",label:g==="on_sale"?r("filter.onSale"):r("filter.notForSale"),onRemove:()=>R("all")}),e.jsxs(ge,{"data-testid":"collection-page",children:[e.jsxs(ye,{"aria-label":r("collection.breadcrumbAria"),children:[e.jsx(N,{onClick:()=>o("/items"),children:r("collection.breadcrumb")}),p?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"/"}),e.jsx(N,{onClick:()=>o(`/items/creator/${p}`),children:X}),e.jsx("span",{children:"/"}),e.jsx(N,{onClick:()=>o(`/items/creator/${p}?collections`),children:r("categories.collections")})]}):null,e.jsx("span",{children:"/"}),e.jsx(ve,{children:L})]}),e.jsx(Ze,{name:L,creator:p}),e.jsxs(Se,{"data-testid":"browse",children:[w?e.jsx($e,{onClick:()=>y(!1),"aria-hidden":!0}):null,e.jsxs(je,{children:[e.jsx(it,{address:p}),e.jsxs(Ee,{"data-open":w||void 0,"data-static":!0,"data-testid":"browse-sidebar",children:[e.jsxs(Ne,{children:[e.jsx(Me,{children:r("assets.filters")}),e.jsx(Fe,{onClick:()=>y(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),e.jsx(Ie,{children:e.jsx(Re,{category:m,subCategory:d,onCategory:Y,onSub:t=>a({subCategory:t}),priceMin:x,priceMax:f,onPriceMin:t=>a({priceMin:t}),onPriceMax:t=>a({priceMax:t}),rarities:n,onToggleRarity:B,status:g,onStatus:R,smart:C,onSmart:t=>a({smart:t}),hideNames:!0})}),e.jsx(Te,{children:e.jsx(_e,{type:"button",onClick:()=>y(!1),children:r("assets.showItems")})})]})]}),e.jsxs(Ae,{children:[e.jsx(Pe,{sort:I,onSort:t=>a({sort:t}),total:Z,loading:S,onOpenFilters:()=>y(!0),chips:v,onClearChips:z}),P?e.jsx(xe,{message:r("collection.error")}):null,!S&&!P&&k.length===0?e.jsx(me,{testId:"collection-empty",icon:ze,title:r("assets.empty.title"),body:r("collection.empty"),cta:{label:r("filterBar.clearAll"),onClick:z}}):e.jsxs(e.Fragment,{children:[e.jsx(We,{"data-testid":"grid",children:S?e.jsx(W,{count:15}):e.jsxs(e.Fragment,{children:[k.map(t=>e.jsx(pe,{item:t},t.id)),D?e.jsx(W,{count:6}):null]})}),e.jsx(De,{hasNextPage:Q,isFetching:D,isError:V,onLoadMore:()=>void J()})]})]})]})]})}export{St as Collection,St as default};
134
- //# sourceMappingURL=Collection-DmKa8SBy.js.map
134
+ //# sourceMappingURL=Collection-BHRp_9DS.js.map
@@ -1,4 +1,4 @@
1
- import{r as C,j as s}from"./react-BY3vVwvc.js";import{s as ae,f as E,A as $,g as T,r as H,m as O,i as R,j as X}from"./authorizations-DxGdOyfi.js";import{i as ne}from"./errors-C7o97G4M.js";import{t as c,s as a,m as ie,b as k,I as U,h as z,aC as re,bG as L,c5 as oe,g as A,f as M,aH as K,W as se,X as G,q as S,an as de,c6 as ce,c7 as D,M as le}from"./index-aVZCrQgK.js";import{E as he}from"./ErrorNotice-4SblVCJ8.js";import{j as pe,k as ue,l as Q,m as ge,n as fe}from"./buy-wWHknAve.js";import{a as xe,w as me,S as be,G as we}from"./buy-gasless-IWvDnyE1.js";import{M as B,E as N,s as Z}from"./sendMetaTransaction-BojzaFVf.js";import{I as ve,C as J}from"./ethers-ByWI-eMv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="31e23663-1594-454a-80ee-5a80ef266172",t._sentryDebugIdIdentifier="sentry-dbid-31e23663-1594-454a-80ee-5a80ef266172")}catch{}})();const W="shop:resume_after_signin",ye=900*1e3;function ht(t){try{sessionStorage.setItem(W,JSON.stringify({...t,at:Date.now()}))}catch{}}function pt(t){let e;try{e=sessionStorage.getItem(W)}catch{return null}if(!e)return null;try{sessionStorage.removeItem(W)}catch{}let n;try{n=JSON.parse(e)}catch{return null}return!n||n.type!==t||typeof n.at!="number"||Date.now()-n.at>ye?null:n.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:n.path}}function ut(t,e){const n=(o,...l)=>void t.invalidateQueries({queryKey:e?[o,...l]:[o]});t.invalidateQueries({queryKey:["usd-balance"]}),t.invalidateQueries({queryKey:["detail-trade"]}),t.invalidateQueries({queryKey:["shop-item"]}),n("owned-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),n("public-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),n("item-resales",e==null?void 0:e.contractAddress,e==null?void 0:e.itemId),t.invalidateQueries({queryKey:["shop-items"]}),t.invalidateQueries({queryKey:["catalog-items"]}),t.invalidateQueries({queryKey:["overview-listings"]}),t.invalidateQueries({queryKey:["upsell-listings"]}),t.invalidateQueries({queryKey:["my-assets"]}),t.invalidateQueries({queryKey:["purchases"]}),t.invalidateQueries({queryKey:["owned-item-count"]})}const ke=ie`
1
+ import{r as C,j as s}from"./react-DyPiTXWH.js";import{s as ae,f as E,A as $,g as T,r as H,m as O,i as R,j as X}from"./authorizations-BYnIZF10.js";import{i as ne}from"./errors-C8Iz-trA.js";import{t as c,s as a,m as ie,b as k,I as U,h as z,aC as re,bG as L,c5 as oe,g as A,f as M,aH as K,W as se,X as G,q as S,an as de,c6 as ce,c7 as D,M as le}from"./index-Ba6ZjOcU.js";import{E as he}from"./ErrorNotice-AmLNAAkn.js";import{j as pe,k as ue,l as Q,m as ge,n as fe}from"./buy-Tscnuj8P.js";import{a as xe,w as me,S as be,G as we}from"./buy-gasless-C1ToktQG.js";import{M as B,E as N,s as Z}from"./sendMetaTransaction-DdKlulxU.js";import{I as ve,C as J}from"./ethers-DgOG59Su.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="174c9fec-5e16-4f4d-ac2f-622dcb1c9297",t._sentryDebugIdIdentifier="sentry-dbid-174c9fec-5e16-4f4d-ac2f-622dcb1c9297")}catch{}})();const W="shop:resume_after_signin",ye=900*1e3;function ht(t){try{sessionStorage.setItem(W,JSON.stringify({...t,at:Date.now()}))}catch{}}function pt(t){let e;try{e=sessionStorage.getItem(W)}catch{return null}if(!e)return null;try{sessionStorage.removeItem(W)}catch{}let n;try{n=JSON.parse(e)}catch{return null}return!n||n.type!==t||typeof n.at!="number"||Date.now()-n.at>ye?null:n.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:n.path}}function ut(t,e){const n=(o,...l)=>void t.invalidateQueries({queryKey:e?[o,...l]:[o]});t.invalidateQueries({queryKey:["usd-balance"]}),t.invalidateQueries({queryKey:["detail-trade"]}),t.invalidateQueries({queryKey:["shop-item"]}),n("owned-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),n("public-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),n("item-resales",e==null?void 0:e.contractAddress,e==null?void 0:e.itemId),t.invalidateQueries({queryKey:["shop-items"]}),t.invalidateQueries({queryKey:["catalog-items"]}),t.invalidateQueries({queryKey:["overview-listings"]}),t.invalidateQueries({queryKey:["upsell-listings"]}),t.invalidateQueries({queryKey:["my-assets"]}),t.invalidateQueries({queryKey:["purchases"]}),t.invalidateQueries({queryKey:["owned-item-count"]})}const ke=ie`
2
2
  to { transform: rotate(360deg); }
3
3
  `,Ce=a.div`
4
4
  position: fixed;
@@ -184,7 +184,7 @@ import{r as C,j as s}from"./react-BY3vVwvc.js";import{s as ae,f as E,A as $,g as
184
184
  @media (prefers-reduced-motion: reduce) {
185
185
  animation: none;
186
186
  }
187
- `;function gt({auth:t,signer:e,step:n,title:o,reason:l,name:h,image:g,icon:u,onAuthorized:v,onCancel:b,onClose:p}){const[f,m]=C.useState(!1),[r,w]=C.useState(null);async function x(){m(!0),w(null);try{await ae({auth:t,signer:e,active:!0}),v()}catch(d){ne(d)?w(k("authorizeStep.errorRejected")):(z(d,{flow:"authorize_step",kind:t.kind}),w(k("authorizeStep.errorGeneric"))),m(!1)}}return s.jsx(Ce,{onClick:f?void 0:p,role:"presentation","data-testid":"authorize-step-scrim",children:s.jsxs(Ae,{onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":o,children:[s.jsxs(Me,{children:[s.jsx(Te,{children:o}),n&&n.total>1?s.jsx(ze,{"data-testid":"authorize-step-count",children:k("authorizeStep.stepOf",{index:n.index,total:n.total})}):null,s.jsx(je,{onClick:p,disabled:f,"aria-label":k("authorizeStep.close"),children:s.jsx(U,{name:"close",className:"ico"})})]}),s.jsxs(Ie,{"data-testid":"authorize-step-row",children:[s.jsx(We,{children:g?s.jsx("img",{src:g,alt:""}):u}),s.jsxs(Ee,{children:[s.jsx($e,{title:h,children:h}),s.jsx(Se,{children:l})]})]}),s.jsx(Be,{children:k("authorizeStep.note")}),s.jsx(he,{message:r}),s.jsxs(Ne,{children:[s.jsx(Pe,{type:"button",onClick:b,disabled:f,children:k("authorizeStep.cancel")}),s.jsx(Fe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void x(),disabled:f,children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ve,{"aria-hidden":!0}),k("authorizeStep.authorizing")]}):k("authorizeStep.authorize")})]})]})})}const ft="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",xt="data:image/webp;base64,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",mt="https://cdn.decentraland.org/@dcl/shop/1.11.3-33155570552.commit-80e7685/_assets/buy-error-22UunaPC.png";function Le(t,e){return(t+e-1n)/e}function De(t,e,n){return t<=0||e<=0?0n:t>=e?n:Le(n*BigInt(t),BigInt(e))}function bt(t){var p,f,m;const e=Number.isFinite(t.priceCents)?Math.max(0,Math.trunc(t.priceCents)):0,n=Number.isFinite(t.balanceCents)?Math.max(0,Math.trunc(t.balanceCents)):0,o=t.priceManaWei>0n?t.priceManaWei:0n,l=t.manaBalanceWei>0n?t.manaBalanceWei:0n;if(e<=0)return{options:[],preferred:null,manaShortfall:null};const h=[];n>=e&&h.push({method:"credits",creditsCents:e,credits:re(e),manaWei:0n});const g=L(n)*oe;if(o>0n&&g>0&&g<e){const r=e-g,w=De(r,e,o);l>=w&&h.push({method:"combined",creditsCents:g,credits:L(g),manaWei:w})}o>0n&&l>=o&&h.push({method:"mana",creditsCents:0,credits:0,manaWei:o});const u=((p=h.find(r=>r.method==="credits"))==null?void 0:p.method)??((f=h.find(r=>r.method==="combined"))==null?void 0:f.method)??((m=h.find(r=>r.method==="mana"))==null?void 0:m.method)??null,b=!h.some(r=>r.method==="mana"||r.method==="combined")&&o>0n&&l>0n?{manaWei:l,manaCents:qe(l,e,o),priceCents:e}:null;return{options:h,preferred:u,manaShortfall:b}}function qe(t,e,n){return Number(t*BigInt(e)/n)}function wt(t,e){let n=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return t.map(o=>{const l=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,h=Math.min(l,n);return n-=h,h})}function vt(t,e){return t.options.find(n=>n.method===e)??null}async function yt(t){const[e]=await Y({...t,trades:[t.trade]});return e}async function kt(t){const[e]=await Y({...t,trades:[],mints:[t.mint]});return e}async function Y(t){const{trades:e,mints:n=[],buyer:o,signer:l,onSigned:h,manaWei:g}=t;if(e.length===0&&n.length===0)throw new Error("No items to buy");const u=new Map;for(const p of e){const f=`${p.chainId}:${p.contract.toLowerCase()}`,m=u.get(f);m?m.push(p):u.set(f,[p])}const v=new Map;for(const p of n){const f=v.get(p.chainId);f?f.push(p):v.set(p.chainId,[p])}const b=[];for(const p of u.values())b.push(await He({trades:p,buyer:o,signer:l,onSigned:h,requiredManaWei:g}));for(const[p,f]of v){const m=g??f.reduce((r,w)=>r+BigInt(w.item.priceWei),0n);b.push(await Oe({mints:f,chainId:p,buyer:o,signer:l,onSigned:h,requiredManaWei:m}))}return b}async function He(t){const{trades:e,buyer:n,signer:o,onSigned:l,requiredManaWei:h}=t,g=e[0],u=A(K(g.contract),g.chainId),v=A(M.MANAToken,g.chainId);await E({auth:{kind:$.Allowance,contractAddress:v.address,spenderAddress:u.address,chainId:g.chainId},signer:o,requiredWei:h});const b=e.map(r=>ue(r,n));if(T.enabled)try{const r=new ve(u.abi).encodeFunctionData("accept",[b]),w=H(),x=O(o.provider,w),d=await Z(x,w,r,u,{serverURL:T.relayerUrl});return l==null||l(),await R(d,"the MANA purchase"),d}catch(r){if(r instanceof B&&r.code===N.USER_DENIED||r instanceof X)throw r;z(r,{flow:"buy_mana",step:"gasless_fallback"})}await G(o.provider,g.chainId);const f=await new J(u.address,u.abi,o).accept(b,Q(g.chainId));return l==null||l(),(await f.wait()).transactionHash}async function Oe(t){const{mints:e,chainId:n,buyer:o,signer:l,onSigned:h,requiredManaWei:g}=t,u=A(M.CollectionStore,n),v=A(M.MANAToken,n),b=e.map(r=>r.item);if(await E({auth:{kind:$.Allowance,contractAddress:v.address,spenderAddress:u.address,chainId:n},signer:l,requiredWei:g}),T.enabled)try{const r=ge(b,o,u.abi),w=H(),x=O(l.provider,w),d=await Z(x,w,r,u,{serverURL:T.relayerUrl});return h==null||h(),await R(d,"the MANA purchase"),d}catch(r){if(r instanceof B&&r.code===N.USER_DENIED||r instanceof X)throw r;z(r,{flow:"buy_mint_mana",step:"gasless_fallback"})}await G(l.provider,n);const f=await new J(u.address,u.abi,l).buy(fe(b,o),Q(n));return h==null||h(),(await f.wait()).transactionHash}async function Ct(t){const{trade:e,...n}=t;return _({target:{kind:"trade",trade:e},...n})}async function At(t){const{mint:e,...n}=t;return _({target:{kind:"store",mint:e},...n})}async function _(t){const{target:e,buyer:n,signer:o,credits:l,manaGapWei:h,providerType:g,onBroadcast:u,onReverted:v,onUnobservable:b}=t;if(l.length===0)throw new Error("No credits to spend — use the MANA-only rail for that");if(h<=0n)throw new Error("No MANA gap to cover — use the credits-only rail for that");const p=ee(e),f=A(M.MANAToken,p),m=A(M.CreditsManager,p);await E({auth:{kind:$.Allowance,contractAddress:f.address,spenderAddress:m.address,chainId:p},signer:o,requiredWei:h});const w=(l.reduce((d,y)=>d+BigInt(y.availableAmount),0n)+h).toString(),x=Re(e,l,w);if(T.enabled){let d;try{return d=await xe({purchase:x,buyer:n,signer:o}),u==null||u({txHash:d}),await me(d),d}catch(y){if(y instanceof B&&y.code===N.USER_DENIED||y instanceof be)throw y;if(!(y instanceof we))throw d&&(v==null||v({txHash:d})),y;if(y.reason==="relayer-unreachable")throw b==null||b(),y;if(!se(g))throw y;z(y,{flow:"buy_credits_and_mana",step:"gasless_fallback"})}}return pe({purchase:x,buyer:n,signer:o,onBroadcast:u,onReverted:v})}function ee(t){return t.kind==="trade"?t.trade.chainId:t.mint.chainId}function Re(t,e,n){return t.kind==="trade"?{kind:"trade",trade:t.trade,credits:e,maxCreditedValue:n}:{kind:"store",item:t.mint.item,chainId:t.mint.chainId,credits:e,maxCreditedValue:n}}function Mt(t,e){const n=ee(e);return t==="combined"?{spender:A(M.CreditsManager,n).address,chainId:n}:{spender:e.kind==="trade"?A(K(e.trade.contract),n).address:A(M.CollectionStore,n).address,chainId:n}}function Tt(t){return s.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...t,children:s.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function jt(t){return s.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...t,children:s.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:i,gradients:P,radius:te,z:Xe}=c,zt=a.div`
187
+ `;function gt({auth:t,signer:e,step:n,title:o,reason:l,name:h,image:g,icon:u,onAuthorized:v,onCancel:b,onClose:p}){const[f,m]=C.useState(!1),[r,w]=C.useState(null);async function x(){m(!0),w(null);try{await ae({auth:t,signer:e,active:!0}),v()}catch(d){ne(d)?w(k("authorizeStep.errorRejected")):(z(d,{flow:"authorize_step",kind:t.kind}),w(k("authorizeStep.errorGeneric"))),m(!1)}}return s.jsx(Ce,{onClick:f?void 0:p,role:"presentation","data-testid":"authorize-step-scrim",children:s.jsxs(Ae,{onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":o,children:[s.jsxs(Me,{children:[s.jsx(Te,{children:o}),n&&n.total>1?s.jsx(ze,{"data-testid":"authorize-step-count",children:k("authorizeStep.stepOf",{index:n.index,total:n.total})}):null,s.jsx(je,{onClick:p,disabled:f,"aria-label":k("authorizeStep.close"),children:s.jsx(U,{name:"close",className:"ico"})})]}),s.jsxs(Ie,{"data-testid":"authorize-step-row",children:[s.jsx(We,{children:g?s.jsx("img",{src:g,alt:""}):u}),s.jsxs(Ee,{children:[s.jsx($e,{title:h,children:h}),s.jsx(Se,{children:l})]})]}),s.jsx(Be,{children:k("authorizeStep.note")}),s.jsx(he,{message:r}),s.jsxs(Ne,{children:[s.jsx(Pe,{type:"button",onClick:b,disabled:f,children:k("authorizeStep.cancel")}),s.jsx(Fe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void x(),disabled:f,children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ve,{"aria-hidden":!0}),k("authorizeStep.authorizing")]}):k("authorizeStep.authorize")})]})]})})}const ft="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",xt="data:image/webp;base64,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",mt="https://cdn.decentraland.org/@dcl/shop/1.11.3/_assets/buy-error-22UunaPC.png";function Le(t,e){return(t+e-1n)/e}function De(t,e,n){return t<=0||e<=0?0n:t>=e?n:Le(n*BigInt(t),BigInt(e))}function bt(t){var p,f,m;const e=Number.isFinite(t.priceCents)?Math.max(0,Math.trunc(t.priceCents)):0,n=Number.isFinite(t.balanceCents)?Math.max(0,Math.trunc(t.balanceCents)):0,o=t.priceManaWei>0n?t.priceManaWei:0n,l=t.manaBalanceWei>0n?t.manaBalanceWei:0n;if(e<=0)return{options:[],preferred:null,manaShortfall:null};const h=[];n>=e&&h.push({method:"credits",creditsCents:e,credits:re(e),manaWei:0n});const g=L(n)*oe;if(o>0n&&g>0&&g<e){const r=e-g,w=De(r,e,o);l>=w&&h.push({method:"combined",creditsCents:g,credits:L(g),manaWei:w})}o>0n&&l>=o&&h.push({method:"mana",creditsCents:0,credits:0,manaWei:o});const u=((p=h.find(r=>r.method==="credits"))==null?void 0:p.method)??((f=h.find(r=>r.method==="combined"))==null?void 0:f.method)??((m=h.find(r=>r.method==="mana"))==null?void 0:m.method)??null,b=!h.some(r=>r.method==="mana"||r.method==="combined")&&o>0n&&l>0n?{manaWei:l,manaCents:qe(l,e,o),priceCents:e}:null;return{options:h,preferred:u,manaShortfall:b}}function qe(t,e,n){return Number(t*BigInt(e)/n)}function wt(t,e){let n=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return t.map(o=>{const l=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,h=Math.min(l,n);return n-=h,h})}function vt(t,e){return t.options.find(n=>n.method===e)??null}async function yt(t){const[e]=await Y({...t,trades:[t.trade]});return e}async function kt(t){const[e]=await Y({...t,trades:[],mints:[t.mint]});return e}async function Y(t){const{trades:e,mints:n=[],buyer:o,signer:l,onSigned:h,manaWei:g}=t;if(e.length===0&&n.length===0)throw new Error("No items to buy");const u=new Map;for(const p of e){const f=`${p.chainId}:${p.contract.toLowerCase()}`,m=u.get(f);m?m.push(p):u.set(f,[p])}const v=new Map;for(const p of n){const f=v.get(p.chainId);f?f.push(p):v.set(p.chainId,[p])}const b=[];for(const p of u.values())b.push(await He({trades:p,buyer:o,signer:l,onSigned:h,requiredManaWei:g}));for(const[p,f]of v){const m=g??f.reduce((r,w)=>r+BigInt(w.item.priceWei),0n);b.push(await Oe({mints:f,chainId:p,buyer:o,signer:l,onSigned:h,requiredManaWei:m}))}return b}async function He(t){const{trades:e,buyer:n,signer:o,onSigned:l,requiredManaWei:h}=t,g=e[0],u=A(K(g.contract),g.chainId),v=A(M.MANAToken,g.chainId);await E({auth:{kind:$.Allowance,contractAddress:v.address,spenderAddress:u.address,chainId:g.chainId},signer:o,requiredWei:h});const b=e.map(r=>ue(r,n));if(T.enabled)try{const r=new ve(u.abi).encodeFunctionData("accept",[b]),w=H(),x=O(o.provider,w),d=await Z(x,w,r,u,{serverURL:T.relayerUrl});return l==null||l(),await R(d,"the MANA purchase"),d}catch(r){if(r instanceof B&&r.code===N.USER_DENIED||r instanceof X)throw r;z(r,{flow:"buy_mana",step:"gasless_fallback"})}await G(o.provider,g.chainId);const f=await new J(u.address,u.abi,o).accept(b,Q(g.chainId));return l==null||l(),(await f.wait()).transactionHash}async function Oe(t){const{mints:e,chainId:n,buyer:o,signer:l,onSigned:h,requiredManaWei:g}=t,u=A(M.CollectionStore,n),v=A(M.MANAToken,n),b=e.map(r=>r.item);if(await E({auth:{kind:$.Allowance,contractAddress:v.address,spenderAddress:u.address,chainId:n},signer:l,requiredWei:g}),T.enabled)try{const r=ge(b,o,u.abi),w=H(),x=O(l.provider,w),d=await Z(x,w,r,u,{serverURL:T.relayerUrl});return h==null||h(),await R(d,"the MANA purchase"),d}catch(r){if(r instanceof B&&r.code===N.USER_DENIED||r instanceof X)throw r;z(r,{flow:"buy_mint_mana",step:"gasless_fallback"})}await G(l.provider,n);const f=await new J(u.address,u.abi,l).buy(fe(b,o),Q(n));return h==null||h(),(await f.wait()).transactionHash}async function Ct(t){const{trade:e,...n}=t;return _({target:{kind:"trade",trade:e},...n})}async function At(t){const{mint:e,...n}=t;return _({target:{kind:"store",mint:e},...n})}async function _(t){const{target:e,buyer:n,signer:o,credits:l,manaGapWei:h,providerType:g,onBroadcast:u,onReverted:v,onUnobservable:b}=t;if(l.length===0)throw new Error("No credits to spend — use the MANA-only rail for that");if(h<=0n)throw new Error("No MANA gap to cover — use the credits-only rail for that");const p=ee(e),f=A(M.MANAToken,p),m=A(M.CreditsManager,p);await E({auth:{kind:$.Allowance,contractAddress:f.address,spenderAddress:m.address,chainId:p},signer:o,requiredWei:h});const w=(l.reduce((d,y)=>d+BigInt(y.availableAmount),0n)+h).toString(),x=Re(e,l,w);if(T.enabled){let d;try{return d=await xe({purchase:x,buyer:n,signer:o}),u==null||u({txHash:d}),await me(d),d}catch(y){if(y instanceof B&&y.code===N.USER_DENIED||y instanceof be)throw y;if(!(y instanceof we))throw d&&(v==null||v({txHash:d})),y;if(y.reason==="relayer-unreachable")throw b==null||b(),y;if(!se(g))throw y;z(y,{flow:"buy_credits_and_mana",step:"gasless_fallback"})}}return pe({purchase:x,buyer:n,signer:o,onBroadcast:u,onReverted:v})}function ee(t){return t.kind==="trade"?t.trade.chainId:t.mint.chainId}function Re(t,e,n){return t.kind==="trade"?{kind:"trade",trade:t.trade,credits:e,maxCreditedValue:n}:{kind:"store",item:t.mint.item,chainId:t.mint.chainId,credits:e,maxCreditedValue:n}}function Mt(t,e){const n=ee(e);return t==="combined"?{spender:A(M.CreditsManager,n).address,chainId:n}:{spender:e.kind==="trade"?A(K(e.trade.contract),n).address:A(M.CollectionStore,n).address,chainId:n}}function Tt(t){return s.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...t,children:s.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function jt(t){return s.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...t,children:s.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:i,gradients:P,radius:te,z:Xe}=c,zt=a.div`
188
188
  position: fixed;
189
189
  inset: 0;
190
190
  z-index: ${Xe.overlay};
@@ -848,4 +848,4 @@ import{r as C,j as s}from"./react-BY3vVwvc.js";import{s as ae,f as E,A as $,g as
848
848
  transform: scale(1.1);
849
849
  }
850
850
  `;function xa({title:t,items:e,onViewAll:n}){const o=C.useRef(null),[l,h]=C.useState(1),[g,u]=C.useState(0),[v,b]=C.useState(!0),[p,f]=C.useState(!1),m=C.useCallback(()=>{const x=o.current;if(!x)return;const{scrollLeft:d,scrollWidth:y,clientWidth:I}=x,V=Math.max(1,Math.ceil(y/I));h(V),u(Math.min(V-1,Math.round(d/I))),b(d<=1),f(d+I>=y-1)},[]);if(C.useEffect(()=>{m();const x=o.current;if(x)return x.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),()=>{x.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m,e.length]),e.length===0)return null;function r(x){const d=o.current;d&&d.scrollBy({left:x*d.clientWidth,behavior:"smooth"})}function w(x){const d=o.current;d&&d.scrollTo({left:x*d.clientWidth,behavior:"smooth"})}return s.jsxs(Ke,{"data-testid":"carousel",children:[s.jsxs(Ge,{children:[s.jsx(Qe,{children:t}),n?s.jsxs(Ze,{onClick:n,children:[k("collectionCarousel.viewAll"),s.jsx(Je,{name:"chevron-down",size:16})]}):null]}),s.jsxs(Ye,{children:[s.jsx(q,{"data-side":"left",onClick:()=>r(-1),"aria-label":k("collectionCarousel.scrollLeft"),disabled:v,children:s.jsx("img",{src:D,alt:"","aria-hidden":!0})}),s.jsx(_e,{ref:o,children:e.map(x=>s.jsx(le,{item:x},x.id))}),s.jsx(q,{"data-side":"right",onClick:()=>r(1),"aria-label":k("collectionCarousel.scrollRight"),disabled:p,children:s.jsx("img",{src:D,alt:"","aria-hidden":!0})})]}),l>1?s.jsx(et,{"aria-label":k("collectionCarousel.pages"),children:Array.from({length:l}).map((x,d)=>s.jsx(tt,{"data-active":d===g||void 0,"aria-label":k("collectionCarousel.goToPage",{page:d+1}),"aria-current":d===g?"true":void 0,onClick:()=>w(d)},d))}):null]})}export{wt as $,Dt as A,Nt as B,Wt as C,Yt as D,xt as E,_t as F,ea as G,Et as H,ta as I,aa as J,na as K,sa as L,zt as M,ia as N,bt as O,ha as P,pt as Q,xa as R,It as S,St as T,gt as U,ht as V,Kt as W,Bt as X,ut as Y,Mt as Z,Y as _,$t as a,De as a0,Re as a1,ee as a2,ga as a3,fa as a4,oa as a5,vt as a6,yt as a7,kt as a8,Ct as a9,At as aa,Tt as b,Pt as c,Ft as d,Vt as e,Lt as f,da as g,ca as h,mt as i,la as j,ra as k,Ue as l,ft as m,pa as n,ua as o,jt as p,Gt as q,Qt as r,qt as s,Ht as t,Ot as u,Rt as v,Xt as w,Ut as x,Zt as y,Jt as z};
851
- //# sourceMappingURL=CollectionCarousel-xKmRjdjJ.js.map
851
+ //# sourceMappingURL=CollectionCarousel-7w9vcOQY.js.map
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es--QATjUsF.js","_assets/react-BY3vVwvc.js"])))=>i.map(i=>d[i]);
2
- import{s as a,_ as s}from"./index-aVZCrQgK.js";import{r as n,j as i}from"./react-BY3vVwvc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6fa02be9-33fb-4ba3-9237-36b1dcd4bb39",e._sentryDebugIdIdentifier="sentry-dbid-6fa02be9-33fb-4ba3-9237-36b1dcd4bb39")}catch{}})();const o=a.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-CX2yBV9N.js","_assets/react-DyPiTXWH.js"])))=>i.map(i=>d[i]);
2
+ import{s as a,_ as s}from"./index-Ba6ZjOcU.js";import{r as n,j as i}from"./react-DyPiTXWH.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6fa02be9-33fb-4ba3-9237-36b1dcd4bb39",e._sentryDebugIdIdentifier="sentry-dbid-6fa02be9-33fb-4ba3-9237-36b1dcd4bb39")}catch{}})();const o=a.div`
3
3
  position: fixed;
4
4
  inset: 0;
5
5
  /**
@@ -14,5 +14,5 @@ import{s as a,_ as s}from"./index-aVZCrQgK.js";import{r as n,j as i}from"./react
14
14
  */
15
15
  z-index: -1;
16
16
  pointer-events: none;
17
- `,r=n.lazy(async()=>{const[{default:e},{default:t}]=await Promise.all([s(()=>import("./index.es--QATjUsF.js"),__vite__mapDeps([0,1])),s(()=>import("./confettiAnimation-Btd6HRFo.js"),[])]);return{default:()=>i.jsx(e,{animationData:t,loop:1})}});function u(){const[e]=n.useState(()=>{var t;return!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)});return e?i.jsx(o,{"aria-hidden":!0,"data-testid":"confetti",children:i.jsx(n.Suspense,{fallback:null,children:i.jsx(r,{})})}):null}export{u as C};
18
- //# sourceMappingURL=Confetti-Z8v6OTnK.js.map
17
+ `,r=n.lazy(async()=>{const[{default:e},{default:t}]=await Promise.all([s(()=>import("./index.es-CX2yBV9N.js"),__vite__mapDeps([0,1])),s(()=>import("./confettiAnimation-Btd6HRFo.js"),[])]);return{default:()=>i.jsx(e,{animationData:t,loop:1})}});function u(){const[e]=n.useState(()=>{var t;return!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)});return e?i.jsx(o,{"aria-hidden":!0,"data-testid":"confetti",children:i.jsx(n.Suspense,{fallback:null,children:i.jsx(r,{})})}):null}export{u as C};
18
+ //# sourceMappingURL=Confetti-CYh3a_SI.js.map
@@ -1,2 +1,2 @@
1
- import{p as o}from"./sentry-DTXXLFvs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="212e6b2b-00bf-4961-b68b-1d32c6f901a6",e._sentryDebugIdIdentifier="sentry-dbid-212e6b2b-00bf-4961-b68b-1d32c6f901a6")}catch{}})();var n={};const r={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof o<"u"&&typeof n<"u"?n.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{r as C};
2
- //# sourceMappingURL=ConstantsUtil-BPwpv-BJ.js.map
1
+ import{p as o}from"./sentry-wjuCVNXH.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="212e6b2b-00bf-4961-b68b-1d32c6f901a6",e._sentryDebugIdIdentifier="sentry-dbid-212e6b2b-00bf-4961-b68b-1d32c6f901a6")}catch{}})();var n={};const r={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof o<"u"&&typeof n<"u"?n.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{r as C};
2
+ //# sourceMappingURL=ConstantsUtil-DblXIgum.js.map