@dcl/shop 0.7.3-31002809274.commit-68e2004 → 0.7.3-31004669641.commit-bf2b4b9

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 (196) hide show
  1. package/_assets/Activity-BY9v5uGI.js +381 -0
  2. package/_assets/{AnimatedBackground-BPNjZnHs.js → AnimatedBackground-d_qXXLZ1.js} +2 -2
  3. package/_assets/{Assets-B9gu6JnA.js → Assets-BZE6MNTH.js} +11 -11
  4. package/_assets/{Assets.styles-DiCnesUC.js → Assets.styles-CnXHifI7.js} +2 -2
  5. package/_assets/{Authorizations-BQzDrrA_.js → Authorizations-DWPIfXPK.js} +4 -4
  6. package/_assets/Cart-eLOXdOz1.js +695 -0
  7. package/_assets/{CircularProgress-CQb8cfhx.js → CircularProgress-DTjTksS3.js} +3 -3
  8. package/_assets/{Collection-DvApaJVE.js → Collection-CIFeZjf3.js} +2 -2
  9. package/_assets/{CollectionCarousel-3Ff7fmHM.js → CollectionCarousel-DQNzqOkv.js} +55 -55
  10. package/_assets/{ContentClient-Bv-dXg1a.js → ContentClient-CRr9ZuRH.js} +1 -1
  11. package/_assets/{Creator-phXYNMmi.js → Creator-CrPYV324.js} +26 -26
  12. package/_assets/{DeploymentBuilder-DbR23a3M.js → DeploymentBuilder-DYNbIRzZ.js} +1 -1
  13. package/_assets/{ErrorNotice-Biw7jacR.js → ErrorNotice--UMHyZQ4.js} +1 -1
  14. package/_assets/{ExchangeController-j0EaU5ur.js → ExchangeController-Cw3I4QaN.js} +1 -1
  15. package/_assets/{Faq-CYehw8Xd.js → Faq-Bp-D4IrP.js} +2 -2
  16. package/_assets/{GetCredits-B5t5SiEY.js → GetCredits-CP5H3xk1.js} +4 -4
  17. package/_assets/{Grow-BbO3nPWz.js → Grow-CJ1PmyMj.js} +1 -1
  18. package/_assets/{HelpersUtil-Bm2I2riv.js → HelpersUtil-SHIQGznF.js} +1 -1
  19. package/_assets/ItemDetail-JScjMgo5.js +3516 -0
  20. package/_assets/LazyEmoteControls-D0uKVSFP.js +2 -0
  21. package/_assets/{LoadMore-DMhOO7Nq.js → LoadMore-CYbQF7Q0.js} +2 -2
  22. package/_assets/ManaPricingBanner.styles-7PjhHSIi.js +74 -0
  23. package/_assets/{MyAssets-pppiT6fl.js → MyAssets-BtVKb2bo.js} +2 -2
  24. package/_assets/{MyFavorites-B8NF0NVk.js → MyFavorites-BjdScB7R.js} +1 -1
  25. package/_assets/{NotFound-ySn_lkJ7.js → NotFound-DJy-difK.js} +4 -4
  26. package/_assets/{NotificationsBell-Mz-RqcfB.js → NotificationsBell-CYkkKwLS.js} +1 -1
  27. package/_assets/{OutfitDetail-dru3bX0e.js → OutfitDetail-Bd_MlsAu.js} +4 -4
  28. package/_assets/{OutfitPreview-RhS9kvYc.js → OutfitPreview-Bog0LK-T.js} +2 -2
  29. package/_assets/{OutfitStudio-B-MkV2Nw.js → OutfitStudio-GawF1FlF.js} +10 -10
  30. package/_assets/{StoreSettings-DMlPpaxq.js → StoreSettings-BuuzjCNb.js} +1 -1
  31. package/_assets/{Success-DGiWm-dB.js → Success-B6PVyVMT.js} +7 -7
  32. package/_assets/{SwapController-DC-RT5b2.js → SwapController-vRfOqnfY.js} +1 -1
  33. package/_assets/{Tooltip-DIS1AoSo.js → Tooltip-z-K5_r2G.js} +1 -1
  34. package/_assets/{TradeService-CW14jFoK.js → TradeService-DXen8uyN.js} +1 -1
  35. package/_assets/{W3MFrameProviderSingleton-Bn14TsAB.js → W3MFrameProviderSingleton-D0DuVK1Q.js} +3 -3
  36. package/_assets/{WebCryptoP256-DN6bPKJH.js → WebCryptoP256-oxgpEQ_A.js} +1 -1
  37. package/_assets/authorizations-jqQwcb6e.js +1 -0
  38. package/_assets/{basic-Db4hGFC-.js → basic-8OT967no.js} +1 -1
  39. package/_assets/{biconomy-yx9AAdUi.js → biconomy-C_1YJrQx.js} +1 -1
  40. package/_assets/{builder-Db8kqGSp.js → builder-DWtVDpBN.js} +1 -1
  41. package/_assets/buy-BQaJKCDU.js +1 -0
  42. package/_assets/buy-gasless-CZ9IMCzy.js +1 -0
  43. package/_assets/{categories-BMCKe30t.js → categories-gEEglioA.js} +32 -38
  44. package/_assets/{ccip-DSJk995u.js → ccip-SKapXXwI.js} +1 -1
  45. package/_assets/{ccip-kyphTkC8.js → ccip-y4ibU2Cv.js} +1 -1
  46. package/_assets/{collectionPage.styles-Dmgr28GG.js → collectionPage.styles-BYaw_6eJ.js} +7 -7
  47. package/_assets/{controller-BxSHfLz5.js → controller-DiG2j0Bj.js} +2 -2
  48. package/_assets/{core-FJbXZcd9.js → core-DVkS31SH.js} +4 -4
  49. package/_assets/{createSvgIcon-BVj0atRc.js → createSvgIcon-BUYy_aBs.js} +1 -1
  50. package/_assets/{custom-8lpWNVH1.js → custom-z_Yw6ggL.js} +1 -1
  51. package/_assets/{data-capture-ZsoqccWO.js → data-capture-DjCvuOfO.js} +1 -1
  52. package/_assets/{dcl-schemas-Dr9BTjb7.js → dcl-schemas-CmtP3U6y.js} +1 -1
  53. package/_assets/{disposePreview-8oEf57G7.js → disposePreview-B96DpOZy.js} +1 -1
  54. package/_assets/{email-TmqKH5rK.js → email-BaVWsYiK.js} +1 -1
  55. package/_assets/{embedded-wallet-D8AjSmuZ.js → embedded-wallet-C6OnTlQL.js} +1 -1
  56. package/_assets/{emotion-styled.browser.esm-B1CecDgm.js → emotion-styled.browser.esm-EAs3eW_Y.js} +1 -1
  57. package/_assets/{engine-CTKRqGmj.js → engine-CTTcDaNZ.js} +1 -1
  58. package/_assets/errors-DEg1qT4Y.js +1 -0
  59. package/_assets/{estimate-l1-fee-DpS-XaOF.js → estimate-l1-fee-AmLKK3kz.js} +1 -1
  60. package/_assets/{ethers-CtNGBird.js → ethers-DejfrZ8i.js} +1 -1
  61. package/_assets/{execute-Bz7pyjbp.js → execute-CG71Q0V6.js} +2 -2
  62. package/_assets/{features-W9H6sjcF.js → features-PXGl3AnM.js} +1 -1
  63. package/_assets/{fetchTokenMetadata-COd7SGVt.js → fetchTokenMetadata-CwMSW9Tj.js} +2 -2
  64. package/_assets/{field.styles-CdYHVXFs.js → field.styles-i8y02t11.js} +1 -1
  65. package/_assets/{get-ecosystem-wallet-info-CMuxAyIB.js → get-ecosystem-wallet-info-DtXl85OB.js} +1 -1
  66. package/_assets/{getBalance-DQubrLKJ.js → getBalance-CiuYRk08.js} +1 -1
  67. package/_assets/{getNFT-BNY2enZa.js → getNFT-BuPS2uUr.js} +1 -1
  68. package/_assets/{getNFT-CSRtW3h-.js → getNFT-CqiHMUz2.js} +1 -1
  69. package/_assets/{grid.styles-DH_ZretM.js → grid.styles-DEbulSnv.js} +1 -1
  70. package/_assets/{hashTypedData-Dqqcre1R.js → hashTypedData-BLt2Myt1.js} +1 -1
  71. package/_assets/{hashTypedData-BA0RWbmG.js → hashTypedData-DFL6TdkK.js} +1 -1
  72. package/_assets/{in-app-BvYCjHKb.js → in-app-sxEWWI71.js} +1 -1
  73. package/_assets/{in-app-wallet-calls-CxpZt-vc.js → in-app-wallet-calls-C5cCPgXV.js} +1 -1
  74. package/_assets/{index-BpsXe6IR.js → index-5ckQJdvo.js} +1 -1
  75. package/_assets/{index-C-IYvYAw.js → index-67nX322c.js} +1 -1
  76. package/_assets/{index-B91rfq1c.js → index-78Cn6c_7.js} +1 -1
  77. package/_assets/{index-Lb7odxFK.js → index-B1dodBTd.js} +1 -1
  78. package/_assets/{index-BDuns4Lg.js → index-B3D9_3qT.js} +1 -1
  79. package/_assets/{index-CuJbAAma.js → index-B7ZIe8-o.js} +1 -1
  80. package/_assets/index-BIZt_Cii.js +1 -0
  81. package/_assets/{index-CNepofQh.js → index-B_JiruyT.js} +1 -1
  82. package/_assets/{index-Bqt5iJBo.js → index-Bc0XpRAE.js} +1 -1
  83. package/_assets/{index-kUOBQ2KK.js → index-BkMwrTJ3.js} +1 -1
  84. package/_assets/{index-Cfy91mWw.js → index-BvRxx-Op.js} +1 -1
  85. package/_assets/{index-CNDHrB-N.js → index-C1zDjUql.js} +1 -1
  86. package/_assets/{index-qsorFlMF.js → index-C33PRPh0.js} +1 -1
  87. package/_assets/{index-BGOWhyHo.js → index-C3OG0-Rm.js} +3 -3
  88. package/_assets/{index-BiAcVSuI.js → index-C4dNaJNB.js} +1 -1
  89. package/_assets/{index-jjnXqv_1.js → index-C5KfCPRU.js} +1 -1
  90. package/_assets/{index-BjtZr1Rk.js → index-C7bppXGo.js} +1 -1
  91. package/_assets/{index-CkZ39O4D.js → index-C8xUshki.js} +1 -1
  92. package/_assets/{index-vZmAzias.js → index-CHcpd_Ml.js} +1 -1
  93. package/_assets/{index-C0jkYp6u.js → index-CIehX5LY.js} +1 -1
  94. package/_assets/{index-DtS2WMUT.js → index-CLEBFSaY.js} +1 -1
  95. package/_assets/{index-BmtMCuH8.js → index-CQ-nzCsh.js} +1 -1
  96. package/_assets/{index-Cj_FIJ6O.js → index-CW7T-svS.js} +1 -1
  97. package/_assets/{index-o5wXH6k1.js → index-CYXSUQre.js} +1 -1
  98. package/_assets/{index-DDe_P04W.js → index-CaVKZu6I.js} +1 -1
  99. package/_assets/index-CeopVToX.js +3504 -0
  100. package/_assets/{index-DsSWYz9j.js → index-ClN4jZIk.js} +1 -1
  101. package/_assets/{index-Wj_hpWlf.js → index-CoFiKLCF.js} +1 -1
  102. package/_assets/{index-Vcg4k-hF.js → index-CoPWTFH8.js} +1 -1
  103. package/_assets/{index-DIYqluqo.js → index-CtmC7UzU.js} +3 -3
  104. package/_assets/{index-CjpWKs8Q.js → index-Cv1Bu0gQ.js} +1 -1
  105. package/_assets/index-CvmGmJY_.js +2 -0
  106. package/_assets/{index-DOPim6Hs.js → index-D3pGB9SZ.js} +1 -1
  107. package/_assets/{index-BsEcuD0O.js → index-D93EJWs2.js} +2 -2
  108. package/_assets/{index-DhygeoM5.js → index-DHQ2fPeu.js} +3 -3
  109. package/_assets/{index-Ch2NaYC8.js → index-DN_dErJN.js} +1 -1
  110. package/_assets/{index-CRKbJ2OP.js → index-DQ6Egb9a.js} +1 -1
  111. package/_assets/{index-BJNlk-SI.js → index-DQJrunBx.js} +1 -1
  112. package/_assets/{index-Bl9hxKO2.js → index-DRX1VYfQ.js} +1 -1
  113. package/_assets/{index-Cr_vaK1b.js → index-DdKN54Dm.js} +1 -1
  114. package/_assets/{index-l92NuJVf.js → index-Dfv984cL.js} +1 -1
  115. package/_assets/{index-DBwuf2dy.js → index-Dqs83TPk.js} +1 -1
  116. package/_assets/{index-DLrjz4Tx.js → index-DsTxG252.js} +1 -1
  117. package/_assets/{index-WguW8tuP.js → index-DurGhmUt.js} +1 -1
  118. package/_assets/{index-CtwVaZjN.js → index-DvlueLuH.js} +1 -1
  119. package/_assets/{index-BfAg05xe.js → index-FAGRZO5x.js} +1 -1
  120. package/_assets/{index-CN8Fwkg_.js → index-FjcfjJmU.js} +2 -2
  121. package/_assets/{index-DG6oakSS.js → index-G6kG-9qx.js} +1 -1
  122. package/_assets/{index-DFAt726n.js → index-JjDJFXBe.js} +1 -1
  123. package/_assets/{index-DFCfS17C.js → index-K5Fr8OrY.js} +1 -1
  124. package/_assets/{index-DYoWqsAK.js → index-SVsxH_b4.js} +1 -1
  125. package/_assets/{index-DBGfpyip.js → index-dFGs7ucu.js} +1 -1
  126. package/_assets/{index-CefOdSuo.js → index-kQ-ETH4W.js} +1 -1
  127. package/_assets/{index-CxlN6NCL.js → index-miZ-bpMn.js} +7 -7
  128. package/_assets/{index-BogeqjBp.js → index-tAv2AuqO.js} +1 -1
  129. package/_assets/{index-DZOsxVd8.js → index-v6z9lSk-.js} +1 -1
  130. package/_assets/{index-CTvMZ0av.js → index-vW-YvhXV.js} +1 -1
  131. package/_assets/{index-Bw6vREOp.js → index-yniyfO-A.js} +2 -2
  132. package/_assets/{index.es-Db0bppXh.js → index.es-B_R9O1eE.js} +4 -4
  133. package/_assets/{index.es-DRPff5jo.js → index.es-CnlQU9TO.js} +1 -1
  134. package/_assets/{index.es-vm3av0ZU.js → index.es-nH3kt9zb.js} +1 -1
  135. package/_assets/{localBatchGatewayRequest-BT4bgYX3.js → localBatchGatewayRequest-CRA7Ohwq.js} +1 -1
  136. package/_assets/{networks-BjCyq87b.js → networks-BPbRQuXJ.js} +1 -1
  137. package/_assets/{onramp-MxLeUwo5.js → onramp-DAURmNvI.js} +1 -1
  138. package/_assets/{openzeppelin-NiqHvD0o.js → openzeppelin-RAIrBNFG.js} +1 -1
  139. package/_assets/{parseNft-DXKUZt78.js → parseNft-C8cGcKny.js} +2 -2
  140. package/_assets/{parseSignature-CHSFJk_c.js → parseSignature-Cosz4bIV.js} +1 -1
  141. package/_assets/{parseSignature-JjWPQjiQ.js → parseSignature-DI4-gGRK.js} +3 -3
  142. package/_assets/{passkeys-Dp5NPgWw.js → passkeys-Dx5zNag-.js} +1 -1
  143. package/_assets/{pay-with-exchange-CxuzzGwq.js → pay-with-exchange-DL_Cj2vD.js} +1 -1
  144. package/_assets/{qr-overlay-C29AmkL1.js → qr-overlay-D-IY5b74.js} +1 -1
  145. package/_assets/{receive-BSxHY6Lk.js → receive-BK0cXamC.js} +1 -1
  146. package/_assets/{resolveImplementation-DBwFo6J8.js → resolveImplementation-DtBE8M6b.js} +1 -1
  147. package/_assets/{rpc-B7hkwqRp.js → rpc-DvdjRONR.js} +1 -1
  148. package/_assets/{secp256k1-80kUQxfu.js → secp256k1-BGblV5cK.js} +1 -1
  149. package/_assets/{secp256k1-dBN4ORWU.js → secp256k1-DqooDfDM.js} +1 -1
  150. package/_assets/{secp256k1-BmlNWGtD.js → secp256k1-Jn3F0n__.js} +1 -1
  151. package/_assets/{send-C63T079L.js → send-DsSxPyoB.js} +1 -1
  152. package/_assets/{send-batch-transaction-BkwLmlea.js → send-batch-transaction-CjeCT7XS.js} +1 -1
  153. package/_assets/{send-eip712-transaction-6nm-uQAt.js → send-eip712-transaction-CTme_bPY.js} +2 -2
  154. package/_assets/{send-gasless-transaction-ASekpRez.js → send-gasless-transaction-Bb4bNRR9.js} +2 -2
  155. package/_assets/{send-transaction-Bzhp2g8b.js → send-transaction-pABhtz56.js} +2 -2
  156. package/_assets/{sendMetaTransaction-BATUzHIf.js → sendMetaTransaction-H67kFub1.js} +1 -1
  157. package/_assets/{sendRawTransaction-_Kv849f3.js → sendRawTransaction-B79pWyP7.js} +3 -3
  158. package/_assets/{serializeTransaction-ZzhlS1TB.js → serializeTransaction-48HG-PU6.js} +1 -1
  159. package/_assets/{session-proposal-DzR3pRyS.js → session-proposal-BcsaTK8S.js} +1 -1
  160. package/_assets/{session-request-VXo9pQwV.js → session-request-CeeAG1yH.js} +2 -2
  161. package/_assets/{signing-CGrYz3PN.js → signing-BKuWdGYf.js} +3 -3
  162. package/_assets/{socials-B-JrWB2l.js → socials-D_UOJlsU.js} +1 -1
  163. package/_assets/{styled-gTPQAN-Y.js → styled-BiSZljCY.js} +2 -2
  164. package/_assets/{swaps-CyAk4mTe.js → swaps-Czr01d7W.js} +1 -1
  165. package/_assets/{thirdweb-8szcRqMp.js → thirdweb-vG4lgpUb.js} +3 -3
  166. package/_assets/{to-serializable-transaction-CF8YxIRs.js → to-serializable-transaction-wl_9nUoT.js} +2 -2
  167. package/_assets/{transactionReceipt-CGVPV54W.js → transactionReceipt-CcSJiG0c.js} +1 -1
  168. package/_assets/{transactions-BIRi6SwZ.js → transactions-Ddia0n7n.js} +1 -1
  169. package/_assets/{useCreditPacks-B-X7zfCn.js → useCreditPacks-MqR7c3SM.js} +1 -1
  170. package/_assets/useImportable-NxQmNfsn.js +1 -0
  171. package/_assets/{useInfiniteGrid-6IGMMT5_.js → useInfiniteGrid-Kcee13Mj.js} +1 -1
  172. package/_assets/{useTheme-BwoD3vEY.js → useTheme-B7WRHLy8.js} +1 -1
  173. package/_assets/{verifyHash-C5CdkBh3.js → verifyHash-DyarspWE.js} +1 -1
  174. package/_assets/{w3m-modal-B3GHykWz.js → w3m-modal-DF93OTvH.js} +1 -1
  175. package/_assets/{w3m-modal-B3F6Mnna.js → w3m-modal-DKYntPky.js} +1 -1
  176. package/_assets/{wait-for-tx-receipt-C_FjDUYj.js → wait-for-tx-receipt-DR-RY-a_.js} +1 -1
  177. package/_assets/{wallets-DzQ1vri5.js → wallets-C9IItlAk.js} +5 -5
  178. package/_assets/{web-connector-B4iFaMmt.js → web-connector-BuJ7c2wG.js} +3 -3
  179. package/_assets/{writeContract-DaZaDo8I.js → writeContract-Buu3J9V_.js} +1 -1
  180. package/_assets/{zoraTestnet-W4T_ajaY.js → zoraTestnet-jeCAG28W.js} +1 -1
  181. package/index.html +11 -11
  182. package/package.json +2 -2
  183. package/_assets/Activity-DRU10G0s.js +0 -381
  184. package/_assets/Cart-BHkq2PkV.js +0 -695
  185. package/_assets/ItemDetail-D-C6pe19.js +0 -3497
  186. package/_assets/LazyEmoteControls-BxXOD9g-.js +0 -2
  187. package/_assets/ManaPricingBanner.styles-D0ksfubq.js +0 -74
  188. package/_assets/authorizations-BJlchz9P.js +0 -1
  189. package/_assets/buy-DHqPe2Je.js +0 -1
  190. package/_assets/buy-gasless-CvTXQoUY.js +0 -1
  191. package/_assets/errors-CCUK8cBW.js +0 -1
  192. package/_assets/index-4grC8vnQ.js +0 -3386
  193. package/_assets/index-DAPvhTCu.js +0 -1
  194. package/_assets/index-DBkJBt2j.js +0 -2
  195. package/_assets/trade-encoding-dpFoczNW.js +0 -1
  196. package/_assets/useImportable-C11MUaBr.js +0 -1
@@ -0,0 +1,381 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-miZ-bpMn.js","_assets/react-DehiWSvs.js","_assets/index-CeopVToX.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/ethers-DejfrZ8i.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-NxQmNfsn.js","_assets/buy-BQaJKCDU.js","_assets/authorizations-jqQwcb6e.js","_assets/sendMetaTransaction-H67kFub1.js","_assets/ManaPricingBanner.styles-7PjhHSIi.js","_assets/Faq-Bp-D4IrP.js","_assets/field.styles-i8y02t11.js"])))=>i.map(i=>d[i]);
2
+ import{m as we,bH as je,k as q,n as I,bI as ke,s as l,t as s,o as Ie,B as Ae,q as $e,b as d,ai as Pe,I as A,bJ as Y,bK as ee,bL as Le,_ as Ne,w as N,bM as Ee,x as Te,bc as z,aA as Ce,bN as Se,z as Fe,bO as De,bP as O}from"./index-CeopVToX.js";import{r as g,e as Me,j as t,L as se,a as He}from"./react-DehiWSvs.js";import{u as qe}from"./useImportable-NxQmNfsn.js";import{L as ze}from"./LoadMore-CYbQF7Q0.js";import{u as P}from"./useInfiniteGrid-Kcee13Mj.js";import{m as ne}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./buy-BQaJKCDU.js";import"./authorizations-jqQwcb6e.js";import"./sendMetaTransaction-H67kFub1.js";const Oe=15e3;function Re(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)<=Oe}function We(e){const a=[...e].sort((i,r)=>r.createdAt-i.createdAt),n=[];for(const i of a){const r=n[n.length-1];r&&Re(r[r.length-1],i)?r.push(i):n.push([i])}return n.map(i=>{var r;return{id:((r=i.find(c=>c.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,u)=>c+u.credits,0),lines:i}})}function _e(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Be(e){const a=[],n=new Map;for(const i of e){const r=_e(i);if(!r){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=n.get(r);if(c){c.quantity+=1,c.credits+=i.credits;continue}const u={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(r,u),a.push(u)}return a}function Ge(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?we(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Ke(e){const n=We(e.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=e.sales.map(o=>{const x=Ge(o,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(e.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),c=new Set(e.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(o=>!c.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...r,...u].sort((o,x)=>x.createdAt-o.createdAt||(o.id<x.id?-1:1))}function Ue(e,a){return a==="all"?e:a==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const re=e=>e.trim().toLowerCase();function Qe(e){const a=new Map;for(const n of e??[]){const i=re(n.txHash??"");if(!i)continue;const r=a.get(i);r?r.push(n):a.set(i,[n])}return a}function Ve(e,a,n=Date.now()){const i=a.txHash?e.get(re(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?Xe(i[0].netCents):null,c=i.filter(o=>!o.available&&o.availableAt>n);if(c.length===0)return{kind:"credited",credits:r};const u=c.reduce((o,x)=>Math.max(o,x.availableAt),0);return{kind:"pending",credits:r,availableAt:u}}function Xe(e){return je(e)}function Je(){const e=q(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:a,isLoading:n}=I({queryKey:["listing-count",e],queryFn:()=>ke({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:a==null?void 0:a.total,isLoading:n}}const Ze="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/credits-product-vs4Q6u6l.svg",R=Ie`
3
+ 0% { background-position: 200% 0; }
4
+ 100% { background-position: -200% 0; }
5
+ `,Ye=l.section`
6
+ width: 100%;
7
+ min-width: 0;
8
+ min-height: 60vh;
9
+ /* Centre the whole column — heading, tabs and cards as ONE block — so the feed isn't parked against
10
+ the left edge of a wide page. Centring only the list would leave the heading orphaned from it.
11
+
12
+ ONE width for every view. The migration tool needs 1003px (its row is a thumbnail, a name and a
13
+ 144px price field; narrower, the price field drops to its own line on a desktop), and the feed used
14
+ to sit at 760px — so switching chips resized the heading and the whole column under it, which reads
15
+ as the page reloading rather than as a filter changing. */
16
+ max-width: 1003px;
17
+ margin-inline: auto;
18
+ `,et=l.div`
19
+ display: flex;
20
+ align-items: baseline;
21
+ gap: 12px;
22
+ margin-bottom: 20px;
23
+ `,tt=l.h1`
24
+ font-family: ${s.font.sans};
25
+ margin: 0;
26
+ `;l.span`
27
+ color: ${s.colors.muted};
28
+ font-size: 14px;
29
+ `;const it=l.div`
30
+ display: flex;
31
+ gap: 8px;
32
+ margin-bottom: 20px;
33
+ flex-wrap: wrap;
34
+ `,oe=l.button`
35
+ appearance: none;
36
+ /* Figma draws the row as a 0.5px Gray 4 hairline, a shade darker and half the weight of the card
37
+ border this used, and sets the label a point smaller with the tracking the shop's other 13px
38
+ pills carry. */
39
+ border: 0.5px solid ${s.colors.gray4};
40
+ background: ${s.colors.white};
41
+ color: ${s.colors.text};
42
+ font-family: ${s.font.sans};
43
+ font-size: 13px;
44
+ font-weight: 600;
45
+ line-height: 24px;
46
+ letter-spacing: 0.46px;
47
+ /* The design gives the pill a flat 40px and no vertical padding, centring the 24px line box inside
48
+ it — so the height is the 40 it draws rather than the sum of a line box, padding and a border. */
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ padding: 0 16px;
53
+ min-height: 40px;
54
+ border-radius: ${s.radius.pill};
55
+ cursor: pointer;
56
+ transition:
57
+ background 0.15s,
58
+ border-color 0.15s,
59
+ color 0.15s;
60
+
61
+ &:hover {
62
+ background: ${s.colors.media};
63
+ }
64
+ &:focus-visible {
65
+ outline: 2px solid ${s.colors.accent};
66
+ outline-offset: 2px;
67
+ }
68
+ &[data-active='true'] {
69
+ background: ${s.colors.accent};
70
+ border-color: ${s.colors.accent};
71
+ color: ${s.colors.white};
72
+ }
73
+ `,at=l(oe)`
74
+ position: relative;
75
+
76
+ /* Violet-on-violet once the chip fills, so the badge inverts. Reached by test id rather than by
77
+ interpolating the styled def, which throws under vitest (see CLAUDE.md). */
78
+ &[data-active='true'] [data-testid='activity-migrate-count'] {
79
+ background: ${s.colors.white};
80
+ color: ${s.colors.accent};
81
+ /* See MigrateBadge: a white ring would vanish into the page here, since the disc itself is white. */
82
+ box-shadow: 0 0 0 2px ${s.colors.accent};
83
+ }
84
+ `,st=l.span`
85
+ position: absolute;
86
+ /* Offsets run from the chip's PADDING box, so they carry the 1px its hairline occupies in layout on
87
+ top of the 5.5 / 2.5 the design measures from the pill's outer edge. */
88
+ top: -6.5px;
89
+ right: -3.5px;
90
+ display: grid;
91
+ place-items: center;
92
+ /* The chip's tracking would otherwise widen the disc off its 20px. */
93
+ letter-spacing: normal;
94
+ /* Figma only ever draws a single digit, as a fixed 20px disc. The padding is what lets a two- or
95
+ three-figure count grow leftwards out of the corner instead of spilling out of the circle. */
96
+ min-width: 20px;
97
+ height: 20px;
98
+ padding: 0 6px;
99
+ border-radius: ${s.radius.pill};
100
+ background: ${s.colors.brandViolet};
101
+ /**
102
+ * A ring, whose colour has to FOLLOW THE DISC rather than the page.
103
+ *
104
+ * The disc hangs off the corner: part of it sits on the chip, part on the page. Unselected it is violet
105
+ * on white, so it already reads and the white ring only separates it from the chip's grey hairline.
106
+ * Selected, the chip inverts it to white on violet — and a white disc against the white page has no edge
107
+ * at all along the half that overhangs, which is the state where the circle looked unfinished. That case
108
+ * needs the ring in the chip's accent instead (below), so the disc keeps a hard edge on both surfaces.
109
+ *
110
+ * box-shadow rather than a border: a border would grow the 20px disc the design fixes, while a spread
111
+ * shadow draws outside the box.
112
+ */
113
+ box-shadow: 0 0 0 2px ${s.colors.white};
114
+ font-weight: 600;
115
+ font-size: 12px;
116
+ line-height: 1.6;
117
+ color: ${s.colors.white};
118
+ `,nt=l.div`
119
+ min-height: 60vh;
120
+ `,te=l.div`
121
+ display: flex;
122
+ flex-direction: column;
123
+ gap: 16px;
124
+ `,E=l.div`
125
+ background: ${s.colors.white};
126
+ border: 1px solid ${s.colors.line};
127
+ border-radius: 16px;
128
+ overflow: hidden;
129
+ `,T=l.div`
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: space-between;
133
+ gap: 12px;
134
+ padding: 14px 18px;
135
+ background: ${s.colors.softWhite};
136
+ border-bottom: 1px solid ${s.colors.line};
137
+
138
+ ${s.media.maxWidth("mobile")} {
139
+ flex-wrap: wrap;
140
+ }
141
+ `,C=l.div`
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: 2px;
145
+ min-width: 0;
146
+ `,S=l.span`
147
+ font-weight: 700;
148
+ color: ${s.colors.text};
149
+ `,F=l.span`
150
+ font-size: 13px;
151
+ color: ${s.colors.muted};
152
+ `,D=l.div`
153
+ display: flex;
154
+ align-items: center;
155
+ gap: 14px;
156
+ /* Pin to the right regardless of how many elements sit on the left (the credit-purchase card adds a
157
+ leading thumbnail, giving the head three children instead of two). */
158
+ margin-left: auto;
159
+ `,rt=l.div`
160
+ flex: 0 0 auto;
161
+ width: 52px;
162
+ height: 52px;
163
+ border-radius: 10px;
164
+ background: ${s.colors.media};
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+
169
+ img {
170
+ width: 30px;
171
+ height: 30px;
172
+ display: block;
173
+ }
174
+ `,M=l.span`
175
+ font-size: 11px;
176
+ font-weight: 700;
177
+ text-transform: uppercase;
178
+ letter-spacing: 0.03em;
179
+ padding: 4px 10px;
180
+ border-radius: ${s.radius.pill};
181
+ white-space: nowrap;
182
+
183
+ &[data-status='SETTLED'] {
184
+ background: rgba(30, 166, 114, 0.14);
185
+ color: ${s.colors.okStrong};
186
+ }
187
+ &[data-status='PENDING'] {
188
+ background: rgba(245, 166, 35, 0.16);
189
+ color: #b5790a;
190
+ }
191
+ &[data-status='SOLD'] {
192
+ background: rgba(103, 58, 183, 0.14);
193
+ color: ${s.colors.accent};
194
+ }
195
+ &[data-status='FAILED'] {
196
+ background: rgba(214, 61, 61, 0.14);
197
+ color: #b02a2a;
198
+ }
199
+ /* Nobody paid and nobody is owed anything — deliberately the quietest of the four. Reusing PENDING's
200
+ amber here is what made an abandoned checkout look like money on its way. */
201
+ &[data-status='UNFINISHED'] {
202
+ background: ${s.colors.line};
203
+ color: ${s.colors.muted};
204
+ }
205
+ `,ot=l.button`
206
+ font-size: 11px;
207
+ font-weight: 700;
208
+ text-transform: uppercase;
209
+ letter-spacing: 0.03em;
210
+ padding: 4px 10px;
211
+ border-radius: ${s.radius.pill};
212
+ white-space: nowrap;
213
+ border: 1px solid ${s.colors.accent};
214
+ background: transparent;
215
+ color: ${s.colors.accent};
216
+ cursor: pointer;
217
+ transition: background 0.15s ease;
218
+
219
+ &:hover:not(:disabled) {
220
+ background: rgba(103, 58, 183, 0.08);
221
+ }
222
+ &:disabled {
223
+ opacity: 0.6;
224
+ cursor: default;
225
+ }
226
+ `,j=l.div`
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 5px;
230
+ font-weight: 800;
231
+ color: ${s.colors.text};
232
+ white-space: nowrap;
233
+
234
+ .ccy-mark {
235
+ width: 16px;
236
+ height: 16px;
237
+ }
238
+
239
+ // Money received (a sale) reads as income in the shop's success green.
240
+ &[data-kind='income'] {
241
+ color: ${s.colors.okStrong};
242
+ }
243
+ `,ce=l.img`
244
+ width: 16px;
245
+ height: 16px;
246
+ vertical-align: -0.15em;
247
+ `,ct=l.span`
248
+ display: inline-flex;
249
+ align-items: center;
250
+ cursor: pointer;
251
+ `,dt=l.span`
252
+ position: fixed;
253
+ transform: translateX(-50%);
254
+ padding: 6px 8px;
255
+ border-radius: 6px;
256
+ background: #16141a;
257
+ color: ${s.colors.white};
258
+ font-size: 12px;
259
+ font-weight: 600;
260
+ line-height: 1;
261
+ white-space: nowrap;
262
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
263
+ pointer-events: none;
264
+ z-index: 9999;
265
+ `,W=l.div`
266
+ display: flex;
267
+ flex-direction: column;
268
+ `,H=l.div`
269
+ display: grid;
270
+ grid-template-columns: 52px 1fr auto;
271
+ align-items: center;
272
+ gap: 14px;
273
+ padding: 12px 18px;
274
+ text-decoration: none;
275
+ color: inherit;
276
+
277
+ & + & {
278
+ border-top: 1px solid ${s.colors.line};
279
+ }
280
+
281
+ &[data-link='true'] {
282
+ transition: background 0.15s;
283
+ }
284
+ &[data-link='true']:hover {
285
+ background: ${s.colors.media};
286
+ }
287
+ &[data-link='true']:focus-visible {
288
+ outline: 2px solid ${s.colors.accent};
289
+ outline-offset: -2px;
290
+ }
291
+ `,_=l.div`
292
+ width: 52px;
293
+ height: 52px;
294
+ border-radius: 10px;
295
+ background: ${s.colors.media};
296
+ overflow: hidden;
297
+ display: flex;
298
+ align-items: center;
299
+ justify-content: center;
300
+ color: ${s.colors.muted2};
301
+
302
+ img {
303
+ width: 100%;
304
+ height: 100%;
305
+ object-fit: contain;
306
+ }
307
+ `,B=l.div`
308
+ width: 52px;
309
+ height: 52px;
310
+ border-radius: 10px;
311
+ background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
312
+ background-size: 200% 100%;
313
+ animation: ${R} 1.3s infinite linear;
314
+
315
+ @media (prefers-reduced-motion: reduce) {
316
+ animation: none;
317
+ }
318
+ `,G=l.div`
319
+ min-width: 0;
320
+ display: flex;
321
+ flex-direction: column;
322
+ gap: 2px;
323
+ `,K=l.span`
324
+ font-weight: 700;
325
+ white-space: nowrap;
326
+ overflow: hidden;
327
+ text-overflow: ellipsis;
328
+ `,U=l.span`
329
+ display: inline-block;
330
+ width: 140px;
331
+ max-width: 60%;
332
+ height: 12px;
333
+ border-radius: 6px;
334
+ background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
335
+ background-size: 200% 100%;
336
+ animation: ${R} 1.3s infinite linear;
337
+
338
+ @media (prefers-reduced-motion: reduce) {
339
+ animation: none;
340
+ }
341
+ `,Q=l.span`
342
+ font-size: 13px;
343
+ color: ${s.colors.muted};
344
+ `,lt=l.div`
345
+ display: flex;
346
+ align-items: center;
347
+ gap: 4px;
348
+ font-weight: 700;
349
+ color: ${s.colors.text};
350
+ white-space: nowrap;
351
+
352
+ .ccy-mark {
353
+ width: 14px;
354
+ height: 14px;
355
+ }
356
+ `,ie=l.div`
357
+ height: 132px;
358
+ border-radius: 16px;
359
+ border: 1px solid transparent;
360
+ background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
361
+ background-size: 200% 100%;
362
+ animation: ${R} 1.3s infinite linear;
363
+
364
+ @media (prefers-reduced-motion: reduce) {
365
+ animation: none;
366
+ }
367
+ `,de=l.div`
368
+ display: flex;
369
+ flex-direction: column;
370
+ align-items: center;
371
+ gap: 8px;
372
+ text-align: center;
373
+ padding: 90px 20px;
374
+ min-height: 50vh;
375
+ `,le=l.p`
376
+ font-size: 22px;
377
+ font-weight: 700;
378
+ margin: 6px 0 0;
379
+ `,ht=l(Ae)`
380
+ margin-top: 12px;
381
+ `,V=H.withComponent(se),ut=g.lazy(()=>Ne(()=>import("./index-miZ-bpMn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),L=24,pt=["all","purchases","sales"],ae="migrate";function k(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function he(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function ue(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function pe({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),r=()=>{var u;const c=(u=a.current)==null?void 0:u.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(ct,{ref:a,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[e,n?He.createPortal(t.jsx(dt,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function xt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:r}=I({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?De(e.tradeId):O(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&r,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",x=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[c?t.jsx(B,{}):t.jsx(_,{children:o?t.jsx("img",{src:o,alt:u}):t.jsx(A,{name:"cart",size:20})}),t.jsxs(G,{children:[c?t.jsx(U,{}):t.jsx(K,{title:u,children:u}),e.quantity>1?t.jsx(Q,{children:d("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(lt,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]});return x?t.jsx(V,{to:x,"data-link":"true",children:f}):t.jsx(H,{children:f})}function mt({order:e}){const a=Be(e.lines),n=a.reduce((i,r)=>i+r.quantity,0);return t.jsxs(E,{"data-testid":"purchase-order",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsxs(F,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":e.status,children:e.status==="PENDING"?d("activity.processing"):d("activity.completed")}),t.jsxs(j,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(W,{children:a.map(i=>t.jsx(xt,{item:i},i.key))})]})}function gt({sale:e}){const{data:a,isLoading:n}=I({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>O(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??d("activity.itemFallback"),r=(a==null?void 0:a.thumbnail)??"",c=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(B,{}):t.jsx(_,{children:r?t.jsx("img",{src:r,alt:i}):t.jsx(A,{name:"offer",size:20})}),t.jsxs(G,{children:[n?t.jsx(U,{}):t.jsx(K,{title:i,children:i}),t.jsx(Q,{children:d("activity.boughtFrom",{account:he(e.seller)})})]})]});return t.jsxs(E,{"data-testid":"activity-mana-purchase",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsx(F,{children:d("activity.paidWithMana")})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":"SETTLED",children:d("activity.completed")}),t.jsxs(j,{children:[ue(e.manaWei)," ",t.jsx(pe,{children:t.jsx(ce,{src:ne,alt:"MANA"})})]})]})]}),t.jsx(W,{children:c?t.jsx(V,{to:c,"data-link":"true",children:u}):t.jsx(H,{children:u})})]})}function ft({sale:e,payout:a}){const{data:n,isLoading:i}=I({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>O(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),r=(n==null?void 0:n.name)??d("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,o=t.jsxs(t.Fragment,{children:[i?t.jsx(B,{}):t.jsx(_,{children:c?t.jsx("img",{src:c,alt:r}):t.jsx(A,{name:"offer",size:20})}),t.jsxs(G,{children:[i?t.jsx(U,{}):t.jsx(K,{title:r,children:r}),t.jsxs(Q,{children:[d("activity.soldTo",{account:he(e.counterparty)}),a.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:k(a.availableAt)})}`:""]})]})]});return t.jsxs(E,{"data-testid":"activity-sale",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsx(F,{children:d("activity.saleLabel")})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),a.kind==="direct"?t.jsxs(j,{"data-kind":"income",children:["+",ue(e.manaWei)," ",t.jsx(pe,{children:t.jsx(ce,{src:ne,alt:"MANA"})})]}):a.credits!==null?t.jsxs(j,{"data-kind":"income",children:[t.jsx(N,{className:"ccy-mark"})," +",Ce(a.credits)]}):t.jsx(j,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),t.jsx(W,{children:u?t.jsx(V,{to:u,"data-link":"true",children:o}):t.jsx(H,{children:o})})]})}function bt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Ee(e.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):n==="UNFINISHED"?d("activity.unfinished"):d("activity.processing"),r=q(p=>p.session),c=Te(),[u,o]=g.useState(!1),x=e.status==="initiated"&&!!r;async function f(){if(!(!r||u)){o(!0);try{const p=await Se(e.id,r.identity);if(p){window.location.href=p;return}Fe.info(d("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})}finally{o(!1)}}}return t.jsx(E,{"data-testid":"credit-order",children:t.jsxs(T,{children:[t.jsx(rt,{children:t.jsx("img",{src:Ze,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsxs(F,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:a})]})]}),t.jsxs(D,{children:[x?t.jsx(ot,{type:"button",onClick:()=>void f(),disabled:u,"data-testid":"resume-order",children:u?d("activity.resuming"):d("activity.resume")}):null,t.jsx(M,{"data-status":n,children:i}),t.jsxs(j,{"data-kind":"income",children:["+",t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]})]})})}function yt({filter:e}){const a={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[e];return t.jsxs(de,{children:[t.jsx(A,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(le,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ht,{as:se,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function St(){const{session:e}=q(),[a,n]=g.useState("all"),[i,r]=Me(),c=i.get("view")===ae;$e({title:c?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=qe(),{count:o}=Je(),f=u!==void 0&&o!==void 0&&(u>0||o>0||c),p=!!e&&!c&&a!=="sales",m=!!e&&!c&&a!=="purchases",b=P(["purchases",e==null?void 0:e.address],h=>Le(e.address,e.identity,{first:L,skip:h}),{enabled:p}),y=P(["sales",e==null?void 0:e.address],h=>Y(e.address,{role:"seller",first:L,skip:h}),{enabled:m}),v=P(["credit-orders",e==null?void 0:e.address],h=>ee(e.address,e.identity,{first:L,skip:h}),{enabled:p}),w=P(["mana-purchases",e==null?void 0:e.address],h=>Y(e.address,{role:"buyer",first:L,skip:h}),{enabled:p}),{data:X}=I({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ee(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:m,staleTime:6e4}),xe=g.useMemo(()=>Qe(X),[X]),{data:me}=Pe(m);if(!e)return t.jsxs(de,{children:[t.jsx(A,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(le,{children:d("activity.signInTitle")}),t.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const J=Ue(Ke({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?w.items:[],rate:me}),a),ge=p&&(b.isLoading||v.isLoading||w.isLoading)||m&&y.isLoading,Z=p&&(b.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||m&&y.isFetchingNextPage,fe=p&&(b.hasNextPage||v.hasNextPage||w.hasNextPage)||m&&y.hasNextPage;function be(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&w.hasNextPage&&w.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function ye(h){if(n(h),!c)return;const $=new URLSearchParams(i);$.delete("view"),r($,{replace:!0})}function ve(){const h=new URLSearchParams(i);h.set("view",ae),r(h,{replace:!0})}return t.jsxs(Ye,{children:[t.jsx(et,{children:t.jsx(tt,{children:d("nav.activity")})}),t.jsxs(it,{role:"tablist","aria-label":d("nav.activity"),children:[pt.map(h=>t.jsx(oe,{type:"button",role:"tab","aria-selected":!c&&a===h,"data-active":!c&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>ye(h),children:d(`activity.filter.${h}`)},h)),f?t.jsxs(at,{type:"button",role:"tab","aria-selected":c,"data-active":c,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:ve,children:[d("activity.migrate.chip"),u?t.jsx(st,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),c?t.jsx(g.Suspense,{fallback:t.jsx(nt,{"aria-busy":"true"}),children:t.jsx(ut,{})}):ge?t.jsx(te,{children:Array.from({length:5}).map((h,$)=>t.jsx(ie,{},$))}):J.length===0?t.jsx(yt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(te,{children:[J.map(h=>h.kind==="purchase"?t.jsx(mt,{order:h.order},h.id):h.kind==="credit"?t.jsx(bt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(gt,{sale:h.sale},h.id):t.jsx(ft,{sale:h.sale,payout:Ve(xe,h.sale)},h.id)),Z?t.jsx(ie,{}):null]}),t.jsx(ze,{hasNextPage:fe,isFetching:Z,onLoadMore:be})]})]})}export{St as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-4grC8vnQ.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-CeopVToX.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";const b="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -94,4 +94,4 @@ void main() {
94
94
  inset: 0;
95
95
  width: 100%;
96
96
  height: 100%;
97
- `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,b,()=>d),w=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${S})`}}),v.jsx(I,{ref:t})]})}export{G as default};
97
+ `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,S,()=>d),w=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${b})`}}),v.jsx(I,{ref:t})]})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r as st,bg as rt,bh as ot,au as it,b as at,s,t,k as Ue,b6 as lt,x as ct,az as be,d as n,v as dt,I as R,w as M,bS as se,b5 as pt,S as ee,bk as ht,bj as xt,q as He,ai as Oe,m as De,l as mt,ag as ft,ak as Ie,al as V,aB as ut,bD as gt}from"./index-4grC8vnQ.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-DiCnesUC.js";import{S as Ae,R as Bt,F as Wt,e as Ft}from"./categories-BMCKe30t.js";import{L as Lt}from"./LoadMore-DMhOO7Nq.js";import{u as Ut}from"./useInfiniteGrid-6IGMMT5_.js";import{E as Ht}from"./ErrorNotice-Biw7jacR.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Dt,G as Gt,w as qt,S as Vt}from"./buy-gasless-CvTXQoUY.js";import{s as Zt}from"./buy-DHqPe2Je.js";import{j as Kt}from"./trade-encoding-dpFoczNW.js";import{f as Jt}from"./errors-CCUK8cBW.js";import{J as Qt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-DIS1AoSo.js";import{G as en}from"./grid.styles-DH_ZretM.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-BJlchz9P.js";import"./sendMetaTransaction-BATUzHIf.js";function Z(r){const i=r.source??"item",h=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",Ge=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(r){const i=r.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<Ge?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function rn(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function on(r,i={}){var l;const{rpc:h,address:c}=rn(),d=new Qt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${r}") on ${h}`);const m=await a.available(r);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${m}`),m?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(r){return it(H,r)}async function cn(r,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,m=await at(a,{method:"GET",identity:r,metadata:{}});if(!m.ok){let p;try{p=(l=await m.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${m.status}`)}return m.json()}function dn(r,i){const h=ye.from(r.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Kt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(r,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let m=0;m<d;m++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${r}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,f=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:f};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:f}}}catch{}m<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(r){const{name:i,identity:h,signer:c}=r,d=r.chainId??U.chainId,a=r.provider??"across",m=(r.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:m,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const f=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:f.externalCall.target,selector:f.externalCall.selector,provider:f.provider,quoteId:f.quoteId});const C=await rt(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,f);let g;try{g=await Dt({chainId:d,buyer:m,signer:c,args:k})}catch(b){if(!(b instanceof Gt))throw b;g=await Zt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:m,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await ot(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Jt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
1
+ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r as st,bh as rt,bi as ot,av as it,a as at,s,t,k as Ue,b7 as lt,x as ct,aA as be,b as n,v as dt,I as R,w as M,bU as se,b6 as pt,R as ee,bm as ht,bl as xt,q as He,ai as Oe,m as Ge,l as ft,af as mt,ak as Ie,al as V,aC as ut,bF as gt}from"./index-CeopVToX.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-CnXHifI7.js";import{S as Ae,R as Wt,F as Bt,d as Ft}from"./categories-gEEglioA.js";import{L as Lt}from"./LoadMore-CYbQF7Q0.js";import{u as Ut}from"./useInfiniteGrid-Kcee13Mj.js";import{E as Ht}from"./ErrorNotice--UMHyZQ4.js";import{d as Ot}from"./dcl-schemas-CmtP3U6y.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-CZ9IMCzy.js";import{s as Zt,k as Kt}from"./buy-BQaJKCDU.js";import{f as Jt}from"./errors-DEg1qT4Y.js";import{J as Qt,C as Xt,B as ye}from"./ethers-DejfrZ8i.js";import{n as Yt}from"./Tooltip-z-K5_r2G.js";import{G as en}from"./grid.styles-DEbulSnv.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-jqQwcb6e.js";import"./sendMetaTransaction-H67kFub1.js";function Z(r){const i=r.source??"item",h=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",De=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(r){const i=r.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<De?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function rn(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function on(r,i={}){var l;const{rpc:h,address:c}=rn(),d=new Qt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${r}") on ${h}`);const f=await a.available(r);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${f}`),f?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(r){return it(H,r)}async function cn(r,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,f=await at(a,{method:"GET",identity:r,metadata:{}});if(!f.ok){let p;try{p=(l=await f.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${f.status}`)}return f.json()}function dn(r,i){const h=ye.from(r.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Kt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(r,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let f=0;f<d;f++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${r}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,m=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:m};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:m}}}catch{}f<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(r){const{name:i,identity:h,signer:c}=r,d=r.chainId??U.chainId,a=r.provider??"across",f=(r.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:f,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const m=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await rt(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,m);let g;try{g=await Gt({chainId:d,buyer:f,signer:c,args:k})}catch(b){if(!(b instanceof Dt))throw b;g=await Zt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:f,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await ot(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Jt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -7,7 +7,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
7
7
  justify-content: center;
8
8
  padding: 16px;
9
9
  background: rgba(22, 21, 24, 0.55);
10
- `,mn=s.div`
10
+ `,fn=s.div`
11
11
  width: 560px;
12
12
  max-width: 100%;
13
13
  max-height: 92vh;
@@ -112,7 +112,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
112
112
  font-family: ${t.font.sans};
113
113
  font-size: 14px;
114
114
  color: ${t.colors.muted2};
115
- `,me=s.div`
115
+ `,fe=s.div`
116
116
  flex: none;
117
117
  display: flex;
118
118
  align-items: center;
@@ -127,7 +127,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
127
127
  height: 22px;
128
128
  color: ${t.colors.brandViolet};
129
129
  }
130
- `,fn=s.div`
130
+ `,mn=s.div`
131
131
  margin-top: 16px;
132
132
  padding: 16px;
133
133
  border-radius: 12px;
@@ -294,7 +294,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
294
294
  b {
295
295
  font-weight: 700;
296
296
  }
297
- `,Be=s.div`
297
+ `,We=s.div`
298
298
  display: flex;
299
299
  gap: 16px;
300
300
  margin-top: 20px;
@@ -302,7 +302,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
302
302
  ${t.media.maxWidth("mobile")} {
303
303
  flex-direction: column;
304
304
  }
305
- `,We=s.button`
305
+ `,Be=s.button`
306
306
  flex: 1;
307
307
  height: 48px;
308
308
  border: 1px solid ${t.colors.accent};
@@ -347,7 +347,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
347
347
  outline: 2px solid ${t.colors.accent};
348
348
  outline-offset: 2px;
349
349
  }
350
- `,fe=s.div`
350
+ `,me=s.div`
351
351
  display: flex;
352
352
  align-items: flex-start;
353
353
  gap: 12px;
@@ -379,7 +379,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function In({name:r,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),m=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,f]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===r.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,B=i!=null&&E!=null?i-E:0,$=B>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(B)}):null;u.useEffect(()=>{const w=D=>{D.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:r,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(mn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(fn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(r)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>f(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsx(Be,{children:e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsxs(Be,{children:[e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(r){return r.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/invite-BfwIhP2C.webp",Bn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/governance-DnazlIjy.webp",Wn=s.div`
382
+ `;function In({name:r,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),f=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,m]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===r.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,W=i!=null&&E!=null?i-E:0,$=W>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(W)}):null;u.useEffect(()=>{const w=G=>{G.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:r,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),f.invalidateQueries({queryKey:["usd-balance"]}),f.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(fn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(mn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(r)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>m(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(me,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(me,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsx(We,{children:e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsxs(We,{children:[e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(r){return r.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/invite-BfwIhP2C.webp",Wn="https://cdn.decentraland.org/@dcl/shop/0.7.3-31004669641.commit-bf2b4b9/_assets/governance-DnazlIjy.webp",Bn=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Fn=s.nav`
@@ -438,12 +438,12 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
438
438
  padding: 40px 20px;
439
439
  gap: 28px;
440
440
  }
441
- `,Dn=s.div`
441
+ `,Gn=s.div`
442
442
  display: flex;
443
443
  flex-direction: column;
444
444
  align-items: center;
445
445
  gap: 12px;
446
- `,Gn=s.h1`
446
+ `,Dn=s.h1`
447
447
  margin: 0;
448
448
  font-family: ${t.font.sans};
449
449
  font-weight: 600;
@@ -798,4 +798,4 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
798
798
  clip: rect(0, 0, 0, 0);
799
799
  white-space: nowrap;
800
800
  border: 0;
801
- `,xs="https://docs.decentraland.org/creator/worlds/about/",ms="https://governance.decentraland.org";function fs(r){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(r)}`}function us({onBack:r}){He({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:h}=Ue(),{data:c}=Oe(),d=c?De(H,c):null,[a,m]=u.useState(""),[l,p]=u.useState("idle"),[x,y]=u.useState(!1),f=u.useRef(null),[C,k]=u.useState(void 0);u.useLayoutEffect(()=>{f.current&&k(f.current.offsetWidth)},[a]),u.useEffect(()=>{if(!Ne(a).ok){p(a.length===0?"idle":"invalid");return}p("checking");const E=new AbortController,B=setTimeout(()=>{(async()=>{try{const $=await on(a,{signal:E.signal});p($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;p("error")}})()},400);return()=>{clearTimeout(B),E.abort()}},[a]);const g=Ne(a),b=g.ok&&(l==="available"||l==="error");function S(){if(b){if(!i){h();return}y(!0)}}const v=e.jsxs(e.Fragment,{children:[n("names.claim"),d!=null?e.jsxs(os,{children:[e.jsx(M,{}),be(d)]}):null]});return e.jsxs(Wn,{"data-testid":"names-page",children:[e.jsxs(Fn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Ln,{onClick:r,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Un,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Dn,{children:[e.jsx(Gn,{children:n("names.heroTitle")}),e.jsx(qn,{children:n("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Zn,{children:[e.jsxs(Kn,{invalid:l==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:a,onChange:_=>m(nn(_.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:te,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Jn,{ref:f,"aria-hidden":!0,children:a||n("names.inputPlaceholder")}),e.jsx(ns,{children:n("names.suffix")})]}),a.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[a.length,"/",te]}):null,e.jsx(qe,{onClick:S,disabled:!b,"data-testid":"names-claim",children:v})]}),l==="taken"?e.jsxs(Qn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Xn,{href:fs(a),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(rs,{onClick:S,disabled:!b,children:v}),l==="checking"?e.jsx(ue,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):l==="error"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.checkError")}):l==="invalid"&&!g.ok&&g.reason==="too-short"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.tooShort",{min:Ge})}):null,e.jsx(hs,{role:"status","aria-live":"polite",children:l==="available"?n("names.available",{name:a}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:n("names.whyTitle")}),e.jsx(cs,{children:n("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(K,{children:[e.jsx(J,{src:Nn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why1Title")}),e.jsx(Y,{children:n("names.why1")})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Pn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why2Title")}),e.jsxs(Y,{children:[n("names.why2")," ",e.jsx(ps,{children:n("names.why2Address")})]}),e.jsxs(Fe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Mn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why3Title")}),e.jsx(Y,{children:n("names.why3")})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Bn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why4Title")}),e.jsx(Y,{children:n("names.why4")}),e.jsxs(Fe,{href:ms,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),x?e.jsx(In,{name:a,priceCredits:d,onClose:()=>y(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ge=48,bs=["all","on_sale","not_for_sale"];function Ws(){const[r,i]=nt(),h=Le(),c=(r.get("q")??"").trim().toLowerCase(),d=(r.get("q")??"").trim();He({title:d?n("seo.collectibles.searchTitle",{query:d}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const a=r.get("category")??(c?"all":"wearable"),m=r.get("status"),l=m&&bs.includes(m)?m:"on_sale",p=(o,j)=>i(z=>{const ne=new URLSearchParams(z);return j==null?ne.delete(o):ne.set(o,j),ne},{replace:!0}),[x,y]=u.useState(null),[f,C]=u.useState([]),[k,g]=u.useState(""),[b,S]=u.useState(""),[v,_]=u.useState(!1),[E,B]=u.useState("newest"),[$,T]=u.useState(!1);u.useEffect(()=>{if(!$)return;const o=z=>{z.key==="Escape"&&T(!1)};document.addEventListener("keydown",o);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=j}},[$]);const I=l==="on_sale",A=k&&!Number.isNaN(Number(k))?Number(k):void 0,N=b&&!Number.isNaN(Number(b))?Number(b):void 0,w=mt(),O=x?Ft[x]:void 0,D=(Ae.find(o=>o.key===E)??Ae[0]).server,je={category:a,rarities:f.length?f:void 0,wearableCategories:O,minPriceCredits:A,maxPriceCredits:N,search:c||void 0,sortBy:D,isSmart:v||void 0,onSale:!0,listingType:w?void 0:"primary"},ve={category:a,rarities:f.length?f:void 0,wearableCategories:O,search:c||void 0,sortBy:D,isWearableSmart:v||void 0,isOnSale:l==="not_for_sale"?!1:void 0},{items:F,total:$e,isLoading:P,isPlaceholderData:W,error:Ce,hasNextPage:Ve,isFetchingNextPage:ke,isFetchNextPageError:Ze,fetchNextPage:Ke}=Ut(I?["shop-items",je]:["catalog-items",ve],o=>I?ut({...je,first:ge,skip:o}):gt({...ve,first:ge,skip:o}),{enabled:a!=="names"}),G=$e,{data:Se,isError:Je,isPending:Qe}=Oe(),Xe=o=>Se&&o.manaWei?De(o.manaWei,Se):null,Ye=I&&Qe&&F.some(o=>o.source==="legacy"),Ee=P||W||Ye,et=P?15:Math.min(Math.max(F.length,1),ge),Re=u.useRef(null);u.useEffect(()=>{P||W||!c||Re.current===c||(Re.current=c,ee("Shop Searched",{query:c,result_count:G}))},[c,P,W,G]);const q=u.useRef("__init__");u.useEffect(()=>{if(P||W)return;const o=JSON.stringify({category:a,subCategory:x,rarities:f,min:A,max:N,sort:E,status:l,smart:v});if(q.current==="__init__"||q.current===o){q.current=o;return}q.current=o,ee("Shop Applied Filter",{filters:{category:a,sub_category:x,rarities:f,min_price_credits:A??null,max_price_credits:N??null,status:l,smart:v,sort:E},result_count:G})},[a,x,f,A,N,E,l,v,P,W,G]);function _e(o){p("category",o),y(null)}function Te(o){p("status",o==="on_sale"?null:o)}function ze(o){C(j=>j.includes(o)?j.filter(z=>z!==o):[...j,o])}function tt(){i(o=>{const j=new URLSearchParams(o);return j.delete("category"),j.delete("status"),j},{replace:!0}),y(null),C([]),g(""),S(""),_(!1)}const L=[];(A!=null||N!=null)&&L.push({key:"price",label:n("filter.price"),onRemove:()=>{g(""),S("")}});for(const o of Bt)f.includes(o)&&L.push({key:`rarity-${o}`,label:ft(o),onRemove:()=>ze(o)});return v&&L.push({key:"smart",label:n("filter.smart"),onRemove:()=>_(!1)}),l!=="on_sale"&&L.push({key:"status",label:l==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>Te("on_sale")}),e.jsxs(bt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[$?e.jsx(yt,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(wt,{"data-open":$||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(jt,{children:[e.jsx(vt,{children:n("assets.filters")}),e.jsx($t,{onClick:()=>T(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(Ct,{children:e.jsx(kt,{category:a,subCategory:x,onCategory:_e,onSub:y,priceMin:k,priceMax:b,onPriceMin:g,onPriceMax:S,rarities:f,onToggleRarity:ze,status:l,onStatus:Te,smart:v,onSmart:_})}),e.jsx(St,{children:e.jsx(Et,{type:"button",onClick:()=>T(!1),children:n("assets.showItems")})})]})]}),e.jsx(Rt,{children:a==="names"?e.jsx(us,{onBack:()=>_e("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Wt,{sort:E,onSort:B,total:$e,loading:P||W,query:c,onOpenFilters:()=>T(!0),chips:L,onClearChips:tt}),Je&&I&&F.some(o=>o.source==="legacy")?e.jsx(_t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,Ce?e.jsx(Ht,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ee&&F.length===0&&!Ce?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(zt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(At,{children:n("assets.empty.title")}),e.jsx(Nt,{children:d?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:d}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Pt,{children:e.jsx(Mt,{type:"button",onClick:()=>h("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(en,{"data-testid":"grid",children:Ee?e.jsx(Ie,{count:et}):e.jsxs(e.Fragment,{children:[F.map(o=>{if(!I)return e.jsx(V,{item:o,mode:"view"},Z(o));const j=o;if(j.source!=="legacy")return e.jsx(V,{item:o},Z(o));const z=Xe(j);return z==null?e.jsx(V,{item:o,mode:"view"},Z(o)):e.jsx(V,{item:{...j,priceCredits:z}},Z(o))}),ke?e.jsx(Ie,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:ke,isError:Ze,onLoadMore:()=>void Ke()})]})]})})]})}export{Ws as Assets};
801
+ `,xs="https://docs.decentraland.org/creator/worlds/about/",fs="https://governance.decentraland.org";function ms(r){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(r)}`}function us({onBack:r}){He({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:h}=Ue(),{data:c}=Oe(),d=c?Ge(H,c):null,[a,f]=u.useState(""),[l,p]=u.useState("idle"),[x,y]=u.useState(!1),m=u.useRef(null),[C,k]=u.useState(void 0);u.useLayoutEffect(()=>{m.current&&k(m.current.offsetWidth)},[a]),u.useEffect(()=>{if(!Ne(a).ok){p(a.length===0?"idle":"invalid");return}p("checking");const E=new AbortController,W=setTimeout(()=>{(async()=>{try{const $=await on(a,{signal:E.signal});p($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;p("error")}})()},400);return()=>{clearTimeout(W),E.abort()}},[a]);const g=Ne(a),b=g.ok&&(l==="available"||l==="error");function S(){if(b){if(!i){h();return}y(!0)}}const v=e.jsxs(e.Fragment,{children:[n("names.claim"),d!=null?e.jsxs(os,{children:[e.jsx(M,{}),be(d)]}):null]});return e.jsxs(Bn,{"data-testid":"names-page",children:[e.jsxs(Fn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Ln,{onClick:r,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Un,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{children:[e.jsx(Dn,{children:n("names.heroTitle")}),e.jsx(qn,{children:n("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Zn,{children:[e.jsxs(Kn,{invalid:l==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:a,onChange:_=>f(nn(_.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:te,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Jn,{ref:m,"aria-hidden":!0,children:a||n("names.inputPlaceholder")}),e.jsx(ns,{children:n("names.suffix")})]}),a.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[a.length,"/",te]}):null,e.jsx(qe,{onClick:S,disabled:!b,"data-testid":"names-claim",children:v})]}),l==="taken"?e.jsxs(Qn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Xn,{href:ms(a),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(rs,{onClick:S,disabled:!b,children:v}),l==="checking"?e.jsx(ue,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):l==="error"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.checkError")}):l==="invalid"&&!g.ok&&g.reason==="too-short"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.tooShort",{min:De})}):null,e.jsx(hs,{role:"status","aria-live":"polite",children:l==="available"?n("names.available",{name:a}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:n("names.whyTitle")}),e.jsx(cs,{children:n("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(K,{children:[e.jsx(J,{src:Nn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why1Title")}),e.jsx(Y,{children:n("names.why1")})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Pn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why2Title")}),e.jsxs(Y,{children:[n("names.why2")," ",e.jsx(ps,{children:n("names.why2Address")})]}),e.jsxs(Fe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Mn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why3Title")}),e.jsx(Y,{children:n("names.why3")})]})]}),e.jsxs(K,{children:[e.jsx(J,{src:Wn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why4Title")}),e.jsx(Y,{children:n("names.why4")}),e.jsxs(Fe,{href:fs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),x?e.jsx(In,{name:a,priceCredits:d,onClose:()=>y(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ge=48,bs=["all","on_sale","not_for_sale"];function Ws(){const[r,i]=nt(),h=Le(),c=(r.get("q")??"").trim().toLowerCase(),d=(r.get("q")??"").trim();He({title:d?n("seo.collectibles.searchTitle",{query:d}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const a=r.get("category")??(c?"all":"wearable"),f=r.get("status"),l=f&&bs.includes(f)?f:"on_sale",p=(o,j)=>i(z=>{const ne=new URLSearchParams(z);return j==null?ne.delete(o):ne.set(o,j),ne},{replace:!0}),[x,y]=u.useState(null),[m,C]=u.useState([]),[k,g]=u.useState(""),[b,S]=u.useState(""),[v,_]=u.useState(!1),[E,W]=u.useState("newest"),[$,T]=u.useState(!1);u.useEffect(()=>{if(!$)return;const o=z=>{z.key==="Escape"&&T(!1)};document.addEventListener("keydown",o);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=j}},[$]);const I=l==="on_sale",A=k&&!Number.isNaN(Number(k))?Number(k):void 0,N=b&&!Number.isNaN(Number(b))?Number(b):void 0,w=ft(),O=x?Ft[x]:void 0,G=(Ae.find(o=>o.key===E)??Ae[0]).server,je={category:a,rarities:m.length?m:void 0,wearableCategories:O,minPriceCredits:A,maxPriceCredits:N,search:c||void 0,sortBy:G,isSmart:v||void 0,onSale:!0,listingType:w?void 0:"primary"},ve={category:a,rarities:m.length?m:void 0,wearableCategories:O,search:c||void 0,sortBy:G,isWearableSmart:v||void 0,isOnSale:l==="not_for_sale"?!1:void 0},{items:F,total:$e,isLoading:P,isPlaceholderData:B,error:Ce,hasNextPage:Ve,isFetchingNextPage:ke,isFetchNextPageError:Ze,fetchNextPage:Ke}=Ut(I?["shop-items",je]:["catalog-items",ve],o=>I?ut({...je,first:ge,skip:o}):gt({...ve,first:ge,skip:o}),{enabled:a!=="names"}),D=$e,{data:Se,isError:Je,isPending:Qe}=Oe(),Xe=o=>Se&&o.manaWei?Ge(o.manaWei,Se):null,Ye=I&&Qe&&F.some(o=>o.source==="legacy"),Ee=P||B||Ye,et=P?15:Math.min(Math.max(F.length,1),ge),Re=u.useRef(null);u.useEffect(()=>{P||B||!c||Re.current===c||(Re.current=c,ee("Shop Searched",{query:c,result_count:D}))},[c,P,B,D]);const q=u.useRef("__init__");u.useEffect(()=>{if(P||B)return;const o=JSON.stringify({category:a,subCategory:x,rarities:m,min:A,max:N,sort:E,status:l,smart:v});if(q.current==="__init__"||q.current===o){q.current=o;return}q.current=o,ee("Shop Applied Filter",{filters:{category:a,sub_category:x,rarities:m,min_price_credits:A??null,max_price_credits:N??null,status:l,smart:v,sort:E},result_count:D})},[a,x,m,A,N,E,l,v,P,B,D]);function _e(o){p("category",o),y(null)}function Te(o){p("status",o==="on_sale"?null:o)}function ze(o){C(j=>j.includes(o)?j.filter(z=>z!==o):[...j,o])}function tt(){i(o=>{const j=new URLSearchParams(o);return j.delete("category"),j.delete("status"),j},{replace:!0}),y(null),C([]),g(""),S(""),_(!1)}const L=[];(A!=null||N!=null)&&L.push({key:"price",label:n("filter.price"),onRemove:()=>{g(""),S("")}});for(const o of Wt)m.includes(o)&&L.push({key:`rarity-${o}`,label:mt(o),onRemove:()=>ze(o)});return v&&L.push({key:"smart",label:n("filter.smart"),onRemove:()=>_(!1)}),l!=="on_sale"&&L.push({key:"status",label:l==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>Te("on_sale")}),e.jsxs(bt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[$?e.jsx(yt,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(wt,{"data-open":$||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(jt,{children:[e.jsx(vt,{children:n("assets.filters")}),e.jsx($t,{onClick:()=>T(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(Ct,{children:e.jsx(kt,{category:a,subCategory:x,onCategory:_e,onSub:y,priceMin:k,priceMax:b,onPriceMin:g,onPriceMax:S,rarities:m,onToggleRarity:ze,status:l,onStatus:Te,smart:v,onSmart:_})}),e.jsx(St,{children:e.jsx(Et,{type:"button",onClick:()=>T(!1),children:n("assets.showItems")})})]})]}),e.jsx(Rt,{children:a==="names"?e.jsx(us,{onBack:()=>_e("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Bt,{sort:E,onSort:W,total:$e,loading:P||B,query:c,onOpenFilters:()=>T(!0),chips:L,onClearChips:tt}),Je&&I&&F.some(o=>o.source==="legacy")?e.jsx(_t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,Ce?e.jsx(Ht,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ee&&F.length===0&&!Ce?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(zt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(At,{children:n("assets.empty.title")}),e.jsx(Nt,{children:d?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:d}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Pt,{children:e.jsx(Mt,{type:"button",onClick:()=>h("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(en,{"data-testid":"grid",children:Ee?e.jsx(Ie,{count:et}):e.jsxs(e.Fragment,{children:[F.map(o=>{if(!I)return e.jsx(V,{item:o,mode:"view"},Z(o));const j=o;if(j.source!=="legacy")return e.jsx(V,{item:o},Z(o));const z=Xe(j);return z==null?e.jsx(V,{item:o,mode:"view"},Z(o)):e.jsx(V,{item:{...j,priceCredits:z}},Z(o))}),ke?e.jsx(Ie,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:ke,isError:Ze,onLoadMore:()=>void Ke()})]})]})})]})}export{Ws as Assets};