@dcl/shop 1.0.2-31094361365.commit-b4e12f4 → 1.1.0

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 (174) hide show
  1. package/_assets/{Activity-eih8ZdOc.js → Activity-9rrEHk5U.js} +3 -3
  2. package/_assets/{AnimatedBackground-Bjic9bNS.js → AnimatedBackground-D1YVAiBf.js} +1 -1
  3. package/_assets/{Assets-CnETD67e.js → Assets-2biGpywQ.js} +6 -6
  4. package/_assets/{Assets.styles-Cm61Yk9G.js → Assets.styles-BzDEqf9t.js} +1 -1
  5. package/_assets/{Authorizations-CG7WO1hC.js → Authorizations-rtqoKvNU.js} +1 -1
  6. package/_assets/{Cart-C-zS6F-I.js → Cart-BCsBSqSP.js} +1 -1
  7. package/_assets/{CircularProgress-CWz3JCfV.js → CircularProgress-kQAHHpsk.js} +1 -1
  8. package/_assets/{Collection-D7JFffZu.js → Collection-cADy_yQr.js} +1 -1
  9. package/_assets/{CollectionCarousel-CucQ0QV7.js → CollectionCarousel-DQQb78H6.js} +2 -2
  10. package/_assets/{Confetti-DWstoxYf.js → Confetti-UARYHnCB.js} +1 -1
  11. package/_assets/{Creator-C-RBpKLr.js → Creator-CpoDM7h0.js} +1 -1
  12. package/_assets/{ErrorNotice-C0iIUOEA.js → ErrorNotice-CBZMlTMX.js} +1 -1
  13. package/_assets/{ExchangeController-CtAdMliY.js → ExchangeController-Cddqljvh.js} +1 -1
  14. package/_assets/{Faq-CJVPehMK.js → Faq-B-73-LFA.js} +1 -1
  15. package/_assets/{GetCredits-DbGxdrKl.js → GetCredits-D780-ZO_.js} +1 -1
  16. package/_assets/{Grow-CBGBZvVu.js → Grow-qhmTjoD7.js} +1 -1
  17. package/_assets/{HelpersUtil-JUn70XlG.js → HelpersUtil-BwxpK1Xg.js} +1 -1
  18. package/_assets/{ItemDetail-C97nncjp.js → ItemDetail-BlDCDzBB.js} +1 -1
  19. package/_assets/LazyEmoteControls-mFjjYqjp.js +2 -0
  20. package/_assets/{LoadMore-BgEWB4j8.js → LoadMore-yWxoUUNf.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-DnMdTKPw.js → ManaPricingBanner.styles-CqFpaBa_.js} +1 -1
  22. package/_assets/{MyAssets-DX_Dv5Iw.js → MyAssets-CGsMig4K.js} +1 -1
  23. package/_assets/{MyFavorites-D9BRIln5.js → MyFavorites-DSk8GQMl.js} +1 -1
  24. package/_assets/{NotFound-gxLh1Oz1.js → NotFound-BeLWmEE0.js} +1 -1
  25. package/_assets/{NotificationsBell-9GpgR-9j.js → NotificationsBell-CQOx6AV5.js} +1 -1
  26. package/_assets/{OutfitDetail-vfk8Obgf.js → OutfitDetail-DhmrauCq.js} +1 -1
  27. package/_assets/{OutfitPreview-BQkuKxKt.js → OutfitPreview-C6pvZTXL.js} +1 -1
  28. package/_assets/{OutfitStudio-Cbyc_ob0.js → OutfitStudio-DTpIr2VD.js} +1 -1
  29. package/_assets/{StoreSettings-D_9vzZ85.js → StoreSettings-DPntmfY3.js} +1 -1
  30. package/_assets/{Success-Bqb9haMX.js → Success-CCBHTTsN.js} +1 -1
  31. package/_assets/{SwapController-BAt3MSAG.js → SwapController-CwiA0ELe.js} +1 -1
  32. package/_assets/{Tooltip-C7ohRZVT.js → Tooltip-BrPg6WWE.js} +1 -1
  33. package/_assets/{TradeService-BioVjsGK.js → TradeService-BvzE84HN.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-CkaGvlNS.js → W3MFrameProviderSingleton-C1sKmSDA.js} +3 -3
  35. package/_assets/{WebCryptoP256-DrQ8zT87.js → WebCryptoP256-COsxHEzN.js} +1 -1
  36. package/_assets/{authorizations-5kJTkikm.js → authorizations-DffPbrZU.js} +1 -1
  37. package/_assets/{basic-cPftIshO.js → basic-BshP5Aek.js} +1 -1
  38. package/_assets/{biconomy-Bk5GWpkr.js → biconomy-ozimuL1v.js} +1 -1
  39. package/_assets/{builder-duVm3eqN.js → builder-BjB54DJ_.js} +1 -1
  40. package/_assets/{buy-CnDiuzF0.js → buy-BWhjAqGQ.js} +1 -1
  41. package/_assets/{buy-gasless-DOp9N7fN.js → buy-gasless-LQIhVXxE.js} +1 -1
  42. package/_assets/{categories-Bwk-Btnk.js → categories-CIEcQPqv.js} +1 -1
  43. package/_assets/{ccip-Cnn102VM.js → ccip-DZZX7g_4.js} +1 -1
  44. package/_assets/{ccip-C-cPNY-1.js → ccip-D_u08xkT.js} +1 -1
  45. package/_assets/{collectionPage.styles-Cbo17VjU.js → collectionPage.styles-E6y_4kdA.js} +1 -1
  46. package/_assets/{controller-bFOGIDOw.js → controller-BwAsbRce.js} +2 -2
  47. package/_assets/{core-BT84t22J.js → core-CVv2mj4u.js} +4 -4
  48. package/_assets/{createSvgIcon-BKsw2Cb_.js → createSvgIcon-nZkOIL2l.js} +1 -1
  49. package/_assets/{custom-BUlPw5S7.js → custom-CIT_LT0y.js} +1 -1
  50. package/_assets/{data-capture-DKSqr5cv.js → data-capture-TE6Dq1tX.js} +1 -1
  51. package/_assets/{email-DHSxgAeW.js → email-B6SGDIgr.js} +1 -1
  52. package/_assets/{embedded-wallet-DjLhiaHj.js → embedded-wallet-DbCbqi3U.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-C6xWmqMa.js → emotion-styled.browser.esm-C1JGC3m9.js} +1 -1
  54. package/_assets/{engine-DCT3c-JH.js → engine-AiLI-eRm.js} +1 -1
  55. package/_assets/{errors-DGBGW8UJ.js → errors-ueM8ONld.js} +1 -1
  56. package/_assets/{estimate-l1-fee-DlYgxocO.js → estimate-l1-fee-DHnmnFZ4.js} +1 -1
  57. package/_assets/{execute-Dkzbfol0.js → execute-CrO8CJ5D.js} +2 -2
  58. package/_assets/{features-CVvHxQoV.js → features-BXpt3Ahg.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-_l1JubAq.js → fetchTokenMetadata-C0sODWOF.js} +2 -2
  60. package/_assets/{field.styles-BLxFNwqc.js → field.styles-PwPucAqS.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-CBkCodOV.js → get-ecosystem-wallet-info-Cjuk1nsV.js} +1 -1
  62. package/_assets/{getBalance-D4FG6mrw.js → getBalance-Ck0P9Nks.js} +1 -1
  63. package/_assets/{getNFT-BwCpumx4.js → getNFT-3Tj7jt0R.js} +1 -1
  64. package/_assets/{getNFT-9rCI1jKQ.js → getNFT-J7sRvxML.js} +1 -1
  65. package/_assets/{grid.styles-C7DIeQ4F.js → grid.styles-DpEPS70S.js} +1 -1
  66. package/_assets/{hashTypedData-DBC-OJUC.js → hashTypedData-DRxCie6p.js} +1 -1
  67. package/_assets/{hashTypedData-D-Pf78s7.js → hashTypedData-lvi-DsFW.js} +1 -1
  68. package/_assets/{in-app-D1Nm6bV1.js → in-app-DCz3bI1C.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-D5PyTekp.js → in-app-wallet-calls-ijhv1NTQ.js} +1 -1
  70. package/_assets/{index-BIbwD_h7.js → index-16W-z5r9.js} +1 -1
  71. package/_assets/{index-BHxCY9nU.js → index-5tI1x7HI.js} +1 -1
  72. package/_assets/{index-ChJRAgfr.js → index-7hh8tA4H.js} +1 -1
  73. package/_assets/{index-KqrePQun.js → index-B-Tuwg1A.js} +1 -1
  74. package/_assets/{index-DOilGPCx.js → index-B5W5wJaQ.js} +2 -2
  75. package/_assets/{index-Bd1wvuf1.js → index-BBKeGR3Z.js} +1 -1
  76. package/_assets/{index-Bppxm-UK.js → index-BJS4KLeY.js} +1 -1
  77. package/_assets/{index-LPzQkwMs.js → index-BUDnYYak.js} +1 -1
  78. package/_assets/{index-Cax079_G.js → index-Bj7jFbI-.js} +1 -1
  79. package/_assets/{index-CvjzTxQn.js → index-BoFa52HJ.js} +1 -1
  80. package/_assets/{index-5vvcDM2k.js → index-BovFMPz-.js} +1 -1
  81. package/_assets/{index-dgtHYvIy.js → index-BsiMisxo.js} +2 -2
  82. package/_assets/{index-ZyTD2rk5.js → index-Btabzvt2.js} +1 -1
  83. package/_assets/{index-CQDa0B78.js → index-C5ApWYin.js} +1 -1
  84. package/_assets/{index-BlEvHt7m.js → index-C7fDi1_q.js} +1 -1
  85. package/_assets/{index-D6rcsTPP.js → index-CBVgax9G.js} +1 -1
  86. package/_assets/{index-CT7DTzQ0.js → index-CDafoVl9.js} +1 -1
  87. package/_assets/{index-CgRQiahV.js → index-CEWrdOju.js} +1 -1
  88. package/_assets/{index-0RqsNpah.js → index-CHHwDN0N.js} +1 -1
  89. package/_assets/{index-BbsDSodI.js → index-COufQ_yw.js} +1 -1
  90. package/_assets/{index-eSTWjgZS.js → index-CRJlj3-L.js} +1 -1
  91. package/_assets/{index-CZYxvxjt.js → index-CTnpX_6H.js} +1 -1
  92. package/_assets/{index-6NIdKt9N.js → index-CX3BY9Sg.js} +3 -3
  93. package/_assets/{index-Crzd9TpY.js → index-CaglN0Ov.js} +1 -1
  94. package/_assets/{index-BwIb-046.js → index-CbCf9Fwk.js} +1 -1
  95. package/_assets/{index-DDfgCSl3.js → index-CbGfOyO_.js} +1 -1
  96. package/_assets/{index-YKnFr2ui.js → index-CbdkGVO_.js} +3 -3
  97. package/_assets/{index-DrsPf8lM.js → index-CgKd8MIG.js} +11 -11
  98. package/_assets/{index-DWHnd0rm.js → index-Ci_lI5HK.js} +1 -1
  99. package/_assets/{index-2DjB0zcq.js → index-CoqqSzbF.js} +1 -1
  100. package/_assets/{index-C--P9pv4.js → index-CuYA00Jo.js} +1 -1
  101. package/_assets/{index-DerNWOKd.js → index-CvxbRAdp.js} +1 -1
  102. package/_assets/{index-CL6NyWIZ.js → index-D14r_Fxe.js} +1 -1
  103. package/_assets/{index-D7O7s4gu.js → index-D24M_ecl.js} +1 -1
  104. package/_assets/{index-_LSAY_H4.js → index-D7dCFhiL.js} +1 -1
  105. package/_assets/{index-Cmwvs9e4.js → index-DGzHax2k.js} +1 -1
  106. package/_assets/{index-ByROsW-4.js → index-DLYlDeh3.js} +1 -1
  107. package/_assets/{index-B51NTlTj.js → index-Dd_xp1GX.js} +1 -1
  108. package/_assets/{index-DMcoQM0q.js → index-DfSm--v1.js} +3 -3
  109. package/_assets/{index-CBL-49VE.js → index-DgtAwbud.js} +1 -1
  110. package/_assets/{index-C8ygh3Cc.js → index-DhJzB2WE.js} +2 -2
  111. package/_assets/{index-qPVMgubM.js → index-Ds1OsNhA.js} +1 -1
  112. package/_assets/{index-DJl-mzyN.js → index-DsDwjBn2.js} +1 -1
  113. package/_assets/{index-DFXJQ_G7.js → index-DtOH6n73.js} +1 -1
  114. package/_assets/{index-BtR0lQsx.js → index-DwsYB4bs.js} +1 -1
  115. package/_assets/{index-BqHb3xk2.js → index-FL9sZYKH.js} +1 -1
  116. package/_assets/{index-D3SdX5ud.js → index-KxgFV9Te.js} +1 -1
  117. package/_assets/{index-iN4U0GKi.js → index-Tv-nFOLW.js} +1 -1
  118. package/_assets/{index-R66kS2GO.js → index-ddCUYyj8.js} +1 -1
  119. package/_assets/{index-DgAxP-68.js → index-g5rjULM6.js} +1 -1
  120. package/_assets/{index-CEWyrymV.js → index-x3VfqdWM.js} +1 -1
  121. package/_assets/{index-BFXpBFCH.js → index-zeywwNfv.js} +1 -1
  122. package/_assets/{index.es-BLdr_pVQ.js → index.es-B-7-l7nJ.js} +4 -4
  123. package/_assets/{index.es-CH-WgFA9.js → index.es-C9oJO4VH.js} +1 -1
  124. package/_assets/{index.es-D-HRLB1S.js → index.es-Djc-Qn7H.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-DoGsIr7C.js → localBatchGatewayRequest-Ccb4lfcA.js} +1 -1
  126. package/_assets/{networks-L7OSL8zg.js → networks-qS_5A4aX.js} +1 -1
  127. package/_assets/{onramp-_ndBrQ1Y.js → onramp-DU_EEEZ5.js} +1 -1
  128. package/_assets/{openzeppelin-CEqH_0rd.js → openzeppelin-RXLv0_Gd.js} +1 -1
  129. package/_assets/{parseNft-DqwsN2e1.js → parseNft-BraQXdQ1.js} +2 -2
  130. package/_assets/{parseSignature-C-Ekknac.js → parseSignature-BifKvwmK.js} +3 -3
  131. package/_assets/{parseSignature-Dz4k-_BJ.js → parseSignature-Cldxp3mW.js} +1 -1
  132. package/_assets/{passkeys-BrbqIhfp.js → passkeys-DoJ-qnwS.js} +1 -1
  133. package/_assets/{pay-with-exchange-MrP0zCJw.js → pay-with-exchange-CuWwWzQQ.js} +1 -1
  134. package/_assets/{qr-overlay-_GMjxw26.js → qr-overlay-489AKbsX.js} +1 -1
  135. package/_assets/{receive-CPSAAVFo.js → receive-C982fpOH.js} +1 -1
  136. package/_assets/{resolveImplementation-35MQR22Q.js → resolveImplementation-Btngn0IO.js} +1 -1
  137. package/_assets/{rpc-CIbYZEJ-.js → rpc-5yTJpyZ_.js} +1 -1
  138. package/_assets/{secp256k1-B5CND0qJ.js → secp256k1-CCNWEuXT.js} +1 -1
  139. package/_assets/{secp256k1-BLQqFrl6.js → secp256k1-JRFVqF4g.js} +1 -1
  140. package/_assets/{secp256k1-BsbxTtcz.js → secp256k1-kGauLUHg.js} +1 -1
  141. package/_assets/{send-CRTrg7O4.js → send-RKuRCaGt.js} +1 -1
  142. package/_assets/{send-batch-transaction-C7LQ1a8I.js → send-batch-transaction-gbesD3yw.js} +1 -1
  143. package/_assets/{send-eip712-transaction-D3JpeGm2.js → send-eip712-transaction-D8lmfcov.js} +2 -2
  144. package/_assets/{send-gasless-transaction-C6aPY-r7.js → send-gasless-transaction-COWRFzT1.js} +2 -2
  145. package/_assets/{send-transaction-CyvxGWI_.js → send-transaction-hfS9gGmU.js} +2 -2
  146. package/_assets/{sendMetaTransaction-DXB2zppk.js → sendMetaTransaction-CQLcqeK_.js} +1 -1
  147. package/_assets/{sendRawTransaction-Dq9HYIL8.js → sendRawTransaction-BIIO_kfm.js} +3 -3
  148. package/_assets/{serializeTransaction-zE1My_Zo.js → serializeTransaction-CteU12Pb.js} +1 -1
  149. package/_assets/{session-proposal-BztuR617.js → session-proposal-ZLPRJiDD.js} +1 -1
  150. package/_assets/{session-request-CNoVMSOn.js → session-request-CS2orfQ2.js} +2 -2
  151. package/_assets/{signing-Dg_MHc88.js → signing-B3-6ckz7.js} +3 -3
  152. package/_assets/{skeleton.styles-B-VOk6tY.js → skeleton.styles-ChQLBG5k.js} +1 -1
  153. package/_assets/{socials-CB8D1PHY.js → socials-C31w_qg5.js} +1 -1
  154. package/_assets/{styled-DxeNVjAi.js → styled-C9y--t9u.js} +1 -1
  155. package/_assets/{swaps-BhrhXVsJ.js → swaps-DdVcKLtU.js} +1 -1
  156. package/_assets/{thirdweb-SPUs9Rme.js → thirdweb-Zq3Uj3Cd.js} +3 -3
  157. package/_assets/{to-serializable-transaction-BJrJeLP8.js → to-serializable-transaction-CuXbkoN8.js} +2 -2
  158. package/_assets/{transactionReceipt-BRpfQd2-.js → transactionReceipt-BeusdWSX.js} +1 -1
  159. package/_assets/{transactions-BXthhxDf.js → transactions-CLKroJ1L.js} +1 -1
  160. package/_assets/{useCreditPacks-tiUs7FLz.js → useCreditPacks-BI219E4X.js} +1 -1
  161. package/_assets/{useImportable-DPsQqZpS.js → useImportable-Dd4LHEFZ.js} +1 -1
  162. package/_assets/{useInfiniteGrid-BxsdGvVu.js → useInfiniteGrid-D9tb6urG.js} +1 -1
  163. package/_assets/{useTheme-DGmDzugK.js → useTheme-DxcP-VD3.js} +1 -1
  164. package/_assets/{verifyHash--87JCj9L.js → verifyHash-C0ADopSi.js} +1 -1
  165. package/_assets/{w3m-modal-Bwk-fcT4.js → w3m-modal-BEmGW-J3.js} +1 -1
  166. package/_assets/{w3m-modal-BSqPeKdp.js → w3m-modal-C16ao9pB.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-vkwvqtSf.js → wait-for-tx-receipt-DyDajQ2z.js} +1 -1
  168. package/_assets/{wallets-BKzJcGzk.js → wallets-BFmp1oZg.js} +5 -5
  169. package/_assets/{web-connector-C1sskh4G.js → web-connector-Kml6W9yG.js} +3 -3
  170. package/_assets/{writeContract-Cb_tmbEE.js → writeContract-BvbKotKG.js} +1 -1
  171. package/_assets/{zoraTestnet-CuYyg3MY.js → zoraTestnet-CVv7zArX.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/LazyEmoteControls-BkXz1q2Q.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-5vvcDM2k.js","_assets/react-BYHuwl8r.js","_assets/index-DrsPf8lM.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/sentry-Dx-KuLV3.js","_assets/ethers-BDpbhgX6.js","_assets/intl-CBcMB1D2.js","_assets/index-DB6GvbxL.css","_assets/useImportable-DPsQqZpS.js","_assets/buy-CnDiuzF0.js","_assets/authorizations-5kJTkikm.js","_assets/sendMetaTransaction-DXB2zppk.js","_assets/ManaPricingBanner.styles-DnMdTKPw.js","_assets/Faq-CJVPehMK.js","_assets/field.styles-BLxFNwqc.js"])))=>i.map(i=>d[i]);
2
- import{n as It,bN as At,o as O,v as A,bO as $t,t as s,s as l,w as Et,B as Lt,x as Pt,b as c,an as Tt,I as $,bP as et,bQ as it,bR as Nt,_ as St,z as P,bS as Ct,A as Ft,aF as q,L as Dt,bT as Mt,E as Ht,bU as Rt,bV as W}from"./index-DrsPf8lM.js";import{r as g,u as zt,j as e,L as rt,e as Ot}from"./react-BYHuwl8r.js";import{u as qt}from"./useImportable-DPsQqZpS.js";import{L as Wt}from"./LoadMore-BgEWB4j8.js";import{u as E}from"./useInfiniteGrid-BxsdGvVu.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./buy-CnDiuzF0.js";import"./authorizations-5kJTkikm.js";import"./sendMetaTransaction-DXB2zppk.js";const _t=15e3;function Gt(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=_t}function Bt(t){const n=[...t].sort((i,r)=>r.createdAt-i.createdAt),a=[];for(const i of n){const r=a[a.length-1];r&&Gt(r[r.length-1],i)?r.push(i):a.push([i])}return a.map(i=>{var r;return{id:((r=i.find(o=>o.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(o=>o.createdAt)),status:Kt(i),totalCredits:i.reduce((o,h)=>o+h.credits,0),lines:i}})}function Kt(t){return t.some(n=>n.status==="PENDING")?"PENDING":t.some(n=>n.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ut(t){return t==="SETTLED"?"SETTLED":t==="EXPIRED"?"FAILED":"PENDING"}function Qt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function Vt(t){const n=[],a=new Map;for(const i of t){const r=Qt(i);if(!r){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const o=a.get(r);if(o){o.quantity+=1,o.credits+=i.credits;continue}const h={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};a.set(r,h),n.push(h)}return n}function Xt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?It(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Yt(t){return t.status!=="EXPIRED"||!!t.submittedTxHash}function Zt(t){const a=Bt(t.purchases.filter(Yt)).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=t.sales.map(d=>{const x=Xt(d,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(t.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),o=new Set(t.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(d=>!o.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...a,...i,...r,...h].sort((d,x)=>x.createdAt-d.createdAt||(d.id<x.id?-1:1))}function Jt(t,n){return n==="all"?t:n==="sales"?t.filter(a=>a.kind==="sale"):t.filter(a=>a.kind==="purchase"||a.kind==="credit"||a.kind==="mana-purchase")}const ct=t=>t.trim().toLowerCase();function te(t){const n=new Map;for(const a of t??[]){const i=ct(a.txHash??"");if(!i)continue;const r=n.get(i);r?r.push(a):n.set(i,[a])}return n}function ee(t,n,a=Date.now()){const i=n.txHash?t.get(ct(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?ie(i[0].netCents):null,o=i.filter(d=>!d.available&&d.availableAt>a);if(o.length===0)return{kind:"credited",credits:r};const h=o.reduce((d,x)=>Math.max(d,x.availableAt),0);return{kind:"pending",credits:r,availableAt:h}}function ie(t){return At(t)}function ne(){const t=O(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:n,isLoading:a}=A({queryKey:["listing-count",t],queryFn:()=>$t({creator:t,onSale:!0,first:1}),enabled:!!t,staleTime:5*6e4});return{count:n==null?void 0:n.total,isLoading:a}}const se="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/credits-product-vs4Q6u6l.svg",_=Et`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-BovFMPz-.js","_assets/react-BYHuwl8r.js","_assets/index-CgKd8MIG.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/sentry-Dx-KuLV3.js","_assets/ethers-BDpbhgX6.js","_assets/intl-CBcMB1D2.js","_assets/index-DB6GvbxL.css","_assets/useImportable-Dd4LHEFZ.js","_assets/buy-BWhjAqGQ.js","_assets/authorizations-DffPbrZU.js","_assets/sendMetaTransaction-CQLcqeK_.js","_assets/ManaPricingBanner.styles-CqFpaBa_.js","_assets/Faq-B-73-LFA.js","_assets/field.styles-PwPucAqS.js"])))=>i.map(i=>d[i]);
2
+ import{n as It,bN as At,o as O,v as A,bO as $t,t as s,s as l,w as Et,B as Lt,x as Pt,b as c,an as Tt,I as $,bP as et,bQ as it,bR as Nt,_ as St,z as P,bS as Ct,A as Ft,aF as q,L as Dt,bT as Mt,E as Ht,bU as Rt,bV as W}from"./index-CgKd8MIG.js";import{r as g,u as zt,j as e,L as rt,e as Ot}from"./react-BYHuwl8r.js";import{u as qt}from"./useImportable-Dd4LHEFZ.js";import{L as Wt}from"./LoadMore-yWxoUUNf.js";import{u as E}from"./useInfiniteGrid-D9tb6urG.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./buy-BWhjAqGQ.js";import"./authorizations-DffPbrZU.js";import"./sendMetaTransaction-CQLcqeK_.js";const _t=15e3;function Gt(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=_t}function Bt(t){const n=[...t].sort((i,r)=>r.createdAt-i.createdAt),a=[];for(const i of n){const r=a[a.length-1];r&&Gt(r[r.length-1],i)?r.push(i):a.push([i])}return a.map(i=>{var r;return{id:((r=i.find(o=>o.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(o=>o.createdAt)),status:Kt(i),totalCredits:i.reduce((o,h)=>o+h.credits,0),lines:i}})}function Kt(t){return t.some(n=>n.status==="PENDING")?"PENDING":t.some(n=>n.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ut(t){return t==="SETTLED"?"SETTLED":t==="EXPIRED"?"FAILED":"PENDING"}function Qt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function Vt(t){const n=[],a=new Map;for(const i of t){const r=Qt(i);if(!r){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const o=a.get(r);if(o){o.quantity+=1,o.credits+=i.credits;continue}const h={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};a.set(r,h),n.push(h)}return n}function Xt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?It(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Yt(t){return t.status!=="EXPIRED"||!!t.submittedTxHash}function Zt(t){const a=Bt(t.purchases.filter(Yt)).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=t.sales.map(d=>{const x=Xt(d,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(t.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),o=new Set(t.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(d=>!o.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...a,...i,...r,...h].sort((d,x)=>x.createdAt-d.createdAt||(d.id<x.id?-1:1))}function Jt(t,n){return n==="all"?t:n==="sales"?t.filter(a=>a.kind==="sale"):t.filter(a=>a.kind==="purchase"||a.kind==="credit"||a.kind==="mana-purchase")}const ct=t=>t.trim().toLowerCase();function te(t){const n=new Map;for(const a of t??[]){const i=ct(a.txHash??"");if(!i)continue;const r=n.get(i);r?r.push(a):n.set(i,[a])}return n}function ee(t,n,a=Date.now()){const i=n.txHash?t.get(ct(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?ie(i[0].netCents):null,o=i.filter(d=>!d.available&&d.availableAt>a);if(o.length===0)return{kind:"credited",credits:r};const h=o.reduce((d,x)=>Math.max(d,x.availableAt),0);return{kind:"pending",credits:r,availableAt:h}}function ie(t){return At(t)}function ne(){const t=O(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:n,isLoading:a}=A({queryKey:["listing-count",t],queryFn:()=>$t({creator:t,onSale:!0,first:1}),enabled:!!t,staleTime:5*6e4});return{count:n==null?void 0:n.total,isLoading:a}}const se="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/credits-product-vs4Q6u6l.svg",_=Et`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,ae=l.section`
@@ -375,4 +375,4 @@ import{n as It,bN as At,o as O,v as A,bO as $t,t as s,s as l,w as Et,B as Lt,x a
375
375
  color: ${s.colors.softWhite};
376
376
  `,be=l(Lt)`
377
377
  margin-top: 12px;
378
- `,Y=H.withComponent(rt),ye=g.lazy(()=>St(()=>import("./index-5vvcDM2k.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.ImportListings}))),L=24,ve=["all","purchases","sales"],R="section",at="listings",z="view",je="migrate";function I(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function xt(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function mt(t){const n=Number(t)/1e18;return Number.isFinite(n)?n.toLocaleString("en",{maximumFractionDigits:2}):"0"}function gt({children:t}){const n=g.useRef(null),[a,i]=g.useState(null),r=()=>{var h;const o=(h=n.current)==null?void 0:h.getBoundingClientRect();o&&i({top:o.bottom+8,left:o.left+o.width/2})};return e.jsxs(xe,{ref:n,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[t,a?Ot.createPortal(e.jsx(me,{style:{top:a.top,left:a.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function we({item:t}){const n=!!t.contractAddress&&!!t.itemId,a=!!t.tradeId||n,{data:i,isLoading:r}=A({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?Rt(t.tradeId):W(t.contractAddress,{itemId:t.itemId}),enabled:a,staleTime:5*6e4}),o=a&&r,h=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",x=q({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=e.jsxs(e.Fragment,{children:[o?e.jsx(K,{}):e.jsx(B,{children:d?e.jsx("img",{src:d,alt:h}):e.jsx($,{name:"cart",size:20})}),e.jsxs(U,{children:[o?e.jsx(V,{}):e.jsx(Q,{title:h,children:h}),t.quantity>1?e.jsx(X,{children:c("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(fe,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]});return x?e.jsx(Y,{to:x,"data-link":"true",children:f}):e.jsx(H,{children:f})}function ke({order:t}){const n=Vt(t.lines),a=n.reduce((o,h)=>o+h.quantity,0),i=Ut(t.status),r=i==="SETTLED"?c("activity.completed"):i==="FAILED"?c("activity.failed"):c("activity.processing");return e.jsxs(T,{"data-testid":"purchase-order",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsxs(F,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:a})]})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":i,children:r}),e.jsxs(w,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),i==="FAILED"?e.jsx(ge,{children:c("activity.purchaseFailedNote")}):null,e.jsx(G,{children:n.map(o=>e.jsx(we,{item:o},o.key))})]})}function Ie({sale:t}){const{data:n,isLoading:a}=A({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>W(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",o=q({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[a?e.jsx(K,{}):e.jsx(B,{children:r?e.jsx("img",{src:r,alt:i}):e.jsx($,{name:"offer",size:20})}),e.jsxs(U,{children:[a?e.jsx(V,{}):e.jsx(Q,{title:i,children:i}),e.jsx(X,{children:c("activity.boughtFrom",{account:xt(t.seller)})})]})]});return e.jsxs(T,{"data-testid":"activity-mana-purchase",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsx(F,{children:c("activity.paidWithMana")})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":"SETTLED",children:c("activity.completed")}),e.jsxs(w,{children:[mt(t.manaWei)," ",e.jsx(gt,{children:e.jsx(lt,{src:ot,alt:"MANA"})})]})]})]}),e.jsx(G,{children:o?e.jsx(Y,{to:o,"data-link":"true",children:h}):e.jsx(H,{children:h})})]})}function Ae({sale:t,payout:n}){const{data:a,isLoading:i}=A({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>W(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),r=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",h=q({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,d=e.jsxs(e.Fragment,{children:[i?e.jsx(K,{}):e.jsx(B,{children:o?e.jsx("img",{src:o,alt:r}):e.jsx($,{name:"offer",size:20})}),e.jsxs(U,{children:[i?e.jsx(V,{}):e.jsx(Q,{title:r,children:r}),e.jsxs(X,{children:[c("activity.soldTo",{account:xt(t.counterparty)}),n.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:I(n.availableAt)})}`:""]})]})]});return e.jsxs(T,{"data-testid":"activity-sale",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsx(F,{children:c("activity.saleLabel")})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":n.kind==="pending"?"PENDING":"SOLD",children:n.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),n.kind==="direct"?e.jsxs(w,{"data-kind":"income",children:["+",mt(t.manaWei)," ",e.jsx(gt,{children:e.jsx(lt,{src:ot,alt:"MANA"})})]}):n.credits!==null?e.jsxs(w,{"data-kind":"income",children:[e.jsx(P,{className:"ccy-mark"})," +",Dt(n.credits)]}):e.jsx(w,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),e.jsx(G,{children:h?e.jsx(Y,{to:h,"data-link":"true",children:d}):e.jsx(H,{children:d})})]})}function $e({order:t}){const n=`$${(t.usdCents/100).toFixed(2)}`,a=Ct(t.status),i=a==="SETTLED"?c("activity.completed"):a==="FAILED"?c("activity.failed"):a==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),r=O(p=>p.session),o=Ft(),[h,d]=g.useState(!1),x=t.status==="initiated"&&!!r;async function f(){if(!(!r||h)){d(!0);try{const p=await Mt(t.id,r.identity);if(p){window.location.href=p;return}Ht.info(c("activity.resumeExpired")),o.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return e.jsx(T,{"data-testid":"credit-order",children:e.jsxs(N,{children:[e.jsx(he,{children:e.jsx("img",{src:se,alt:"","aria-hidden":!0})}),e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsxs(F,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:n})]})]}),e.jsxs(D,{children:[x?e.jsx(pe,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?c("activity.resuming"):c("activity.resume")}):null,e.jsx(M,{"data-status":a,children:i}),e.jsxs(w,{"data-kind":"income",children:["+",e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Ee({filter:t}){const n={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")}}[t];return e.jsxs(ut,{children:[e.jsx($,{name:n.icon,size:40,color:s.colors.muted2}),e.jsx(ht,{children:n.title}),e.jsx(pt,{children:n.body}),t!=="sales"?e.jsx(be,{as:rt,to:"/items",variant:"white",children:c("notFound.cta")}):null]})}function qe(){const{session:t}=O(),[n,a]=g.useState("all"),[i,r]=zt(),o=i.get(R)===at||i.get(z)===je;Pt({title:o?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:h}=qt(),{count:d}=ne(),f=h!==void 0&&d!==void 0&&(h>0||d>0||o),p=!!t&&!o&&n!=="sales",m=!!t&&!o&&n!=="purchases",b=E(["purchases",t==null?void 0:t.address],u=>Nt(t.address,t.identity,{first:L,skip:u}),{enabled:p}),y=E(["sales",t==null?void 0:t.address],u=>et(t.address,{role:"seller",first:L,skip:u}),{enabled:m}),v=E(["credit-orders",t==null?void 0:t.address],u=>it(t.address,t.identity,{first:L,skip:u}),{enabled:p}),j=E(["mana-purchases",t==null?void 0:t.address],u=>et(t.address,{role:"buyer",first:L,skip:u}),{enabled:p}),{data:Z}=A({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>it(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:m,staleTime:6e4}),ft=g.useMemo(()=>te(Z),[Z]),{data:bt}=Tt(m);if(!t)return e.jsxs(ut,{children:[e.jsx($,{name:"clock",size:40,color:s.colors.muted2}),e.jsx(ht,{children:c("activity.signInTitle")}),e.jsx(pt,{children:c("activity.signInBody")})]});const J=Jt(Zt({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:bt}),n),yt=p&&(b.isLoading||v.isLoading||j.isLoading)||m&&y.isLoading,tt=p&&(b.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||m&&y.isFetchingNextPage,vt=p&&(b.hasNextPage||v.hasNextPage||j.hasNextPage)||m&&y.hasNextPage;function jt(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function wt(u){if(a(u),!o)return;const k=new URLSearchParams(i);k.delete(R),k.delete(z),r(k,{replace:!0})}function kt(){const u=new URLSearchParams(i);u.set(R,at),u.delete(z),r(u,{replace:!0})}return e.jsxs(ae,{children:[e.jsx(re,{children:e.jsx(oe,{children:c("nav.activity")})}),e.jsxs(ce,{role:"tablist","aria-label":c("nav.activity"),children:[ve.map(u=>e.jsx(dt,{type:"button",role:"tab","aria-selected":!o&&n===u,"data-active":!o&&n===u,"data-testid":`activity-filter-${u}`,onClick:()=>wt(u),children:c(`activity.filter.${u}`)},u)),f?e.jsxs(de,{type:"button",role:"tab","aria-selected":o,"data-active":o,"data-testid":"activity-filter-migrate","aria-label":h?c("activity.migrate.chipAria",{count:h}):void 0,onClick:kt,children:[c("activity.migrate.chip"),h?e.jsx(le,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),o?e.jsx(g.Suspense,{fallback:e.jsx(ue,{"aria-busy":"true"}),children:e.jsx(ye,{})}):yt?e.jsx(nt,{children:Array.from({length:5}).map((u,k)=>e.jsx(st,{},k))}):J.length===0?e.jsx(Ee,{filter:n}):e.jsxs(e.Fragment,{children:[e.jsxs(nt,{children:[J.map(u=>u.kind==="purchase"?e.jsx(ke,{order:u.order},u.id):u.kind==="credit"?e.jsx($e,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ie,{sale:u.sale},u.id):e.jsx(Ae,{sale:u.sale,payout:ee(ft,u.sale)},u.id)),tt?e.jsx(st,{}):null]}),e.jsx(Wt,{hasNextPage:vt,isFetching:tt,onLoadMore:jt})]})]})}export{qe as Activity};
378
+ `,Y=H.withComponent(rt),ye=g.lazy(()=>St(()=>import("./index-BovFMPz-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.ImportListings}))),L=24,ve=["all","purchases","sales"],R="section",at="listings",z="view",je="migrate";function I(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function xt(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function mt(t){const n=Number(t)/1e18;return Number.isFinite(n)?n.toLocaleString("en",{maximumFractionDigits:2}):"0"}function gt({children:t}){const n=g.useRef(null),[a,i]=g.useState(null),r=()=>{var h;const o=(h=n.current)==null?void 0:h.getBoundingClientRect();o&&i({top:o.bottom+8,left:o.left+o.width/2})};return e.jsxs(xe,{ref:n,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[t,a?Ot.createPortal(e.jsx(me,{style:{top:a.top,left:a.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function we({item:t}){const n=!!t.contractAddress&&!!t.itemId,a=!!t.tradeId||n,{data:i,isLoading:r}=A({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?Rt(t.tradeId):W(t.contractAddress,{itemId:t.itemId}),enabled:a,staleTime:5*6e4}),o=a&&r,h=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",x=q({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=e.jsxs(e.Fragment,{children:[o?e.jsx(K,{}):e.jsx(B,{children:d?e.jsx("img",{src:d,alt:h}):e.jsx($,{name:"cart",size:20})}),e.jsxs(U,{children:[o?e.jsx(V,{}):e.jsx(Q,{title:h,children:h}),t.quantity>1?e.jsx(X,{children:c("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(fe,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]});return x?e.jsx(Y,{to:x,"data-link":"true",children:f}):e.jsx(H,{children:f})}function ke({order:t}){const n=Vt(t.lines),a=n.reduce((o,h)=>o+h.quantity,0),i=Ut(t.status),r=i==="SETTLED"?c("activity.completed"):i==="FAILED"?c("activity.failed"):c("activity.processing");return e.jsxs(T,{"data-testid":"purchase-order",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsxs(F,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:a})]})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":i,children:r}),e.jsxs(w,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),i==="FAILED"?e.jsx(ge,{children:c("activity.purchaseFailedNote")}):null,e.jsx(G,{children:n.map(o=>e.jsx(we,{item:o},o.key))})]})}function Ie({sale:t}){const{data:n,isLoading:a}=A({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>W(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",o=q({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[a?e.jsx(K,{}):e.jsx(B,{children:r?e.jsx("img",{src:r,alt:i}):e.jsx($,{name:"offer",size:20})}),e.jsxs(U,{children:[a?e.jsx(V,{}):e.jsx(Q,{title:i,children:i}),e.jsx(X,{children:c("activity.boughtFrom",{account:xt(t.seller)})})]})]});return e.jsxs(T,{"data-testid":"activity-mana-purchase",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsx(F,{children:c("activity.paidWithMana")})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":"SETTLED",children:c("activity.completed")}),e.jsxs(w,{children:[mt(t.manaWei)," ",e.jsx(gt,{children:e.jsx(lt,{src:ot,alt:"MANA"})})]})]})]}),e.jsx(G,{children:o?e.jsx(Y,{to:o,"data-link":"true",children:h}):e.jsx(H,{children:h})})]})}function Ae({sale:t,payout:n}){const{data:a,isLoading:i}=A({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>W(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),r=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",h=q({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,d=e.jsxs(e.Fragment,{children:[i?e.jsx(K,{}):e.jsx(B,{children:o?e.jsx("img",{src:o,alt:r}):e.jsx($,{name:"offer",size:20})}),e.jsxs(U,{children:[i?e.jsx(V,{}):e.jsx(Q,{title:r,children:r}),e.jsxs(X,{children:[c("activity.soldTo",{account:xt(t.counterparty)}),n.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:I(n.availableAt)})}`:""]})]})]});return e.jsxs(T,{"data-testid":"activity-sale",children:[e.jsxs(N,{children:[e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsx(F,{children:c("activity.saleLabel")})]}),e.jsxs(D,{children:[e.jsx(M,{"data-status":n.kind==="pending"?"PENDING":"SOLD",children:n.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),n.kind==="direct"?e.jsxs(w,{"data-kind":"income",children:["+",mt(t.manaWei)," ",e.jsx(gt,{children:e.jsx(lt,{src:ot,alt:"MANA"})})]}):n.credits!==null?e.jsxs(w,{"data-kind":"income",children:[e.jsx(P,{className:"ccy-mark"})," +",Dt(n.credits)]}):e.jsx(w,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),e.jsx(G,{children:h?e.jsx(Y,{to:h,"data-link":"true",children:d}):e.jsx(H,{children:d})})]})}function $e({order:t}){const n=`$${(t.usdCents/100).toFixed(2)}`,a=Ct(t.status),i=a==="SETTLED"?c("activity.completed"):a==="FAILED"?c("activity.failed"):a==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),r=O(p=>p.session),o=Ft(),[h,d]=g.useState(!1),x=t.status==="initiated"&&!!r;async function f(){if(!(!r||h)){d(!0);try{const p=await Mt(t.id,r.identity);if(p){window.location.href=p;return}Ht.info(c("activity.resumeExpired")),o.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return e.jsx(T,{"data-testid":"credit-order",children:e.jsxs(N,{children:[e.jsx(he,{children:e.jsx("img",{src:se,alt:"","aria-hidden":!0})}),e.jsxs(S,{children:[e.jsx(C,{children:I(t.createdAt)}),e.jsxs(F,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:n})]})]}),e.jsxs(D,{children:[x?e.jsx(pe,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?c("activity.resuming"):c("activity.resume")}):null,e.jsx(M,{"data-status":a,children:i}),e.jsxs(w,{"data-kind":"income",children:["+",e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Ee({filter:t}){const n={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")}}[t];return e.jsxs(ut,{children:[e.jsx($,{name:n.icon,size:40,color:s.colors.muted2}),e.jsx(ht,{children:n.title}),e.jsx(pt,{children:n.body}),t!=="sales"?e.jsx(be,{as:rt,to:"/items",variant:"white",children:c("notFound.cta")}):null]})}function qe(){const{session:t}=O(),[n,a]=g.useState("all"),[i,r]=zt(),o=i.get(R)===at||i.get(z)===je;Pt({title:o?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:h}=qt(),{count:d}=ne(),f=h!==void 0&&d!==void 0&&(h>0||d>0||o),p=!!t&&!o&&n!=="sales",m=!!t&&!o&&n!=="purchases",b=E(["purchases",t==null?void 0:t.address],u=>Nt(t.address,t.identity,{first:L,skip:u}),{enabled:p}),y=E(["sales",t==null?void 0:t.address],u=>et(t.address,{role:"seller",first:L,skip:u}),{enabled:m}),v=E(["credit-orders",t==null?void 0:t.address],u=>it(t.address,t.identity,{first:L,skip:u}),{enabled:p}),j=E(["mana-purchases",t==null?void 0:t.address],u=>et(t.address,{role:"buyer",first:L,skip:u}),{enabled:p}),{data:Z}=A({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>it(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:m,staleTime:6e4}),ft=g.useMemo(()=>te(Z),[Z]),{data:bt}=Tt(m);if(!t)return e.jsxs(ut,{children:[e.jsx($,{name:"clock",size:40,color:s.colors.muted2}),e.jsx(ht,{children:c("activity.signInTitle")}),e.jsx(pt,{children:c("activity.signInBody")})]});const J=Jt(Zt({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:bt}),n),yt=p&&(b.isLoading||v.isLoading||j.isLoading)||m&&y.isLoading,tt=p&&(b.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||m&&y.isFetchingNextPage,vt=p&&(b.hasNextPage||v.hasNextPage||j.hasNextPage)||m&&y.hasNextPage;function jt(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function wt(u){if(a(u),!o)return;const k=new URLSearchParams(i);k.delete(R),k.delete(z),r(k,{replace:!0})}function kt(){const u=new URLSearchParams(i);u.set(R,at),u.delete(z),r(u,{replace:!0})}return e.jsxs(ae,{children:[e.jsx(re,{children:e.jsx(oe,{children:c("nav.activity")})}),e.jsxs(ce,{role:"tablist","aria-label":c("nav.activity"),children:[ve.map(u=>e.jsx(dt,{type:"button",role:"tab","aria-selected":!o&&n===u,"data-active":!o&&n===u,"data-testid":`activity-filter-${u}`,onClick:()=>wt(u),children:c(`activity.filter.${u}`)},u)),f?e.jsxs(de,{type:"button",role:"tab","aria-selected":o,"data-active":o,"data-testid":"activity-filter-migrate","aria-label":h?c("activity.migrate.chipAria",{count:h}):void 0,onClick:kt,children:[c("activity.migrate.chip"),h?e.jsx(le,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),o?e.jsx(g.Suspense,{fallback:e.jsx(ue,{"aria-busy":"true"}),children:e.jsx(ye,{})}):yt?e.jsx(nt,{children:Array.from({length:5}).map((u,k)=>e.jsx(st,{},k))}):J.length===0?e.jsx(Ee,{filter:n}):e.jsxs(e.Fragment,{children:[e.jsxs(nt,{children:[J.map(u=>u.kind==="purchase"?e.jsx(ke,{order:u.order},u.id):u.kind==="credit"?e.jsx($e,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ie,{sale:u.sale},u.id):e.jsx(Ae,{sale:u.sale,payout:ee(ft,u.sale)},u.id)),tt?e.jsx(st,{}):null]}),e.jsx(Wt,{hasNextPage:vt,isFetching:tt,onLoadMore:jt})]})]})}export{qe as Activity};
@@ -1,4 +1,4 @@
1
- import{r as u,j as m}from"./react-BYHuwl8r.js";import{s as d}from"./index-DrsPf8lM.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/custom-welcome-background-BxlFQma9.webp",L="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/DCL_LogoPattern-BryBPc3d.png",D=`
1
+ import{r as u,j as m}from"./react-BYHuwl8r.js";import{s as d}from"./index-CgKd8MIG.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/custom-welcome-background-BxlFQma9.webp",L="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/DCL_LogoPattern-BryBPc3d.png",D=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}from"./useUrlFilters-DH-gxdfV.js";import{u as Je,S as $e,R as Xe,F as Ye,e as et}from"./categories-Bwk-Btnk.js";import{c as P,r as tt,aK as nt,aL as st,aS as it,a as ot,s,t,o as Fe,aA as at,A as rt,L as xe,b as n,y as lt,I as T,z as W,cn as ee,ax as ct,Z as X,aP as dt,aO as ht,x as Ie,an as ze,n as Ne,q as pt,ac as ft,ap as ke,aq as Z,aY as xt,bL as mt}from"./index-DrsPf8lM.js";import{g as ut,h as gt,i as yt,j as bt,k as wt,C as Ct,l as vt,o as jt,m as $t,n as kt,M as St,u as Et,q as Tt,v as Lt,E as Rt,r as Mt,p as _t,s as At,t as Ft}from"./Assets.styles-Cm61Yk9G.js";import{L as It}from"./LoadMore-BgEWB4j8.js";import{u as zt}from"./useInfiniteGrid-BxsdGvVu.js";import{E as Nt}from"./ErrorNotice-C0iIUOEA.js";import{d as Wt}from"./dcl-schemas-CmtP3U6y.js";import{s as Bt,G as Pt,w as Ht,S as Ot}from"./buy-gasless-DOp9N7fN.js";import{s as Ut,k as Gt}from"./buy-CnDiuzF0.js";import{f as Zt}from"./errors-DGBGW8UJ.js";import{J as qt,C as Dt,B as me}from"./ethers-BDpbhgX6.js";import{n as Vt}from"./Tooltip-C7ohRZVT.js";import{G as Kt}from"./grid.styles-C7DIeQ4F.js";import"./skeleton.styles-B-VOk6tY.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-5kJTkikm.js";import"./sendMetaTransaction-DXB2zppk.js";function q(i){const a=i.source??"item",o=i.tradeId||`${i.contractAddress}-${i.tokenId??i.itemId??""}`;return`${a}:${o}`}const H="100000000000000000000",We=2,Y=15,Qt=/^[a-zA-Z0-9]+$/;function Se(i){const a=i.trim();return a.length===0?{ok:!1,reason:"empty"}:Qt.test(a)?a.length<We?{ok:!1,reason:"too-short"}:a.length>Y?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Jt(i){return i.replace(/[^a-zA-Z0-9]/g,"").slice(0,Y)}const Xt=["function available(string _subdomain) view returns (bool)"],Ee={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return P.chainId===Number(Wt.ChainId.MATIC_MAINNET)?Ee.mainnet:Ee.sepolia}async function en(i,a={}){var h;const{rpc:o,address:p}=Yt(),f=new qt(o),c=new Dt(p,Xt,f);console.info(`[names] availability check → DCLRegistrar(${p}).available("${i}") on ${o}`);const d=await c.available(i);if((h=a.signal)!=null&&h.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${i}" available=${d}`),d?"available":"taken"}const tn="https://app.across.to/api";class ue extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(i){return it(H,i)}async function sn(i,a,o={}){var h;const p=o.chainId??P.chainId,f=o.provider??"across",c=`${P.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${p}&provider=${f}`,d=await ot(c,{method:"GET",identity:i,metadata:{}});if(!d.ok){let l;try{l=(h=await d.json())==null?void 0:h.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new ue:new Error(`fetchNameCreditRoute ${d.status}`)}return d.json()}function on(i,a){const o=me.from(i.availableAmount),f=me.from(H).sub(o);return{credits:[{value:i.amount,expiresAt:Number(i.expiresAt),salt:Gt(i.id)}],creditsSignatures:[i.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:f.isNegative()?"0":f.toString(),maxCreditedValue:H}}async function an(i,a={}){const o=tn,p=a.intervalMs??1e4,f=a.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let d=0;d<f;d++){try{const h=await fetch(`${o}/deposit/status?originChainId=137&depositTxHash=${i}`);if(h.ok){const l=await h.json(),m=(l.status??"pending").toLowerCase(),y=l.fillTx??l.fillTxnRef??null,b=l.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:b};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:y,actionsSucceeded:b}}}catch{}d<f-1&&await new Promise(h=>setTimeout(h,p))}return c}async function rn(i){const{name:a,identity:o,signer:p}=i,f=i.chainId??P.chainId,c=i.provider??"across",d=(i.beneficiary??await p.getAddress()).toLowerCase();let h=null,l=!1;console.info("[names] register start",{name:a,buyer:d,chainId:f,provider:c});try{const m=await tt(f),y=nn(m);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:m});const b=await sn(o,a,{chainId:f,provider:c});console.info("[names] step 2/6 route fetched",{target:b.externalCall.target,selector:b.externalCall.selector,provider:b.provider,quoteId:b.quoteId});const v=await nt(o,y);if(h=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),me.from(v.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const C=on(v.credit,b);let g;try{g=await Bt({chainId:f,buyer:d,signer:p,args:C})}catch(w){if(!(w instanceof Pt))throw w;g=await Ut(f,C,p)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await Ht(g),l=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),c==="across"){const w=await an(g,i.acrossPoll);if(console.info("[names] step 6/6 across status",w),w.status==="pending")return{status:"pending",originTxHash:g};if(w.status!=="filled"||!w.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:w.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:a,buyer:d,originConfirmed:l}),m instanceof Ot)return{status:"pending",originTxHash:m.txHash};if(h&&!l&&await st(o,[h]).catch(()=>{}),m instanceof ue)throw m;const y=new Error(Zt(m,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=m,y}}const ln=60,cn=700,dn=25;function hn(i){if(!i)return[];const a=[];for(let o=1;o<=i.length;o++)a.push({text:i.slice(0,o),delay:ln});a[a.length-1]={text:i,delay:cn};for(let o=i.length-1;o>=1;o--)a.push({text:i.slice(0,o),delay:dn});return a}function pn(i){return i.flatMap(hn)}function fn(i,a){const o=u.useMemo(()=>pn(i),[i]),[p,f]=u.useState(0);return u.useEffect(()=>{if(!a||o.length===0)return;const c=setTimeout(()=>f(d=>(d+1)%o.length),o[p%o.length].delay);return()=>clearTimeout(c)},[p,a,o]),!a||o.length===0?"":o[p%o.length].text}const xn="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='46.999'%20height='46.999'%20viewBox='0%200%2046.999%2046.999'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vector'%3e%3cpath%20d='M23.5861%2046.999C27.4441%2046.999%2031.1266%2046.1286%2034.3708%2044.475H12.8014C16.0456%2046.1286%2019.6405%2046.999%2023.5861%2046.999Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M8.76807%2041.9509H38.1411C39.1056%2041.1676%2040.1577%2040.2102%2040.7715%2039.514H6.13765C7.01445%2040.3843%207.89126%2041.2547%208.76807%2041.9509Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M25.0767%2034.0307H2.2797C2.80578%2035.0752%203.41955%2036.0326%204.03331%2036.9899H22.5339L25.0767%2034.0307Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M23.5861%200C10.6094%200%200%2010.4442%200%2023.4125C0%2026.2846%200.526084%2029.0697%201.49057%2031.5938L10.6094%2020.7144L15.8702%2014.3608L28.6716%2029.679L32.3542%2025.2402L41.999%2036.7288H42.7882C45.5063%2032.8993%2046.9968%2028.2864%2046.9968%2023.3254C47.1722%2010.4442%2036.5628%200%2023.5861%200ZM15.7825%2012.272C13.9412%2012.272%2012.5383%2010.7924%2012.5383%209.05166C12.5383%207.31095%2014.0289%205.83136%2015.7825%205.83136C17.6238%205.83136%2019.0267%207.31095%2019.0267%209.05166C19.0267%2010.7924%2017.6238%2012.272%2015.7825%2012.272ZM32.8803%2022.8032C29.2853%2022.8032%2026.3919%2019.931%2026.3919%2016.3626C26.3919%2012.7942%2029.2853%209.92201%2032.8803%209.92201C36.4752%209.92201%2039.3686%2012.7942%2039.3686%2016.3626C39.4563%2019.931%2036.4752%2022.8032%2032.8803%2022.8032Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M16.484%2018.7126V31.6808H27.2687L16.484%2018.7126Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M33.1433%2037.164H39.2809L33.1433%2029.766V37.164Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3c/g%3e%3c/svg%3e",mn="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/name-verified-oGwQ3ntb.svg",un="#34fee6",gn=s.div`
1
+ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}from"./useUrlFilters-DH-gxdfV.js";import{u as Je,S as $e,R as Xe,F as Ye,e as et}from"./categories-CIEcQPqv.js";import{c as P,r as tt,aK as nt,aL as st,aS as it,a as ot,s,t,o as Fe,aA as at,A as rt,L as fe,b as n,y as lt,I as T,z as W,cn as ee,ax as ct,Z as X,aP as dt,aO as ht,x as Ie,an as ze,n as Ne,q as pt,ac as xt,ap as ke,aq as Z,aY as ft,bL as mt}from"./index-CgKd8MIG.js";import{g as ut,h as gt,i as yt,j as bt,k as wt,C as Ct,l as vt,o as jt,m as $t,n as kt,M as St,u as Et,q as Tt,v as Lt,E as Rt,r as Mt,p as _t,s as At,t as Ft}from"./Assets.styles-BzDEqf9t.js";import{L as It}from"./LoadMore-yWxoUUNf.js";import{u as zt}from"./useInfiniteGrid-D9tb6urG.js";import{E as Nt}from"./ErrorNotice-CBZMlTMX.js";import{d as Wt}from"./dcl-schemas-CmtP3U6y.js";import{s as Bt,G as Pt,w as Ht,S as Ot}from"./buy-gasless-LQIhVXxE.js";import{s as Ut,k as Gt}from"./buy-BWhjAqGQ.js";import{f as Zt}from"./errors-ueM8ONld.js";import{J as qt,C as Dt,B as me}from"./ethers-BDpbhgX6.js";import{n as Vt}from"./Tooltip-BrPg6WWE.js";import{G as Kt}from"./grid.styles-DpEPS70S.js";import"./skeleton.styles-ChQLBG5k.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-DffPbrZU.js";import"./sendMetaTransaction-CQLcqeK_.js";function q(i){const a=i.source??"item",o=i.tradeId||`${i.contractAddress}-${i.tokenId??i.itemId??""}`;return`${a}:${o}`}const H="100000000000000000000",We=2,Y=15,Qt=/^[a-zA-Z0-9]+$/;function Se(i){const a=i.trim();return a.length===0?{ok:!1,reason:"empty"}:Qt.test(a)?a.length<We?{ok:!1,reason:"too-short"}:a.length>Y?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Jt(i){return i.replace(/[^a-zA-Z0-9]/g,"").slice(0,Y)}const Xt=["function available(string _subdomain) view returns (bool)"],Ee={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return P.chainId===Number(Wt.ChainId.MATIC_MAINNET)?Ee.mainnet:Ee.sepolia}async function en(i,a={}){var h;const{rpc:o,address:p}=Yt(),x=new qt(o),c=new Dt(p,Xt,x);console.info(`[names] availability check → DCLRegistrar(${p}).available("${i}") on ${o}`);const d=await c.available(i);if((h=a.signal)!=null&&h.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${i}" available=${d}`),d?"available":"taken"}const tn="https://app.across.to/api";class ue extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(i){return it(H,i)}async function sn(i,a,o={}){var h;const p=o.chainId??P.chainId,x=o.provider??"across",c=`${P.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${p}&provider=${x}`,d=await ot(c,{method:"GET",identity:i,metadata:{}});if(!d.ok){let l;try{l=(h=await d.json())==null?void 0:h.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new ue:new Error(`fetchNameCreditRoute ${d.status}`)}return d.json()}function on(i,a){const o=me.from(i.availableAmount),x=me.from(H).sub(o);return{credits:[{value:i.amount,expiresAt:Number(i.expiresAt),salt:Gt(i.id)}],creditsSignatures:[i.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:x.isNegative()?"0":x.toString(),maxCreditedValue:H}}async function an(i,a={}){const o=tn,p=a.intervalMs??1e4,x=a.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let d=0;d<x;d++){try{const h=await fetch(`${o}/deposit/status?originChainId=137&depositTxHash=${i}`);if(h.ok){const l=await h.json(),m=(l.status??"pending").toLowerCase(),y=l.fillTx??l.fillTxnRef??null,b=l.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:b};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:y,actionsSucceeded:b}}}catch{}d<x-1&&await new Promise(h=>setTimeout(h,p))}return c}async function rn(i){const{name:a,identity:o,signer:p}=i,x=i.chainId??P.chainId,c=i.provider??"across",d=(i.beneficiary??await p.getAddress()).toLowerCase();let h=null,l=!1;console.info("[names] register start",{name:a,buyer:d,chainId:x,provider:c});try{const m=await tt(x),y=nn(m);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:m});const b=await sn(o,a,{chainId:x,provider:c});console.info("[names] step 2/6 route fetched",{target:b.externalCall.target,selector:b.externalCall.selector,provider:b.provider,quoteId:b.quoteId});const v=await nt(o,y);if(h=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),me.from(v.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const C=on(v.credit,b);let g;try{g=await Bt({chainId:x,buyer:d,signer:p,args:C})}catch(w){if(!(w instanceof Pt))throw w;g=await Ut(x,C,p)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await Ht(g),l=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),c==="across"){const w=await an(g,i.acrossPoll);if(console.info("[names] step 6/6 across status",w),w.status==="pending")return{status:"pending",originTxHash:g};if(w.status!=="filled"||!w.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:w.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:a,buyer:d,originConfirmed:l}),m instanceof Ot)return{status:"pending",originTxHash:m.txHash};if(h&&!l&&await st(o,[h]).catch(()=>{}),m instanceof ue)throw m;const y=new Error(Zt(m,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=m,y}}const ln=60,cn=700,dn=25;function hn(i){if(!i)return[];const a=[];for(let o=1;o<=i.length;o++)a.push({text:i.slice(0,o),delay:ln});a[a.length-1]={text:i,delay:cn};for(let o=i.length-1;o>=1;o--)a.push({text:i.slice(0,o),delay:dn});return a}function pn(i){return i.flatMap(hn)}function xn(i,a){const o=u.useMemo(()=>pn(i),[i]),[p,x]=u.useState(0);return u.useEffect(()=>{if(!a||o.length===0)return;const c=setTimeout(()=>x(d=>(d+1)%o.length),o[p%o.length].delay);return()=>clearTimeout(c)},[p,a,o]),!a||o.length===0?"":o[p%o.length].text}const fn="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='46.999'%20height='46.999'%20viewBox='0%200%2046.999%2046.999'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vector'%3e%3cpath%20d='M23.5861%2046.999C27.4441%2046.999%2031.1266%2046.1286%2034.3708%2044.475H12.8014C16.0456%2046.1286%2019.6405%2046.999%2023.5861%2046.999Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M8.76807%2041.9509H38.1411C39.1056%2041.1676%2040.1577%2040.2102%2040.7715%2039.514H6.13765C7.01445%2040.3843%207.89126%2041.2547%208.76807%2041.9509Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M25.0767%2034.0307H2.2797C2.80578%2035.0752%203.41955%2036.0326%204.03331%2036.9899H22.5339L25.0767%2034.0307Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M23.5861%200C10.6094%200%200%2010.4442%200%2023.4125C0%2026.2846%200.526084%2029.0697%201.49057%2031.5938L10.6094%2020.7144L15.8702%2014.3608L28.6716%2029.679L32.3542%2025.2402L41.999%2036.7288H42.7882C45.5063%2032.8993%2046.9968%2028.2864%2046.9968%2023.3254C47.1722%2010.4442%2036.5628%200%2023.5861%200ZM15.7825%2012.272C13.9412%2012.272%2012.5383%2010.7924%2012.5383%209.05166C12.5383%207.31095%2014.0289%205.83136%2015.7825%205.83136C17.6238%205.83136%2019.0267%207.31095%2019.0267%209.05166C19.0267%2010.7924%2017.6238%2012.272%2015.7825%2012.272ZM32.8803%2022.8032C29.2853%2022.8032%2026.3919%2019.931%2026.3919%2016.3626C26.3919%2012.7942%2029.2853%209.92201%2032.8803%209.92201C36.4752%209.92201%2039.3686%2012.7942%2039.3686%2016.3626C39.4563%2019.931%2036.4752%2022.8032%2032.8803%2022.8032Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M16.484%2018.7126V31.6808H27.2687L16.484%2018.7126Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3cpath%20d='M33.1433%2037.164H39.2809L33.1433%2029.766V37.164Z'%20fill='%23FCFCFC'%20fill-opacity='0.6'/%3e%3c/g%3e%3c/svg%3e",mn="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/name-verified-oGwQ3ntb.svg",un="#34fee6",gn=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -432,7 +432,7 @@ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}fr
432
432
  color: ${t.colors.accent};
433
433
  }
434
434
  }
435
- `;function Pn({name:i,priceCredits:a,onClose:o}){const{session:p}=Fe(),{data:f,isError:c}=at(p),d=rt(),h=Ae(),[l,m]=u.useState("confirm"),[y,b]=u.useState(""),[v,C]=u.useState(null),g=u.useRef(!1),w=y.trim().toLowerCase()===i.toLowerCase(),S=l==="completing",L=a!=null?xe(a):"—",$=a==null,E=f==null?void 0:f.credits,I=a!=null&&E!=null?a-E:0,A=I>0,_=$?n("names.priceUnavailable"):A?n("names.insufficientCredits",{credits:xe(I)}):null;u.useEffect(()=>{const x=k=>{k.key==="Escape"&&!S&&o()};document.addEventListener("keydown",x);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",x),document.body.style.overflow=j}},[S,o]);async function F(){if(!(!p||!w||$||A||g.current)){g.current=!0,m("completing"),C(null);try{const x=await rn({name:i,identity:p.identity,signer:p.signer});X("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:a??null,settlement:x.status}),d.invalidateQueries({queryKey:["usd-balance"]}),d.invalidateQueries({queryKey:["my-assets"]}),m(x.status==="registered"?"success":"pending")}catch(x){X(ht(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(x),purchase_type:"name"}),C(x instanceof ue?n("names.errorRouteCost"):(x==null?void 0:x.message)||n("names.errorGeneric")),m("error")}finally{g.current=!1}}}const z=l!=="success"&&l!=="pending",R=lt(p==null?void 0:p.providerType);return e.jsx(gn,{onClick:S?void 0:o,role:"presentation",children:e.jsxs(yn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:x=>x.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:l==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(se,{onClick:o,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(f,c)]}),e.jsx(oe,{})]}),(l==="confirm"||l==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ae,{children:[e.jsx(Te,{"aria-hidden":!0,children:"@"}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(he,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(Le,{onClick:()=>m("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(jn,{children:[e.jsx($n,{children:n("names.confirmTitle")}),e.jsx(kn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Hn(i)}</b>`})}}),e.jsxs(Sn,{children:[e.jsx(En,{"aria-hidden":!0,children:"@"}),e.jsx(Tn,{value:y,onChange:x=>b(x.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(Ln,{children:".dcl.eth"})]})]}),_?e.jsxs(he,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:_})]}):null,e.jsx(Le,{onClick:()=>void F(),disabled:!w||!p||$||A,children:n("names.buyCta")})]})]}),l==="completing"&&e.jsxs(Rn,{children:[e.jsx(Mn,{src:ct,alt:"",width:56,height:56}),e.jsx(_n,{children:R?n("names.confirming"):n("names.completing")}),e.jsxs(An,{children:[e.jsx(Fn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(In,{children:"1/1"})]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:n("names.pendingHeaderTitle")}),e.jsx(se,{onClick:o,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(f,c)]}),e.jsx(oe,{}),e.jsxs(he,{"data-tone":"info",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ae,{style:{marginTop:20},children:[e.jsx(Te,{"aria-hidden":!0,children:"@"}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),e.jsx(Re,{children:e.jsx(Me,{onClick:()=>{o(),h("/my-items")},children:n("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:n("names.successHeaderTitle")}),e.jsx(se,{onClick:o,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(f,c)]}),e.jsx(oe,{}),e.jsxs(zn,{children:[e.jsx(Nn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(Wn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ae,{style:{marginTop:20},children:[e.jsxs(bn,{"data-testid":"name-success-tile",children:[e.jsx(wn,{src:xn,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Cn,{children:[e.jsx("span",{"aria-hidden":!0,children:i}),e.jsx(vn,{src:mn,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),e.jsxs(Re,{children:[e.jsx(Me,{onClick:()=>{o(),h("/my-items")},children:n("names.myItems")}),e.jsx(Bn,{href:P.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Hn(i){return i.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}const On="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/identity-icon-C8yAW_Gq.svg",Un="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/world-icon-6xQ-PmmW.svg",Gn="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/invite-icon-Bz6lCTuB.svg",Zn="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",qn=s.div`
435
+ `;function Pn({name:i,priceCredits:a,onClose:o}){const{session:p}=Fe(),{data:x,isError:c}=at(p),d=rt(),h=Ae(),[l,m]=u.useState("confirm"),[y,b]=u.useState(""),[v,C]=u.useState(null),g=u.useRef(!1),w=y.trim().toLowerCase()===i.toLowerCase(),S=l==="completing",L=a!=null?fe(a):"—",$=a==null,E=x==null?void 0:x.credits,I=a!=null&&E!=null?a-E:0,A=I>0,_=$?n("names.priceUnavailable"):A?n("names.insufficientCredits",{credits:fe(I)}):null;u.useEffect(()=>{const f=k=>{k.key==="Escape"&&!S&&o()};document.addEventListener("keydown",f);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=j}},[S,o]);async function F(){if(!(!p||!w||$||A||g.current)){g.current=!0,m("completing"),C(null);try{const f=await rn({name:i,identity:p.identity,signer:p.signer});X("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:a??null,settlement:f.status}),d.invalidateQueries({queryKey:["usd-balance"]}),d.invalidateQueries({queryKey:["my-assets"]}),m(f.status==="registered"?"success":"pending")}catch(f){X(ht(f)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(f),purchase_type:"name"}),C(f instanceof ue?n("names.errorRouteCost"):(f==null?void 0:f.message)||n("names.errorGeneric")),m("error")}finally{g.current=!1}}}const z=l!=="success"&&l!=="pending",R=lt(p==null?void 0:p.providerType);return e.jsx(gn,{onClick:S?void 0:o,role:"presentation",children:e.jsxs(yn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:f=>f.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:l==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(se,{onClick:o,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(x,c)]}),e.jsx(oe,{})]}),(l==="confirm"||l==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ae,{children:[e.jsx(Te,{"aria-hidden":!0,children:"@"}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(he,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(Le,{onClick:()=>m("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(jn,{children:[e.jsx($n,{children:n("names.confirmTitle")}),e.jsx(kn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Hn(i)}</b>`})}}),e.jsxs(Sn,{children:[e.jsx(En,{"aria-hidden":!0,children:"@"}),e.jsx(Tn,{value:y,onChange:f=>b(f.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(Ln,{children:".dcl.eth"})]})]}),_?e.jsxs(he,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:_})]}):null,e.jsx(Le,{onClick:()=>void F(),disabled:!w||!p||$||A,children:n("names.buyCta")})]})]}),l==="completing"&&e.jsxs(Rn,{children:[e.jsx(Mn,{src:ct,alt:"",width:56,height:56}),e.jsx(_n,{children:R?n("names.confirming"):n("names.completing")}),e.jsxs(An,{children:[e.jsx(Fn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(In,{children:"1/1"})]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:n("names.pendingHeaderTitle")}),e.jsx(se,{onClick:o,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(x,c)]}),e.jsx(oe,{}),e.jsxs(he,{"data-tone":"info",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ae,{style:{marginTop:20},children:[e.jsx(Te,{"aria-hidden":!0,children:"@"}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),e.jsx(Re,{children:e.jsx(Me,{onClick:()=>{o(),h("/my-items")},children:n("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{children:n("names.successHeaderTitle")}),e.jsx(se,{onClick:o,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(ie,{children:[n("names.myCreditsBalance")," ",e.jsx(W,{})," ",ee(x,c)]}),e.jsx(oe,{}),e.jsxs(zn,{children:[e.jsx(Nn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(Wn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ae,{style:{marginTop:20},children:[e.jsxs(bn,{"data-testid":"name-success-tile",children:[e.jsx(wn,{src:fn,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Cn,{children:[e.jsx("span",{"aria-hidden":!0,children:i}),e.jsx(vn,{src:mn,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(re,{children:[e.jsxs(le,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(W,{}),L]})]}),e.jsxs(Re,{children:[e.jsx(Me,{onClick:()=>{o(),h("/my-items")},children:n("names.myItems")}),e.jsx(Bn,{href:P.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Hn(i){return i.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}const On="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/identity-icon-C8yAW_Gq.svg",Un="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/world-icon-6xQ-PmmW.svg",Gn="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/invite-icon-Bz6lCTuB.svg",Zn="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",qn=s.div`
436
436
  width: 100%;
437
437
  min-width: 0;
438
438
  `,Dn=s.nav`
@@ -718,7 +718,7 @@ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}fr
718
718
  height: 48px;
719
719
  border-radius: 12px;
720
720
  }
721
- `,fs=s.span`
721
+ `,xs=s.span`
722
722
  display: inline-flex;
723
723
  align-items: center;
724
724
  gap: 4px;
@@ -729,7 +729,7 @@ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}fr
729
729
  width: 13.26px;
730
730
  height: 14px;
731
731
  }
732
- `,xs=s.div`
732
+ `,fs=s.div`
733
733
  display: flex;
734
734
  align-items: center;
735
735
  gap: 8px;
@@ -748,7 +748,7 @@ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}fr
748
748
  height: 16px;
749
749
  flex: none;
750
750
  }
751
- `,pe=s(xs)`
751
+ `,pe=s(fs)`
752
752
  position: absolute;
753
753
  top: calc(100% + 8px);
754
754
  left: 0;
@@ -889,4 +889,4 @@ import{r as u,b as Ae,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Qe}fr
889
889
  clip: rect(0, 0, 0, 0);
890
890
  white-space: nowrap;
891
891
  border: 0;
892
- `,vs="https://docs.decentraland.org/creator/worlds/about/",js="https://governance.decentraland.org";function $s(i){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(i)}`}function ks({onBack:i}){Ie({title:n("seo.names.title"),description:n("seo.names.description")});const{session:a,signIn:o}=Fe(),{data:p}=ze(),f=p?Ne(H,p):null,[c,d]=u.useState(""),[h,l]=u.useState("idle"),[m,y]=u.useState(!1),[b,v]=u.useState(!1),[C,g]=u.useState(()=>{var x;return typeof window<"u"&&!!((x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)});u.useEffect(()=>{var k;const x=(k=window.matchMedia)==null?void 0:k.call(window,"(prefers-reduced-motion: reduce)");if(!x)return;const j=M=>g(M.matches);return x.addEventListener("change",j),()=>x.removeEventListener("change",j)},[]);const w=n("names.placeholderExamples"),S=u.useMemo(()=>w.split(",").map(x=>x.trim()).filter(Boolean),[w]),$=fn(S,!b&&!c&&!C)||n("names.inputPlaceholder"),E=u.useRef(null),[I,A]=u.useState(void 0);u.useLayoutEffect(()=>{E.current&&A(E.current.getBoundingClientRect().width)},[c,$]),u.useEffect(()=>{if(!Se(c).ok){l(c.length===0?"idle":"invalid");return}l("checking");const j=new AbortController,k=setTimeout(()=>{(async()=>{try{const M=await en(c,{signal:j.signal});l(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;l("error")}})()},400);return()=>{clearTimeout(k),j.abort()}},[c]);const _=Se(c),F=_.ok&&(h==="available"||h==="error");function z(){if(F){if(!a){o();return}y(!0)}}const R=e.jsxs(e.Fragment,{children:[n("names.claim"),f!=null?e.jsxs(fs,{children:[e.jsx(W,{}),xe(f)]}):null]});return e.jsxs(qn,{"data-testid":"names-page",children:[e.jsxs(Dn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Vn,{onClick:i,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Kn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Qn,{children:[e.jsxs(Jn,{children:[e.jsxs(Xn,{children:[e.jsx(Yn,{children:n("names.heroTitle")}),e.jsx(es,{children:n("names.heroSubtitle")})]}),e.jsxs(ts,{children:[e.jsxs(ns,{"data-testid":"names-input-wrap",children:[e.jsxs(ss,{invalid:h==="taken",children:[e.jsxs(rs,{children:[e.jsx(ls,{"aria-hidden":!0,children:"@"}),e.jsx(cs,{value:c,onChange:x=>d(Jt(x.target.value)),placeholder:$,"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Y,onFocus:()=>v(!0),style:{width:I!=null?`${I}px`:void 0}}),e.jsx(is,{ref:E,"aria-hidden":!0,"data-placeholder":!c||void 0,children:c||$}),e.jsx(ds,{children:n("names.suffix")})]}),c.length>0?e.jsxs(hs,{"aria-hidden":!0,children:[c.length,"/",Y]}):null,e.jsx(Be,{onClick:z,disabled:!F,"data-testid":"names-claim",children:R})]}),h==="taken"?e.jsxs(os,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(as,{href:$s(c),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,h==="checking"?e.jsx(pe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):h==="error"?e.jsx(pe,{tone:"muted",role:"status",children:n("names.checkError")}):h==="invalid"&&!_.ok&&_.reason==="too-short"?e.jsx(pe,{tone:"muted",role:"status",children:n("names.tooShort",{min:We})}):null]}),e.jsx(ps,{onClick:z,disabled:!F,children:R}),e.jsx(Cs,{role:"status","aria-live":"polite",children:h==="available"?n("names.available",{name:c}):""})]})]}),e.jsxs(ms,{children:[e.jsxs(us,{children:[e.jsx(gs,{children:n("names.whyTitle")}),e.jsx(ys,{children:n("names.whyIntro")})]}),e.jsxs(bs,{children:[e.jsxs(D,{children:[e.jsx(V,{src:On,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(J,{children:n("names.why1")})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Un,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(J,{children:[n("names.why2")," ",e.jsx(ws,{children:n("names.why2Address")})]}),e.jsxs(_e,{href:vs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Gn,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(J,{children:n("names.why3")})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Zn,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(J,{children:n("names.why4")}),e.jsxs(_e,{href:js,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),m?e.jsx(Pn,{name:c,priceCredits:f,onClose:()=>y(!1)}):null]})}const Ss="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",fe=48,Es=["all","on_sale","not_for_sale"];function Vs(){const[i]=Ke(),a=Ae(),o=(i.get("q")??"").trim().toLowerCase(),p=(i.get("q")??"").trim();Ie({title:p?n("seo.collectibles.searchTitle",{query:p}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const f=u.useMemo(()=>({category:"all",status:"on_sale",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[c,d]=Qe(f),{subCategory:h,rarities:l,priceMin:m,priceMax:y,smart:b,sort:v}=c,C=c.category,g=Es.includes(c.status)?c.status:"on_sale";Je(`${C}:${h??""}`);const[w,S]=u.useState(!1);u.useEffect(()=>{if(!w)return;const r=G=>{G.key==="Escape"&&S(!1)};document.addEventListener("keydown",r);const N=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=N}},[w]);const L=g==="on_sale",$=m&&!Number.isNaN(Number(m))?Number(m):void 0,E=y&&!Number.isNaN(Number(y))?Number(y):void 0,I=pt(),A=h?et[h]:void 0,_=($e.find(r=>r.key===v)??$e[0]).server,F={category:C,rarities:l.length?l:void 0,wearableCategories:A,minPriceCredits:$,maxPriceCredits:E,search:o||void 0,sortBy:_,isSmart:b||void 0,onSale:!0,listingType:I?void 0:"primary"},z={category:C,rarities:l.length?l:void 0,wearableCategories:A,search:o||void 0,sortBy:_,isWearableSmart:b||void 0,isOnSale:g==="not_for_sale"?!1:void 0},{items:R,total:x,isLoading:j,isPlaceholderData:k,error:M,hasNextPage:Pe,isFetchingNextPage:ge,isFetchNextPageError:He,fetchNextPage:Oe}=zt(L?["shop-items",F]:["catalog-items",z],r=>L?xt({...F,first:fe,skip:r}):mt({...z,first:fe,skip:r}),{enabled:C!=="names"}),O=x,{data:ye,isError:Ue,isPending:Ge}=ze(),Ze=r=>ye&&r.manaWei?Ne(r.manaWei,ye):null,qe=L&&Ge&&R.some(r=>r.source==="legacy"),be=j||k||qe,De=j?15:Math.min(Math.max(R.length,1),fe),we=u.useRef(null);u.useEffect(()=>{j||k||!o||we.current===o||(we.current=o,X("Shop Searched",{query:o,result_count:O}))},[o,j,k,O]);const U=u.useRef("__init__");u.useEffect(()=>{if(j||k)return;const r=JSON.stringify({category:C,subCategory:h,rarities:l,min:$,max:E,sort:v,status:g,smart:b});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,X("Shop Applied Filter",{filters:{category:C,sub_category:h,rarities:l,min_price_credits:$??null,max_price_credits:E??null,status:g,smart:b,sort:v},result_count:O})},[C,h,l,$,E,v,g,b,j,k,O]);function Ce(r){d({category:r,subCategory:null})}function ve(r){d({status:r})}function je(r){d({rarities:l.includes(r)?l.filter(N=>N!==r):[...l,r]})}function Ve(){d(f)}const B=[];($!=null||E!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{d({priceMin:"",priceMax:""})}});for(const r of Xe)l.includes(r)&&B.push({key:`rarity-${r}`,label:ft(r),onRemove:()=>je(r)});return b&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>d({smart:!1})}),g!=="on_sale"&&B.push({key:"status",label:g==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>ve("on_sale")}),e.jsxs(ut,{"data-testid":"browse",children:[C!=="names"&&e.jsxs(e.Fragment,{children:[w?e.jsx(gt,{onClick:()=>S(!1),"aria-hidden":!0}):null,e.jsxs(yt,{"data-open":w||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(bt,{children:[e.jsx(wt,{children:n("assets.filters")}),e.jsx(Ct,{onClick:()=>S(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx(jt,{category:C,subCategory:h,onCategory:Ce,onSub:r=>d({subCategory:r}),priceMin:m,priceMax:y,onPriceMin:r=>d({priceMin:r}),onPriceMax:r=>d({priceMax:r}),rarities:l,onToggleRarity:je,status:g,onStatus:ve,smart:b,onSmart:r=>d({smart:r})})}),e.jsx($t,{children:e.jsx(kt,{type:"button",onClick:()=>S(!1),children:n("assets.showItems")})})]})]}),e.jsx(St,{children:C==="names"?e.jsx(ks,{onBack:()=>Ce("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{sort:v,onSort:r=>d({sort:r}),total:x,loading:j||k,query:o,onOpenFilters:()=>S(!0),chips:B,onClearChips:Ve}),Ue&&L&&R.some(r=>r.source==="legacy")?e.jsx(Et,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,M?e.jsx(Nt,{message:n("assets.loadError"),testId:"browse-error"}):null,!be&&R.length===0&&!M?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(Lt,{src:Ss,alt:""}),e.jsxs(Rt,{children:[e.jsx(Mt,{children:n("assets.empty.title")}),e.jsx(_t,{children:p?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:p}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(At,{children:e.jsx(Ft,{type:"button",onClick:()=>a("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:be?e.jsx(ke,{count:De}):e.jsxs(e.Fragment,{children:[R.map(r=>{if(!L)return e.jsx(Z,{item:r,mode:"view"},q(r));const N=r;if(N.source!=="legacy")return e.jsx(Z,{item:r},q(r));const G=Ze(N);return G==null?e.jsx(Z,{item:r,mode:"view"},q(r)):e.jsx(Z,{item:{...N,priceCredits:G}},q(r))}),ge?e.jsx(ke,{count:6}):null]})}),e.jsx(It,{hasNextPage:Pe,isFetching:ge,isError:He,onLoadMore:()=>void Oe()})]})]})})]})}export{Vs as Assets};
892
+ `,vs="https://docs.decentraland.org/creator/worlds/about/",js="https://governance.decentraland.org";function $s(i){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(i)}`}function ks({onBack:i}){Ie({title:n("seo.names.title"),description:n("seo.names.description")});const{session:a,signIn:o}=Fe(),{data:p}=ze(),x=p?Ne(H,p):null,[c,d]=u.useState(""),[h,l]=u.useState("idle"),[m,y]=u.useState(!1),[b,v]=u.useState(!1),[C,g]=u.useState(()=>{var f;return typeof window<"u"&&!!((f=window.matchMedia)!=null&&f.call(window,"(prefers-reduced-motion: reduce)").matches)});u.useEffect(()=>{var k;const f=(k=window.matchMedia)==null?void 0:k.call(window,"(prefers-reduced-motion: reduce)");if(!f)return;const j=M=>g(M.matches);return f.addEventListener("change",j),()=>f.removeEventListener("change",j)},[]);const w=n("names.placeholderExamples"),S=u.useMemo(()=>w.split(",").map(f=>f.trim()).filter(Boolean),[w]),$=xn(S,!b&&!c&&!C)||n("names.inputPlaceholder"),E=u.useRef(null),[I,A]=u.useState(void 0);u.useLayoutEffect(()=>{E.current&&A(E.current.getBoundingClientRect().width)},[c,$]),u.useEffect(()=>{if(!Se(c).ok){l(c.length===0?"idle":"invalid");return}l("checking");const j=new AbortController,k=setTimeout(()=>{(async()=>{try{const M=await en(c,{signal:j.signal});l(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;l("error")}})()},400);return()=>{clearTimeout(k),j.abort()}},[c]);const _=Se(c),F=_.ok&&(h==="available"||h==="error");function z(){if(F){if(!a){o();return}y(!0)}}const R=e.jsxs(e.Fragment,{children:[n("names.claim"),x!=null?e.jsxs(xs,{children:[e.jsx(W,{}),fe(x)]}):null]});return e.jsxs(qn,{"data-testid":"names-page",children:[e.jsxs(Dn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Vn,{onClick:i,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Kn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Qn,{children:[e.jsxs(Jn,{children:[e.jsxs(Xn,{children:[e.jsx(Yn,{children:n("names.heroTitle")}),e.jsx(es,{children:n("names.heroSubtitle")})]}),e.jsxs(ts,{children:[e.jsxs(ns,{"data-testid":"names-input-wrap",children:[e.jsxs(ss,{invalid:h==="taken",children:[e.jsxs(rs,{children:[e.jsx(ls,{"aria-hidden":!0,children:"@"}),e.jsx(cs,{value:c,onChange:f=>d(Jt(f.target.value)),placeholder:$,"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Y,onFocus:()=>v(!0),style:{width:I!=null?`${I}px`:void 0}}),e.jsx(is,{ref:E,"aria-hidden":!0,"data-placeholder":!c||void 0,children:c||$}),e.jsx(ds,{children:n("names.suffix")})]}),c.length>0?e.jsxs(hs,{"aria-hidden":!0,children:[c.length,"/",Y]}):null,e.jsx(Be,{onClick:z,disabled:!F,"data-testid":"names-claim",children:R})]}),h==="taken"?e.jsxs(os,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(as,{href:$s(c),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,h==="checking"?e.jsx(pe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):h==="error"?e.jsx(pe,{tone:"muted",role:"status",children:n("names.checkError")}):h==="invalid"&&!_.ok&&_.reason==="too-short"?e.jsx(pe,{tone:"muted",role:"status",children:n("names.tooShort",{min:We})}):null]}),e.jsx(ps,{onClick:z,disabled:!F,children:R}),e.jsx(Cs,{role:"status","aria-live":"polite",children:h==="available"?n("names.available",{name:c}):""})]})]}),e.jsxs(ms,{children:[e.jsxs(us,{children:[e.jsx(gs,{children:n("names.whyTitle")}),e.jsx(ys,{children:n("names.whyIntro")})]}),e.jsxs(bs,{children:[e.jsxs(D,{children:[e.jsx(V,{src:On,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(J,{children:n("names.why1")})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Un,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(J,{children:[n("names.why2")," ",e.jsx(ws,{children:n("names.why2Address")})]}),e.jsxs(_e,{href:vs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Gn,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(J,{children:n("names.why3")})]})]}),e.jsxs(D,{children:[e.jsx(V,{src:Zn,alt:""}),e.jsxs(K,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(J,{children:n("names.why4")}),e.jsxs(_e,{href:js,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),m?e.jsx(Pn,{name:c,priceCredits:x,onClose:()=>y(!1)}):null]})}const Ss="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",xe=48,Es=["all","on_sale","not_for_sale"];function Vs(){const[i]=Ke(),a=Ae(),o=(i.get("q")??"").trim().toLowerCase(),p=(i.get("q")??"").trim();Ie({title:p?n("seo.collectibles.searchTitle",{query:p}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const x=u.useMemo(()=>({category:"all",status:"on_sale",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[c,d]=Qe(x),{subCategory:h,rarities:l,priceMin:m,priceMax:y,smart:b,sort:v}=c,C=c.category,g=Es.includes(c.status)?c.status:"on_sale";Je(`${C}:${h??""}`);const[w,S]=u.useState(!1);u.useEffect(()=>{if(!w)return;const r=G=>{G.key==="Escape"&&S(!1)};document.addEventListener("keydown",r);const N=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=N}},[w]);const L=g==="on_sale",$=m&&!Number.isNaN(Number(m))?Number(m):void 0,E=y&&!Number.isNaN(Number(y))?Number(y):void 0,I=pt(),A=h?et[h]:void 0,_=($e.find(r=>r.key===v)??$e[0]).server,F={category:C,rarities:l.length?l:void 0,wearableCategories:A,minPriceCredits:$,maxPriceCredits:E,search:o||void 0,sortBy:_,isSmart:b||void 0,onSale:!0,listingType:I?void 0:"primary"},z={category:C,rarities:l.length?l:void 0,wearableCategories:A,search:o||void 0,sortBy:_,isWearableSmart:b||void 0,isOnSale:g==="not_for_sale"?!1:void 0},{items:R,total:f,isLoading:j,isPlaceholderData:k,error:M,hasNextPage:Pe,isFetchingNextPage:ge,isFetchNextPageError:He,fetchNextPage:Oe}=zt(L?["shop-items",F]:["catalog-items",z],r=>L?ft({...F,first:xe,skip:r}):mt({...z,first:xe,skip:r}),{enabled:C!=="names"}),O=f,{data:ye,isError:Ue,isPending:Ge}=ze(),Ze=r=>ye&&r.manaWei?Ne(r.manaWei,ye):null,qe=L&&Ge&&R.some(r=>r.source==="legacy"),be=j||k||qe,De=j?15:Math.min(Math.max(R.length,1),xe),we=u.useRef(null);u.useEffect(()=>{j||k||!o||we.current===o||(we.current=o,X("Shop Searched",{query:o,result_count:O}))},[o,j,k,O]);const U=u.useRef("__init__");u.useEffect(()=>{if(j||k)return;const r=JSON.stringify({category:C,subCategory:h,rarities:l,min:$,max:E,sort:v,status:g,smart:b});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,X("Shop Applied Filter",{filters:{category:C,sub_category:h,rarities:l,min_price_credits:$??null,max_price_credits:E??null,status:g,smart:b,sort:v},result_count:O})},[C,h,l,$,E,v,g,b,j,k,O]);function Ce(r){d({category:r,subCategory:null})}function ve(r){d({status:r})}function je(r){d({rarities:l.includes(r)?l.filter(N=>N!==r):[...l,r]})}function Ve(){d(x)}const B=[];($!=null||E!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{d({priceMin:"",priceMax:""})}});for(const r of Xe)l.includes(r)&&B.push({key:`rarity-${r}`,label:xt(r),onRemove:()=>je(r)});return b&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>d({smart:!1})}),g!=="on_sale"&&B.push({key:"status",label:g==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>ve("on_sale")}),e.jsxs(ut,{"data-testid":"browse",children:[C!=="names"&&e.jsxs(e.Fragment,{children:[w?e.jsx(gt,{onClick:()=>S(!1),"aria-hidden":!0}):null,e.jsxs(yt,{"data-open":w||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(bt,{children:[e.jsx(wt,{children:n("assets.filters")}),e.jsx(Ct,{onClick:()=>S(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx(jt,{category:C,subCategory:h,onCategory:Ce,onSub:r=>d({subCategory:r}),priceMin:m,priceMax:y,onPriceMin:r=>d({priceMin:r}),onPriceMax:r=>d({priceMax:r}),rarities:l,onToggleRarity:je,status:g,onStatus:ve,smart:b,onSmart:r=>d({smart:r})})}),e.jsx($t,{children:e.jsx(kt,{type:"button",onClick:()=>S(!1),children:n("assets.showItems")})})]})]}),e.jsx(St,{children:C==="names"?e.jsx(ks,{onBack:()=>Ce("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{sort:v,onSort:r=>d({sort:r}),total:f,loading:j||k,query:o,onOpenFilters:()=>S(!0),chips:B,onClearChips:Ve}),Ue&&L&&R.some(r=>r.source==="legacy")?e.jsx(Et,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,M?e.jsx(Nt,{message:n("assets.loadError"),testId:"browse-error"}):null,!be&&R.length===0&&!M?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(Lt,{src:Ss,alt:""}),e.jsxs(Rt,{children:[e.jsx(Mt,{children:n("assets.empty.title")}),e.jsx(_t,{children:p?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:p}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(At,{children:e.jsx(Ft,{type:"button",onClick:()=>a("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:be?e.jsx(ke,{count:De}):e.jsxs(e.Fragment,{children:[R.map(r=>{if(!L)return e.jsx(Z,{item:r,mode:"view"},q(r));const N=r;if(N.source!=="legacy")return e.jsx(Z,{item:r},q(r));const G=Ze(N);return G==null?e.jsx(Z,{item:r,mode:"view"},q(r)):e.jsx(Z,{item:{...N,priceCredits:G}},q(r))}),ge?e.jsx(ke,{count:6}):null]})}),e.jsx(It,{hasNextPage:Pe,isFetching:ge,isError:He,onLoadMore:()=>void Oe()})]})]})})]})}export{Vs as Assets};
@@ -1,4 +1,4 @@
1
- import{r as v,j as o}from"./react-BYHuwl8r.js";import{C as q,R as M,a as ue,b as be}from"./categories-Bwk-Btnk.js";import{n as d,T as ye}from"./Tooltip-C7ohRZVT.js";import{s as t,t as e,I as W,b as n,ac as F,C as _}from"./index-DrsPf8lM.js";const g=1e5,b=900,x=90,j=x*2,V=b/x,X=g-b,L=100;function A(i){const s=Math.max(0,Math.min(Math.round(i),j));if(s<=x)return s*V;const c=b+(s-x)/x*X;return Math.round(c/L)*L}function z(i){const s=Math.max(0,Math.min(i,g));return s<=b?Math.round(s/V):x+Math.round((s-b)/X*x)}function D(i){return z(i)/j*100}const we=t.div`
1
+ import{r as v,j as o}from"./react-BYHuwl8r.js";import{C as q,R as M,a as ue,b as be}from"./categories-CIEcQPqv.js";import{n as d,T as ye}from"./Tooltip-BrPg6WWE.js";import{s as t,t as e,I as W,b as n,ac as F,C as _}from"./index-CgKd8MIG.js";const g=1e5,b=900,x=90,j=x*2,V=b/x,X=g-b,L=100;function A(i){const s=Math.max(0,Math.min(Math.round(i),j));if(s<=x)return s*V;const c=b+(s-x)/x*X;return Math.round(c/L)*L}function z(i){const s=Math.max(0,Math.min(i,g));return s<=b?Math.round(s/V):x+Math.round((s-b)/X*x)}function D(i){return z(i)/j*100}const we=t.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-BYHuwl8r.js";import{t as o,s as n,B as G,w as N,x as P,b as e,o as B,y as O,I as z,z as K,v as w,A as H,c as Q,D as X,E as A,F as Z,G as J,H as E}from"./index-DrsPf8lM.js";import{c as U,d as V,b as Y,e as tt,s as it,a as et}from"./authorizations-5kJTkikm.js";import{f as ot}from"./builder-duVm3eqN.js";import{m as at}from"./mana-matic-C4e1sNO3.js";import{f as nt}from"./errors-DGBGW8UJ.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DXB2zppk.js";const st=N`
1
+ import{j as i,L as _,r as F}from"./react-BYHuwl8r.js";import{t as o,s as n,B as G,w as N,x as P,b as e,o as B,y as O,I as z,z as K,v as w,A as H,c as Q,D as X,E as A,F as Z,G as J,H as E}from"./index-CgKd8MIG.js";import{c as U,d as V,b as Y,e as tt,s as it,a as et}from"./authorizations-DffPbrZU.js";import{f as ot}from"./builder-BjB54DJ_.js";import{m as at}from"./mana-matic-C4e1sNO3.js";import{f as nt}from"./errors-ueM8ONld.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CQLcqeK_.js";const st=N`
2
2
  to { transform: rotate(360deg); }
3
3
  `,rt=N`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,ax as aa,ay as Re,az as sa,J as na,I as O,z as Mt,K as Ke,x as ia,X as H,am as dt,o as ra,q as oa,v as ca,aA as da,A as la,aB as ua,an as ha,aC as pa,aD as lt,aE as ga,aF as ma,y as xa,aG as ut,Z as V,aH as ht,aI as fa,F as ae,r as ya,c as pt,aJ as ba,C as va,aK as gt,aL as qe,aM as wa,aN as xe,aO as fe,aP as mt,g as ye,f as Ca,h as Be,aQ as ja}from"./index-DrsPf8lM.js";import{M as ka,S as $a,C as Sa,H as Ma,a as Ta,T as Ia,X as Pa,b as za,B as Aa,c as Ea,d as xt,e as Ra,f as Ce,P as Tt,m as qa,g as Ba,h as _a,i as Fa,j as Wa,k as It,l as je,L as La,n as Ka,o as ft,p as yt,W as Na,q as Qa,r as Ua,s as Ha,A as Oa,t as Ga,u as Va,v as Da,w as Ja,x as Xa,y as Ya,z as Za,D as es,E as ts,F as as,G as ss,I as ns,J as is,K as rs,N as os,O as cs,Q as _e,R as ds,U as ls,V as us,Y as hs,Z as bt,_ as vt,$ as ps,a0 as gs,a1 as ms}from"./CollectionCarousel-CucQ0QV7.js";import{f as xs,h as fs,a as ys,n as bs,i as vs,A as ws}from"./authorizations-5kJTkikm.js";import{g as Cs,j as Fe}from"./buy-CnDiuzF0.js";import{b as js,w as ks,S as wt,G as $s}from"./buy-gasless-DOp9N7fN.js";import{u as Ss,M as Ms,R as be,r as Ts,c as Is,p as Ct}from"./useCreditPacks-tiUs7FLz.js";import{i as Ps,a as zs}from"./errors-DGBGW8UJ.js";import{E as As}from"./ErrorNotice-C0iIUOEA.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DXB2zppk.js";const{colors:se,radius:Es}=de,Rs=i.div`
1
+ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,ax as aa,ay as Re,az as sa,J as na,I as O,z as Mt,K as Ke,x as ia,X as H,am as dt,o as ra,q as oa,v as ca,aA as da,A as la,aB as ua,an as ha,aC as pa,aD as lt,aE as ga,aF as ma,y as xa,aG as ut,Z as V,aH as ht,aI as fa,F as ae,r as ya,c as pt,aJ as ba,C as va,aK as gt,aL as qe,aM as wa,aN as xe,aO as fe,aP as mt,g as ye,f as Ca,h as Be,aQ as ja}from"./index-CgKd8MIG.js";import{M as ka,S as $a,C as Sa,H as Ma,a as Ta,T as Ia,X as Pa,b as za,B as Aa,c as Ea,d as xt,e as Ra,f as Ce,P as Tt,m as qa,g as Ba,h as _a,i as Fa,j as Wa,k as It,l as je,L as La,n as Ka,o as ft,p as yt,W as Na,q as Qa,r as Ua,s as Ha,A as Oa,t as Ga,u as Va,v as Da,w as Ja,x as Xa,y as Ya,z as Za,D as es,E as ts,F as as,G as ss,I as ns,J as is,K as rs,N as os,O as cs,Q as _e,R as ds,U as ls,V as us,Y as hs,Z as bt,_ as vt,$ as ps,a0 as gs,a1 as ms}from"./CollectionCarousel-DQQb78H6.js";import{f as xs,h as fs,a as ys,n as bs,i as vs,A as ws}from"./authorizations-DffPbrZU.js";import{g as Cs,j as Fe}from"./buy-BWhjAqGQ.js";import{b as js,w as ks,S as wt,G as $s}from"./buy-gasless-LQIhVXxE.js";import{u as Ss,M as Ms,R as be,r as Ts,c as Is,p as Ct}from"./useCreditPacks-BI219E4X.js";import{i as Ps,a as zs}from"./errors-ueM8ONld.js";import{E as As}from"./ErrorNotice-CBZMlTMX.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CQLcqeK_.js";const{colors:se,radius:Es}=de,Rs=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-DrsPf8lM.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-DxeNVjAi.js";function F(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 t=44,B=M(P||(P=l`
1
+ import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-CgKd8MIG.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-C9y--t9u.js";function F(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 t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a1 as te,D as T,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ap as z,aq as de,bw as pe,bx as xe}from"./index-DrsPf8lM.js";import{E as he}from"./ErrorNotice-C0iIUOEA.js";import{d as me,P as ge,C as ue,a as be,b as fe}from"./collectionPage.styles-Cbo17VjU.js";import{u as ve,S as W,a as ye,F as je,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-Bwk-Btnk.js";import{L as Se}from"./LoadMore-BgEWB4j8.js";import{u as Pe}from"./useInfiniteGrid-BxsdGvVu.js";import{G as Ae}from"./grid.styles-C7DIeQ4F.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-B-VOk6tY.js";const Me=s.section`
1
+ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a1 as te,D as T,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ap as z,aq as de,bw as pe,bx as xe}from"./index-CgKd8MIG.js";import{E as he}from"./ErrorNotice-CBZMlTMX.js";import{d as me,P as ge,C as ue,a as be,b as fe}from"./collectionPage.styles-E6y_4kdA.js";import{u as ve,S as W,a as ye,F as je,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-CIEcQPqv.js";import{L as Se}from"./LoadMore-yWxoUUNf.js";import{u as Pe}from"./useInfiniteGrid-D9tb6urG.js";import{G as Ae}from"./grid.styles-DpEPS70S.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-ChQLBG5k.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-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,b$ as M,C as Z,w as J,I as D,F as Y,g as W,h as I,f as G,ar as _,a9 as ee,co as q,aq as te}from"./index-DrsPf8lM.js";import{s as ae,i as K,A as H,g as O,r as ne,m as ie,k as oe,l as re}from"./authorizations-5kJTkikm.js";import{i as se}from"./errors-DGBGW8UJ.js";import{E as de}from"./ErrorNotice-C0iIUOEA.js";import{l as ce,m as le,n as pe}from"./buy-CnDiuzF0.js";import{s as he,M as ue,E as xe}from"./sendMetaTransaction-DXB2zppk.js";import{I as ge,C as fe}from"./ethers-BDpbhgX6.js";const P="shop:resume_after_signin",me=900*1e3;function dt(n){try{sessionStorage.setItem(P,JSON.stringify({...n,at:Date.now()}))}catch{}}function ct(n){let a;try{a=sessionStorage.getItem(P)}catch{return null}if(!a)return null;try{sessionStorage.removeItem(P)}catch{}let i;try{i=JSON.parse(a)}catch{return null}return!i||i.type!==n||typeof i.at!="number"||Date.now()-i.at>me?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function be(n,a){return(n+a-1n)/a}function we(n,a,i){return n<=0||a<=0?0n:n>=a?i:be(i*BigInt(n),BigInt(a))}function lt(n){var b,h,y;const a=Number.isFinite(n.priceCents)?Math.max(0,Math.trunc(n.priceCents)):0,i=Number.isFinite(n.balanceCents)?Math.max(0,Math.trunc(n.balanceCents)):0,s=n.priceManaWei>0n?n.priceManaWei:0n,l=n.manaBalanceWei>0n?n.manaBalanceWei:0n;if(a<=0)return{options:[],preferred:null,manaShortfall:null};const d=[];if(i>=a&&d.push({method:"credits",creditsCents:a,manaWei:0n}),s>0n&&i>0&&i<a){const c=a-i,w=we(c,a,s);l>=w&&d.push({method:"combined",creditsCents:i,manaWei:w})}s>0n&&l>=s&&d.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=d.find(c=>c.method==="credits"))==null?void 0:b.method)??((h=d.find(c=>c.method==="combined"))==null?void 0:h.method)??((y=d.find(c=>c.method==="mana"))==null?void 0:y.method)??null,g=!d.some(c=>c.method==="mana"||c.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,a,s),priceCents:a}:null;return{options:d,preferred:p,manaShortfall:g}}function ye(n,a,i){return Number(n*BigInt(a)/i)}function pt(n,a){let i=Number.isFinite(a)?Math.max(0,Math.trunc(a)):0;return n.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,d=Math.min(l,i);return i-=d,d})}function A(n){return Number.isFinite(n)?Math.max(0,n)/10:0}function ht(n,a){return n.options.find(i=>i.method===a)??null}function ut(n,a){if(!Number.isFinite(n)||n<=0||a<=0n)return null;const i=n/10;return Number(a)/1e18/i}const B="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",ve=e.div`
1
+ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,b$ as M,C as Z,w as J,I as D,F as Y,g as W,h as I,f as G,ar as _,a9 as ee,co as q,aq as te}from"./index-CgKd8MIG.js";import{s as ae,i as K,A as H,g as O,r as ne,m as ie,k as oe,l as re}from"./authorizations-DffPbrZU.js";import{i as se}from"./errors-ueM8ONld.js";import{E as de}from"./ErrorNotice-CBZMlTMX.js";import{l as ce,m as le,n as pe}from"./buy-BWhjAqGQ.js";import{s as he,M as ue,E as xe}from"./sendMetaTransaction-CQLcqeK_.js";import{I as ge,C as fe}from"./ethers-BDpbhgX6.js";const P="shop:resume_after_signin",me=900*1e3;function dt(n){try{sessionStorage.setItem(P,JSON.stringify({...n,at:Date.now()}))}catch{}}function ct(n){let a;try{a=sessionStorage.getItem(P)}catch{return null}if(!a)return null;try{sessionStorage.removeItem(P)}catch{}let i;try{i=JSON.parse(a)}catch{return null}return!i||i.type!==n||typeof i.at!="number"||Date.now()-i.at>me?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function be(n,a){return(n+a-1n)/a}function we(n,a,i){return n<=0||a<=0?0n:n>=a?i:be(i*BigInt(n),BigInt(a))}function lt(n){var b,h,y;const a=Number.isFinite(n.priceCents)?Math.max(0,Math.trunc(n.priceCents)):0,i=Number.isFinite(n.balanceCents)?Math.max(0,Math.trunc(n.balanceCents)):0,s=n.priceManaWei>0n?n.priceManaWei:0n,l=n.manaBalanceWei>0n?n.manaBalanceWei:0n;if(a<=0)return{options:[],preferred:null,manaShortfall:null};const d=[];if(i>=a&&d.push({method:"credits",creditsCents:a,manaWei:0n}),s>0n&&i>0&&i<a){const c=a-i,w=we(c,a,s);l>=w&&d.push({method:"combined",creditsCents:i,manaWei:w})}s>0n&&l>=s&&d.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=d.find(c=>c.method==="credits"))==null?void 0:b.method)??((h=d.find(c=>c.method==="combined"))==null?void 0:h.method)??((y=d.find(c=>c.method==="mana"))==null?void 0:y.method)??null,g=!d.some(c=>c.method==="mana"||c.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,a,s),priceCents:a}:null;return{options:d,preferred:p,manaShortfall:g}}function ye(n,a,i){return Number(n*BigInt(a)/i)}function pt(n,a){let i=Number.isFinite(a)?Math.max(0,Math.trunc(a)):0;return n.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,d=Math.min(l,i);return i-=d,d})}function A(n){return Number.isFinite(n)?Math.max(0,n)/10:0}function ht(n,a){return n.options.find(i=>i.method===a)??null}function ut(n,a){if(!Number.isFinite(n)||n<=0||a<=0n)return null;const i=n/10;return Number(a)/1e18/i}const B="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",ve=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function ft({auth:n,signer:a,title:i,reason:s,name:l,image:d,icon:p,onAuthorized:x,onCancel:g,onClose:b}){const[h,y]=v.useState(!1),[c,w]=v.useState(null);async function k(){y(!0),w(null);try{await ae({auth:n,signer:a,active:!0}),x()}catch(u){se(u)?w(m("authorizeStep.errorRejected")):(Y(u,{flow:"authorize_step",kind:n.kind}),w(m("authorizeStep.errorGeneric"))),y(!1)}}return t.jsx(ze,{onClick:h?void 0:b,role:"presentation",children:t.jsxs($e,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Te,{children:i}),t.jsx(Be,{onClick:b,disabled:h,"aria-label":m("authorizeStep.close"),children:t.jsx(D,{name:"close",className:"ico"})})]}),t.jsxs(Ee,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:d?t.jsx("img",{src:d,alt:""}):p}),t.jsxs(Ie,{children:[t.jsx(Pe,{title:l,children:l}),t.jsx(Se,{children:s})]})]}),t.jsx(Ve,{children:m("authorizeStep.note")}),t.jsx(de,{message:c}),t.jsxs(Fe,{children:[t.jsx(Le,{type:"button",onClick:g,disabled:h,children:m("authorizeStep.cancel")}),t.jsx(qe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void k(),disabled:h,children:h?t.jsxs(t.Fragment,{children:[t.jsx(Oe,{"aria-hidden":!0}),m("authorizeStep.authorizing")]}):m("authorizeStep.authorize")})]})]})})}const mt="data:image/webp;base64,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",bt="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/buy-error-22UunaPC.png";async function wt(n){const[a]=await Re({...n,trades:[n.trade]});return a}async function Re(n){const{trades:a,buyer:i,signer:s,onSigned:l}=n;if(a.length===0)throw new Error("No items to buy");const d=new Map;for(const x of a){const g=`${x.chainId}:${x.contract.toLowerCase()}`,b=d.get(g);b?b.push(x):d.set(g,[x])}const p=[];for(const x of d.values())p.push(await Xe({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Xe(n){const{trades:a,buyer:i,signer:s,onSigned:l}=n,d=a[0],p=W(G(d.contract),d.chainId),x=W(I.MANAToken,d.chainId);await K({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:d.chainId},signer:s});const g=a.map(c=>le(c,i));if(O.enabled)try{const c=new ge(p.abi).encodeFunctionData("accept",[g]),w=ne(),k=ie(s.provider,w),u=await he(k,w,c,p,{serverURL:O.relayerUrl});return l==null||l(),await oe(u,"the MANA purchase"),u}catch(c){if(c instanceof ue&&c.code===xe.USER_DENIED||c instanceof re)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await _(s.provider,d.chainId);const h=await new fe(p.address,p.abi,s).accept(g,pe(d.chainId));return l==null||l(),(await h.wait()).transactionHash}async function yt(n){const{trade:a,buyer:i,signer:s,credits:l,manaGapWei:d,onBroadcast:p,onReverted:x}=n;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(d<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const g=W(I.MANAToken,a.chainId),b=W(I.CreditsManager,a.chainId);await K({auth:{kind:H.Allowance,contractAddress:g.address,spenderAddress:b.address,chainId:a.chainId},signer:s});const y=(l.reduce((c,w)=>c+BigInt(w.availableAmount),0n)+d).toString();return ce({trade:a,buyer:i,signer:s,credits:l,maxCreditedValue:y,onBroadcast:p,onReverted:x})}function vt(n){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...n,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function kt(n){return t.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...n,children:t.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:o,gradients:S,radius:U,z:De}=r,jt=e.div`
292
+ `;function ft({auth:n,signer:a,title:i,reason:s,name:l,image:d,icon:p,onAuthorized:x,onCancel:g,onClose:b}){const[h,y]=v.useState(!1),[c,w]=v.useState(null);async function k(){y(!0),w(null);try{await ae({auth:n,signer:a,active:!0}),x()}catch(u){se(u)?w(m("authorizeStep.errorRejected")):(Y(u,{flow:"authorize_step",kind:n.kind}),w(m("authorizeStep.errorGeneric"))),y(!1)}}return t.jsx(ze,{onClick:h?void 0:b,role:"presentation",children:t.jsxs($e,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Te,{children:i}),t.jsx(Be,{onClick:b,disabled:h,"aria-label":m("authorizeStep.close"),children:t.jsx(D,{name:"close",className:"ico"})})]}),t.jsxs(Ee,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:d?t.jsx("img",{src:d,alt:""}):p}),t.jsxs(Ie,{children:[t.jsx(Pe,{title:l,children:l}),t.jsx(Se,{children:s})]})]}),t.jsx(Ve,{children:m("authorizeStep.note")}),t.jsx(de,{message:c}),t.jsxs(Fe,{children:[t.jsx(Le,{type:"button",onClick:g,disabled:h,children:m("authorizeStep.cancel")}),t.jsx(qe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void k(),disabled:h,children:h?t.jsxs(t.Fragment,{children:[t.jsx(Oe,{"aria-hidden":!0}),m("authorizeStep.authorizing")]}):m("authorizeStep.authorize")})]})]})})}const mt="data:image/webp;base64,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",bt="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/buy-error-22UunaPC.png";async function wt(n){const[a]=await Re({...n,trades:[n.trade]});return a}async function Re(n){const{trades:a,buyer:i,signer:s,onSigned:l}=n;if(a.length===0)throw new Error("No items to buy");const d=new Map;for(const x of a){const g=`${x.chainId}:${x.contract.toLowerCase()}`,b=d.get(g);b?b.push(x):d.set(g,[x])}const p=[];for(const x of d.values())p.push(await Xe({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Xe(n){const{trades:a,buyer:i,signer:s,onSigned:l}=n,d=a[0],p=W(G(d.contract),d.chainId),x=W(I.MANAToken,d.chainId);await K({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:d.chainId},signer:s});const g=a.map(c=>le(c,i));if(O.enabled)try{const c=new ge(p.abi).encodeFunctionData("accept",[g]),w=ne(),k=ie(s.provider,w),u=await he(k,w,c,p,{serverURL:O.relayerUrl});return l==null||l(),await oe(u,"the MANA purchase"),u}catch(c){if(c instanceof ue&&c.code===xe.USER_DENIED||c instanceof re)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await _(s.provider,d.chainId);const h=await new fe(p.address,p.abi,s).accept(g,pe(d.chainId));return l==null||l(),(await h.wait()).transactionHash}async function yt(n){const{trade:a,buyer:i,signer:s,credits:l,manaGapWei:d,onBroadcast:p,onReverted:x}=n;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(d<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const g=W(I.MANAToken,a.chainId),b=W(I.CreditsManager,a.chainId);await K({auth:{kind:H.Allowance,contractAddress:g.address,spenderAddress:b.address,chainId:a.chainId},signer:s});const y=(l.reduce((c,w)=>c+BigInt(w.availableAmount),0n)+d).toString();return ce({trade:a,buyer:i,signer:s,credits:l,maxCreditedValue:y,onBroadcast:p,onReverted:x})}function vt(n){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...n,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function kt(n){return t.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...n,children:t.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:o,gradients:S,radius:U,z:De}=r,jt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${De.overlay};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
2
- import{s as o,_ as a}from"./index-DrsPf8lM.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
2
+ import{s as o,_ as a}from"./index-CgKd8MIG.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
3
3
  position: fixed;
4
4
  inset: 0;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import{b as ce,j as e,L as Me,d as Ie,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Be}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Y,R as Te,F as _e,e as ze}from"./categories-Bwk-Btnk.js";import{t as de,bG as We,P as Z,O as X,s,bH as De,J as Oe,bI as Ke,b as o,bJ as Ge,bK as ee,B as Ue,K as he,a1 as pe,bt as He,o as qe,D as ue,bA as Ve,bu as Je,bv as Qe,I as te,c as Ye,x as Ze,v as Xe,ac as et,an as tt,ao as ot,ap as M,aq as oe,bL as re,bM as rt}from"./index-DrsPf8lM.js";import{T as xe}from"./skeleton.styles-B-VOk6tY.js";import{d as it,P as st,C as at,a as nt,b as lt,c as ct,e as dt}from"./collectionPage.styles-Cbo17VjU.js";import{g as ht,h as pt,i as ut,j as xt,k as mt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as B,p as R,q as jt,r as Ct,s as kt,t as $t}from"./Assets.styles-Cm61Yk9G.js";import{L as ie}from"./LoadMore-BgEWB4j8.js";import{u as se}from"./useInfiniteGrid-BxsdGvVu.js";import{E as T}from"./ErrorNotice-C0iIUOEA.js";import{G as ae}from"./grid.styles-C7DIeQ4F.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-C7ohRZVT.js";function St(r){const{gridLoading:i,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return i?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:me,media:Nt}=de,Et=s.article`
1
+ import{b as ce,j as e,L as Me,d as Ie,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Be}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Y,R as Te,F as _e,e as ze}from"./categories-CIEcQPqv.js";import{t as de,bG as We,P as Z,O as X,s,bH as De,J as Oe,bI as Ke,b as o,bJ as Ge,bK as ee,B as Ue,K as he,a1 as pe,bt as He,o as qe,D as ue,bA as Ve,bu as Je,bv as Qe,I as te,c as Ye,x as Ze,v as Xe,ac as et,an as tt,ao as ot,ap as M,aq as oe,bL as re,bM as rt}from"./index-CgKd8MIG.js";import{T as xe}from"./skeleton.styles-ChQLBG5k.js";import{d as it,P as st,C as at,a as nt,b as lt,c as ct,e as dt}from"./collectionPage.styles-E6y_4kdA.js";import{g as ht,h as pt,i as ut,j as xt,k as mt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as B,p as R,q as jt,r as Ct,s as kt,t as $t}from"./Assets.styles-BzDEqf9t.js";import{L as ie}from"./LoadMore-yWxoUUNf.js";import{u as se}from"./useInfiniteGrid-D9tb6urG.js";import{E as T}from"./ErrorNotice-CBZMlTMX.js";import{G as ae}from"./grid.styles-DpEPS70S.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BrPg6WWE.js";function St(r){const{gridLoading:i,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return i?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:me,media:Nt}=de,Et=s.article`
2
2
  height: 300px;
3
3
  /* No fill of its own (Figma 922:183803): the mosaic covers the top and the footer paints its own
4
4
  translucent black, so the page field is what shows through the corners. */
@@ -1 +1 @@
1
- import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-DrsPf8lM.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-BYHuwl8r.js";import{I as i}from"./index-CgKd8MIG.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 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-CkaGvlNS.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-6NIdKt9N.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-C1sKmSDA.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-CX3BY9Sg.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-DrsPf8lM.js";const m=a.section`
1
+ import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-CgKd8MIG.js";const m=a.section`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 36px;
@@ -1,4 +1,4 @@
1
- import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as B,x as ge,b as n,C as h,o as fe,A as me,Z as g,aF as be,F as U,aP as N,bW as we,ax as Q,z as re,I as ye,bX as H}from"./index-DrsPf8lM.js";import{C as ke}from"./Confetti-DWstoxYf.js";import{F as ve}from"./Faq-CJVPehMK.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as Ce,a as $e,R as je,c as Se,i as Ae,b as Pe}from"./useCreditPacks-tiUs7FLz.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/1.0.2-31094361365.commit-b4e12f4/_assets/credit-coin-CmcTCd5i.webp",Te="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
1
+ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as B,x as ge,b as n,C as h,o as fe,A as me,Z as g,aF as be,F as U,aP as N,bW as we,ax as Q,z as re,I as ye,bX as H}from"./index-CgKd8MIG.js";import{C as ke}from"./Confetti-UARYHnCB.js";import{F as ve}from"./Faq-B-73-LFA.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as Ce,a as $e,R as je,c as Se,i as Ae,b as Pe}from"./useCreditPacks-BI219E4X.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/1.1.0/_assets/credit-coin-CmcTCd5i.webp",Te="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;