@dcl/shop 1.17.1-36149310418.commit-795ca33 → 1.17.2-36152359068.commit-47bab5a

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 (249) hide show
  1. package/_assets/{Activity-zYnvta6q.js → Activity-B-tcMJAJ.js} +11 -11
  2. package/_assets/{AnimatedBackground-BWb1WzHF.js → AnimatedBackground-DK3QLOJ2.js} +3 -3
  3. package/_assets/{Assets-BjBHmuPJ.js → Assets-Dn9STriB.js} +7 -7
  4. package/_assets/{Cart-Cy1wJUG-.js → Cart-CII8Xe0D.js} +5 -5
  5. package/_assets/{Collection-C8AK8IBc.js → Collection-B5VerJez.js} +7 -7
  6. package/_assets/{CollectionCarousel-CgH1kned.js → CollectionCarousel-UPeRXz9b.js} +7 -7
  7. package/_assets/{Confetti-C3sqBKSh.js → Confetti-Cw8f6Wn9.js} +4 -4
  8. package/_assets/{ConstantsUtil-DAm53sky.js → ConstantsUtil-BMmlkMBY.js} +2 -2
  9. package/_assets/{ContentClient-BxniuesS.js → ContentClient-WoaFsbEW.js} +2 -2
  10. package/_assets/{Creator-C0Iq-dFP.js → Creator-DFNZWETP.js} +7 -7
  11. package/_assets/{CreditPackPicker-Gbn87yeA.js → CreditPackPicker-BqGavVgR.js} +2 -2
  12. package/_assets/{CreditRate-C9kSg0Qj.js → CreditRate-vLOKKh_P.js} +6 -6
  13. package/_assets/{DeploymentBuilder-D5wD8be7.js → DeploymentBuilder-CWlRoHld.js} +2 -2
  14. package/_assets/{EmotePlaybackBar-D9L_roG8.js → EmotePlaybackBar-q13HrLFU.js} +3 -3
  15. package/_assets/{ErrorNotice-Ba9jMEfx.js → ErrorNotice-CbW4Q2ZV.js} +2 -2
  16. package/_assets/{Event-CTzjTjHA.js → Event-X3zYhRwD.js} +2 -2
  17. package/_assets/{ExchangeController-DBLGG35J.js → ExchangeController-cIXkyf4H.js} +2 -2
  18. package/_assets/{Faq-BJ9-fDIA.js → Faq-iPufE4Ki.js} +2 -2
  19. package/_assets/{Filters-Do-OHwbY.js → Filters-rmYRG9Xu.js} +2 -2
  20. package/_assets/{GetCredits-DfIomWgI.js → GetCredits-CwEq6zsX.js} +2 -2
  21. package/_assets/{Grow-Ds_xGNde.js → Grow-BuqjElXH.js} +2 -2
  22. package/_assets/{HelpersUtil-DisM6Bvv.js → HelpersUtil-CS8EBJH9.js} +2 -2
  23. package/_assets/IssueModal-C8pY_CjA.js +323 -0
  24. package/_assets/ItemDetail-BcjDWr54.js +3090 -0
  25. package/_assets/{LoadMore-BfyG6-zU.js → LoadMore-BOdt5RfM.js} +2 -2
  26. package/_assets/{ManaPricingBanner-BWYPz0SO.js → ManaPricingBanner-CaOs1iNT.js} +2 -2
  27. package/_assets/{ManaPricingBanner.styles-DcahwkXY.js → ManaPricingBanner.styles-DLFrScDr.js} +2 -2
  28. package/_assets/{MyAssets-Deh9-ZRV.js → MyAssets-C5JLt3AZ.js} +2 -2
  29. package/_assets/{MyFavorites-Dgg8gCfc.js → MyFavorites-BUNoJkIc.js} +10 -10
  30. package/_assets/MyStore-D-R3YVGj.js +1691 -0
  31. package/_assets/{NetworkUtil-mlxWBSoO.js → NetworkUtil-r4ZB1Agx.js} +2 -2
  32. package/_assets/{NotFound-DqYdAYxd.js → NotFound-BlzZI2Ql.js} +2 -2
  33. package/_assets/NotificationsBell-vli38TDJ.js +142 -0
  34. package/_assets/{OutfitDetail-CSBQqO3h.js → OutfitDetail-1jGClsB_.js} +3 -3
  35. package/_assets/{OutfitPreview-Be4BQeSH.js → OutfitPreview-VgWQZ9ov.js} +3 -3
  36. package/_assets/{OutfitStudio-CKn2JNtR.js → OutfitStudio-BkgXlCW4.js} +10 -10
  37. package/_assets/{PaymentMethodStep-Bv6piNxs.js → PaymentMethodStep-BDIZKceq.js} +2 -2
  38. package/_assets/{SaleCountdown-DJCIEJrN.js → SaleCountdown-BT87OARJ.js} +2 -2
  39. package/_assets/{Spinner-D7_mSArb.js → Spinner-BZ99cc63.js} +2 -2
  40. package/_assets/{StoreSettings-B1wgao-4.js → StoreSettings-Di1kFuez.js} +8 -8
  41. package/_assets/{Success-BCOKQoCK.js → Success-mbqlFMRP.js} +2 -2
  42. package/_assets/{SwapController-i7LQHy-J.js → SwapController-Bv1KjKr6.js} +2 -2
  43. package/_assets/{Tooltip-C4G_m6-a.js → Tooltip-BqY8lGhV.js} +2 -2
  44. package/_assets/{TradeService-BsyblGFO.js → TradeService-BSb4oEbA.js} +2 -2
  45. package/_assets/{W3MFrameProviderSingleton-DLSJ3ko3.js → W3MFrameProviderSingleton-C3uUAOnI.js} +4 -4
  46. package/_assets/{WebCryptoP256-vs8MB8xV.js → WebCryptoP256-ChnBIYNz.js} +2 -2
  47. package/_assets/{basic-C8kWPlxB.js → basic-Dc-yAZgS.js} +2 -2
  48. package/_assets/{biconomy-DawwY6nO.js → biconomy-Ch2E1lll.js} +2 -2
  49. package/_assets/{browseLayout.styles-DRypk6r3.js → browseLayout.styles-BKTAmYSq.js} +2 -2
  50. package/_assets/{browser-B-SUxiIy.js → browser-CKALJXh2.js} +2 -2
  51. package/_assets/{browser-ponyfill-BphkmcBw.js → browser-ponyfill-CmmcfAMi.js} +2 -2
  52. package/_assets/{browser-w-qjQnx1.js → browser-tP08e2Rq.js} +2 -2
  53. package/_assets/{buy-Blp8fB9D.js → buy-RnCuARVP.js} +2 -2
  54. package/_assets/{buy-gasless-Dx9azM4y.js → buy-gasless-COdNSlBG.js} +2 -2
  55. package/_assets/{ccip-D1pPxz01.js → ccip-D181-o00.js} +2 -2
  56. package/_assets/{ccip-Dd7A9S8A.js → ccip-nOGc-ELR.js} +2 -2
  57. package/_assets/{chains-BHmCK0ek.js → chains-luYqMGzb.js} +2 -2
  58. package/_assets/{collectionPage.styles-WKjZb_Br.js → collectionPage.styles-D9hflc85.js} +2 -2
  59. package/_assets/{common-Cqi3lLq_.js → common-lEsyNCa8.js} +2 -2
  60. package/_assets/{controller-Dw4-woVF.js → controller-D3EAwj-f.js} +3 -3
  61. package/_assets/{core-CDYn9zJw.js → core-BU0HPg4r.js} +5 -5
  62. package/_assets/{createSvgIcon-CYH_BXUh.js → createSvgIcon-DObsJOah.js} +2 -2
  63. package/_assets/{crumbs.styles-LNbHaiVG.js → crumbs.styles-C5oFtMBh.js} +2 -2
  64. package/_assets/{custom-BVcfsuZ9.js → custom-DIXVsLc6.js} +2 -2
  65. package/_assets/{data-capture-BaMQ-ZPd.js → data-capture-CZGhq5a0.js} +2 -2
  66. package/_assets/{dcl-schemas-FrMtnn10.js → dcl-schemas-B4SkwUm_.js} +2 -2
  67. package/_assets/{decimals-CotIy-Lh.js → decimals-DnkGmF3V.js} +2 -2
  68. package/_assets/{decimals-CpkRAPy8.js → decimals-U5WJsdzD.js} +2 -2
  69. package/_assets/{detectExtension-X_gkSOSG.js → detectExtension-6eiVpI1A.js} +2 -2
  70. package/_assets/{disposePreview-xrJvlh5c.js → disposePreview-DeEtkKLL.js} +2 -2
  71. package/_assets/{email-Dx6tnoS0.js → email-Bwii9MB_.js} +7 -7
  72. package/_assets/{embedded-wallet-B4wQ7vGh.js → embedded-wallet-COJK5B-H.js} +2 -2
  73. package/_assets/{emotion-styled.browser.esm-B0QrpOnl.js → emotion-styled.browser.esm-CcSLWrGe.js} +2 -2
  74. package/_assets/{engine-CHyEZGZa.js → engine-B6ScaRDB.js} +2 -2
  75. package/_assets/{errors-0LJiROE6.js → errors-CynPossx.js} +2 -2
  76. package/_assets/{estimate-l1-fee-DEPB19YL.js → estimate-l1-fee-CDcG2dYD.js} +2 -2
  77. package/_assets/{eth_estimateGas-5Fg36OU2.js → eth_estimateGas-DcFq4Lf0.js} +2 -2
  78. package/_assets/{eth_getStorageAt-dHhgrATv.js → eth_getStorageAt-fF-ctFOy.js} +2 -2
  79. package/_assets/{eth_getTransactionCount-CfqVis0R.js → eth_getTransactionCount-DMT5yGEb.js} +2 -2
  80. package/_assets/{ethereum-DknSnkNW.js → ethereum-DHKKDLpc.js} +2 -2
  81. package/_assets/{ethers-DeJawSZV.js → ethers-H2EHHmSo.js} +2 -2
  82. package/_assets/{events-Ds5zATkR.js → events-D1Ro3cjz.js} +2 -2
  83. package/_assets/{execute-C8GHrXLl.js → execute-BWiqZ7j-.js} +3 -3
  84. package/_assets/{extractIPFS-kBtKBoBj.js → extractIPFS-DiV8zmbD.js} +2 -2
  85. package/_assets/{features-BIeQ77qM.js → features-wQa_8a20.js} +2 -2
  86. package/_assets/{fetchTokenMetadata-C6mEpXTK.js → fetchTokenMetadata-C73jMrgi.js} +3 -3
  87. package/_assets/{field.styles-DWrdZ43l.js → field.styles-CTapCSQr.js} +2 -2
  88. package/_assets/{fortmatic-C-oGvfim.js → fortmatic-d8l6VsHl.js} +2 -2
  89. package/_assets/{get-bytecode-ZmYhId5X.js → get-bytecode-6IPPs1XH.js} +2 -2
  90. package/_assets/{get-ecosystem-wallet-info-hfOxpROD.js → get-ecosystem-wallet-info-CiagQo6x.js} +2 -2
  91. package/_assets/{getBalance-DytgoJWu.js → getBalance-DFlqMK0q.js} +3 -3
  92. package/_assets/{getInstalledModules-CdEn_sn-.js → getInstalledModules-DviNZAnD.js} +2 -2
  93. package/_assets/{getNFT-BpmTPthX.js → getNFT-BKd5-jIK.js} +3 -3
  94. package/_assets/{getNFT-DfDNgZuH.js → getNFT-CZsKZDOy.js} +2 -2
  95. package/_assets/{grid.styles-Bk4PoUmi.js → grid.styles-Cnszd1mK.js} +2 -2
  96. package/_assets/{hashTypedData-4YiNP-WS.js → hashTypedData-CIOnYjgW.js} +2 -2
  97. package/_assets/{hashTypedData-BgSea448.js → hashTypedData-Cx4RHD4_.js} +2 -2
  98. package/_assets/{import-CQQNs3tP.js → import-DopjtwQm.js} +2 -2
  99. package/_assets/{in-app-Dq_OdRcE.js → in-app-BZPTqZxK.js} +2 -2
  100. package/_assets/{in-app-wallet-calls-BCjuJnbz.js → in-app-wallet-calls-C-84b8TZ.js} +2 -2
  101. package/_assets/{index-B_WMntff.js → index--6KpZcM5.js} +14 -14
  102. package/_assets/{index-D8LgmTvW.js → index--cLbSkQZ.js} +2 -2
  103. package/_assets/{index-cuqiNa3X.js → index--yhvP7PG.js} +2 -2
  104. package/_assets/{index-ButfXWld.js → index-8mQ7T2Cm.js} +2 -2
  105. package/_assets/{index-C6YN13az.js → index-B2A1Uxrw.js} +2 -2
  106. package/_assets/{index-CF14BeHM.js → index-B2AN1fh7.js} +2 -2
  107. package/_assets/{index-go_a6w6K.js → index-BCNLwPSG.js} +2 -2
  108. package/_assets/{index-DSAOvWbM.js → index-BCftkVti.js} +4 -4
  109. package/_assets/{index-D4Ydwh5V.js → index-BHxfAJlD.js} +2 -2
  110. package/_assets/{index-B-fdIvmV.js → index-BNch3CfU.js} +2 -2
  111. package/_assets/{index-DSXipZKz.js → index-BNj1ZZ--.js} +2 -2
  112. package/_assets/{index-CUwlTQ2d.js → index-BV3gmkVY.js} +2 -2
  113. package/_assets/{index-DtZPPx6-.js → index-BjzJFAq2.js} +2 -2
  114. package/_assets/{index-DdamCNin.js → index-BnzJAKB0.js} +2 -2
  115. package/_assets/{index-C9c0dVvP.js → index-BoqnusFA.js} +2 -2
  116. package/_assets/{index-DmxsKwKF.js → index-BpRttMPE.js} +3 -3
  117. package/_assets/{index-BEnsaskF.js → index-BtqsHqnl.js} +3 -3
  118. package/_assets/{index-CGOvv4p_.js → index-Bx5DSXb8.js} +2 -2
  119. package/_assets/{index-Bn5RjVcC.js → index-C1tknmhO.js} +2 -2
  120. package/_assets/{index-GT0bg1Xs.js → index-C23wZyXv.js} +2 -2
  121. package/_assets/{index-BsgKWUfE.js → index-C487fNvu.js} +2 -2
  122. package/_assets/{index-BmNHCnFS.js → index-C5RpZfZH.js} +2 -2
  123. package/_assets/{index-Bhxiuipz.js → index-C6smoo2I.js} +3 -3
  124. package/_assets/{index-D-00fp_f.js → index-CDDdRbfE.js} +4 -4
  125. package/_assets/{index-BAdzy16n.js → index-CQQK7Wf_.js} +2 -2
  126. package/_assets/{index-q63RdSKk.js → index-CUuXRIl8.js} +2 -2
  127. package/_assets/{index-BxnFaAWy.js → index-CbyazhYc.js} +2 -2
  128. package/_assets/{index-OlAmPqRb.js → index-CjSQXOIE.js} +2 -2
  129. package/_assets/{index-rwEq54MW.js → index-CkM-4uyE.js} +2 -2
  130. package/_assets/{index-DPru9tn6.js → index-CkVXAK71.js} +2 -2
  131. package/_assets/{index-Dizdzzoz.js → index-CmsSxMTc.js} +2 -2
  132. package/_assets/{index-CVkbM3mf.js → index-CsvrK0LK.js} +2 -2
  133. package/_assets/{index-B8bf_CLd.js → index-CtwEP07d.js} +2 -2
  134. package/_assets/{index-DR4n_V9P.js → index-Cu2K-ul5.js} +2 -2
  135. package/_assets/{index-CNTDffHa.js → index-CuX2uyRY.js} +2 -2
  136. package/_assets/{index-BxfEuts8.js → index-CvUNPW6U.js} +2 -2
  137. package/_assets/{index-BInaCa2J.css → index-CzaDIeJ0.css} +1 -1
  138. package/_assets/{index-DHq8b0mB.js → index-D-n00PMZ.js} +2 -2
  139. package/_assets/{index-BQ4wfkbu.js → index-D1B0oznd.js} +2 -2
  140. package/_assets/{index-BoCfJa-S.js → index-D2RG773v.js} +2 -2
  141. package/_assets/index-D2f20T2C.js +3 -0
  142. package/_assets/{index-BOlitJIf.js → index-D5kcKxQR.js} +2 -2
  143. package/_assets/{index-DtNnnm8D.js → index-D60SUbcu.js} +2 -2
  144. package/_assets/{index-BCLvGBf_.js → index-DCAgazge.js} +2 -2
  145. package/_assets/{index-_eHHBzrn.js → index-DHNDuiPp.js} +2 -2
  146. package/_assets/{index-Cmu8yXMj.js → index-DIGWYt9H.js} +2 -2
  147. package/_assets/{index-9tuSqCgV.js → index-DJFoGEzf.js} +2 -2
  148. package/_assets/{index-Cpe1mRbp.js → index-DNdO4V15.js} +2 -2
  149. package/_assets/{index-pGiIZH7w.js → index-DODo43nM.js} +2 -2
  150. package/_assets/{index-5Pi62h5e.js → index-DQkrf2tI.js} +2 -2
  151. package/_assets/{index-Ac2-bQx8.js → index-DXYDN3uA.js} +6 -6
  152. package/_assets/{index-Dl_S4kpn.js → index-DaOnNrHB.js} +2 -2
  153. package/_assets/{index-ktKQy2NE.js → index-DcCTZVkB.js} +2 -2
  154. package/_assets/{index-BhUazss0.js → index-DkGljAs5.js} +2 -2
  155. package/_assets/{index-DyR4CA2t.js → index-DlLuroj0.js} +2 -2
  156. package/_assets/{index-LQSrXubf.js → index-Dp2nuRFm.js} +2 -2
  157. package/_assets/{index-D5DRRNqf.js → index-DrQfAZJ9.js} +2 -2
  158. package/_assets/{index-CsqNIGpg.js → index-DxSv83QK.js} +2 -2
  159. package/_assets/{index-CuFapA0G.js → index-IGrNlyyE.js} +2 -2
  160. package/_assets/{index-CClRbs1n.js → index-Ig7GQRBz.js} +2 -2
  161. package/_assets/{index-SOiDrHAV.js → index-IwTnA1f-.js} +3 -3
  162. package/_assets/{index-CKgi4abw.js → index-IxfADe_K.js} +2 -2
  163. package/_assets/{index-BgEQ4Tua.js → index-UqcTfdvK.js} +2 -2
  164. package/_assets/{index-Bhw3pvFU.js → index-XJGYkd5x.js} +2 -2
  165. package/_assets/{index-1XyZXppO.js → index-ZUZuPwuP.js} +3 -3
  166. package/_assets/{index-BDDWWk-m.js → index-adwnBCwD.js} +2 -2
  167. package/_assets/{index-DTsQ8rPn.js → index-coLYaVXs.js} +2 -2
  168. package/_assets/{index-AX3XTPv0.js → index-zDN0L5qZ.js} +4 -4
  169. package/_assets/{index.es-Dy60HfLr.js → index.es-BQ9Yf2_C.js} +2 -2
  170. package/_assets/{index.es-Bymp_C8M.js → index.es-BoNqoCkO.js} +5 -5
  171. package/_assets/{index.es-BZAtvoTN.js → index.es-CqE1KZqr.js} +2 -2
  172. package/_assets/{index.es-CARiEcML.js → index.es-DGiBui8a.js} +2 -2
  173. package/_assets/{items-empty-Dx16Dkhd.js → items-empty-D0vQ1z0B.js} +2 -2
  174. package/_assets/{jump-DuVsxg2G.js → jump-CY3aYSfg.js} +2 -2
  175. package/_assets/{linkAccount-odTbeKaM.js → linkAccount-CL_IGmZW.js} +2 -2
  176. package/_assets/{loader-logo-B9eq0x19.js → loader-logo-DwchSnaT.js} +2 -2
  177. package/_assets/{localBatchGatewayRequest-C3V8vsXf.js → localBatchGatewayRequest-C3nw9KHu.js} +2 -2
  178. package/_assets/{modal.styles-DKVgluOd.js → modal.styles-p865gbX9.js} +2 -2
  179. package/_assets/{native-z2TWWvM5.js → native-C_fLLHo4.js} +2 -2
  180. package/_assets/{networks-C1qIhT3f.js → networks-BbuCuFCo.js} +2 -2
  181. package/_assets/{onramp-DySU40Oq.js → onramp-DXI3NZWk.js} +2 -2
  182. package/_assets/{openzeppelin-r8yMteXS.js → openzeppelin-BKn4h6Is.js} +2 -2
  183. package/_assets/{ownerOf-CHpn3IyV.js → ownerOf-CYEbPuOg.js} +2 -2
  184. package/_assets/{parseNft-qc0b4koC.js → parseNft-XQGPcr5x.js} +3 -3
  185. package/_assets/{parseSignature-GI7m3i_d.js → parseSignature-CKkAUdfE.js} +4 -4
  186. package/_assets/{parseSignature-DySLduue.js → parseSignature-QQOXClNK.js} +2 -2
  187. package/_assets/{passkeys-Bz2WKBvu.js → passkeys-By-QTPM-.js} +2 -2
  188. package/_assets/{pay-with-exchange-DH8bPeJr.js → pay-with-exchange-B7QyDuNm.js} +2 -2
  189. package/_assets/{prepare-contract-call-CSO6g_43.js → prepare-contract-call-xvjqspvL.js} +2 -2
  190. package/_assets/{qr-overlay-CxHPNCio.js → qr-overlay--8v3aIgN.js} +4 -4
  191. package/_assets/{react-DDGb8tzY.js → react-CIPIqkKp.js} +2 -2
  192. package/_assets/{receive-D23L6PFU.js → receive-BcaxP6Oo.js} +9 -9
  193. package/_assets/{resolveImplementation-C7qS6K5P.js → resolveImplementation-BFZodAYW.js} +2 -2
  194. package/_assets/{resume-buy-Dk1OG_zk.js → resume-buy-C79TtH21.js} +2 -2
  195. package/_assets/{resume-name-BDd1lSeA.js → resume-name-CsOmF5Ph.js} +2 -2
  196. package/_assets/{rpc-t0wCj8j6.js → rpc-CeovO04W.js} +2 -2
  197. package/_assets/{sales-empty-Ut3a1ue9.js → sales-empty-CAD7aHI0.js} +2 -2
  198. package/_assets/{search-empty-3moj5DH0.js → search-empty-Cv5NFb5G.js} +2 -2
  199. package/_assets/{secp256k1-w0BHjKrb.js → secp256k1-Cme7EMNW.js} +2 -2
  200. package/_assets/{secp256k1-BhmojCy4.js → secp256k1-CoRZ8Aa8.js} +2 -2
  201. package/_assets/{secp256k1-Cuq087UG.js → secp256k1-gqyuB-DJ.js} +2 -2
  202. package/_assets/{send-batch-transaction-DF9vFCPw.js → send-batch-transaction-NWdGtXxM.js} +2 -2
  203. package/_assets/{send-eip712-transaction-C_qK1Atk.js → send-eip712-transaction-FWTan1RG.js} +3 -3
  204. package/_assets/{send-gasless-transaction-WC4xzDjv.js → send-gasless-transaction-BBtI35U4.js} +3 -3
  205. package/_assets/{send-Cy-bXF7O.js → send-toFejhMG.js} +2 -2
  206. package/_assets/send-transaction-DJjiFn47.js +3 -0
  207. package/_assets/{sendMetaTransaction-DFpGnYln.js → sendMetaTransaction-8HXF7dJf.js} +2 -2
  208. package/_assets/{sendRawTransaction-BArvMoaY.js → sendRawTransaction-Bf1KTrkg.js} +4 -4
  209. package/_assets/{sentry-CLzhirRK.js → sentry-AydgbXDV.js} +3 -3
  210. package/_assets/{serializeTransaction-DkHau3yF.js → serializeTransaction-CVEcFYFq.js} +2 -2
  211. package/_assets/{session-proposal-Bq7il0Jm.js → session-proposal-B4ZiV2qA.js} +2 -2
  212. package/_assets/{session-request-B3mOchUN.js → session-request-BxJY_bcT.js} +3 -3
  213. package/_assets/{sha256-CUZe3dzn.js → sha256-DYvqSbJq.js} +2 -2
  214. package/_assets/{sha3-BPsNcnk2.js → sha3-DcfuznSG.js} +2 -2
  215. package/_assets/signin-empty-DePdilQ4.js +2 -0
  216. package/_assets/{signing-CkmHVdJ5.js → signing-Dn59-PD3.js} +4 -4
  217. package/_assets/{skeleton.styles-DDovhPLV.js → skeleton.styles-D1L_fgt7.js} +2 -2
  218. package/_assets/{socials-DQgD8fpE.js → socials-CFfwCfjO.js} +2 -2
  219. package/_assets/{styled-qR6SGgCW.js → styled-kGVW2rf5.js} +2 -2
  220. package/_assets/{swaps-C6qF0NJG.js → swaps-ADlq2hm1.js} +2 -2
  221. package/_assets/{thirdweb-eUG4cLWL.js → thirdweb-BOGAnjHo.js} +4 -4
  222. package/_assets/{to-serializable-transaction-wbElHReV.js → to-serializable-transaction-BT9KSpfF.js} +3 -3
  223. package/_assets/{totalSupply-bZGBDJuM.js → totalSupply-C9rpV1_Y.js} +2 -2
  224. package/_assets/{trade-encoding-C22ecqMk.js → trade-encoding-Cv_E0sn5.js} +2 -2
  225. package/_assets/{transaction-CGHVEwqK.js → transaction-CspsFtgm.js} +2 -2
  226. package/_assets/{transactionReceipt-D2p9RG1U.js → transactionReceipt-PeijM3Xl.js} +2 -2
  227. package/_assets/{transactions-B6Yyzv20.js → transactions-BW7ABGiD.js} +2 -2
  228. package/_assets/useInfiniteGrid-BcjCt1yK.js +2 -0
  229. package/_assets/{useStore-CBEDFNF5.js → useStore-CRUsupmX.js} +3 -3
  230. package/_assets/{useTheme-CvsXpBMa.js → useTheme-t2n6dkX3.js} +2 -2
  231. package/_assets/{utils-BCdVJzB0.js → utils-DpDbfelx.js} +2 -2
  232. package/_assets/{verifyHash-BkWhgYuU.js → verifyHash-CVdgHUqA.js} +2 -2
  233. package/_assets/{w3m-modal-D1VAxT-1.js → w3m-modal-DtFKAby2.js} +2 -2
  234. package/_assets/{w3m-modal-DUJuolLM.js → w3m-modal-eNc_hJY-.js} +2 -2
  235. package/_assets/{wait-for-tx-receipt-Bt_nEPV5.js → wait-for-tx-receipt-svBuZEDO.js} +2 -2
  236. package/_assets/{wallets-DXj8z8qb.js → wallets-BjNKPNM7.js} +6 -6
  237. package/_assets/{web-connector-CAF6Nbm1.js → web-connector-DYX5vphE.js} +4 -4
  238. package/_assets/{writeContract-qI_0s6Uc.js → writeContract-abMSghPl.js} +2 -2
  239. package/_assets/{zora-sepolia-BbydYQsg.js → zora-sepolia-CZDfay8A.js} +2 -2
  240. package/_assets/{zoraTestnet-uSM4aObA.js → zoraTestnet-Nzf8iZon.js} +2 -2
  241. package/index.html +12 -12
  242. package/package.json +2 -2
  243. package/_assets/ItemDetail-CRvev_iC.js +0 -3411
  244. package/_assets/MyStore-Dh9AS3Nl.js +0 -1630
  245. package/_assets/NotificationsBell-DUjqFrx_.js +0 -142
  246. package/_assets/index-B7dOO5NS.js +0 -3
  247. package/_assets/send-transaction-CuI5J5PA.js +0 -3
  248. package/_assets/signin-empty-CH_WjCdI.js +0 -2
  249. package/_assets/useInfiniteGrid-Bv_sR1Dw.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-Ac2-bQx8.js","_assets/react-DDGb8tzY.js","_assets/index-B_WMntff.js","_assets/dcl-schemas-FrMtnn10.js","_assets/sentry-CLzhirRK.js","_assets/ethers-DeJawSZV.js","_assets/intl-AKLEHPeO.js","_assets/index-BInaCa2J.css","_assets/import-CQQNs3tP.js","_assets/buy-Blp8fB9D.js","_assets/trade-encoding-C22ecqMk.js","_assets/sendMetaTransaction-DFpGnYln.js","_assets/modal.styles-DKVgluOd.js","_assets/CreditRate-C9kSg0Qj.js","_assets/Faq-BJ9-fDIA.js","_assets/sales-empty-Ut3a1ue9.js","_assets/field.styles-DWrdZ43l.js","_assets/ManaPricingBanner.styles-DcahwkXY.js"])))=>i.map(i=>d[i]);
2
- import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t as o,Y as Te,aH as Pe,$ as ce,bW as ae,bX as ne,bY as Se,_ as Ce,z as L,as as B,bZ as Fe,aI as De,bt as K,I as V,F as He,b_ as Me,aR as $,b$ as Re,c0 as Q}from"./index-B_WMntff.js";import{r as f,u as We,j as t,d as _e,L as qe}from"./react-DDGb8tzY.js";import{u as Oe,s as ze}from"./sales-empty-Ut3a1ue9.js";import{L as Ge}from"./LoadMore-BfyG6-zU.js";import{u as T}from"./useInfiniteGrid-Bv_sR1Dw.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Be}from"./signin-empty-CH_WjCdI.js";import"./dcl-schemas-FrMtnn10.js";import"./sentry-CLzhirRK.js";import"./ethers-DeJawSZV.js";import"./intl-AKLEHPeO.js";import"./import-CQQNs3tP.js";import"./buy-Blp8fB9D.js";import"./trade-encoding-C22ecqMk.js";import"./sendMetaTransaction-DFpGnYln.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]="050c0d8e-b850-4b12-95db-9740532b8fe8",e._sentryDebugIdIdentifier="sentry-dbid-050c0d8e-b850-4b12-95db-9740532b8fe8")}catch{}})();const Ke=15e3;function Ve(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)<=Ke}function Qe(e){const s=[...e].sort((i,n)=>n.createdAt-i.createdAt),a=[];for(const i of s){const n=a[a.length-1];n&&Ve(n[n.length-1],i)?n.push(i):a.push([i])}return a.map(i=>{var n;return{id:((n=i.find(c=>c.txHash))==null?void 0:n.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Xe(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Xe(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const s=[],a=new Map;for(const i of e){const n=Ze(i);if(!n){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 c=a.get(n);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:n,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};a.set(n,l),s.push(l)}return s}function et(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?Ae(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const a=Qe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),n=(e.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...a,...i,...n,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function st(e,s){return s==="all"?e:s==="sales"?e.filter(a=>a.kind==="sale"):e.filter(a=>a.kind==="purchase"||a.kind==="credit"||a.kind==="mana-purchase")}const he=e=>e.trim().toLowerCase();function at(e){const s=new Map;for(const a of e??[]){const i=he(a.txHash??"");if(!i)continue;const n=s.get(i);n?n.push(a):s.set(i,[a])}return s}function nt(e,s,a=Date.now()){const i=s.txHash?e.get(he(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const n=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>a);if(c.length===0)return{kind:"credited",credits:n};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:n,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var n;return(n=i.session)==null?void 0:n.address}),{data:s,isLoading:a}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:a}}const dt="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/credits-product-vs4Q6u6l.svg",X=Ne`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DXYDN3uA.js","_assets/react-CIPIqkKp.js","_assets/index--6KpZcM5.js","_assets/dcl-schemas-B4SkwUm_.js","_assets/sentry-AydgbXDV.js","_assets/ethers-H2EHHmSo.js","_assets/intl-AKLEHPeO.js","_assets/index-CzaDIeJ0.css","_assets/import-DopjtwQm.js","_assets/buy-RnCuARVP.js","_assets/trade-encoding-Cv_E0sn5.js","_assets/sendMetaTransaction-8HXF7dJf.js","_assets/modal.styles-p865gbX9.js","_assets/CreditRate-vLOKKh_P.js","_assets/Faq-iPufE4Ki.js","_assets/sales-empty-CAD7aHI0.js","_assets/field.styles-CTapCSQr.js","_assets/ManaPricingBanner.styles-DLFrScDr.js"])))=>i.map(i=>d[i]);
2
+ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as Te,t as o,a0 as $e,aK as Pe,a2 as ce,bW as se,bX as ne,bY as Se,_ as Ce,z as L,av as B,bZ as Fe,X as De,bu as K,I as V,F as Me,b_ as He,Y as T,b$ as Re,c0 as X}from"./index--6KpZcM5.js";import{r as f,u as We,j as t,d as _e,L as qe}from"./react-CIPIqkKp.js";import{u as Oe,s as ze}from"./sales-empty-CAD7aHI0.js";import{L as Ge}from"./LoadMore-BOdt5RfM.js";import{u as $}from"./useInfiniteGrid-BcjCt1yK.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Be}from"./signin-empty-DePdilQ4.js";import"./dcl-schemas-B4SkwUm_.js";import"./sentry-AydgbXDV.js";import"./ethers-H2EHHmSo.js";import"./intl-AKLEHPeO.js";import"./import-DopjtwQm.js";import"./buy-RnCuARVP.js";import"./trade-encoding-Cv_E0sn5.js";import"./sendMetaTransaction-8HXF7dJf.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]="4d1d101f-aa04-461d-973e-aee8d378e612",e._sentryDebugIdIdentifier="sentry-dbid-4d1d101f-aa04-461d-973e-aee8d378e612")}catch{}})();const Ke=15e3;function Ve(e,a){return e.txHash&&a.txHash?e.txHash===a.txHash:e.txHash||a.txHash?!1:e.status===a.status&&Math.abs(e.createdAt-a.createdAt)<=Ke}function Xe(e){const a=[...e].sort((i,n)=>n.createdAt-i.createdAt),s=[];for(const i of a){const n=s[s.length-1];n&&Ve(n[n.length-1],i)?n.push(i):s.push([i])}return s.map(i=>{var n;return{id:((n=i.find(c=>c.txHash))==null?void 0:n.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Qe(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Qe(e){return e.some(a=>a.status==="PENDING")?"PENDING":e.some(a=>a.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const a=[],s=new Map;for(const i of e){const n=Ze(i);if(!n){a.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 c=s.get(n);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:n,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};s.set(n,l),a.push(l)}return a}function et(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?Ae(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const s=Xe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),n=(e.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...i,...n,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function at(e,a){return a==="all"?e:a==="sales"?e.filter(s=>s.kind==="sale"):e.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const he=e=>e.trim().toLowerCase();function st(e){const a=new Map;for(const s of e??[]){const i=he(s.txHash??"");if(!i)continue;const n=a.get(i);n?n.push(s):a.set(i,[s])}return a}function nt(e,a,s=Date.now()){const i=a.txHash?e.get(he(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const n=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:n,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var n;return(n=i.session)==null?void 0:n.address}),{data:a,isLoading:s}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:a==null?void 0:a.total,isLoading:s}}const dt="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/credits-product-vs4Q6u6l.svg",Q=Ne`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,ct=u.section`
@@ -150,10 +150,10 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
150
150
  `,D=u.span`
151
151
  font-weight: 700;
152
152
  color: ${d.colors.softWhite};
153
- `,H=u.span`
153
+ `,M=u.span`
154
154
  font-size: 13px;
155
155
  color: ${d.colors.gray4};
156
- `,M=u.div`
156
+ `,H=u.div`
157
157
  display: flex;
158
158
  align-items: center;
159
159
  gap: 14px;
@@ -252,11 +252,11 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
252
252
  width: 16px;
253
253
  height: 16px;
254
254
  vertical-align: -0.15em;
255
- `,bt=u.span`
255
+ `,yt=u.span`
256
256
  display: inline-flex;
257
257
  align-items: center;
258
258
  cursor: pointer;
259
- `,yt=u.span`
259
+ `,bt=u.span`
260
260
  position: fixed;
261
261
  transform: translateX(-50%);
262
262
  padding: 6px 8px;
@@ -330,7 +330,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
330
330
  border-radius: 10px;
331
331
  background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
332
332
  background-size: 200% 100%;
333
- animation: ${X} 1.3s infinite linear;
333
+ animation: ${Q} 1.3s infinite linear;
334
334
 
335
335
  @media (prefers-reduced-motion: reduce) {
336
336
  animation: none;
@@ -353,7 +353,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
353
353
  border-radius: 6px;
354
354
  background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
355
355
  background-size: 200% 100%;
356
- animation: ${X} 1.3s infinite linear;
356
+ animation: ${Q} 1.3s infinite linear;
357
357
 
358
358
  @media (prefers-reduced-motion: reduce) {
359
359
  animation: none;
@@ -379,7 +379,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
379
379
  border: 1px solid transparent;
380
380
  background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
381
381
  background-size: 200% 100%;
382
- animation: ${X} 1.3s infinite linear;
382
+ animation: ${Q} 1.3s infinite linear;
383
383
 
384
384
  @media (prefers-reduced-motion: reduce) {
385
385
  animation: none;
@@ -396,5 +396,5 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
396
396
  height: 26px;
397
397
  object-fit: contain;
398
398
  }
399
- `,ee=N.withComponent(qe),jt=f.lazy(()=>Ce(()=>import("./index-Ac2-bQx8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(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 fe({children:e}){const s=f.useRef(null),[a,i]=f.useState(null),n=()=>{var l;const c=(l=s.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(bt,{ref:s,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,a?_e.createPortal(t.jsx(yt,{style:{top:a.top,left:a.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,a=!!e.tradeId||s,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:a,staleTime:5*6e4}),c=a&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(_,{children:[c?t.jsx(J,{}):t.jsx(q,{title:l,children:l}),e.quantity>1?t.jsx(O,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(_,{children:[t.jsx(q,{title:s,children:s}),t.jsx(O,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Je(e.lines),a=s.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(H,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:a})]})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:s.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function $t({sale:e}){const{data:s,isLoading:a}=E({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)??o("activity.itemFallback"),n=(s==null?void 0:s.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[a?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[a?t.jsx(J,{}):t.jsx(q,{title:i,children:i}),t.jsx(O,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(H,{children:o("activity.paidWithMana")})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function Tt({sale:e,payout:s}){const{data:a,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(a==null?void 0:a.name)??o("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(J,{}):t.jsx(q,{title:n,children:n}),t.jsxs(O,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),s.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(H,{children:o("activity.saleLabel")})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",He(s.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,a=Fe(e.status),i=a==="SETTLED"?o("activity.completed"):a==="FAILED"?o("activity.failed"):a==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await Me(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}$.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?($.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?($.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):$.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(H,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:s})]})]}),t.jsxs(M,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":a,children:i}),t.jsxs(k,{"data-kind":a==="UNFINISHED"?void 0:"income",children:[a==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:s,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:s}=U(),[a,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;$e({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=Oe(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&a!=="sales",x=!!e&&!l&&a!=="purchases",b=T(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),y=T(["sales",e==null?void 0:e.address],h=>ae(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=T(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=T(["mana-purchases",e==null?void 0:e.address],h=>ae(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),be=f.useMemo(()=>at(te),[te]),{data:ye}=Te(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>s()},ctaVariant:"solid",fill:!0})});const ie=st(it({purchases:g?b.items:[],sales:x?y.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:ye}),a),ve=g&&(b.isLoading||v.isLoading||w.isLoading)||x&&y.isLoading,se=g&&(b.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&y.isFetchingNextPage,we=g&&(b.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&y.hasNextPage;function ke(){g&&b.hasNextPage&&b.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&y.hasNextPage&&y.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&a===h,"data-active":!l&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx($t,{sale:h.sale},h.id):t.jsx(Tt,{sale:h.sale,payout:nt(be,h.sale)},h.id)),se?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:se,onLoadMore:ke})]})]})}export{Qt as Activity};
400
- //# sourceMappingURL=Activity-zYnvta6q.js.map
399
+ `,ee=N.withComponent(qe),jt=f.lazy(()=>Ce(()=>import("./index-DXYDN3uA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function fe({children:e}){const a=f.useRef(null),[s,i]=f.useState(null),n=()=>{var l;const c=(l=a.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(yt,{ref:a,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,s?_e.createPortal(t.jsx(bt,{style:{top:s.top,left:s.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const a=!!e.contractAddress&&!!e.itemId,s=!!e.tradeId||a,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):X(e.contractAddress,{itemId:e.itemId}),enabled:s,staleTime:5*6e4}),c=s&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(_,{children:[c?t.jsx(J,{}):t.jsx(q,{title:l,children:l}),e.quantity>1?t.jsx(O,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const a=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(_,{children:[t.jsx(q,{title:a,children:a}),t.jsx(O,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const a=Je(e.lines),s=a.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:s})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:a.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function Tt({sale:e}){const{data:a,isLoading:s}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>X(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??o("activity.itemFallback"),n=(a==null?void 0:a.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[s?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[s?t.jsx(J,{}):t.jsx(q,{title:i,children:i}),t.jsx(O,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function $t({sale:e,payout:a}){const{data:s,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>X(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??o("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(J,{}):t.jsx(q,{title:n,children:n}),t.jsxs(O,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),a.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(a.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),a.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):a.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(a.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,s=Fe(e.status),i=s==="SETTLED"?o("activity.completed"):s==="FAILED"?o("activity.failed"):s==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await He(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}T.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?(T.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?(T.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):T.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:a})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":s,children:i}),t.jsxs(k,{"data-kind":s==="UNFINISHED"?void 0:"income",children:[s==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const a={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:a,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Xt(){const{session:e,signIn:a}=U(),[s,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;Te({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=Oe(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&s!=="sales",x=!!e&&!l&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),b=$(["sales",e==null?void 0:e.address],h=>se(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=$(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=$(["mana-purchases",e==null?void 0:e.address],h=>se(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ye=f.useMemo(()=>st(te),[te]),{data:be}=$e(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>a()},ctaVariant:"solid",fill:!0})});const ie=at(it({purchases:g?y.items:[],sales:x?b.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:be}),s),ve=g&&(y.isLoading||v.isLoading||w.isLoading)||x&&b.isLoading,ae=g&&(y.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&b.isFetchingNextPage,we=g&&(y.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&b.hasNextPage;function ke(){g&&y.hasNextPage&&y.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&s===h,"data-active":!l&&s===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(Tt,{sale:h.sale},h.id):t.jsx($t,{sale:h.sale,payout:nt(ye,h.sale)},h.id)),ae?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:ae,onLoadMore:ke})]})]})}export{Xt as Activity};
400
+ //# sourceMappingURL=Activity-B-tcMJAJ.js.map
@@ -1,4 +1,4 @@
1
- import{r as u,j as d}from"./react-DDGb8tzY.js";import{s as m}from"./index-B_WMntff.js";import"./dcl-schemas-FrMtnn10.js";import"./sentry-CLzhirRK.js";import"./ethers-DeJawSZV.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]="73e471b9-72cf-46c7-a8a1-0eac2bda35cd",e._sentryDebugIdIdentifier="sentry-dbid-73e471b9-72cf-46c7-a8a1-0eac2bda35cd")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
1
+ import{r as u,j as d}from"./react-CIPIqkKp.js";import{s as m}from"./index--6KpZcM5.js";import"./dcl-schemas-B4SkwUm_.js";import"./sentry-AydgbXDV.js";import"./ethers-H2EHHmSo.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]="7a7a6437-4d21-4690-b771-d5402278bbc4",e._sentryDebugIdIdentifier="sentry-dbid-7a7a6437-4d21-4690-b771-d5402278bbc4")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -94,5 +94,5 @@ void main() {
94
94
  inset: 0;
95
95
  width: 100%;
96
96
  height: 100%;
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 f=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(f),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(f,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-BWb1WzHF.js.map
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 f=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),b=t.getUniformLocation(i,"u_resolution"),w=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(b,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(w,0),t.enableVertexAttribArray(f),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(f,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-DK3QLOJ2.js.map
@@ -1,4 +1,4 @@
1
- import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c as se,r as wt,b as jt,bF as vt,h as Ye,j as Xe,bB as Ct,bc as $t,ba as kt,w as St,c$ as Et,d0 as Rt,s as i,a as t,x as dt,bl as Tt,aI as _t,F as ht,t as s,d1 as Mt,bI as We,D as It,I as W,z as V,d2 as ze,E as ge,bk as At,l as Nt,O as Me,bv as Je,bE as Lt,bD as Wt,B as pt,Y as ut,m as mt,cc as zt,cd as Pt,y as Bt,bR as Ft,av as Ot,$ as Ut,a1 as et,a2 as be,aG as Ht,bS as Dt,bT as Gt}from"./index-B_WMntff.js";import{u as qt,s as Kt}from"./search-empty-3moj5DH0.js";import{u as Vt,l as Zt,m as Qt,S as Yt,F as Xt,a as Jt}from"./Filters-Do-OHwbY.js";import{R as en,S as tn,a as nn,D as sn,b as an,C as on,c as rn,d as ln,e as cn,M as dn}from"./browseLayout.styles-DRypk6r3.js";import{L as hn}from"./LoadMore-BfyG6-zU.js";import{u as pn}from"./useInfiniteGrid-Bv_sR1Dw.js";import{E as un}from"./ErrorNotice-Ba9jMEfx.js";import{d as mn}from"./dcl-schemas-FrMtnn10.js";import{s as fn,G as xn,w as gn,S as bn}from"./buy-gasless-Dx9azM4y.js";import{s as yn}from"./buy-Blp8fB9D.js";import{u as wn,A as jn,C as vn}from"./trade-encoding-C22ecqMk.js";import{f as Cn}from"./errors-0LJiROE6.js";import{J as $n,C as kn,B as Ie}from"./ethers-DeJawSZV.js";import{z as Sn,D as En,w as Rn,W as Tn,m as _n,n as Mn,o as In,v as An,j as tt}from"./CreditPackPicker-Gbn87yeA.js";import{u as Nn,M as Ln,o as Wn,l as zn,R as Pn,c as Bn}from"./loader-logo-B9eq0x19.js";import{P as Fn}from"./PaymentMethodStep-Bv6piNxs.js";import{R as nt}from"./resume-name-BDd1lSeA.js";import{R as On}from"./resume-buy-Dk1OG_zk.js";import{n as Un}from"./name-glyph-aUugT8vq.js";import{c as Hn}from"./crumbs.styles-LNbHaiVG.js";import{n as Dn}from"./Tooltip-C4G_m6-a.js";import{G as Gn}from"./grid.styles-Bk4PoUmi.js";import"./sentry-CLzhirRK.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-DDovhPLV.js";import"./sendMetaTransaction-DFpGnYln.js";import"./mana-matic-CEqvSwrJ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="81d30b5a-41a9-45c7-9073-de093f40a653",n._sentryDebugIdIdentifier="sentry-dbid-81d30b5a-41a9-45c7-9073-de093f40a653")}catch{}})();function ye(n){const a=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${a}:${r}`}const Z="100000000000000000000",ft=2,Ae=15,qn=/^[a-zA-Z0-9]+$/;function st(n){const a=n.trim();return a.length===0?{ok:!1,reason:"empty"}:qn.test(a)?a.length<ft?{ok:!1,reason:"too-short"}:a.length>Ae?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Kn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,Ae)}const Vn=["function available(string _subdomain) view returns (bool)"],it={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Zn(){return se.chainId===Number(mn.ChainId.MATIC_MAINNET)?it.mainnet:it.sepolia}async function Qn(n,a={}){var g;const{rpc:r,address:h}=Zn(),d=new $n(r),w=new kn(h,Vn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const c=await w.available(n);if((g=a.signal)!=null&&g.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${c}`),c?"available":"taken"}const Yn="https://app.across.to/api";class Qe extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ke extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ve extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function Xn(n){return $t(Z,n)}async function Jn(n,a,r={}){var g;const h=r.chainId??se.chainId,d=r.provider??"across",w=`${se.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${h}&provider=${d}`,c=await kt(w,{method:"GET",identity:n,metadata:{}});if(!c.ok){let l;try{l=(g=await c.json())==null?void 0:g.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new Qe:new Error(`fetchNameCreditRoute ${c.status}`)}return c.json()}function es(n,a){const r=Ie.from(n.availableAmount),d=Ie.from(Z).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:vn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:Z}}async function ts(n,a={}){const r=Yn,h=a.intervalMs??1e4,d=a.maxAttempts??60;let w={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let c=0;c<d;c++){try{const g=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(g.ok){const l=await g.json(),j=(l.status??"pending").toLowerCase(),b=l.fillTx??l.fillTxnRef??null,C=typeof l.actionsSucceeded=="boolean"?l.actionsSucceeded:null;if(j==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:C};if(j==="refunded"||j==="expired")return{status:j,destinationTxHash:null,actionsSucceeded:!1};w={status:"pending",destinationTxHash:b,actionsSucceeded:C}}}catch{}c<d-1&&await new Promise(g=>setTimeout(g,h))}return w}async function ns(n){const{name:a,identity:r,signer:h}=n,d=b=>{var C;try{(C=n.onProgress)==null||C.call(n,b)}catch{}},w=n.chainId??se.chainId,c=n.provider??"across",g=(n.beneficiary??await h.getAddress()).toLowerCase();let l=null,j="unconfirmed";console.info("[names] register start",{name:a,buyer:g,chainId:w,provider:c}),d("preparing");try{const b=await wt(jt(se.chainId).address),C=Xn(b),m=n.creditsCents!=null?Math.max(1,Math.min(Math.trunc(n.creditsCents),C)):C,k=m<C;console.info("[names] step 1/6 sized reservation",{usdCents:m,fullPriceCents:C,payingWithMana:k,manaRate:b});const x=await Jn(r,a,{chainId:w,provider:c});console.info("[names] step 2/6 route fetched",{target:x.externalCall.target,selector:x.externalCall.selector,provider:x.provider,quoteId:x.quoteId});const y=await vt(r,m,void 0,void 0,a);if(l=y.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:y.credit.id,maxCreditedValue:y.maxCreditedValue}),!k&&Ie.from(y.maxCreditedValue).lt(Z))throw new Error("Credit under-sized for the name price");if(k){const u=Ie.from(Z).sub(y.credit.availableAmount);if(n.maxManaWei!=null&&u.gt(n.maxManaWei.toString()))throw new Error("The MANA needed moved past what was agreed");u.gt(0)&&(d("awaiting-confirmation"),await wn({auth:{kind:jn.Allowance,contractAddress:Ye(Xe.MANAToken,w).address,spenderAddress:Ye(Xe.CreditsManager,w).address,chainId:w},signer:h,requiredWei:BigInt(u.toString())}),console.info("[names] step 3b/6 mana allowance ensured",{gapWei:u.toString()}))}d("awaiting-confirmation");const v=es(y.credit,x);let $;try{$=await fn({chainId:w,buyer:g,signer:h,args:v})}catch(u){if(!(u instanceof xn))throw u;if(u.reason==="relayer-unreachable"){j="unobservable";const N=new Ve;throw N.cause=u,N}$=await yn(w,v,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:$}),d("confirming"),await gn($),j="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:$}),c==="across"){d("registering");const u=await ts($,n.acrossPoll);if(console.info("[names] step 6/6 across status",u),u.status==="pending")return{status:"pending",originTxHash:$};if(u.status==="filled"&&u.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:$}),{status:"pending",originTxHash:$};if(u.status!=="filled"||u.actionsSucceeded!==!0)throw new Ke;return{status:"registered",originTxHash:$,destinationTxHash:u.destinationTxHash}}return{status:"pending",originTxHash:$}}catch(b){if(console.error("[names] register failed — raw error:",b,{name:a,buyer:g,originState:j}),b instanceof bn)return{status:"pending",originTxHash:b.txHash};if(l&&j==="unconfirmed"&&await Ct(r,[l]).catch(()=>{}),b instanceof Qe||b instanceof Ke||b instanceof Ve)throw b;const C=new Error(Cn(b,"Couldn't register the name. Please try again.",{sale:!0}));throw C.cause=b,C}}function ss(){const{data:n}=St({queryKey:["feature-flag","shop-names"],queryFn:()=>Et(Rt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const is=60,as=700,os=25;function rs(n){if(!n)return[];const a=[];for(let r=1;r<=n.length;r++)a.push({text:n.slice(0,r),delay:is});a[a.length-1]={text:n,delay:as};for(let r=n.length-1;r>=1;r--)a.push({text:n.slice(0,r),delay:os});return a}function ls(n){return n.flatMap(rs)}function cs(n,a){const r=p.useMemo(()=>ls(n),[n]),[h,d]=p.useState(0);return p.useEffect(()=>{if(!a||r.length===0)return;const w=setTimeout(()=>d(c=>(c+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(w)},[h,a,r]),!a||r.length===0?"":r[h%r.length].text}const ds="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/name-verified-oGwQ3ntb.svg",hs="#34fee6",ps=i.div`
1
+ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-CIPIqkKp.js";import{c as se,r as wt,b as jt,bF as vt,h as Xe,j as Ye,bC as Ct,bd as $t,bb as kt,w as St,c$ as Et,d0 as Rt,s as i,a as t,x as dt,bm as Tt,X as _t,F as ht,t as s,d1 as Mt,bI as We,D as It,I as W,z as V,d2 as ze,E as ge,bl as At,l as Nt,O as Me,bw as Je,Z as Lt,bE as Wt,B as pt,a0 as ut,m as mt,cc as zt,cd as Pt,y as Bt,bR as Ft,ay as Ot,a2 as Ut,a4 as et,a5 as be,aJ as Ht,bS as Dt,bT as Gt}from"./index--6KpZcM5.js";import{u as qt,s as Kt}from"./search-empty-Cv5NFb5G.js";import{u as Vt,l as Zt,m as Qt,S as Xt,F as Yt,a as Jt}from"./Filters-rmYRG9Xu.js";import{R as en,S as tn,a as nn,D as sn,b as an,C as on,c as rn,d as ln,e as cn,M as dn}from"./browseLayout.styles-BKTAmYSq.js";import{L as hn}from"./LoadMore-BOdt5RfM.js";import{u as pn}from"./useInfiniteGrid-BcjCt1yK.js";import{E as un}from"./ErrorNotice-CbW4Q2ZV.js";import{d as mn}from"./dcl-schemas-B4SkwUm_.js";import{s as fn,G as xn,w as gn,S as bn}from"./buy-gasless-COdNSlBG.js";import{s as yn}from"./buy-RnCuARVP.js";import{u as wn,A as jn,C as vn}from"./trade-encoding-Cv_E0sn5.js";import{f as Cn}from"./errors-CynPossx.js";import{J as $n,C as kn,B as Ie}from"./ethers-H2EHHmSo.js";import{z as Sn,D as En,w as Rn,W as Tn,m as _n,n as Mn,o as In,v as An,j as tt}from"./CreditPackPicker-BqGavVgR.js";import{u as Nn,M as Ln,o as Wn,l as zn,R as Pn,c as Bn}from"./loader-logo-DwchSnaT.js";import{P as Fn}from"./PaymentMethodStep-BDIZKceq.js";import{R as nt}from"./resume-name-CsOmF5Ph.js";import{R as On}from"./resume-buy-C79TtH21.js";import{n as Un}from"./name-glyph-aUugT8vq.js";import{c as Hn}from"./crumbs.styles-C5oFtMBh.js";import{n as Dn}from"./Tooltip-BqY8lGhV.js";import{G as Gn}from"./grid.styles-Cnszd1mK.js";import"./sentry-AydgbXDV.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-D1L_fgt7.js";import"./sendMetaTransaction-8HXF7dJf.js";import"./mana-matic-CEqvSwrJ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="95b8bdf3-5002-448b-89e3-93ade4edc016",n._sentryDebugIdIdentifier="sentry-dbid-95b8bdf3-5002-448b-89e3-93ade4edc016")}catch{}})();function ye(n){const a=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${a}:${r}`}const Z="100000000000000000000",ft=2,Ae=15,qn=/^[a-zA-Z0-9]+$/;function st(n){const a=n.trim();return a.length===0?{ok:!1,reason:"empty"}:qn.test(a)?a.length<ft?{ok:!1,reason:"too-short"}:a.length>Ae?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Kn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,Ae)}const Vn=["function available(string _subdomain) view returns (bool)"],it={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Zn(){return se.chainId===Number(mn.ChainId.MATIC_MAINNET)?it.mainnet:it.sepolia}async function Qn(n,a={}){var g;const{rpc:r,address:h}=Zn(),d=new $n(r),w=new kn(h,Vn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const c=await w.available(n);if((g=a.signal)!=null&&g.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${c}`),c?"available":"taken"}const Xn="https://app.across.to/api";class Qe extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ke extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ve extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function Yn(n){return $t(Z,n)}async function Jn(n,a,r={}){var g;const h=r.chainId??se.chainId,d=r.provider??"across",w=`${se.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${h}&provider=${d}`,c=await kt(w,{method:"GET",identity:n,metadata:{}});if(!c.ok){let l;try{l=(g=await c.json())==null?void 0:g.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new Qe:new Error(`fetchNameCreditRoute ${c.status}`)}return c.json()}function es(n,a){const r=Ie.from(n.availableAmount),d=Ie.from(Z).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:vn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:Z}}async function ts(n,a={}){const r=Xn,h=a.intervalMs??1e4,d=a.maxAttempts??60;let w={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let c=0;c<d;c++){try{const g=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(g.ok){const l=await g.json(),j=(l.status??"pending").toLowerCase(),b=l.fillTx??l.fillTxnRef??null,C=typeof l.actionsSucceeded=="boolean"?l.actionsSucceeded:null;if(j==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:C};if(j==="refunded"||j==="expired")return{status:j,destinationTxHash:null,actionsSucceeded:!1};w={status:"pending",destinationTxHash:b,actionsSucceeded:C}}}catch{}c<d-1&&await new Promise(g=>setTimeout(g,h))}return w}async function ns(n){const{name:a,identity:r,signer:h}=n,d=b=>{var C;try{(C=n.onProgress)==null||C.call(n,b)}catch{}},w=n.chainId??se.chainId,c=n.provider??"across",g=(n.beneficiary??await h.getAddress()).toLowerCase();let l=null,j="unconfirmed";console.info("[names] register start",{name:a,buyer:g,chainId:w,provider:c}),d("preparing");try{const b=await wt(jt(se.chainId).address),C=Yn(b),m=n.creditsCents!=null?Math.max(1,Math.min(Math.trunc(n.creditsCents),C)):C,k=m<C;console.info("[names] step 1/6 sized reservation",{usdCents:m,fullPriceCents:C,payingWithMana:k,manaRate:b});const x=await Jn(r,a,{chainId:w,provider:c});console.info("[names] step 2/6 route fetched",{target:x.externalCall.target,selector:x.externalCall.selector,provider:x.provider,quoteId:x.quoteId});const y=await vt(r,m,void 0,void 0,a);if(l=y.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:y.credit.id,maxCreditedValue:y.maxCreditedValue}),!k&&Ie.from(y.maxCreditedValue).lt(Z))throw new Error("Credit under-sized for the name price");if(k){const u=Ie.from(Z).sub(y.credit.availableAmount);if(n.maxManaWei!=null&&u.gt(n.maxManaWei.toString()))throw new Error("The MANA needed moved past what was agreed");u.gt(0)&&(d("awaiting-confirmation"),await wn({auth:{kind:jn.Allowance,contractAddress:Xe(Ye.MANAToken,w).address,spenderAddress:Xe(Ye.CreditsManager,w).address,chainId:w},signer:h,requiredWei:BigInt(u.toString())}),console.info("[names] step 3b/6 mana allowance ensured",{gapWei:u.toString()}))}d("awaiting-confirmation");const v=es(y.credit,x);let $;try{$=await fn({chainId:w,buyer:g,signer:h,args:v})}catch(u){if(!(u instanceof xn))throw u;if(u.reason==="relayer-unreachable"){j="unobservable";const N=new Ve;throw N.cause=u,N}$=await yn(w,v,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:$}),d("confirming"),await gn($),j="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:$}),c==="across"){d("registering");const u=await ts($,n.acrossPoll);if(console.info("[names] step 6/6 across status",u),u.status==="pending")return{status:"pending",originTxHash:$};if(u.status==="filled"&&u.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:$}),{status:"pending",originTxHash:$};if(u.status!=="filled"||u.actionsSucceeded!==!0)throw new Ke;return{status:"registered",originTxHash:$,destinationTxHash:u.destinationTxHash}}return{status:"pending",originTxHash:$}}catch(b){if(console.error("[names] register failed — raw error:",b,{name:a,buyer:g,originState:j}),b instanceof bn)return{status:"pending",originTxHash:b.txHash};if(l&&j==="unconfirmed"&&await Ct(r,[l]).catch(()=>{}),b instanceof Qe||b instanceof Ke||b instanceof Ve)throw b;const C=new Error(Cn(b,"Couldn't register the name. Please try again.",{sale:!0}));throw C.cause=b,C}}function ss(){const{data:n}=St({queryKey:["feature-flag","shop-names"],queryFn:()=>Et(Rt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const is=60,as=700,os=25;function rs(n){if(!n)return[];const a=[];for(let r=1;r<=n.length;r++)a.push({text:n.slice(0,r),delay:is});a[a.length-1]={text:n,delay:as};for(let r=n.length-1;r>=1;r--)a.push({text:n.slice(0,r),delay:os});return a}function ls(n){return n.flatMap(rs)}function cs(n,a){const r=p.useMemo(()=>ls(n),[n]),[h,d]=p.useState(0);return p.useEffect(()=>{if(!a||r.length===0)return;const w=setTimeout(()=>d(c=>(c+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(w)},[h,a,r]),!a||r.length===0?"":r[h%r.length].text}const ds="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/name-verified-oGwQ3ntb.svg",hs="#34fee6",ps=i.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -509,7 +509,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c
509
509
  font-size: 32px;
510
510
  font-weight: 700;
511
511
  color: ${t.colors.white};
512
- `;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),K=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ke,fe=E instanceof Ve;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!K||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(K.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,Y=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":Y,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:Y}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:K==null?void 0:K.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!K||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.17.1-36149310418.commit-795ca33/_assets/invite-icon-Bz6lCTuB.svg",Gs="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",qs=i.div`
512
+ `;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),K=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ke,fe=E instanceof Ve;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!K||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(K.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,X=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":X,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:X}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:K==null?void 0:K.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!K||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.17.2-36152359068.commit-47bab5a/_assets/invite-icon-Bz6lCTuB.svg",Gs="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",qs=i.div`
513
513
  width: 100%;
514
514
  min-width: 0;
515
515
  `,Ks=i.nav`
@@ -551,7 +551,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c
551
551
  gap: 32px;
552
552
  padding-bottom: 32px;
553
553
  }
554
- `,Ys=i.div`
554
+ `,Xs=i.div`
555
555
  position: relative;
556
556
  border: 1px solid ${t.colors.magenta};
557
557
  border-radius: 24px;
@@ -568,7 +568,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c
568
568
  padding: 40px 20px;
569
569
  gap: 28px;
570
570
  }
571
- `,Xs=i.div`
571
+ `,Ys=i.div`
572
572
  display: flex;
573
573
  flex-direction: column;
574
574
  align-items: center;
@@ -970,7 +970,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c
970
970
  clip: rect(0, 0, 0, 0);
971
971
  white-space: nowrap;
972
972
  border: 0;
973
- `,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(V,{}),ht(C)]}):null]});return e.jsxs(qs,{"data-testid":"names-page",children:[e.jsxs(Ks,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Vs,{onClick:n,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Zs,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Qs,{children:[e.jsxs(Ys,{children:[e.jsxs(Xs,{children:[e.jsx(Js,{children:s("names.heroTitle")}),e.jsx(ei,{children:s("names.heroSubtitle")})]}),e.jsxs(ti,{children:[e.jsxs(ni,{"data-testid":"names-input-wrap",children:[e.jsxs(si,{invalid:x==="taken",children:[e.jsxs(ri,{children:[e.jsx(li,{"aria-hidden":!0,children:"@"}),e.jsx(ci,{value:m,onChange:S=>k(Kn(S.target.value)),placeholder:T,"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Ae,onFocus:()=>re(!0),style:{width:L!=null?`${L}px`:void 0}}),e.jsx(ii,{ref:A,"aria-hidden":!0,"data-placeholder":!m||void 0,children:m||T}),e.jsx(di,{children:s("names.suffix")})]}),m.length>0?e.jsxs(hi,{"aria-hidden":!0,children:[m.length,"/",Ae]}):null,e.jsx(gt,{onClick:q,disabled:!H,"data-testid":"names-claim",children:D})]}),x==="taken"?e.jsxs(ai,{role:"status","data-testid":"names-taken",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(oi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,x==="checking"?e.jsx(ke,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):G?e.jsxs(ke,{tone:"muted",role:"status","data-testid":"names-disabled",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.registrationDisabled")}),e.jsxs(fi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.registrationDisabledLink"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):x==="error"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.checkError")}):x==="invalid"&&!U.ok&&U.reason==="too-short"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.tooShort",{min:ft})}):null]}),e.jsx(pi,{onClick:q,disabled:!H,children:D}),e.jsx(vi,{role:"status","aria-live":"polite",children:x==="available"?s("names.available",{name:m}):""})]})]}),e.jsxs(xi,{children:[e.jsxs(gi,{children:[e.jsx(bi,{children:s("names.whyTitle")}),e.jsx(yi,{children:s("names.whyIntro")})]}),e.jsxs(wi,{children:[e.jsxs(Se,{children:[e.jsx(Ee,{src:Us,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why1Title")}),e.jsx(_e,{children:s("names.why1")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Hs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why2Title")}),e.jsxs(_e,{children:[s("names.why2")," ",e.jsx(ji,{children:s("names.why2Address")})]}),e.jsxs(rt,{href:Ci,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Ds,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why3Title")}),e.jsx(_e,{children:s("names.why3")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Gs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why4Title")}),e.jsx(_e,{children:s("names.why4")}),e.jsxs(rt,{href:$i,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),v?e.jsx(Fs,{name:m,priceCredits:C,onClose:()=>$(!1)}):null]})}const Si=i.p`
973
+ `,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(V,{}),ht(C)]}):null]});return e.jsxs(qs,{"data-testid":"names-page",children:[e.jsxs(Ks,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Vs,{onClick:n,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Zs,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Qs,{children:[e.jsxs(Xs,{children:[e.jsxs(Ys,{children:[e.jsx(Js,{children:s("names.heroTitle")}),e.jsx(ei,{children:s("names.heroSubtitle")})]}),e.jsxs(ti,{children:[e.jsxs(ni,{"data-testid":"names-input-wrap",children:[e.jsxs(si,{invalid:x==="taken",children:[e.jsxs(ri,{children:[e.jsx(li,{"aria-hidden":!0,children:"@"}),e.jsx(ci,{value:m,onChange:S=>k(Kn(S.target.value)),placeholder:T,"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Ae,onFocus:()=>re(!0),style:{width:L!=null?`${L}px`:void 0}}),e.jsx(ii,{ref:A,"aria-hidden":!0,"data-placeholder":!m||void 0,children:m||T}),e.jsx(di,{children:s("names.suffix")})]}),m.length>0?e.jsxs(hi,{"aria-hidden":!0,children:[m.length,"/",Ae]}):null,e.jsx(gt,{onClick:q,disabled:!H,"data-testid":"names-claim",children:D})]}),x==="taken"?e.jsxs(ai,{role:"status","data-testid":"names-taken",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(oi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,x==="checking"?e.jsx(ke,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):G?e.jsxs(ke,{tone:"muted",role:"status","data-testid":"names-disabled",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.registrationDisabled")}),e.jsxs(fi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.registrationDisabledLink"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):x==="error"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.checkError")}):x==="invalid"&&!U.ok&&U.reason==="too-short"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.tooShort",{min:ft})}):null]}),e.jsx(pi,{onClick:q,disabled:!H,children:D}),e.jsx(vi,{role:"status","aria-live":"polite",children:x==="available"?s("names.available",{name:m}):""})]})]}),e.jsxs(xi,{children:[e.jsxs(gi,{children:[e.jsx(bi,{children:s("names.whyTitle")}),e.jsx(yi,{children:s("names.whyIntro")})]}),e.jsxs(wi,{children:[e.jsxs(Se,{children:[e.jsx(Ee,{src:Us,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why1Title")}),e.jsx(_e,{children:s("names.why1")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Hs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why2Title")}),e.jsxs(_e,{children:[s("names.why2")," ",e.jsx(ji,{children:s("names.why2Address")})]}),e.jsxs(rt,{href:Ci,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Ds,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why3Title")}),e.jsx(_e,{children:s("names.why3")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Gs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why4Title")}),e.jsx(_e,{children:s("names.why4")}),e.jsxs(rt,{href:$i,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),v?e.jsx(Fs,{name:m,priceCredits:C,onClose:()=>$(!1)}):null]})}const Si=i.p`
974
974
  display: flex;
975
975
  align-items: center;
976
976
  gap: 10px;
@@ -986,5 +986,5 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-DDGb8tzY.js";import{c
986
986
  background: rgba(211, 51, 51, 0.1);
987
987
  color: ${t.colors.err};
988
988
  }
989
- `,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);Vt(`${I}:${x??""}`);const[O,B]=p.useState(!1);p.useEffect(()=>{if(!O)return;const o=xe=>{xe.key==="Escape"&&B(!1)};document.addEventListener("keydown",o);const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=X}},[O]);const ie=n!==void 0&&n.length===0,T=R==="on_sale",A=v&&!Number.isNaN(Number(v))?Number(v):void 0,L=$&&!Number.isNaN(Number($))?Number($):void 0,J=Bt(),U=x?Gt[x]:void 0,z=[...c?[Zt]:[],...F?Qt:Yt],H=z.find(o=>o.key===N)??z[0],G=H.server,q={category:I,rarities:y.length?y:void 0,wearableCategories:U,minPriceCredits:A,maxPriceCredits:L,search:c||void 0,sortBy:G,isSmart:u||void 0,onSale:!0,discounted:F||void 0,listingType:J?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},D={category:I,rarities:y.length?y:void 0,wearableCategories:U,search:c||void 0,sortBy:G,isWearableSmart:u||void 0,isOnSale:R==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:S,total:P,isLoading:_,isPlaceholderData:M,error:ae,hasNextPage:ee,isFetchingNextPage:le,isFetchNextPageError:K,fetchNextPage:Ne}=pn(T?["shop-items",q]:["catalog-items",D],o=>T?Ht({...q,first:ct,skip:o}):Dt({...D,first:ct,skip:o}),{enabled:I!=="names"&&!ie}),te=P,{data:ce,isError:de,isPending:he}=ut(),pe=o=>ce&&o.manaWei?mt(o.manaWei,ce):null,Le=T&&he&&S.some(o=>o.source==="legacy"),ue=_||M||Le,me=_?15:Math.max(S.length,1),Q=p.useRef(null);p.useEffect(()=>{_||M||!c||Q.current===c||(Q.current=c,Me("Shop Searched",{query:c,result_count:te}))},[c,_,M,te]);const Y=p.useRef("__init__");p.useEffect(()=>{if(_||M)return;const o=JSON.stringify({category:I,subCategory:x,rarities:y,min:A,max:L,sort:N,status:R,smart:u});if(Y.current==="__init__"||Y.current===o){Y.current=o;return}Y.current=o,Me("Shop Applied Filter",{filters:{category:I,sub_category:x,rarities:y,min_price_credits:A??null,max_price_credits:L??null,status:R,smart:u,sort:N},result_count:te})},[I,x,y,A,L,N,R,u,_,M,te]);function f(o){k({category:o,subCategory:null})}function E(o){k({status:o})}function oe(o){k({rarities:y.includes(o)?y.filter(X=>X!==o):[...y,o]})}function fe(){k(C)}const ne=[];(A!=null||L!=null)&&ne.push({key:"price",label:s("filter.price"),onRemove:()=>{k({priceMin:"",priceMax:""})}});for(const o of Ft)y.includes(o)&&ne.push({key:`rarity-${o}`,label:Ot(o),onRemove:()=>oe(o)});return u&&ne.push({key:"smart",label:s("filter.smart"),onRemove:()=>k({smart:!1})}),F&&ne.push({key:"deals",label:s("filter.deals"),onRemove:()=>k({deals:!1,sort:qe(!!c,!1)})}),R!==l&&ne.push({key:"status",label:R==="all"?s("filter.statusAll"):R==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>E(l)}),e.jsxs(en,{"data-testid":"browse",children:[I!=="names"&&e.jsxs(e.Fragment,{children:[O?e.jsx(tn,{onClick:()=>B(!1),"aria-hidden":!0}):null,e.jsxs(nn,{"data-open":O||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(sn,{children:[e.jsx(an,{children:s("assets.filters")}),e.jsx(on,{onClick:()=>B(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(rn,{children:e.jsx(Xt,{category:I,subCategory:x,onCategory:f,onSub:o=>k({subCategory:o}),priceMin:v,priceMax:$,onPriceMin:o=>k({priceMin:o}),onPriceMax:o=>k({priceMax:o}),rarities:y,onToggleRarity:oe,status:R,onStatus:E,hideNames:a,smart:u,onSmart:o=>k({smart:o}),deals:F,onDeals:j?o=>k({deals:o,sort:qe(!!c,o)}):void 0})}),e.jsx(ln,{children:e.jsx(cn,{type:"button",onClick:()=>B(!1),children:s("assets.showItems")})})]})]}),e.jsx(dn,{children:I==="names"?e.jsx(ki,{onBack:()=>f("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Jt,{sort:H.key,sortOptions:z,onSort:o=>k({sort:o}),total:P,loading:_||M,query:c,onOpenFilters:()=>B(!0),chips:ne,onClearChips:fe}),de&&T&&S.some(o=>o.source==="legacy")?e.jsx(Si,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,ae?e.jsx(un,{message:s("assets.loadError"),testId:"browse-error"}):null,!ue&&S.length===0&&!ae?e.jsx(Ut,{testId:"browse-empty",icon:Kt,title:s("assets.empty.title"),body:g?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:g}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>w("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(Gn,{"data-testid":"grid",children:ue?e.jsx(et,{count:me}):e.jsxs(e.Fragment,{children:[S.map(o=>{if(!T)return e.jsx(be,{item:o,mode:"view"},ye(o));const X=o;if(X.source!=="legacy")return e.jsx(be,{item:o},ye(o));const xe=pe(X);return xe==null?e.jsx(be,{item:o,mode:"view"},ye(o)):e.jsx(be,{item:{...X,priceCredits:xe}},ye(o))}),le?e.jsx(et,{count:6}):null]})}),e.jsx(hn,{hasNextPage:ee,isFetching:le,isError:K,onLoadMore:()=>void Ne()})]})]})})]})}export{sa as Assets};
990
- //# sourceMappingURL=Assets-BjBHmuPJ.js.map
989
+ `,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);Vt(`${I}:${x??""}`);const[O,B]=p.useState(!1);p.useEffect(()=>{if(!O)return;const o=xe=>{xe.key==="Escape"&&B(!1)};document.addEventListener("keydown",o);const Y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=Y}},[O]);const ie=n!==void 0&&n.length===0,T=R==="on_sale",A=v&&!Number.isNaN(Number(v))?Number(v):void 0,L=$&&!Number.isNaN(Number($))?Number($):void 0,J=Bt(),U=x?Gt[x]:void 0,z=[...c?[Zt]:[],...F?Qt:Xt],H=z.find(o=>o.key===N)??z[0],G=H.server,q={category:I,rarities:y.length?y:void 0,wearableCategories:U,minPriceCredits:A,maxPriceCredits:L,search:c||void 0,sortBy:G,isSmart:u||void 0,onSale:!0,discounted:F||void 0,listingType:J?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},D={category:I,rarities:y.length?y:void 0,wearableCategories:U,search:c||void 0,sortBy:G,isWearableSmart:u||void 0,isOnSale:R==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:S,total:P,isLoading:_,isPlaceholderData:M,error:ae,hasNextPage:ee,isFetchingNextPage:le,isFetchNextPageError:K,fetchNextPage:Ne}=pn(T?["shop-items",q]:["catalog-items",D],o=>T?Ht({...q,first:ct,skip:o}):Dt({...D,first:ct,skip:o}),{enabled:I!=="names"&&!ie}),te=P,{data:ce,isError:de,isPending:he}=ut(),pe=o=>ce&&o.manaWei?mt(o.manaWei,ce):null,Le=T&&he&&S.some(o=>o.source==="legacy"),ue=_||M||Le,me=_?15:Math.max(S.length,1),Q=p.useRef(null);p.useEffect(()=>{_||M||!c||Q.current===c||(Q.current=c,Me("Shop Searched",{query:c,result_count:te}))},[c,_,M,te]);const X=p.useRef("__init__");p.useEffect(()=>{if(_||M)return;const o=JSON.stringify({category:I,subCategory:x,rarities:y,min:A,max:L,sort:N,status:R,smart:u});if(X.current==="__init__"||X.current===o){X.current=o;return}X.current=o,Me("Shop Applied Filter",{filters:{category:I,sub_category:x,rarities:y,min_price_credits:A??null,max_price_credits:L??null,status:R,smart:u,sort:N},result_count:te})},[I,x,y,A,L,N,R,u,_,M,te]);function f(o){k({category:o,subCategory:null})}function E(o){k({status:o})}function oe(o){k({rarities:y.includes(o)?y.filter(Y=>Y!==o):[...y,o]})}function fe(){k(C)}const ne=[];(A!=null||L!=null)&&ne.push({key:"price",label:s("filter.price"),onRemove:()=>{k({priceMin:"",priceMax:""})}});for(const o of Ft)y.includes(o)&&ne.push({key:`rarity-${o}`,label:Ot(o),onRemove:()=>oe(o)});return u&&ne.push({key:"smart",label:s("filter.smart"),onRemove:()=>k({smart:!1})}),F&&ne.push({key:"deals",label:s("filter.deals"),onRemove:()=>k({deals:!1,sort:qe(!!c,!1)})}),R!==l&&ne.push({key:"status",label:R==="all"?s("filter.statusAll"):R==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>E(l)}),e.jsxs(en,{"data-testid":"browse",children:[I!=="names"&&e.jsxs(e.Fragment,{children:[O?e.jsx(tn,{onClick:()=>B(!1),"aria-hidden":!0}):null,e.jsxs(nn,{"data-open":O||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(sn,{children:[e.jsx(an,{children:s("assets.filters")}),e.jsx(on,{onClick:()=>B(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(rn,{children:e.jsx(Yt,{category:I,subCategory:x,onCategory:f,onSub:o=>k({subCategory:o}),priceMin:v,priceMax:$,onPriceMin:o=>k({priceMin:o}),onPriceMax:o=>k({priceMax:o}),rarities:y,onToggleRarity:oe,status:R,onStatus:E,hideNames:a,smart:u,onSmart:o=>k({smart:o}),deals:F,onDeals:j?o=>k({deals:o,sort:qe(!!c,o)}):void 0})}),e.jsx(ln,{children:e.jsx(cn,{type:"button",onClick:()=>B(!1),children:s("assets.showItems")})})]})]}),e.jsx(dn,{children:I==="names"?e.jsx(ki,{onBack:()=>f("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Jt,{sort:H.key,sortOptions:z,onSort:o=>k({sort:o}),total:P,loading:_||M,query:c,onOpenFilters:()=>B(!0),chips:ne,onClearChips:fe}),de&&T&&S.some(o=>o.source==="legacy")?e.jsx(Si,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,ae?e.jsx(un,{message:s("assets.loadError"),testId:"browse-error"}):null,!ue&&S.length===0&&!ae?e.jsx(Ut,{testId:"browse-empty",icon:Kt,title:s("assets.empty.title"),body:g?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:g}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>w("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(Gn,{"data-testid":"grid",children:ue?e.jsx(et,{count:me}):e.jsxs(e.Fragment,{children:[S.map(o=>{if(!T)return e.jsx(be,{item:o,mode:"view"},ye(o));const Y=o;if(Y.source!=="legacy")return e.jsx(be,{item:o},ye(o));const xe=pe(Y);return xe==null?e.jsx(be,{item:o,mode:"view"},ye(o)):e.jsx(be,{item:{...Y,priceCredits:xe}},ye(o))}),le?e.jsx(et,{count:6}):null]})}),e.jsx(hn,{hasNextPage:ee,isFetching:le,isError:K,onLoadMore:()=>void Ne()})]})]})})]})}export{sa as Assets};
990
+ //# sourceMappingURL=Assets-Dn9STriB.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-DDGb8tzY.js";import{s as i,a as z,t as a,z as Ie,F as pe,W as Fe,C as Me,E as Le,bk as Ma,A as Ta,I as Y,n as Je,B as Ia,ag as H,X as Tt,x as Aa,y as Ea,w as Pa,bl as za,aI as Ra,bm as Ba,Y as _a,bn as qa,bo as Wa,bp as Fa,bq as It,$ as La,br as Ka,bs as Na,bt as Qa,as as Ke,a0 as Ua,D as Ga,bu as At,O as V,bv as Et,bw as Oa,bx as Ha,l as ie,by as Da,bz as Va,bA as Ya,bB as Ne,bh as Xa,bC as we,bD as Ce,bE as Pt,bF as Ja,h as zt,j as Rt,bG as Za}from"./index-B_WMntff.js";import{C as es,b as ts,t as as,a as ss,A as ns,s as Bt,r as _t,i as qt,m as is,c as rs,p as Wt,d as os}from"./CollectionCarousel-CgH1kned.js";import{M as cs,S as ls,C as ds,H as us,a as hs,T as ps,X as gs,B as fs,b as xs,c as Ft,d as ms,e as Ae,f as bs,g as ys,h as vs,i as Xe,j as he,L as ws,P as Cs,k as Lt,l as Kt,W as js,m as ks,n as Ss,o as $s,A as Ms,p as Ts,q as Is,r as As,s as Es,t as Ps,u as zs,v as Rs,w as Qe,x as Bs,y as _s}from"./CreditPackPicker-Gbn87yeA.js";import{m as Te}from"./mana-matic-light-Bl5duieC.js";import{q as qs,s as Ws,g as Fs,t as Ls,u as Ks,A as Ns}from"./trade-encoding-C22ecqMk.js";import{p as Nt,g as Qs,a as Ue}from"./buy-Blp8fB9D.js";import{w as Us,S as Ge,b as Gs,G as Os}from"./buy-gasless-Dx9azM4y.js";import{l as Hs,u as Ds,M as Vs,R as je,o as Ys,r as Xs,c as Js,g as Zs,a as en,p as Qt,b as Oe}from"./loader-logo-B9eq0x19.js";import{i as tn,a as an}from"./errors-0LJiROE6.js";import{E as sn}from"./ErrorNotice-Ba9jMEfx.js";import"./dcl-schemas-FrMtnn10.js";import"./sentry-CLzhirRK.js";import"./ethers-DeJawSZV.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-DFpGnYln.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new n.Error().stack;d&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[d]="21f41a21-7a31-4317-89d9-855cd1a1895f",n._sentryDebugIdIdentifier="sentry-dbid-21f41a21-7a31-4317-89d9-855cd1a1895f")}catch{}})();const nn=i.div`
1
+ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-CIPIqkKp.js";import{s as i,a as z,t as a,z as Ie,F as pe,W as Fe,C as Me,E as Le,bl as Ma,A as Ta,I as Y,n as Je,B as Ia,aj as H,$ as Tt,x as Aa,y as Ea,w as Pa,bm as za,X as Ra,bn as Ba,a0 as _a,bo as qa,bp as Wa,bq as Fa,br as It,a2 as La,bs as Ka,bt as Na,bu as Qa,av as Ke,a3 as Ua,D as Ga,bv as At,O as V,bw as Et,bx as Oa,by as Ha,l as ie,bz as Da,bA as Va,bB as Ya,bC as Ne,bi as Xa,bD as we,bE as Ce,Z as Pt,bF as Ja,h as zt,j as Rt,bG as Za}from"./index--6KpZcM5.js";import{C as es,b as ts,t as as,a as ss,A as ns,s as Bt,r as _t,i as qt,m as is,c as rs,p as Wt,d as os}from"./CollectionCarousel-UPeRXz9b.js";import{M as cs,S as ls,C as ds,H as us,a as hs,T as ps,X as gs,B as xs,b as fs,c as Ft,d as ms,e as Ae,f as bs,g as ys,h as vs,i as Xe,j as he,L as ws,P as Cs,k as Lt,l as Kt,W as js,m as ks,n as Ss,o as $s,A as Ms,p as Ts,q as Is,r as As,s as Es,t as Ps,u as zs,v as Rs,w as Qe,x as Bs,y as _s}from"./CreditPackPicker-BqGavVgR.js";import{m as Te}from"./mana-matic-light-Bl5duieC.js";import{q as qs,s as Ws,g as Fs,t as Ls,u as Ks,A as Ns}from"./trade-encoding-Cv_E0sn5.js";import{p as Nt,g as Qs,a as Ue}from"./buy-RnCuARVP.js";import{w as Us,S as Ge,b as Gs,G as Os}from"./buy-gasless-COdNSlBG.js";import{l as Hs,u as Ds,M as Vs,R as je,o as Ys,r as Xs,c as Js,g as Zs,a as en,p as Qt,b as Oe}from"./loader-logo-DwchSnaT.js";import{i as tn,a as an}from"./errors-CynPossx.js";import{E as sn}from"./ErrorNotice-CbW4Q2ZV.js";import"./dcl-schemas-B4SkwUm_.js";import"./sentry-AydgbXDV.js";import"./ethers-H2EHHmSo.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-8HXF7dJf.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new n.Error().stack;d&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[d]="ebcb1288-dcd4-4af0-8020-5169e1deaa23",n._sentryDebugIdIdentifier="sentry-dbid-ebcb1288-dcd4-4af0-8020-5169e1deaa23")}catch{}})();const nn=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -161,7 +161,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-DDGb8tzY.js";import{s
161
161
  font-weight: 700;
162
162
  color: ${re.text};
163
163
  }
164
- `,fn=i.p`
164
+ `,xn=i.p`
165
165
  margin: 12px 0 0;
166
166
  background: rgba(255, 162, 90, 0.3);
167
167
  border-radius: ${z.radius.btn};
@@ -170,7 +170,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-DDGb8tzY.js";import{s
170
170
  font-size: 14px;
171
171
  line-height: 1.334;
172
172
  color: ${z.colors.text2};
173
- `;function xn(n){const{phase:d,balanceCredits:k,onClose:S}=n,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),G=d==="processing";return e.jsxs(cs,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ls,{onClick:R?void 0:S,"aria-hidden":!0}),e.jsxs(ds,{"data-tall":G||void 0,children:[e.jsxs(us,{children:[e.jsxs(hs,{children:[e.jsx(ps,{children:U}),!R&&e.jsx(gs,{onClick:S,"aria-label":a("buyModal.close"),children:e.jsx(es,{})})]}),e.jsxs(fs,{children:[e.jsx(xs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Ft,{}),e.jsx(ms,{children:pe(k)})]}),n.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(fn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:n.heldCreditsCount,currency:Me.name})}):null]}),d==="choose"&&e.jsxs(Ae,{children:[e.jsxs(gn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Ft,{}),pe(n.totalCredits??0)]})]}),e.jsx(Zt,{options:n.options??[],totalCents:n.totalCents??0,shortfall:n.shortfall,onPay:n.onPay??(()=>{})})]}),d==="processing"&&e.jsx(mn,{stage:n.stage??"reserving",step:n.step??1,total:n.total??1,isSelfCustody:!!n.isSelfCustody,signatures:n.signatures}),d==="nofunds"&&e.jsx(bn,{lines:n.lines??[],shortfallCredits:n.shortfallCredits??0,packs:n.packs??[],selectedPack:n.selectedPack??"",onSelectPack:n.onSelectPack??(()=>{}),onBuyPacks:n.onBuyPacks??(()=>{}),onCancel:S}),d==="error"&&e.jsxs(Ae,{children:[e.jsxs(bs,{"data-testid":"buy-error",children:[e.jsx(ys,{src:ts,alt:"",width:64,height:80}),e.jsxs(vs,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",n.heldCredits?e.jsxs(e.Fragment,{children:[n.message?e.jsxs(e.Fragment,{children:[n.message," "]}):null,a("cartCheckout.heldLead",{currency:Me.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Me.name})]}):n.message??a("cartCheckout.errorBody")]})]}),n.heldCredits?e.jsx(Xe,{children:e.jsx(he,{"data-variant":"purple","data-full":!0,onClick:S,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:S,children:a("buyModal.cancel")}),e.jsx(he,{"data-variant":"purple",onClick:n.onRetry??S,children:a("cartCheckout.tryAgain")})]})]})]})]})}function mn({stage:n,step:d,total:k,isSelfCustody:S,signatures:R}){const U=n==="reserving",G=k>0?Math.min(100,Math.round(d/k*100)):0,O=S&&R&&R.total>1,M=n==="awaiting-signature"?S?O?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):n==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ae,{"data-processing":!0,children:[e.jsx(ws,{src:Hs,alt:"",width:61,height:61}),e.jsx(Cs,{children:M}),U?e.jsxs(dn,{children:[e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{"data-step":!0,style:{width:`${G}%`}})}),k>1?e.jsxs(un,{children:[d,"/",k]}):null]}):e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{})})]})}function bn({lines:n,shortfallCredits:d,packs:k,selectedPack:S,onSelectPack:R,onBuyPacks:U,onCancel:G}){const O=n.reduce((M,r)=>M+(r.quantity??1),0);return e.jsxs(Ae,{children:[e.jsxs(js,{"data-testid":"nofunds-warning",children:[e.jsx(ks,{}),e.jsxs(Ss,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:O}),Le()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx($s,{href:Ma("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(hn,{children:n.map(M=>{const r=M.quantity??1;return e.jsxs(Ms,{children:[e.jsx(Ts,{children:M.item.thumbnail?e.jsx("img",{src:M.item.thumbnail,alt:""}):null}),e.jsxs(Is,{children:[e.jsxs("div",{children:[e.jsxs(As,{title:M.item.name,children:[M.item.name||a("buyModal.itemFallback"),r>1?e.jsx(pn,{children:a("cartCheckout.qty",{count:r})}):null]}),M.item.creator?e.jsx(Es,{address:M.item.creator}):null]}),e.jsxs(Ps,{children:[e.jsx(zs,{}),e.jsx("span",{children:pe(M.priceCredits*r)})]})]})]},M.item.id)})}),Le()?null:e.jsx(e.Fragment,{children:e.jsx(Rs,{packs:k,selectedId:S||void 0,onSelect:R})}),e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:G,children:a("buyModal.cancel")}),Le()?null:e.jsx(he,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:yn,radius:oe}=z,ea="@media (max-width: 1080px)",E="@media (max-width: 880px)",Gt=i.div`
173
+ `;function fn(n){const{phase:d,balanceCredits:k,onClose:S}=n,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),G=d==="processing";return e.jsxs(cs,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ls,{onClick:R?void 0:S,"aria-hidden":!0}),e.jsxs(ds,{"data-tall":G||void 0,children:[e.jsxs(us,{children:[e.jsxs(hs,{children:[e.jsx(ps,{children:U}),!R&&e.jsx(gs,{onClick:S,"aria-label":a("buyModal.close"),children:e.jsx(es,{})})]}),e.jsxs(xs,{children:[e.jsx(fs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Ft,{}),e.jsx(ms,{children:pe(k)})]}),n.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(xn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:n.heldCreditsCount,currency:Me.name})}):null]}),d==="choose"&&e.jsxs(Ae,{children:[e.jsxs(gn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Ft,{}),pe(n.totalCredits??0)]})]}),e.jsx(Zt,{options:n.options??[],totalCents:n.totalCents??0,shortfall:n.shortfall,onPay:n.onPay??(()=>{})})]}),d==="processing"&&e.jsx(mn,{stage:n.stage??"reserving",step:n.step??1,total:n.total??1,isSelfCustody:!!n.isSelfCustody,signatures:n.signatures}),d==="nofunds"&&e.jsx(bn,{lines:n.lines??[],shortfallCredits:n.shortfallCredits??0,packs:n.packs??[],selectedPack:n.selectedPack??"",onSelectPack:n.onSelectPack??(()=>{}),onBuyPacks:n.onBuyPacks??(()=>{}),onCancel:S}),d==="error"&&e.jsxs(Ae,{children:[e.jsxs(bs,{"data-testid":"buy-error",children:[e.jsx(ys,{src:ts,alt:"",width:64,height:80}),e.jsxs(vs,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",n.heldCredits?e.jsxs(e.Fragment,{children:[n.message?e.jsxs(e.Fragment,{children:[n.message," "]}):null,a("cartCheckout.heldLead",{currency:Me.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Me.name})]}):n.message??a("cartCheckout.errorBody")]})]}),n.heldCredits?e.jsx(Xe,{children:e.jsx(he,{"data-variant":"purple","data-full":!0,onClick:S,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:S,children:a("buyModal.cancel")}),e.jsx(he,{"data-variant":"purple",onClick:n.onRetry??S,children:a("cartCheckout.tryAgain")})]})]})]})]})}function mn({stage:n,step:d,total:k,isSelfCustody:S,signatures:R}){const U=n==="reserving",G=k>0?Math.min(100,Math.round(d/k*100)):0,O=S&&R&&R.total>1,M=n==="awaiting-signature"?S?O?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):n==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ae,{"data-processing":!0,children:[e.jsx(ws,{src:Hs,alt:"",width:61,height:61}),e.jsx(Cs,{children:M}),U?e.jsxs(dn,{children:[e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{"data-step":!0,style:{width:`${G}%`}})}),k>1?e.jsxs(un,{children:[d,"/",k]}):null]}):e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{})})]})}function bn({lines:n,shortfallCredits:d,packs:k,selectedPack:S,onSelectPack:R,onBuyPacks:U,onCancel:G}){const O=n.reduce((M,r)=>M+(r.quantity??1),0);return e.jsxs(Ae,{children:[e.jsxs(js,{"data-testid":"nofunds-warning",children:[e.jsx(ks,{}),e.jsxs(Ss,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:O}),Le()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx($s,{href:Ma("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(hn,{children:n.map(M=>{const r=M.quantity??1;return e.jsxs(Ms,{children:[e.jsx(Ts,{children:M.item.thumbnail?e.jsx("img",{src:M.item.thumbnail,alt:""}):null}),e.jsxs(Is,{children:[e.jsxs("div",{children:[e.jsxs(As,{title:M.item.name,children:[M.item.name||a("buyModal.itemFallback"),r>1?e.jsx(pn,{children:a("cartCheckout.qty",{count:r})}):null]}),M.item.creator?e.jsx(Es,{address:M.item.creator}):null]}),e.jsxs(Ps,{children:[e.jsx(zs,{}),e.jsx("span",{children:pe(M.priceCredits*r)})]})]})]},M.item.id)})}),Le()?null:e.jsx(e.Fragment,{children:e.jsx(Rs,{packs:k,selectedId:S||void 0,onSelect:R})}),e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:G,children:a("buyModal.cancel")}),Le()?null:e.jsx(he,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:yn,radius:oe}=z,ea="@media (max-width: 1080px)",E="@media (max-width: 880px)",Gt=i.div`
174
174
  max-width: 1510px;
175
175
  margin: 0 auto;
176
176
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -744,5 +744,5 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-DDGb8tzY.js";import{s
744
744
  & section {
745
745
  margin-top: 0;
746
746
  }
747
- `;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.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 oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,fe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:xe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),fa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),xa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),fe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const f=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:x,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:x.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[x],maxCreditedValue:b})}),K+=p.units.length}catch(x){if(an(x)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw x}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,x)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(x)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const x=await Promise.allSettled(p.map(b=>Us(b)));return x.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),x.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>f.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const x=await ae(g);if(x.length&&!x.some(b=>b instanceof Ge))throw x[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:x})=>x.forEach(b=>f.add(b)),onSettled:({txHash:x,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(x)},onReverted:({salts:x})=>x.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(x=>f.add(x)),onSettled:({txHash:p,salts:x})=>{x.forEach(b=>I.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(x=>L.add(x))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...f].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,f)=>v+f.usdCents,0),c=(xe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n});if(s&&v.options.some(f=>f.method===s)){if(s==="credits"){_e(t);return}const f=bt(v,s);await xt(ft(s,t),f,()=>s==="mana"?void yt(t,f):void vt(t,c,h));return}if(v.options.some(f=>f.method==="mana"||f.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n})}const[ue,ye]=T.useState(null);function ft(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function xt(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const f=Ws(v,h),I=r?await Fs(f,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(f)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);xt(ft(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(f=>({...f.item,priceCredits:f.priceCredits})),h=t.map(f=>({...f.item,priceCredits:f.priceCredits,quantity:f.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const f=await rs({trades:fa(o),coupons:xa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:f[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,f)}catch(f){ht(f,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),f=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=f[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const x=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,x.contractAddress&&x.itemId!=null?{contractAddress:x.contractAddress,itemId:String(x.itemId)}:void 0);I.push({salt:b.id,itemId:x.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),fe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),fe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),fe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,f=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{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(Pn,{"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(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||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(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||f,"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(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.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}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(xn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
748
- //# sourceMappingURL=Cart-Cy1wJUG-.js.map
747
+ `;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.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 oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,xe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:fe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),xa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),fa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),xe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const x=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:f,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:f.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[f],maxCreditedValue:b})}),K+=p.units.length}catch(f){if(an(f)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw f}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,f)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(f)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const f=await Promise.allSettled(p.map(b=>Us(b)));return f.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),f.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>x.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const f=await ae(g);if(f.length&&!f.some(b=>b instanceof Ge))throw f[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:f})=>f.forEach(b=>x.add(b)),onSettled:({txHash:f,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(f)},onReverted:({salts:f})=>f.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(f=>x.add(f)),onSettled:({txHash:p,salts:f})=>{f.forEach(b=>I.add(b)),F.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(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...x].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,x)=>v+x.usdCents,0),c=(fe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n});if(s&&v.options.some(x=>x.method===s)){if(s==="credits"){_e(t);return}const x=bt(v,s);await ft(xt(s,t),x,()=>s==="mana"?void yt(t,x):void vt(t,c,h));return}if(v.options.some(x=>x.method==="mana"||x.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n})}const[ue,ye]=T.useState(null);function xt(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function ft(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const x=Ws(v,h),I=r?await Fs(x,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(x)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);ft(xt(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const x=await rs({trades:xa(o),coupons:fa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,x)}catch(x){ht(x,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),x=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=x[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const f=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,f.contractAddress&&f.itemId!=null?{contractAddress:f.contractAddress,itemId:String(f.itemId)}:void 0);I.push({salt:b.id,itemId:f.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),xe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),xe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),xe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,x=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{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(Pn,{"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(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||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(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||x,"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(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.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}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(fn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
748
+ //# sourceMappingURL=Cart-CII8Xe0D.js.map