@dcl/shop 0.6.1 → 0.6.2-30957461961.commit-f1e9c8c

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 (183) hide show
  1. package/_assets/{Activity-CCVwnN-d.js → Activity-xfL86s6s.js} +3 -3
  2. package/_assets/{AnimatedBackground-CNn-Vax_.js → AnimatedBackground-IB1Z9dqO.js} +2 -2
  3. package/_assets/{Assets-BPgkfGkc.js → Assets-BJafG3Rc.js} +4 -4
  4. package/_assets/{Assets.styles-BAy3by3Z.js → Assets.styles-BdrGrnkY.js} +1 -1
  5. package/_assets/{Authorizations-CdqHugnL.js → Authorizations-B4Hc4ONU.js} +1 -1
  6. package/_assets/{Cart-CzNOpZkY.js → Cart-CHXOg9IK.js} +2 -2
  7. package/_assets/{CircularProgress-DqLGsuLk.js → CircularProgress-BRgKUIR1.js} +3 -3
  8. package/_assets/{Collection-DmrD6mAW.js → Collection-B3xcQ2FC.js} +1 -1
  9. package/_assets/{CollectionCarousel-BpMj1RRH.js → CollectionCarousel-stedMsne.js} +7 -7
  10. package/_assets/{Creator-DYPK74k6.js → Creator-BnMNWHkh.js} +7 -7
  11. package/_assets/{ErrorNotice-6j32LCd-.js → ErrorNotice-CrDVf-1v.js} +1 -1
  12. package/_assets/{ExchangeController-CjtWowut.js → ExchangeController-vWsevK3U.js} +1 -1
  13. package/_assets/{GetCredits-9nCD-_vL.js → GetCredits-0ZerlbuF.js} +17 -17
  14. package/_assets/{HelpersUtil-6C8PzEL7.js → HelpersUtil-BTwXVKGc.js} +1 -1
  15. package/_assets/{ItemDetail-lJyiLtT6.js → ItemDetail-BviTSDBJ.js} +193 -194
  16. package/_assets/LazyEmoteControls-DA1cvJoy.js +2 -0
  17. package/_assets/{LoadMore-C6sUcyIf.js → LoadMore-Bjd9tWsJ.js} +1 -1
  18. package/_assets/{ManaPricingBanner.styles-zp0428S7.js → ManaPricingBanner.styles-BNpx6cwF.js} +3 -3
  19. package/_assets/{MenuList-BTdUxA4D.js → MenuList-D9IBfoDS.js} +2 -2
  20. package/_assets/{MyAssets-BbmsS4SI.js → MyAssets-P0rgL94h.js} +1 -1
  21. package/_assets/{MyFavorites-B_Mv89Yf.js → MyFavorites-35gtd4-A.js} +35 -24
  22. package/_assets/{NotFound-0lsOfC5s.js → NotFound-rrfC084v.js} +1 -1
  23. package/_assets/NotificationsBell-BSo_zb5s.js +34 -0
  24. package/_assets/OutfitDetail-C1M8VH09.js +334 -0
  25. package/_assets/OutfitPreview-BDPPBs6D.js +6 -0
  26. package/_assets/OutfitStudio-dyspmim4.js +537 -0
  27. package/_assets/{StoreSettings-BxTLlxHn.js → StoreSettings-BFFzbrko.js} +1 -1
  28. package/_assets/{Success-DMCTT33h.js → Success-Bn1PHEuJ.js} +5 -5
  29. package/_assets/{SwapController-Ci7sPB_-.js → SwapController-CWYTe23G.js} +1 -1
  30. package/_assets/{Tooltip-BZ-qUO0l.js → Tooltip-CsoII5yH.js} +1 -1
  31. package/_assets/{TradeService-Cu6fpwnh.js → TradeService-Bw-JPB-8.js} +1 -1
  32. package/_assets/{W3MFrameProviderSingleton-8GeYldkk.js → W3MFrameProviderSingleton-82XrvSVc.js} +3 -3
  33. package/_assets/{WebCryptoP256-fMzbuVHl.js → WebCryptoP256-B6AJTLYG.js} +1 -1
  34. package/_assets/{authorizations-DOwEBZw0.js → authorizations-BPxCPWb-.js} +1 -1
  35. package/_assets/{basic-CNB5RbBM.js → basic-Cir-xTgR.js} +1 -1
  36. package/_assets/{biconomy-VIh33SiE.js → biconomy-BdjZAawq.js} +1 -1
  37. package/_assets/{builder-ENYhtC9A.js → builder-CBPifwvU.js} +1 -1
  38. package/_assets/{buy-gasless-CsB_UciL.js → buy-gasless-DmiZzQtt.js} +1 -1
  39. package/_assets/{buy-DME37PMo.js → buy-q4FEKtCt.js} +1 -1
  40. package/_assets/{categories-SI1YlvJt.js → categories-CWfLUCEz.js} +1 -1
  41. package/_assets/{ccip-r6C5X7kR.js → ccip-DD41252L.js} +1 -1
  42. package/_assets/{ccip-BWQZvTr_.js → ccip-oMUJQ_3W.js} +1 -1
  43. package/_assets/clsx-WwvpwSg0.js +1 -0
  44. package/_assets/{collectionPage.styles-DTQE0MEN.js → collectionPage.styles-Os4dJAOn.js} +4 -4
  45. package/_assets/{controller-D4hrVQu3.js → controller-CkCV-5vZ.js} +2 -2
  46. package/_assets/{core-CG9Ai3BM.js → core-DN1c4wuS.js} +4 -4
  47. package/_assets/{createSvgIcon-BBqN76DB.js → createSvgIcon-COy0CObH.js} +2 -2
  48. package/_assets/{custom-CoESkeU0.js → custom-CTD_m409.js} +1 -1
  49. package/_assets/{data-capture-DsD2q2fn.js → data-capture-DQuOjU0T.js} +1 -1
  50. package/_assets/{email-2Crwdpgb.js → email-lo07Az2L.js} +1 -1
  51. package/_assets/{embedded-wallet-B5qGTlLf.js → embedded-wallet-JD5HNlFT.js} +1 -1
  52. package/_assets/emotion-styled.browser.esm-CBrboUj8.js +1 -0
  53. package/_assets/{engine-DMQKkPgK.js → engine-D6M-eu3V.js} +1 -1
  54. package/_assets/{errors-BNZ7sBF_.js → errors-TT0eRE9n.js} +1 -1
  55. package/_assets/{estimate-l1-fee-D7epFE-D.js → estimate-l1-fee-hMtUBfFA.js} +1 -1
  56. package/_assets/{execute-DKumTrX9.js → execute-C6R8GVpP.js} +2 -2
  57. package/_assets/{features-DI5UMV_W.js → features-DpMRSy0v.js} +1 -1
  58. package/_assets/{fetchTokenMetadata-D4n2TjLB.js → fetchTokenMetadata-Di2hD0T7.js} +2 -2
  59. package/_assets/{field.styles-CjeX0pR0.js → field.styles-D43vo7Wv.js} +1 -1
  60. package/_assets/{get-ecosystem-wallet-info-b6CDxjL2.js → get-ecosystem-wallet-info-BfAXy3V0.js} +1 -1
  61. package/_assets/{getBalance-k1LJAZwU.js → getBalance-DgaBMaZu.js} +1 -1
  62. package/_assets/{getNFT-BMgMzvsZ.js → getNFT-Cbnn5r5E.js} +1 -1
  63. package/_assets/{getNFT-B39rY-PL.js → getNFT-DKvKDEaY.js} +1 -1
  64. package/_assets/{getThemeProps-CppRRpEN.js → getThemeProps-Bu9YSzaf.js} +1 -1
  65. package/_assets/{grid.styles-Ckr_d1Os.js → grid.styles-CZVOpjjs.js} +1 -1
  66. package/_assets/{hashTypedData-CiesaRhT.js → hashTypedData-CtDvd41l.js} +1 -1
  67. package/_assets/{hashTypedData-DUwT6kJz.js → hashTypedData-rLfQ957S.js} +1 -1
  68. package/_assets/{in-app-B5W9FA6J.js → in-app-B_bX5Pf7.js} +1 -1
  69. package/_assets/{in-app-wallet-calls--fTMhgRz.js → in-app-wallet-calls-C9bmJ6R3.js} +1 -1
  70. package/_assets/{index-C2R_7cZP.js → index--NKKldVb.js} +1 -1
  71. package/_assets/{index-DyyMlzME.js → index-4TawLs5a.js} +1 -1
  72. package/_assets/{index-7Jx0RbBI.js → index-6I8HEC_Y.js} +1 -1
  73. package/_assets/{index-CqYYwjL0.js → index-B11NezU2.js} +1 -1
  74. package/_assets/{index-DUdz_zrJ.js → index-B2EDgPii.js} +1 -1
  75. package/_assets/{index-C_8wyBUp.js → index-B2oCz9h3.js} +1 -1
  76. package/_assets/{index-hzUEG0Wn.js → index-BNUKwZHP.js} +1 -1
  77. package/_assets/{index-Cz0mItuU.js → index-BRbEj2uS.js} +1 -1
  78. package/_assets/{index-pzI9SPYg.js → index-BkCasTMp.js} +1 -1
  79. package/_assets/{index-3Gl3qzVg.js → index-BmaN82SE.js} +1 -1
  80. package/_assets/{index-D3b-6hLL.js → index-BnLMVprY.js} +3 -3
  81. package/_assets/{index-DmlHhfEt.js → index-BwfpKO5P.js} +1 -1
  82. package/_assets/{index-CiVLOnq4.js → index-C1lRXCQm.js} +1 -1
  83. package/_assets/{index-CROLwqLK.js → index-C2hAMnK8.js} +1 -1
  84. package/_assets/{index-DIpNccsB.js → index-C58EvIrR.js} +1 -1
  85. package/_assets/{index-DLJMJNYR.js → index-CG_YZLVB.js} +1 -1
  86. package/_assets/{index-BPLQs7pP.js → index-CK8TpyLf.js} +1 -1
  87. package/_assets/index-CPUNB1w5.js +3318 -0
  88. package/_assets/{index-8Gs8aT7x.js → index-CbJc7MGP.js} +1 -1
  89. package/_assets/{index-DCUHwzVB.js → index-CjUWMpHg.js} +1 -1
  90. package/_assets/{index-BvHiSowo.js → index-Cr6TDW8C.js} +1 -1
  91. package/_assets/{index-CWl1zAsC.js → index-CtjcwqzD.js} +2 -2
  92. package/_assets/{index-baUyxxA5.js → index-CyXu5qnd.js} +1 -1
  93. package/_assets/{index-D0VlnNE3.js → index-D0I_Osxp.js} +1 -1
  94. package/_assets/{index-BjDpMJu4.js → index-D9RmlytH.js} +1 -1
  95. package/_assets/{index-CjmdU7lV.js → index-DAsjno4g.js} +3 -3
  96. package/_assets/{index-BH9Lj6j_.js → index-DMVQ9umm.js} +1 -1
  97. package/_assets/{index-D0JaJVwf.js → index-DS2Lupaq.js} +1 -1
  98. package/_assets/index-DeMkx1da.js +4 -0
  99. package/_assets/{index-Ct4YR2LP.js → index-DfbxtuYX.js} +1 -1
  100. package/_assets/{index-CMt6SGgd.js → index-DidBFajD.js} +1 -1
  101. package/_assets/{index-BSMtncI0.js → index-DjXuQ48T.js} +1 -1
  102. package/_assets/{index-DIGH_-jR.js → index-DqBwWIVT.js} +1 -1
  103. package/_assets/{index-r_ie-fYk.js → index-DqNeZR4B.js} +1 -1
  104. package/_assets/{index-6hXQkpzo.js → index-DvR68cSd.js} +1 -1
  105. package/_assets/{index-C4Mo9qnf.js → index-Dx3tYAkZ.js} +3 -3
  106. package/_assets/{index-BwnQwSAu.js → index-DyZW2SfQ.js} +2 -2
  107. package/_assets/{index-brzaaZ1P.js → index-GLTtUdTB.js} +1 -1
  108. package/_assets/{index-D1Kwe229.js → index-Gtw4uHDD.js} +1 -1
  109. package/_assets/{index--5-WNACO.js → index-HsA1Y52f.js} +1 -1
  110. package/_assets/index-ILKiTpsF.js +1 -0
  111. package/_assets/{index-BlTW8bE5.js → index-Mx9r3Xj8.js} +1 -1
  112. package/_assets/{index-6lOpuU8D.js → index-O8eM0pm8.js} +1 -1
  113. package/_assets/{index-DN_XFLDI.js → index-WEMl9gKw.js} +9 -9
  114. package/_assets/{index-DIYC-eqY.js → index-XJdGfRRo.js} +1 -1
  115. package/_assets/index-Y7gUVJgS.js +2 -0
  116. package/_assets/{index-DJigbyYH.js → index-_jtymwJR.js} +1 -1
  117. package/_assets/{index-MSDyZgBz.js → index-l3jlQAcT.js} +2 -2
  118. package/_assets/{index-CdMXnYZl.js → index-lIAXRjQl.js} +1 -1
  119. package/_assets/{index-CWDp9PWh.js → index-pXPDx04x.js} +1 -1
  120. package/_assets/{index-CnU32wDE.js → index-rRK3UI8J.js} +1 -1
  121. package/_assets/{index-COM-LGX-.js → index-yfz6G4Xe.js} +1 -1
  122. package/_assets/{index.es-BfycRISM.js → index.es-C8UEqm2t.js} +1 -1
  123. package/_assets/{index.es-CEspgBOo.js → index.es-C9HClJ_9.js} +4 -4
  124. package/_assets/{index.es-Dz4gJjtG.js → index.es-HJK4dzqN.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-C2ejDWSe.js → localBatchGatewayRequest-BtzqioHt.js} +1 -1
  126. package/_assets/{networks-C8W7qTmi.js → networks-pKt33-ss.js} +1 -1
  127. package/_assets/{onramp-gMYCcz-L.js → onramp-Ctw7NTkL.js} +1 -1
  128. package/_assets/{openzeppelin-DoXqKfoL.js → openzeppelin-DbWIwLSo.js} +1 -1
  129. package/_assets/{parseNft-CG6mXwGw.js → parseNft-Dccz4pWl.js} +2 -2
  130. package/_assets/{parseSignature-BtFyUMyh.js → parseSignature-C_tLHwks.js} +1 -1
  131. package/_assets/{parseSignature-YB0y-EIH.js → parseSignature-Dc2mQKDQ.js} +3 -3
  132. package/_assets/{passkeys-DMD6dHpE.js → passkeys-C3dWsC0m.js} +1 -1
  133. package/_assets/{pay-with-exchange-DmOk5KUk.js → pay-with-exchange-CORKKjc3.js} +1 -1
  134. package/_assets/{qr-overlay-BmfI4Van.js → qr-overlay-DiWyFso0.js} +1 -1
  135. package/_assets/{receive-C8CxHyfZ.js → receive-DjdbP-wR.js} +1 -1
  136. package/_assets/{resolveImplementation-D10q4uG8.js → resolveImplementation-CEtEoi9u.js} +1 -1
  137. package/_assets/{rpc-C6XV-dPj.js → rpc-BTQU7mWR.js} +1 -1
  138. package/_assets/{secp256k1-i1ynB1kh.js → secp256k1-COzkU0Sk.js} +1 -1
  139. package/_assets/{secp256k1-CplZyQx1.js → secp256k1-Ci7kyRE_.js} +1 -1
  140. package/_assets/{secp256k1-BmbnB2T6.js → secp256k1-RykjkvHG.js} +1 -1
  141. package/_assets/{send-r-sbW-NR.js → send-CM4vfbSg.js} +1 -1
  142. package/_assets/{send-batch-transaction-DPGUnjFL.js → send-batch-transaction-iGW_cuJF.js} +1 -1
  143. package/_assets/{send-eip712-transaction-DDBiSwZa.js → send-eip712-transaction-D0lFeOT-.js} +2 -2
  144. package/_assets/{send-gasless-transaction-TUww1FFr.js → send-gasless-transaction-CnHTe9_r.js} +2 -2
  145. package/_assets/{send-transaction-INP2LgJd.js → send-transaction-C5W9oQnP.js} +2 -2
  146. package/_assets/{sendMetaTransaction-CtlcvZ2u.js → sendMetaTransaction-BVuZvVgm.js} +1 -1
  147. package/_assets/{sendRawTransaction-BiF1pCL3.js → sendRawTransaction-DvotfhRl.js} +3 -3
  148. package/_assets/{serializeTransaction-_CDXrMP2.js → serializeTransaction-CiQSGeOE.js} +1 -1
  149. package/_assets/{session-proposal-Cyo4-zWW.js → session-proposal-BXqH_t9S.js} +1 -1
  150. package/_assets/{session-request-DhBEeqtM.js → session-request-Dcm6nAp0.js} +2 -2
  151. package/_assets/{signing-eZY4IKkr.js → signing-ByP_Wc98.js} +3 -3
  152. package/_assets/{socials-ez11BKnF.js → socials-B5ceEXYk.js} +1 -1
  153. package/_assets/styled-DA27NEZ_.js +9 -0
  154. package/_assets/{swaps-D50dXpS9.js → swaps-eU2KptHT.js} +1 -1
  155. package/_assets/{thirdweb-DtMwg5nw.js → thirdweb-R9NbdQHe.js} +3 -3
  156. package/_assets/{to-serializable-transaction-Bo2k0bHN.js → to-serializable-transaction-DwiP3Lmn.js} +2 -2
  157. package/_assets/{trade-encoding-DBrxq_08.js → trade-encoding-COzPhGqu.js} +1 -1
  158. package/_assets/{transactionReceipt-D84_cL1Y.js → transactionReceipt-CpCsiha2.js} +1 -1
  159. package/_assets/{transactions-BxDrgH0T.js → transactions-B2h28VwI.js} +1 -1
  160. package/_assets/{useCreditPacks-DJGSwrlc.js → useCreditPacks-BVqZm9sZ.js} +1 -1
  161. package/_assets/{useImportable-8-eoe6U0.js → useImportable-BYV2kQzZ.js} +1 -1
  162. package/_assets/{useInfiniteGrid-BioQWUj3.js → useInfiniteGrid-e8wVPY4L.js} +1 -1
  163. package/_assets/{useTheme-CuHYv3yr.js → useTheme-CvexxEpq.js} +1 -1
  164. package/_assets/{verifyHash-Dp410C0R.js → verifyHash-CJ_AAsFU.js} +1 -1
  165. package/_assets/{w3m-modal-ChBvc6av.js → w3m-modal-C-2rGpST.js} +1 -1
  166. package/_assets/{w3m-modal-q1294Ir0.js → w3m-modal-D-9NLCOl.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-GGiAUH7I.js → wait-for-tx-receipt-B-hXNmE8.js} +1 -1
  168. package/_assets/{wallets-B8DTTYN0.js → wallets-rEY4QoJJ.js} +5 -5
  169. package/_assets/{web-connector-CwvhuMom.js → web-connector-T9PtO1CT.js} +3 -3
  170. package/_assets/{writeContract-CsfeVlnc.js → writeContract-CcBmkVg7.js} +1 -1
  171. package/_assets/{zoraTestnet-CaYytGcL.js → zoraTestnet-B7aoW9Ms.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/NotificationsBell-CaKoTXrL.js +0 -34
  175. package/_assets/OutfitDetail-ME6t5FNU.js +0 -326
  176. package/_assets/OutfitPreview-BCoX8M6g.js +0 -6
  177. package/_assets/OutfitStudio-DeiWpnBW.js +0 -500
  178. package/_assets/clsx-Dp2xNKFR.js +0 -9
  179. package/_assets/emotion-styled.browser.esm-Cc0eNU1p.js +0 -1
  180. package/_assets/index-BQADEYsi.js +0 -1
  181. package/_assets/index-BYQ4eOXE.js +0 -2
  182. package/_assets/index-C50bRdDg.js +0 -3318
  183. package/_assets/index-C5xtRArG.js +0 -4
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DN_XFLDI.js","_assets/react-DehiWSvs.js","_assets/index-C50bRdDg.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-8-eoe6U0.js","_assets/buy-DME37PMo.js","_assets/authorizations-DOwEBZw0.js","_assets/sendMetaTransaction-CtlcvZ2u.js","_assets/trade-encoding-DBrxq_08.js","_assets/ManaPricingBanner.styles-zp0428S7.js","_assets/field.styles-CjeX0pR0.js"])))=>i.map(i=>d[i]);
2
- import{m as ye,bv as ve,s as l,t as s,q as we,B as je,l as te,v as ke,d as c,o as $,b3 as Ie,I as j,bw as Z,bx as J,by as Ae,_ as $e,x as P,bz as Pe,y as Le,b7 as H,av as Ne,bA as Ee,A as Te,bB as Ce,bC as q}from"./index-C50bRdDg.js";import{r as g,e as Se,j as t,L as ie,a as Fe}from"./react-DehiWSvs.js";import{u as De}from"./useImportable-8-eoe6U0.js";import{L as Me}from"./LoadMore-C6sUcyIf.js";import{u as I}from"./useInfiniteGrid-BioQWUj3.js";import{m as ae}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-DME37PMo.js";import"./authorizations-DOwEBZw0.js";import"./sendMetaTransaction-CtlcvZ2u.js";import"./trade-encoding-DBrxq_08.js";const He=15e3;function qe(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)<=He}function ze(e){const a=[...e].sort((i,o)=>o.createdAt-i.createdAt),n=[];for(const i of a){const o=n[n.length-1];o&&qe(o[o.length-1],i)?o.push(i):n.push([i])}return n.map(i=>{var o;return{id:((o=i.find(r=>r.txHash))==null?void 0:o.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function Oe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Re(e){const a=[],n=new Map;for(const i of e){const o=Oe(i);if(!o){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(o);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:o,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(o,u),a.push(u)}return a}function We(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?ye(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function _e(e){const n=ze(e.purchases.filter(d=>d.status!=="EXPIRED")).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=e.sales.map(d=>{const p=We(d,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),o=(e.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),r=new Set(e.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(d=>!r.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...n,...i,...o,...u].sort((d,p)=>p.createdAt-d.createdAt||(d.id<p.id?-1:1))}function Be(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 se=e=>e.trim().toLowerCase();function Ge(e){const a=new Map;for(const n of e??[]){const i=se(n.txHash??"");if(!i)continue;const o=a.get(i);o?o.push(n):a.set(i,[n])}return a}function Ue(e,a,n=Date.now()){const i=a.txHash?e.get(se(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const o=i.length===1?Ke(i[0].netCents):null,r=i.filter(d=>!d.available&&d.availableAt>n);if(r.length===0)return{kind:"credited",credits:o};const u=r.reduce((d,p)=>Math.max(d,p.availableAt),0);return{kind:"pending",credits:o,availableAt:u}}function Ke(e){return ve(e)}const Qe="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/credits-product-vs4Q6u6l.svg",z=we`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-WEMl9gKw.js","_assets/react-DehiWSvs.js","_assets/index-CPUNB1w5.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-BYV2kQzZ.js","_assets/buy-q4FEKtCt.js","_assets/authorizations-BPxCPWb-.js","_assets/sendMetaTransaction-BVuZvVgm.js","_assets/trade-encoding-COzPhGqu.js","_assets/ManaPricingBanner.styles-BNpx6cwF.js","_assets/field.styles-D43vo7Wv.js"])))=>i.map(i=>d[i]);
2
+ import{m as ye,by as ve,s as l,t as s,q as we,B as je,l as te,v as ke,d as c,o as $,ah as Ie,I as j,bz as Z,bA as J,bB as Ae,_ as $e,x as P,bC as Pe,y as Le,ba as H,ay as Ne,bD as Ee,A as Te,bE as Ce,bF as q}from"./index-CPUNB1w5.js";import{r as g,e as Se,j as t,L as ie,a as Fe}from"./react-DehiWSvs.js";import{u as De}from"./useImportable-BYV2kQzZ.js";import{L as Me}from"./LoadMore-Bjd9tWsJ.js";import{u as I}from"./useInfiniteGrid-e8wVPY4L.js";import{m as ae}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-q4FEKtCt.js";import"./authorizations-BPxCPWb-.js";import"./sendMetaTransaction-BVuZvVgm.js";import"./trade-encoding-COzPhGqu.js";const He=15e3;function qe(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)<=He}function ze(e){const a=[...e].sort((i,o)=>o.createdAt-i.createdAt),n=[];for(const i of a){const o=n[n.length-1];o&&qe(o[o.length-1],i)?o.push(i):n.push([i])}return n.map(i=>{var o;return{id:((o=i.find(r=>r.txHash))==null?void 0:o.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function Oe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Re(e){const a=[],n=new Map;for(const i of e){const o=Oe(i);if(!o){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(o);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:o,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(o,u),a.push(u)}return a}function We(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?ye(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function _e(e){const n=ze(e.purchases.filter(d=>d.status!=="EXPIRED")).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=e.sales.map(d=>{const p=We(d,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),o=(e.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),r=new Set(e.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(d=>!r.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...n,...i,...o,...u].sort((d,p)=>p.createdAt-d.createdAt||(d.id<p.id?-1:1))}function Be(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 se=e=>e.trim().toLowerCase();function Ge(e){const a=new Map;for(const n of e??[]){const i=se(n.txHash??"");if(!i)continue;const o=a.get(i);o?o.push(n):a.set(i,[n])}return a}function Ue(e,a,n=Date.now()){const i=a.txHash?e.get(se(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const o=i.length===1?Ke(i[0].netCents):null,r=i.filter(d=>!d.available&&d.availableAt>n);if(r.length===0)return{kind:"credited",credits:o};const u=r.reduce((d,p)=>Math.max(d,p.availableAt),0);return{kind:"pending",credits:o,availableAt:u}}function Ke(e){return ve(e)}const Qe="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/credits-product-vs4Q6u6l.svg",z=we`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,Ve=l.section`
@@ -381,4 +381,4 @@ import{m as ye,bv as ve,s as l,t as s,q as we,B as je,l as te,v as ke,d as c,o a
381
381
  margin: 6px 0 0;
382
382
  `,ot=l(je)`
383
383
  margin-top: 12px;
384
- `,K=D.withComponent(ie),dt=g.lazy(()=>$e(()=>import("./index-DN_XFLDI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),A=24,ct=["all","purchases","sales"],M="migrate";function w(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ce(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function le(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function he({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),o=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return t.jsxs(st,{ref:a,tabIndex:0,onMouseEnter:o,onMouseLeave:()=>i(null),onFocus:o,onBlur:()=>i(null),children:[e,n?Fe.createPortal(t.jsx(nt,{style:{top:n.top,left:n.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function lt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:o}=$({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Ce(e.tradeId):q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),r=n&&o,u=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",p=H({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=t.jsxs(t.Fragment,{children:[r?t.jsx(W,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:u}):t.jsx(j,{name:"cart",size:20})}),t.jsxs(_,{children:[r?t.jsx(G,{}):t.jsx(B,{title:u,children:u}),e.quantity>1?t.jsx(U,{children:c("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(rt,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]});return p?t.jsx(K,{to:p,"data-link":"true",children:x}):t.jsx(D,{children:x})}function ht({order:e}){const a=Re(e.lines),n=a.reduce((i,o)=>i+o.quantity,0);return t.jsxs(L,{"data-testid":"purchase-order",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:n})]})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":e.status,children:e.status==="PENDING"?c("activity.processing"):c("activity.completed")}),t.jsxs(v,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(O,{children:a.map(i=>t.jsx(lt,{item:i},i.key))})]})}function ut({sale:e}){const{data:a,isLoading:n}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",r=H({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(W,{}):t.jsx(R,{children:o?t.jsx("img",{src:o,alt:i}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[n?t.jsx(G,{}):t.jsx(B,{title:i,children:i}),t.jsx(U,{children:c("activity.boughtFrom",{account:ce(e.seller)})})]})]});return t.jsxs(L,{"data-testid":"activity-mana-purchase",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.paidWithMana")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":"SETTLED",children:c("activity.completed")}),t.jsxs(v,{children:[le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]})]})]}),t.jsx(O,{children:r?t.jsx(K,{to:r,"data-link":"true",children:u}):t.jsx(D,{children:u})})]})}function pt({sale:e,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),o=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=H({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,d=t.jsxs(t.Fragment,{children:[i?t.jsx(W,{}):t.jsx(R,{children:r?t.jsx("img",{src:r,alt:o}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(G,{}):t.jsx(B,{title:o,children:o}),t.jsxs(U,{children:[c("activity.soldTo",{account:ce(e.counterparty)}),a.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return t.jsxs(L,{"data-testid":"activity-sale",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.saleLabel")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),a.kind==="direct"?t.jsxs(v,{"data-kind":"income",children:["+",le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]}):a.credits!==null?t.jsxs(v,{"data-kind":"income",children:[t.jsx(P,{className:"ccy-mark"})," +",Ne(a.credits)]}):t.jsx(v,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),t.jsx(O,{children:u?t.jsx(K,{to:u,"data-link":"true",children:d}):t.jsx(D,{children:d})})]})}function xt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Pe(e.status),i=n==="SETTLED"?c("activity.completed"):n==="FAILED"?c("activity.failed"):n==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),o=te(m=>m.session),r=Le(),[u,d]=g.useState(!1),p=e.status==="initiated"&&!!o;async function x(){if(!(!o||u)){d(!0);try{const m=await Ee(e.id,o.identity);if(m){window.location.href=m;return}Te.info(c("activity.resumeExpired")),r.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return t.jsx(L,{"data-testid":"credit-order",children:t.jsxs(N,{children:[t.jsx(it,{children:t.jsx("img",{src:Qe,alt:"","aria-hidden":!0})}),t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:a})]})]}),t.jsxs(S,{children:[p?t.jsx(at,{type:"button",onClick:()=>void x(),disabled:u,"data-testid":"resume-order",children:u?c("activity.resuming"):c("activity.resume")}):null,t.jsx(F,{"data-status":n,children:i}),t.jsxs(v,{"data-kind":"income",children:["+",t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]})]})})}function mt({filter:e}){const a={all:{icon:"clock",title:c("activity.emptyAllTitle"),body:c("activity.emptyAllBody")},purchases:{icon:"cart",title:c("activity.emptyPurchasesTitle"),body:c("activity.emptyPurchasesBody")},sales:{icon:"offer",title:c("activity.emptySalesTitle"),body:c("activity.emptySalesBody")}}[e];return t.jsxs(oe,{children:[t.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(de,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ot,{as:ie,to:"/items",variant:"purple",children:c("notFound.cta")}):null]})}function Et(){const{session:e}=te(),[a,n]=g.useState("all"),[i,o]=Se(),r=i.get("view")===M;ke({title:r?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:u}=De(),d=u!==void 0&&(u>0||r),p=!!e&&!r&&a!=="sales",x=!!e&&!r&&a!=="purchases",m=I(["purchases",e==null?void 0:e.address],h=>Ae(e.address,e.identity,{first:A,skip:h}),{enabled:p}),f=I(["sales",e==null?void 0:e.address],h=>Z(e.address,{role:"seller",first:A,skip:h}),{enabled:x}),b=I(["credit-orders",e==null?void 0:e.address],h=>J(e.address,e.identity,{first:A,skip:h}),{enabled:p}),y=I(["mana-purchases",e==null?void 0:e.address],h=>Z(e.address,{role:"buyer",first:A,skip:h}),{enabled:p}),{data:Q}=$({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>J(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ue=g.useMemo(()=>Ge(Q),[Q]),{data:pe}=Ie(x);if(!e)return t.jsxs(oe,{children:[t.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(de,{children:c("activity.signInTitle")}),t.jsx("p",{className:"muted",children:c("activity.signInBody")})]});const V=Be(_e({purchases:p?m.items:[],sales:x?f.items:[],creditOrders:p?b.items:[],manaPurchases:p?y.items:[],rate:pe}),a),xe=p&&(m.isLoading||b.isLoading||y.isLoading)||x&&f.isLoading,X=p&&(m.isFetchingNextPage||b.isFetchingNextPage||y.isFetchingNextPage)||x&&f.isFetchingNextPage,me=p&&(m.hasNextPage||b.hasNextPage||y.hasNextPage)||x&&f.hasNextPage;function ge(){p&&m.hasNextPage&&m.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),p&&y.hasNextPage&&y.fetchNextPage(),x&&f.hasNextPage&&f.fetchNextPage()}function fe(h){if(n(h),!r)return;const k=new URLSearchParams(i);k.delete("view"),o(k,{replace:!0})}function be(){const h=new URLSearchParams(i);h.set("view",M),o(h,{replace:!0})}return t.jsxs(Ve,{"data-view":r?M:"feed",children:[t.jsx(Xe,{children:t.jsx(Ze,{children:c("nav.activity")})}),t.jsxs(Je,{role:"tablist","aria-label":c("nav.activity"),children:[ct.map(h=>t.jsx(ne,{type:"button",role:"tab","aria-selected":!r&&a===h,"data-active":!r&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>fe(h),children:c(`activity.filter.${h}`)},h)),d?t.jsxs(Ye,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?c("activity.migrate.chipAria",{count:u}):void 0,onClick:be,children:[c("activity.migrate.chip"),u?t.jsx(et,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?t.jsx(g.Suspense,{fallback:t.jsx(tt,{"aria-busy":"true"}),children:t.jsx(dt,{})}):xe?t.jsx(Y,{children:Array.from({length:5}).map((h,k)=>t.jsx(ee,{},k))}):V.length===0?t.jsx(mt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[V.map(h=>h.kind==="purchase"?t.jsx(ht,{order:h.order},h.id):h.kind==="credit"?t.jsx(xt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(ut,{sale:h.sale},h.id):t.jsx(pt,{sale:h.sale,payout:Ue(ue,h.sale)},h.id)),X?t.jsx(ee,{}):null]}),t.jsx(Me,{hasNextPage:me,isFetching:X,onLoadMore:ge})]})]})}export{Et as Activity};
384
+ `,K=D.withComponent(ie),dt=g.lazy(()=>$e(()=>import("./index-WEMl9gKw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),A=24,ct=["all","purchases","sales"],M="migrate";function w(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ce(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function le(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function he({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),o=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return t.jsxs(st,{ref:a,tabIndex:0,onMouseEnter:o,onMouseLeave:()=>i(null),onFocus:o,onBlur:()=>i(null),children:[e,n?Fe.createPortal(t.jsx(nt,{style:{top:n.top,left:n.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function lt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:o}=$({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Ce(e.tradeId):q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),r=n&&o,u=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",p=H({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=t.jsxs(t.Fragment,{children:[r?t.jsx(W,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:u}):t.jsx(j,{name:"cart",size:20})}),t.jsxs(_,{children:[r?t.jsx(G,{}):t.jsx(B,{title:u,children:u}),e.quantity>1?t.jsx(U,{children:c("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(rt,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]});return p?t.jsx(K,{to:p,"data-link":"true",children:x}):t.jsx(D,{children:x})}function ht({order:e}){const a=Re(e.lines),n=a.reduce((i,o)=>i+o.quantity,0);return t.jsxs(L,{"data-testid":"purchase-order",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:n})]})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":e.status,children:e.status==="PENDING"?c("activity.processing"):c("activity.completed")}),t.jsxs(v,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(O,{children:a.map(i=>t.jsx(lt,{item:i},i.key))})]})}function ut({sale:e}){const{data:a,isLoading:n}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",r=H({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(W,{}):t.jsx(R,{children:o?t.jsx("img",{src:o,alt:i}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[n?t.jsx(G,{}):t.jsx(B,{title:i,children:i}),t.jsx(U,{children:c("activity.boughtFrom",{account:ce(e.seller)})})]})]});return t.jsxs(L,{"data-testid":"activity-mana-purchase",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.paidWithMana")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":"SETTLED",children:c("activity.completed")}),t.jsxs(v,{children:[le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]})]})]}),t.jsx(O,{children:r?t.jsx(K,{to:r,"data-link":"true",children:u}):t.jsx(D,{children:u})})]})}function pt({sale:e,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),o=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=H({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,d=t.jsxs(t.Fragment,{children:[i?t.jsx(W,{}):t.jsx(R,{children:r?t.jsx("img",{src:r,alt:o}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(G,{}):t.jsx(B,{title:o,children:o}),t.jsxs(U,{children:[c("activity.soldTo",{account:ce(e.counterparty)}),a.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return t.jsxs(L,{"data-testid":"activity-sale",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.saleLabel")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),a.kind==="direct"?t.jsxs(v,{"data-kind":"income",children:["+",le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]}):a.credits!==null?t.jsxs(v,{"data-kind":"income",children:[t.jsx(P,{className:"ccy-mark"})," +",Ne(a.credits)]}):t.jsx(v,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),t.jsx(O,{children:u?t.jsx(K,{to:u,"data-link":"true",children:d}):t.jsx(D,{children:d})})]})}function xt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Pe(e.status),i=n==="SETTLED"?c("activity.completed"):n==="FAILED"?c("activity.failed"):n==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),o=te(m=>m.session),r=Le(),[u,d]=g.useState(!1),p=e.status==="initiated"&&!!o;async function x(){if(!(!o||u)){d(!0);try{const m=await Ee(e.id,o.identity);if(m){window.location.href=m;return}Te.info(c("activity.resumeExpired")),r.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return t.jsx(L,{"data-testid":"credit-order",children:t.jsxs(N,{children:[t.jsx(it,{children:t.jsx("img",{src:Qe,alt:"","aria-hidden":!0})}),t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:a})]})]}),t.jsxs(S,{children:[p?t.jsx(at,{type:"button",onClick:()=>void x(),disabled:u,"data-testid":"resume-order",children:u?c("activity.resuming"):c("activity.resume")}):null,t.jsx(F,{"data-status":n,children:i}),t.jsxs(v,{"data-kind":"income",children:["+",t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]})]})})}function mt({filter:e}){const a={all:{icon:"clock",title:c("activity.emptyAllTitle"),body:c("activity.emptyAllBody")},purchases:{icon:"cart",title:c("activity.emptyPurchasesTitle"),body:c("activity.emptyPurchasesBody")},sales:{icon:"offer",title:c("activity.emptySalesTitle"),body:c("activity.emptySalesBody")}}[e];return t.jsxs(oe,{children:[t.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(de,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ot,{as:ie,to:"/items",variant:"purple",children:c("notFound.cta")}):null]})}function Et(){const{session:e}=te(),[a,n]=g.useState("all"),[i,o]=Se(),r=i.get("view")===M;ke({title:r?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:u}=De(),d=u!==void 0&&(u>0||r),p=!!e&&!r&&a!=="sales",x=!!e&&!r&&a!=="purchases",m=I(["purchases",e==null?void 0:e.address],h=>Ae(e.address,e.identity,{first:A,skip:h}),{enabled:p}),f=I(["sales",e==null?void 0:e.address],h=>Z(e.address,{role:"seller",first:A,skip:h}),{enabled:x}),b=I(["credit-orders",e==null?void 0:e.address],h=>J(e.address,e.identity,{first:A,skip:h}),{enabled:p}),y=I(["mana-purchases",e==null?void 0:e.address],h=>Z(e.address,{role:"buyer",first:A,skip:h}),{enabled:p}),{data:Q}=$({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>J(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ue=g.useMemo(()=>Ge(Q),[Q]),{data:pe}=Ie(x);if(!e)return t.jsxs(oe,{children:[t.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(de,{children:c("activity.signInTitle")}),t.jsx("p",{className:"muted",children:c("activity.signInBody")})]});const V=Be(_e({purchases:p?m.items:[],sales:x?f.items:[],creditOrders:p?b.items:[],manaPurchases:p?y.items:[],rate:pe}),a),xe=p&&(m.isLoading||b.isLoading||y.isLoading)||x&&f.isLoading,X=p&&(m.isFetchingNextPage||b.isFetchingNextPage||y.isFetchingNextPage)||x&&f.isFetchingNextPage,me=p&&(m.hasNextPage||b.hasNextPage||y.hasNextPage)||x&&f.hasNextPage;function ge(){p&&m.hasNextPage&&m.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),p&&y.hasNextPage&&y.fetchNextPage(),x&&f.hasNextPage&&f.fetchNextPage()}function fe(h){if(n(h),!r)return;const k=new URLSearchParams(i);k.delete("view"),o(k,{replace:!0})}function be(){const h=new URLSearchParams(i);h.set("view",M),o(h,{replace:!0})}return t.jsxs(Ve,{"data-view":r?M:"feed",children:[t.jsx(Xe,{children:t.jsx(Ze,{children:c("nav.activity")})}),t.jsxs(Je,{role:"tablist","aria-label":c("nav.activity"),children:[ct.map(h=>t.jsx(ne,{type:"button",role:"tab","aria-selected":!r&&a===h,"data-active":!r&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>fe(h),children:c(`activity.filter.${h}`)},h)),d?t.jsxs(Ye,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?c("activity.migrate.chipAria",{count:u}):void 0,onClick:be,children:[c("activity.migrate.chip"),u?t.jsx(et,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?t.jsx(g.Suspense,{fallback:t.jsx(tt,{"aria-busy":"true"}),children:t.jsx(dt,{})}):xe?t.jsx(Y,{children:Array.from({length:5}).map((h,k)=>t.jsx(ee,{},k))}):V.length===0?t.jsx(mt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[V.map(h=>h.kind==="purchase"?t.jsx(ht,{order:h.order},h.id):h.kind==="credit"?t.jsx(xt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(ut,{sale:h.sale},h.id):t.jsx(pt,{sale:h.sale,payout:Ue(ue,h.sale)},h.id)),X?t.jsx(ee,{}):null]}),t.jsx(Me,{hasNextPage:me,isFetching:X,onLoadMore:ge})]})]})}export{Et as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-C50bRdDg.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.6.1/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-CPUNB1w5.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.6.2-30957461961.commit-f1e9c8c/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_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),c=p(e,e.FRAGMENT_SHADER,P);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const a=D(e,o,c);if(!a){e.deleteShader(o),e.deleteShader(c);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 i=window.devicePixelRatio||1,E=r.clientWidth*i,g=r.clientHeight*i;(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=i=>{i.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(c),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};
@@ -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,k as st,bc as rt,bd as ot,aq as it,b as at,s,t,l as Ue,b1 as lt,y as ct,av as be,d as n,w as dt,I as R,x as M,bM as se,b0 as pt,U as ee,bg as ht,bf as xt,v as He,b3 as Oe,m as Ge,n as ft,ae as mt,ag as ze,ah as V,ax as ut,bI as gt}from"./index-C50bRdDg.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 It,p as zt,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-BAy3by3Z.js";import{S as Ae,R as Wt,F as Bt,e as Ft}from"./categories-SI1YlvJt.js";import{L as Lt}from"./LoadMore-C6sUcyIf.js";import{u as Ut}from"./useInfiniteGrid-BioQWUj3.js";import{E as Ht}from"./ErrorNotice-6j32LCd-.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-CsB_UciL.js";import{s as Zt}from"./buy-DME37PMo.js";import{j as Kt}from"./trade-encoding-DBrxq_08.js";import{f as Jt}from"./errors-BNZ7sBF_.js";import{J as Qt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-BZ-qUO0l.js";import{G as en}from"./grid.styles-Ckr_d1Os.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-DOwEBZw0.js";import"./sendMetaTransaction-CtlcvZ2u.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`
1
+ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k as st,bf as rt,bg as ot,at as it,b as at,s,t,l as Ue,b5 as lt,y as ct,ay as be,d as n,w as dt,I as R,x as M,bP as se,b4 as pt,U as ee,bj as ht,bi as xt,v as He,ah as Oe,m as Ge,n as ft,af as mt,aj as Ie,ak as V,aA as ut,bL as gt}from"./index-CPUNB1w5.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 Pt,s as Nt,t as Mt}from"./Assets.styles-BdrGrnkY.js";import{S as Ae,R as Wt,F as Bt,e as Ft}from"./categories-CWfLUCEz.js";import{L as Lt}from"./LoadMore-Bjd9tWsJ.js";import{u as Ut}from"./useInfiniteGrid-e8wVPY4L.js";import{E as Ht}from"./ErrorNotice-CrDVf-1v.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-DmiZzQtt.js";import{s as Zt}from"./buy-q4FEKtCt.js";import{j as Kt}from"./trade-encoding-COzPhGqu.js";import{f as Jt}from"./errors-TT0eRE9n.js";import{J as Qt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-CsoII5yH.js";import{G as en}from"./grid.styles-CZVOpjjs.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-BPxCPWb-.js";import"./sendMetaTransaction-BVuZvVgm.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 Pe(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)"],Ne={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)?Ne.mainnet:Ne.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;
@@ -323,7 +323,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
323
323
  outline: 2px solid ${t.colors.accent};
324
324
  outline-offset: 2px;
325
325
  }
326
- `,In=s.a`
326
+ `,zn=s.a`
327
327
  flex: 1;
328
328
  display: inline-flex;
329
329
  align-items: center;
@@ -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,k a
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function zn({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 z(){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 z(),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(In,{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.6.1/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/invite-BfwIhP2C.webp",Wn="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/governance-DnazlIjy.webp",Bn=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",P=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:P?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 Pn="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/identity-B4DXDuJP.webp",Nn="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/invite-BfwIhP2C.webp",Wn="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/governance-DnazlIjy.webp",Bn=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Fn=s.nav`
@@ -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,k 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/",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(zn,{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 Bs(){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(I=>{const ne=new URLSearchParams(I);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=I=>{I.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 z=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(z?["shop-items",je]:["catalog-items",ve],o=>z?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=z&&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 Ie(o){C(j=>j.includes(o)?j.filter(I=>I!==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:()=>Ie(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:Ie,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&&z&&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(It,{src:gs,alt:""}),e.jsxs(zt,{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(ze,{count:et}):e.jsxs(e.Fragment,{children:[F.map(o=>{if(!z)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 I=Xe(j);return I==null?e.jsx(V,{item:o,mode:"view"},Z(o)):e.jsx(V,{item:{...j,priceCredits:I}},Z(o))}),ke?e.jsx(ze,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:ke,isError:Ze,onLoadMore:()=>void Ke()})]})]})})]})}export{Bs 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(!Pe(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=Pe(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:Pn,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:Nn,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 Bs(){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,P=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:P,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:N,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=N||B||Ye,et=N?15:Math.min(Math.max(F.length,1),ge),Re=u.useRef(null);u.useEffect(()=>{N||B||!c||Re.current===c||(Re.current=c,ee("Shop Searched",{query:c,result_count:D}))},[c,N,B,D]);const q=u.useRef("__init__");u.useEffect(()=>{if(N||B)return;const o=JSON.stringify({category:a,subCategory:x,rarities:m,min:A,max:P,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:P??null,status:l,smart:v,sort:E},result_count:D})},[a,x,m,A,P,E,l,v,N,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||P!=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:N||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(Pt,{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(Nt,{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{Bs as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-SI1YlvJt.js";import{n as c,T as le}from"./Tooltip-BZ-qUO0l.js";import{t as e,s as o,I as g,d as s,ae as ce,e as v}from"./index-C50bRdDg.js";const de=o.div`
1
+ import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-CWfLUCEz.js";import{n as c,T as le}from"./Tooltip-CsoII5yH.js";import{t as e,s as o,I as g,d as s,af as ce,e as v}from"./index-CPUNB1w5.js";const de=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as i,L as _,r as F}from"./react-DehiWSvs.js";import{s as n,B as P,t as a,q as D,v as W,d as e,l as G,w as O,I as b,x as B,o as w,y as K,c as Q,z as H,A,D as X,E as Z,F as E}from"./index-C50bRdDg.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-DOwEBZw0.js";import{f as et}from"./builder-ENYhtC9A.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-BNZ7sBF_.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CtlcvZ2u.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-DehiWSvs.js";import{s as n,B as P,t as a,q as D,v as W,d as e,l as G,w as O,I as b,x as B,o as w,y as K,c as Q,z as H,A,D as X,E as Z,F as E}from"./index-CPUNB1w5.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-BPxCPWb-.js";import{f as et}from"./builder-CBPifwvU.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-TT0eRE9n.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BVuZvVgm.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,av as le,b0 as sa,au as na,I as H,x as Mt,ad as Qe,v as ia,Q as N,af as dt,l as ra,n as oa,o as ca,b1 as da,y as la,b2 as ua,b3 as ha,b4 as pa,b5 as lt,b6 as ga,b7 as xa,w as ma,b8 as ut,U as G,b9 as ht,ba as fa,D as ae,k as ya,c as pt,bb as ba,e as va,bc as gt,bd as _e,be as ye,bf as be,bg as xt,g as ve,a as wa,C as We,bh as Ca}from"./index-C50bRdDg.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ua,q as Ka,A as Qa,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-BpMj1RRH.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-DOwEBZw0.js";import{g as ys,b as Le}from"./buy-DME37PMo.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-CsB_UciL.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-DJGSwrlc.js";import{i as $s,a as Ms}from"./errors-BNZ7sBF_.js";import{E as Ts}from"./ErrorNotice-6j32LCd-.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DBrxq_08.js";import"./sendMetaTransaction-CtlcvZ2u.js";const{colors:se,radius:Is}=ue,Ps=i.div`
1
+ import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,ay as le,b4 as sa,ax as na,I as H,x as Mt,ae as Qe,v as ia,Q as N,ag as dt,l as ra,n as oa,o as ca,b5 as da,y as la,b6 as ua,ah as ha,b7 as pa,b8 as lt,b9 as ga,ba as xa,w as ma,bb as ut,U as G,bc as ht,bd as fa,D as ae,k as ya,c as pt,be as ba,e as va,bf as gt,bg as _e,bh as ye,bi as be,bj as xt,g as ve,a as wa,C as We,bk as Ca}from"./index-CPUNB1w5.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ua,q as Ka,A as Qa,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-stedMsne.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-BPxCPWb-.js";import{g as ys,b as Le}from"./buy-q4FEKtCt.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-DmiZzQtt.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-BVqZm9sZ.js";import{i as $s,a as Ms}from"./errors-TT0eRE9n.js";import{E as Ts}from"./ErrorNotice-CrDVf-1v.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-COzPhGqu.js";import"./sendMetaTransaction-BVuZvVgm.js";const{colors:se,radius:Is}=ue,Ps=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,Bs="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ua,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Qa,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
61
+ `,Bs="https://cdn.decentraland.org/@dcl/shop/0.6.2-30957461961.commit-f1e9c8c/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ua,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Qa,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -1,4 +1,4 @@
1
- import{a9 as N,aa as U,ab as o,ac as n,ad as D,q as M}from"./index-C50bRdDg.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-Dp2xNKFR.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,q=M(P||(P=l`
1
+ import{aa as N,ab as U,ac as o,ad as n,ae as D,q as M}from"./index-CPUNB1w5.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-DA27NEZ_.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,q=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -21,8 +21,8 @@ import{a9 as N,aa as U,ab as o,ac as n,ad as D,q as M}from"./index-C50bRdDg.js";
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),G=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,u={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(u,K,e)},L=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
24
+ `)),G=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,m={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,e)},L=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
26
  `),q)),V=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Z=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
27
27
  animation: ${0} 1.4s ease-in-out infinite;
28
- `),B)),O=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=t,j=U(t,W),c=o({},t,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((a-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(L,o({className:I(f.root,d),style:o({width:m,height:m},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(V,{className:f.svg,ownerState:c,viewBox:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(Z,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{O as C};
28
+ `),B)),Q=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=t,j=U(t,W),c=o({},t,{color:m,disableShrink:R,size:u,thickness:i,value:p,variant:k}),f=G(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((a-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(L,o({className:I(f.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(V,{className:f.svg,ownerState:c,viewBox:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(Z,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{Q as C};
@@ -1,4 +1,4 @@
1
- import{j as e,r as h,u as Z,d as J}from"./react-DehiWSvs.js";import{t as b,s,bi as ee,X as te,z as T,bj as ae,bk as oe,I as ie,d as a,c as re,D as se,o as ne,v as ce,e as le,ag as F,ah as de,bl as pe,bm as xe}from"./index-C50bRdDg.js";import{E as me}from"./ErrorNotice-6j32LCd-.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-DTQE0MEN.js";import{S as L,C as je,F as ye,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-SI1YlvJt.js";import{L as Pe}from"./LoadMore-C6sUcyIf.js";import{u as Se}from"./useInfiniteGrid-BioQWUj3.js";import{G as Ae}from"./grid.styles-Ckr_d1Os.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,u as Z,d as J}from"./react-DehiWSvs.js";import{t as b,s,bl as ee,X as te,z as T,bm as ae,bn as oe,I as ie,d as a,c as re,D as se,o as ne,v as ce,e as le,aj as F,ak as de,bo as pe,bp as xe}from"./index-CPUNB1w5.js";import{E as me}from"./ErrorNotice-CrDVf-1v.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-Os4dJAOn.js";import{S as L,C as je,F as ye,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-CWfLUCEz.js";import{L as Pe}from"./LoadMore-Bjd9tWsJ.js";import{u as Se}from"./useInfiniteGrid-e8wVPY4L.js";import{G as Ae}from"./grid.styles-CZVOpjjs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as k,av as j,bD as C,e as G,q as Y,I as Q,D as X,g as W,C as B,a as Z,a1 as q,c5 as D,ah as J}from"./index-C50bRdDg.js";import{s as ee,i as U,A as H,g as F,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-DOwEBZw0.js";import{i as se}from"./errors-BNZ7sBF_.js";import{E as re}from"./ErrorNotice-6j32LCd-.js";import{a as ce}from"./buy-DME37PMo.js";import{g as de,a as le}from"./trade-encoding-DBrxq_08.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-CtlcvZ2u.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function pt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
1
+ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as k,ay as j,bG as C,e as G,q as Y,I as Q,D as X,g as W,C as B,a as Z,a2 as q,c8 as F,ak as J}from"./index-CPUNB1w5.js";import{s as ee,i as U,A as H,g as D,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-BPxCPWb-.js";import{i as se}from"./errors-TT0eRE9n.js";import{E as re}from"./ErrorNotice-CrDVf-1v.js";import{a as ce}from"./buy-q4FEKtCt.js";import{g as de,a as le}from"./trade-encoding-COzPhGqu.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BVuZvVgm.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function pt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -222,7 +222,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
222
222
  ${o.media.maxWidth("mobile")} {
223
223
  flex-direction: column-reverse;
224
224
  }
225
- `,De=e.button`
225
+ `,Fe=e.button`
226
226
  flex: 1 1 0;
227
227
  height: 48px;
228
228
  border: 2px solid ${o.colors.accent};
@@ -248,7 +248,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
248
248
  outline: 2px solid ${o.colors.accent};
249
249
  outline-offset: 2px;
250
250
  }
251
- `,Fe=e.button`
251
+ `,De=e.button`
252
252
  flex: 1 1 0;
253
253
  display: inline-flex;
254
254
  align-items: center;
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await ee({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(De,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(Fe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function bt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(F.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=te(),$=ne(s.provider,m),h=await pe($,m,d,p,{serverURL:F.relayerUrl});return l==null||l(),await ae(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function yt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function wt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function vt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,kt=e.div`
292
+ `;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await ee({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(De,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function bt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(D.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=te(),$=ne(s.provider,m),h=await pe($,m,d,p,{serverURL:D.relayerUrl});return l==null||l(),await ae(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function yt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function wt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function vt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,kt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${He.overlay};
@@ -426,7 +426,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
426
426
  font-size: 10px;
427
427
  line-height: 1.43;
428
428
  color: ${r.muted};
429
- `,Dt=e.div`
429
+ `,Ft=e.div`
430
430
  display: flex;
431
431
  align-items: center;
432
432
  gap: 4px;
@@ -436,7 +436,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
436
436
  font-weight: 600;
437
437
  color: ${r.text2};
438
438
  }
439
- `,Ft=e(k)`
439
+ `,Dt=e(k)`
440
440
  width: 24px;
441
441
  height: 24px;
442
442
  background: ${r.text2};
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,x as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:D,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(J,{item:h},h.id))}),t.jsx(K,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:D,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Gt as F,Yt as G,Ct as H,Xt as I,Zt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Kt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,qt as j,Jt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Dt as v,Ft as w,Ut as x,Ht as y,_t as z};
804
+ `;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(J,{item:h},h.id))}),t.jsx(K,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Gt as F,Yt as G,Ct as H,Xt as I,Zt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Kt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,qt as j,Jt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Ft as v,Dt as w,Ut as x,Ht as y,_t as z};
@@ -1,4 +1,4 @@
1
- import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bE as Ie,au as Re,bF as ze,d as o,bG as Be,bH as ee,B as Me,ad as me,X as xe,bi as _e,l as Te,z as ue,bp as We,bj as De,bk as Ge,I as te,c as Oe,v as Ke,o as He,ae as Ue,ag as A,ah as oe,bI as re,bJ as qe}from"./index-C50bRdDg.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-DTQE0MEN.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-BAy3by3Z.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-SI1YlvJt.js";import{L as se}from"./LoadMore-C6sUcyIf.js";import{u as ae}from"./useInfiniteGrid-BioQWUj3.js";import{E as W}from"./ErrorNotice-6j32LCd-.js";import{G as ne}from"./grid.styles-Ckr_d1Os.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BZ-qUO0l.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
1
+ import{d as de,j as e,L as Ee,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bH as Ie,ax as Re,bI as ze,d as o,bJ as Me,bK as ee,B as Be,ae as me,X as xe,bl as _e,l as Te,z as ue,bs as We,bm as De,bn as Ke,I as te,c as Oe,v as Ge,o as He,af as Ue,aj as A,ak as oe,bL as re,bM as qe}from"./index-CPUNB1w5.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-Os4dJAOn.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-BdrGrnkY.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-CWfLUCEz.js";import{L as se}from"./LoadMore-Bjd9tWsJ.js";import{u as ae}from"./useInfiniteGrid-e8wVPY4L.js";import{E as W}from"./ErrorNotice-CrDVf-1v.js";import{G as ne}from"./grid.styles-CZVOpjjs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-CsoII5yH.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
4
  border-radius: ${pe.card};
@@ -54,14 +54,14 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
54
54
  object-fit: contain;
55
55
  padding: 10px;
56
56
  }
57
- `,Et=s.div`
57
+ `,Pt=s.div`
58
58
  flex: 0 0 102px;
59
59
  height: 102px;
60
60
  padding: 12px 14px;
61
61
  display: flex;
62
62
  flex-direction: column;
63
63
  gap: 8px;
64
- `,Pt=s.h3`
64
+ `,Et=s.h3`
65
65
  margin: 0;
66
66
  font-weight: 700;
67
67
  font-size: 18px;
@@ -135,7 +135,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
135
135
  &:active {
136
136
  background: ${b.accentActive};
137
137
  }
138
- `;function Bt({collection:r,cover:i,itemCount:a}){const n=de(),{contractAddress:h,name:l,creator:m}=r,C=i==null||a==null,{data:x}=ze(h,C),j=i==null?(x==null?void 0:x.items)??[]:[],g=a??(x==null?void 0:x.total);function w(){n(`/collection/${h}`)}return e.jsxs(kt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),w())},children:[e.jsx($t,{children:i?e.jsx(St,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):j.length>0?e.jsx(Nt,{items:j,tinted:!1}):null}),e.jsxs(Et,{children:[e.jsx(Pt,{title:l,children:l}),e.jsxs(Ft,{children:[e.jsxs(Lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(At,{address:m,linkToProfile:!0}):e.jsx(It,{children:" "}),e.jsx(Rt,{children:g==null?"…":o("collectionCard.itemCount",{count:g})})]}),e.jsx(zt,{"data-view":!0,"data-testid":"coll-card-view",onClick:u=>{u.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Mt({address:r,className:i=""}){const a=Be(),n=ee(l=>l.followed.includes(r.toLowerCase())),h=ee(l=>l.toggle);return!a||!r?null:e.jsx(Me,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>h(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:ge,media:v}=he,fe=me`
138
+ `;function Mt({collection:r,cover:i,itemCount:a}){const n=de(),{contractAddress:h,name:l,creator:m}=r,C=i==null||a==null,{data:x}=ze(h,C),j=i==null?(x==null?void 0:x.items)??[]:[],g=a??(x==null?void 0:x.total);function w(){n(`/collection/${h}`)}return e.jsxs(kt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),w())},children:[e.jsx($t,{children:i?e.jsx(St,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):j.length>0?e.jsx(Nt,{items:j,tinted:!1}):null}),e.jsxs(Pt,{children:[e.jsx(Et,{title:l,children:l}),e.jsxs(Ft,{children:[e.jsxs(Lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(At,{address:m,linkToProfile:!0}):e.jsx(It,{children:" "}),e.jsx(Rt,{children:g==null?"…":o("collectionCard.itemCount",{count:g})})]}),e.jsx(zt,{"data-view":!0,"data-testid":"coll-card-view",onClick:u=>{u.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Bt({address:r,className:i=""}){const a=Me(),n=ee(l=>l.followed.includes(r.toLowerCase())),h=ee(l=>l.toggle);return!a||!r?null:e.jsx(Be,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>h(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:ge,media:v}=he,fe=me`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
@@ -183,7 +183,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
183
183
  position: absolute;
184
184
  inset: 0;
185
185
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
186
- `,Gt=s.div`
186
+ `,Kt=s.div`
187
187
  position: absolute;
188
188
  top: 16px;
189
189
  right: 16px;
@@ -219,7 +219,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
219
219
  }
220
220
  `,Ot=s.a`
221
221
  ${be};
222
- `,Kt=s(Pe)`
222
+ `,Gt=s(Ee)`
223
223
  ${be};
224
224
  width: 32px;
225
225
  height: 32px;
@@ -303,4 +303,4 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,Qt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Xt({address:r}){var u,k;const{data:i}=xe(r),{data:a}=_e(r),n=Te(c=>{var $;return($=c.session)==null?void 0:$.address}),h=!!n&&n.toLowerCase()===r.toLowerCase(),l=(i==null?void 0:i.name)||ue(r),m=(k=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||Ve,x=a==null?void 0:a.description,j=`${Oe.profileUrl}/${r}`,g=We.filter(c=>a==null?void 0:a.links[c]),w=De(Ge({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(_t,{"aria-label":`${l} storefront`,children:[e.jsxs(Tt,{children:[e.jsx(Wt,{src:C,alt:"",loading:"eager"}),e.jsx(Dt,{"aria-hidden":!0})]}),(g.length>0||h)&&e.jsxs(Gt,{children:[g.map(c=>e.jsx(Ot,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${c}`),"aria-label":o(`creator.link.${c}`),children:e.jsx(te,{name:Qt[c]})},c)),h&&e.jsx(Kt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Ht,{children:[m?e.jsx(le,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Ut,{children:l}),x?e.jsx(qt,{children:x}):null]}),e.jsxs(Vt,{children:[e.jsx(Jt,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Mt,{address:r,className:"creator-hero__follow"})]})]})]})}const ce=48;function xo(){const{address:r}=Fe(),i=de(),[a]=Le(),n=a.has("collections"),{data:h}=xe(r),l=(h==null?void 0:h.name)||(r?ue(r):o("creator.fallbackName"));Ke({title:l,description:o("seo.creator.description",{name:l})});const[m,C]=f.useState("all"),[x,j]=f.useState(null),[g,w]=f.useState([]),[u,k]=f.useState(""),[c,$]=f.useState(""),[N,I]=f.useState("all"),[R,z]=f.useState(!1),[D,we]=f.useState("newest"),[P,E]=f.useState(!1);f.useEffect(()=>{if(!P)return;const t=T=>{T.key==="Escape"&&E(!1)};document.addEventListener("keydown",t);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=d}},[P]);const G=u&&!Number.isNaN(Number(u))?Number(u):void 0,O=c&&!Number.isNaN(Number(c))?Number(c):void 0,je=x?vt[x]:void 0,ve=(ie.find(t=>t.key===D)??ie[0]).server,K={creator:r,category:m,rarities:g.length?g:void 0,wearableCategories:je,minPriceCredits:G,maxPriceCredits:O,isWearableSmart:R||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:ve},{items:B,total:ye,isLoading:Ce,isPlaceholderData:ke,error:H,hasNextPage:$e,isFetchingNextPage:U,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",K],t=>re({...K,first:ce,skip:t}),{enabled:!!r&&!n}),F=He({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=ae(["creator-collections",r],t=>qe(r,{first:ce,skip:t}).then(d=>({items:d.collections,total:d.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}`:""},{replace:!0})}function Ee(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}&collections`:"?collections"},{replace:!0})}function J(t){w(d=>d.includes(t)?d.filter(T=>T!==t):[...d,t])}function Q(){C("all"),j(null),w([]),k(""),$(""),I("all"),z(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(G!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of wt)g.includes(t)&&S.push({key:`rarity-${t}`,label:Ue(t),onRemove:()=>J(t)});R&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>z(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>I("all")});const L=yt({gridLoading:Ce||ke,gridError:!!H,gridCount:B.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),M=L==="skeletons",X=B.filter(t=>t.priceCredits>0),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(Je,{children:[e.jsxs(Qe,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(Xe,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Ye,{children:l})]}),r?e.jsx(Xt,{address:r}):null,!n&&!M&&X.length>0?e.jsx(Ze,{items:X,source:"creator"}):null,e.jsxs(ot,{children:[P?e.jsx(rt,{onClick:()=>E(!1),"aria-hidden":!0}):null,e.jsxs(it,{"data-open":P||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(st,{children:[e.jsx(at,{children:o("assets.filters")}),e.jsx(nt,{onClick:()=>E(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(lt,{children:e.jsx(ct,{category:m,subCategory:x,onCategory:q,onSub:j,priceMin:u,priceMax:c,onPriceMin:k,onPriceMax:$,rarities:g,onToggleRarity:J,status:N,onStatus:I,smart:R,onSmart:z,hideNames:!0,collections:n,onCollections:Ee})}),e.jsx(dt,{children:e.jsx(ht,{type:"button",onClick:()=>E(!1),children:o("assets.showItems")})})]}),e.jsx(mt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(et,{children:e.jsx(tt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Bt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:D,onSort:we,total:ye,loading:M,onOpenFilters:()=>E(!0),chips:S,onClearChips:Q}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:M?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[B.map(t=>t.priceCredits>0?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:$e,isFetching:U,isError:Se,onLoadMore:()=>void Ne()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(xt,{"data-testid":"creator-empty-filters",children:[e.jsxs(ut,{children:[e.jsx(pt,{children:o("creator.emptyFilters.title")}),e.jsx(gt,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:Q,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{xo as Creator,xo as default};
306
+ `,Qt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Xt({address:r}){var u,k;const{data:i}=xe(r),{data:a}=_e(r),n=Te(c=>{var $;return($=c.session)==null?void 0:$.address}),h=!!n&&n.toLowerCase()===r.toLowerCase(),l=(i==null?void 0:i.name)||ue(r),m=(k=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||Ve,x=a==null?void 0:a.description,j=`${Oe.profileUrl}/${r}`,g=We.filter(c=>a==null?void 0:a.links[c]),w=De(Ke({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(_t,{"aria-label":`${l} storefront`,children:[e.jsxs(Tt,{children:[e.jsx(Wt,{src:C,alt:"",loading:"eager"}),e.jsx(Dt,{"aria-hidden":!0})]}),(g.length>0||h)&&e.jsxs(Kt,{children:[g.map(c=>e.jsx(Ot,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${c}`),"aria-label":o(`creator.link.${c}`),children:e.jsx(te,{name:Qt[c]})},c)),h&&e.jsx(Gt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Ht,{children:[m?e.jsx(le,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Ut,{children:l}),x?e.jsx(qt,{children:x}):null]}),e.jsxs(Vt,{children:[e.jsx(Jt,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Bt,{address:r,className:"creator-hero__follow"})]})]})]})}const ce=48;function xo(){const{address:r}=Fe(),i=de(),[a]=Le(),n=a.has("collections"),{data:h}=xe(r),l=(h==null?void 0:h.name)||(r?ue(r):o("creator.fallbackName"));Ge({title:l,description:o("seo.creator.description",{name:l})});const[m,C]=f.useState("all"),[x,j]=f.useState(null),[g,w]=f.useState([]),[u,k]=f.useState(""),[c,$]=f.useState(""),[N,I]=f.useState("all"),[R,z]=f.useState(!1),[D,we]=f.useState("newest"),[E,P]=f.useState(!1);f.useEffect(()=>{if(!E)return;const t=T=>{T.key==="Escape"&&P(!1)};document.addEventListener("keydown",t);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=d}},[E]);const K=u&&!Number.isNaN(Number(u))?Number(u):void 0,O=c&&!Number.isNaN(Number(c))?Number(c):void 0,je=x?vt[x]:void 0,ve=(ie.find(t=>t.key===D)??ie[0]).server,G={creator:r,category:m,rarities:g.length?g:void 0,wearableCategories:je,minPriceCredits:K,maxPriceCredits:O,isWearableSmart:R||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:ve},{items:M,total:ye,isLoading:Ce,isPlaceholderData:ke,error:H,hasNextPage:$e,isFetchingNextPage:U,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",G],t=>re({...G,first:ce,skip:t}),{enabled:!!r&&!n}),F=He({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=ae(["creator-collections",r],t=>qe(r,{first:ce,skip:t}).then(d=>({items:d.collections,total:d.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}`:""},{replace:!0})}function Pe(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}&collections`:"?collections"},{replace:!0})}function J(t){w(d=>d.includes(t)?d.filter(T=>T!==t):[...d,t])}function Q(){C("all"),j(null),w([]),k(""),$(""),I("all"),z(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(K!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of wt)g.includes(t)&&S.push({key:`rarity-${t}`,label:Ue(t),onRemove:()=>J(t)});R&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>z(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>I("all")});const L=yt({gridLoading:Ce||ke,gridError:!!H,gridCount:M.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),B=L==="skeletons",X=M.filter(t=>t.priceCredits>0),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(Je,{children:[e.jsxs(Qe,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(Xe,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Ye,{children:l})]}),r?e.jsx(Xt,{address:r}):null,!n&&!B&&X.length>0?e.jsx(Ze,{items:X,source:"creator"}):null,e.jsxs(ot,{children:[E?e.jsx(rt,{onClick:()=>P(!1),"aria-hidden":!0}):null,e.jsxs(it,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(st,{children:[e.jsx(at,{children:o("assets.filters")}),e.jsx(nt,{onClick:()=>P(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(lt,{children:e.jsx(ct,{category:m,subCategory:x,onCategory:q,onSub:j,priceMin:u,priceMax:c,onPriceMin:k,onPriceMax:$,rarities:g,onToggleRarity:J,status:N,onStatus:I,smart:R,onSmart:z,hideNames:!0,collections:n,onCollections:Pe})}),e.jsx(dt,{children:e.jsx(ht,{type:"button",onClick:()=>P(!1),children:o("assets.showItems")})})]}),e.jsx(mt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(et,{children:e.jsx(tt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Mt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:D,onSort:we,total:ye,loading:B,onOpenFilters:()=>P(!0),chips:S,onClearChips:Q}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:B?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[M.map(t=>t.priceCredits>0?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:$e,isFetching:U,isError:Se,onLoadMore:()=>void Ne()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(xt,{"data-testid":"creator-empty-filters",children:[e.jsxs(ut,{children:[e.jsx(pt,{children:o("creator.emptyFilters.title")}),e.jsx(gt,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:Q,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{xo as Creator,xo as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-C50bRdDg.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-CPUNB1w5.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};