@dcl/shop 0.1.0-30533467189.commit-9c5e50b → 0.1.0-30546268577.commit-51c9020

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 (190) hide show
  1. package/assets/{Activity-BeCpEUcx.js → Activity-CjSEeiSV.js} +5 -5
  2. package/assets/{AnimatedBackground-CNBmTudE.js → AnimatedBackground-BTiUO6oZ.js} +1 -1
  3. package/assets/{Assets-Drh794UP.js → Assets-BakwJdNE.js} +10 -10
  4. package/assets/{Assets.styles-Bs38vrbb.js → Assets.styles-DPfy47Yz.js} +1 -1
  5. package/assets/{Authorizations-CXLUdRrt.js → Authorizations-_yZR7wlJ.js} +2 -2
  6. package/assets/Cart-NESueVBd.js +695 -0
  7. package/assets/{CircularProgress-Cj5HjTPO.js → CircularProgress-B838AFJT.js} +5 -5
  8. package/assets/{Collection-CIB8FY5B.js → Collection-BPHP1zi6.js} +1 -1
  9. package/assets/{CollectionCarousel-lV1nhHlw.js → CollectionCarousel-CipJZ4Jp.js} +11 -11
  10. package/assets/{ContentClient-gZyDAKO3.js → ContentClient-CHs-qED4.js} +1 -1
  11. package/assets/{Creator-BWkuY9vG.js → Creator-iyC-uTI8.js} +5 -5
  12. package/assets/{DeploymentBuilder-DufsvYDr.js → DeploymentBuilder-ku3det23.js} +1 -1
  13. package/assets/{ErrorNotice-D1mxPlFl.js → ErrorNotice-BDPNfqx0.js} +1 -1
  14. package/assets/{ExchangeController-Ds17lqFl.js → ExchangeController-CVMU9e-y.js} +1 -1
  15. package/assets/{GetCredits-iWdg6r5p.js → GetCredits-CCPnCpLE.js} +12 -12
  16. package/assets/{HelpersUtil-DUa9W6LU.js → HelpersUtil-CLRWW-JG.js} +1 -1
  17. package/assets/{ImportListings-DTqxR-r8.js → ImportListings-kvaDCP0o.js} +10 -10
  18. package/assets/{ItemDetail-Ds7gpKeP.js → ItemDetail-Bli253Mg.js} +24 -24
  19. package/assets/LoadMore-Bg1WdJa_.js +7 -0
  20. package/assets/{MenuList-DUpgo85O.js → MenuList-DyNPpfN8.js} +1 -1
  21. package/assets/{MyAssets-dO612_rE.js → MyAssets-BQi5bsrn.js} +1 -1
  22. package/assets/{MyFavorites-DqoY6rBc.js → MyFavorites-jnBBqCpp.js} +1 -1
  23. package/assets/{NotFound-D2CFCHDj.js → NotFound-BXC5nxMj.js} +4 -4
  24. package/assets/{NotificationsBell-DzaE8jdt.js → NotificationsBell-HKxgY3NU.js} +1 -1
  25. package/assets/{StoreSettings-C5TOIYXn.js → StoreSettings-DF4mEasf.js} +5 -5
  26. package/assets/{Success-BwnY9KEQ.js → Success-B-8PxhyV.js} +7 -7
  27. package/assets/{SwapController-BdsPfurP.js → SwapController-DdH70j30.js} +1 -1
  28. package/assets/{Tooltip-Br2xIJNX.js → Tooltip-Nt-DyBD0.js} +1 -1
  29. package/assets/{TradeService-D9oY18xN.js → TradeService-CL3q5o0U.js} +1 -1
  30. package/assets/{W3MFrameProviderSingleton-C2UxaXWl.js → W3MFrameProviderSingleton-Bum-DrEQ.js} +3 -3
  31. package/assets/{WebCryptoP256-BVwoCVpw.js → WebCryptoP256-CyVP2wWt.js} +1 -1
  32. package/assets/{authorizations-BSrgiqQQ.js → authorizations-CRss4Km2.js} +1 -1
  33. package/assets/{basic-B_C7mAl9.js → basic-DHCLMBzG.js} +1 -1
  34. package/assets/{biconomy-C_XvaCiN.js → biconomy-D3-_U8ud.js} +1 -1
  35. package/assets/{browseLayout.styles-CwvQOYmi.js → browseLayout.styles-B9TM0sjQ.js} +12 -12
  36. package/assets/{builder-43MkjBkG.js → builder-B_9KaS-W.js} +1 -1
  37. package/assets/{buy-NnyfA38F.js → buy-CQDvi-Z2.js} +1 -1
  38. package/assets/{buy-gasless-DScVbMRZ.js → buy-gasless-D0882Rr8.js} +1 -1
  39. package/assets/{categories-DEfi9CfU.js → categories-B6c_VHlD.js} +3 -3
  40. package/assets/{ccip-IP7G9cbg.js → ccip-W9GWssu_.js} +1 -1
  41. package/assets/{ccip-CrecNrnD.js → ccip-tmXFoKyG.js} +1 -1
  42. package/assets/{clsx-BdbYsiyl.js → clsx-DvvcJE_g.js} +2 -2
  43. package/assets/{controller-cbUcBUrH.js → controller-DIzv_zYO.js} +2 -2
  44. package/assets/{core-bHMQ1_Mr.js → core-D28BQIc2.js} +4 -4
  45. package/assets/{createSvgIcon-BESAkrOU.js → createSvgIcon-CWSm-SRl.js} +3 -3
  46. package/assets/{custom-BiLTt2sa.js → custom-DZpHgkVB.js} +1 -1
  47. package/assets/{data-capture-BUUOHCKU.js → data-capture-pK_Tv-hz.js} +1 -1
  48. package/assets/{email-BC9OAJXc.js → email-CtVQSJFe.js} +1 -1
  49. package/assets/{embedded-wallet-CjyStHIw.js → embedded-wallet-ZDQSZ5fJ.js} +1 -1
  50. package/assets/{emotion-styled.browser.esm-C55xmzJL.js → emotion-styled.browser.esm-ObtTAShi.js} +1 -1
  51. package/assets/{engine-DyObRAzu.js → engine-CZ-Hi_lm.js} +1 -1
  52. package/assets/{errors-BjCeABAr.js → errors-Bq2Mu6G5.js} +1 -1
  53. package/assets/{estimate-l1-fee-D0RkmwMW.js → estimate-l1-fee-nbXW8n0n.js} +1 -1
  54. package/assets/{ethers-CpLYx0ea.js → ethers-CXBJm_wN.js} +1 -1
  55. package/assets/{execute-Wy24SrPH.js → execute-Dn81thV4.js} +2 -2
  56. package/assets/{features-_ZfA9H45.js → features-Cd8utqE-.js} +1 -1
  57. package/assets/{fetchTokenMetadata-g0Cwcuk5.js → fetchTokenMetadata-C6h4HQcG.js} +2 -2
  58. package/assets/{get-ecosystem-wallet-info-CaQJBLQt.js → get-ecosystem-wallet-info-BJFL8Ls9.js} +1 -1
  59. package/assets/{getBalance-BchSsnuR.js → getBalance--wLYv_Wi.js} +1 -1
  60. package/assets/{getNFT-C7zYsElU.js → getNFT-DuSw54F-.js} +1 -1
  61. package/assets/{getNFT-B6N9a0WP.js → getNFT-a1Nf-Yxw.js} +1 -1
  62. package/assets/{getThemeProps-4SvFOZFg.js → getThemeProps-ClN2Fv_K.js} +1 -1
  63. package/assets/{grid.styles-D_Jbs44i.js → grid.styles-DxJ1n2rK.js} +1 -1
  64. package/assets/{hashTypedData-Dz90TJo5.js → hashTypedData-BtiwfEFc.js} +1 -1
  65. package/assets/{hashTypedData-BZL8Z-wh.js → hashTypedData-D_etcs5u.js} +1 -1
  66. package/assets/{import-jtw911qv.js → import-CYD98Dph.js} +1 -1
  67. package/assets/{in-app-akb4hnYm.js → in-app-3OV_nmgG.js} +1 -1
  68. package/assets/{in-app-wallet-calls-gVWhlVjS.js → in-app-wallet-calls-VcctZRek.js} +1 -1
  69. package/assets/{index-DZtBOyk9.js → index-9ijpZr49.js} +1 -1
  70. package/assets/{index-kdSvdaR1.js → index-9rhkaWrx.js} +1 -1
  71. package/assets/{index-BuXqiOY4.js → index-B5xVJZSj.js} +1 -1
  72. package/assets/{index-BmzNos4-.js → index-B6-ez4HU.js} +3 -3
  73. package/assets/{index-Blsedj7w.js → index-B8KoR7hy.js} +1 -1
  74. package/assets/{index-B0b7Et6O.js → index-B9JrHlPn.js} +1 -1
  75. package/assets/{index-CcTRO2aV.js → index-BAeAH5ly.js} +1 -1
  76. package/assets/{index-YUVIXaKh.css → index-BMzstP-8.css} +1 -1
  77. package/assets/{index-D6yMQf8Y.js → index-BQr6Gfsp.js} +1 -1
  78. package/assets/{index-B3JmhrNg.js → index-BWmQWw6Q.js} +1 -1
  79. package/assets/{index-BmpyBGMP.js → index-BWzFwNSL.js} +1 -1
  80. package/assets/{index-DEpnF9Wi.js → index-BXrG6gz_.js} +1 -1
  81. package/assets/{index-BHHPSewi.js → index-B_LIxJKB.js} +1 -1
  82. package/assets/{index-Dp35ZriU.js → index-BbB-EGIL.js} +2 -2
  83. package/assets/{index-BC_1S9p4.js → index-Bc6CsYH5.js} +1 -1
  84. package/assets/{index-BmfZCMnr.js → index-Big9wV9m.js} +1 -1
  85. package/assets/{index-B7ResnK5.js → index-BzC7P3rh.js} +1 -1
  86. package/assets/{index-B_4siyWV.js → index-Bzfa0XEQ.js} +1 -1
  87. package/assets/{index-qUvGBGNH.js → index-C1A_3mRS.js} +1 -1
  88. package/assets/{index-BXwwaP-V.js → index-C2ozFumj.js} +1 -1
  89. package/assets/{index-BOFKzXjc.js → index-C4pQJ4un.js} +1 -1
  90. package/assets/{index-cbzE2y4I.js → index-C5WX4daB.js} +1 -1
  91. package/assets/{index-CK7WvZif.js → index-CEP90DOS.js} +1 -1
  92. package/assets/{index-AinO5jlX.js → index-CFKKYXej.js} +1 -1
  93. package/assets/{index-_u92gDCj.js → index-CHPRaB-Z.js} +1 -1
  94. package/assets/{index-CdObRSWE.js → index-CKfkRfuc.js} +1 -1
  95. package/assets/{index-Bavc2hNt.js → index-CQK1zDT_.js} +1 -1
  96. package/assets/{index-CPEmrUBm.js → index-CVlJa6t_.js} +3 -3
  97. package/assets/{index-C5HC_oCV.js → index-C_jjojzc.js} +1 -1
  98. package/assets/{index-BgErFyDC.js → index-ChIdc3F1.js} +1 -1
  99. package/assets/{index-B-Kqr2Lr.js → index-Cw22meEP.js} +1 -1
  100. package/assets/{index-Dt6E6M6p.js → index-CwxgWYVj.js} +1 -1
  101. package/assets/{index-CdT0g-0m.js → index-D2jvGNN0.js} +2 -2
  102. package/assets/{index-CmZ_zCk6.js → index-D2kMWo74.js} +1 -1
  103. package/assets/{index-ldILnJ5u.js → index-D3byoEP7.js} +1 -1
  104. package/assets/{index-CU_QDgpy.js → index-D4TqGnX3.js} +3 -3
  105. package/assets/{index-B1omY0iS.js → index-D5SkK98O.js} +2 -2
  106. package/assets/{index-D0y9dFEX.js → index-D7eID9fV.js} +1 -1
  107. package/assets/{index-B8Bu2_L_.js → index-DFxWOBf7.js} +1 -1
  108. package/assets/{index-BJQJ6qaf.js → index-DFzHpbP5.js} +1 -1
  109. package/assets/{index-DlkFYSp0.js → index-DQ2tXB-9.js} +1 -1
  110. package/assets/{index-B0pnNsxo.js → index-D_Cr3ySt.js} +1 -1
  111. package/assets/{index-DutOGRmD.js → index-DgKHc2Pp.js} +1 -1
  112. package/assets/{index-DMamev_S.js → index-DifXdg7h.js} +1 -1
  113. package/assets/{index-CzYciFoQ.js → index-DkEIacBh.js} +1 -1
  114. package/assets/{index-DPLedEOx.js → index-DrNdDAUt.js} +1 -1
  115. package/assets/{index-BFopPvwi.js → index-Dw57E0gA.js} +1 -1
  116. package/assets/{index-D-yWtbt-.js → index-EP1NKxUH.js} +1 -1
  117. package/assets/{index-BFWrtVCG.js → index-Fc-0pErb.js} +2 -2
  118. package/assets/{index-B-HKGF9V.js → index-LUHXTqk6.js} +1 -1
  119. package/assets/index-Wf8RWpZ6.js +2815 -0
  120. package/assets/{index-CN9i-xys.js → index-ZpNI2gFx.js} +1 -1
  121. package/assets/{index-DRbSD9RK.js → index-b_M0YiWv.js} +1 -1
  122. package/assets/{index-gk5_iRhU.js → index-iWo5bwxy.js} +2 -2
  123. package/assets/{index-8Xp2N2qi.js → index-o9-JIK9h.js} +1 -1
  124. package/assets/{index-BSqWvbLc.js → index-pRcoDIl4.js} +1 -1
  125. package/assets/{index-WLKSffU2.js → index-qo50HoTd.js} +1 -1
  126. package/assets/{index-rVbEY7Ss.js → index-uVZf2hjB.js} +1 -1
  127. package/assets/{index.es-D3pQLfWc.js → index.es-C7AM-hAJ.js} +1 -1
  128. package/assets/{index.es-BoeBl1Ce.js → index.es-DeL8MDY5.js} +1 -1
  129. package/assets/{index.es-D8ikd0EN.js → index.es-Dm_DN_o8.js} +4 -4
  130. package/assets/{localBatchGatewayRequest-B6O8A-Fd.js → localBatchGatewayRequest-D_Kxo5IY.js} +1 -1
  131. package/assets/{mana-convert-GIWR9f74.js → mana-convert-CTsR_3Ej.js} +1 -1
  132. package/assets/{mana-rate-C2oyZxQp.js → mana-rate-C115gAGh.js} +1 -1
  133. package/assets/{networks-CeSVlBGL.js → networks-_4OAhcxm.js} +1 -1
  134. package/assets/{onramp-Dinzhb7k.js → onramp-CSUyuOLB.js} +1 -1
  135. package/assets/{openzeppelin-T7U-Yfrm.js → openzeppelin-CRfl-P-Y.js} +1 -1
  136. package/assets/{parseNft-CRc3kz2s.js → parseNft-NH_oxr1p.js} +2 -2
  137. package/assets/{parseSignature-EJFTHTqk.js → parseSignature-BKPTd0Wp.js} +1 -1
  138. package/assets/{parseSignature-Dy8dB5gM.js → parseSignature-Dv5iREVh.js} +3 -3
  139. package/assets/{passkeys-CiWO3ZPW.js → passkeys-BOKQqJLG.js} +1 -1
  140. package/assets/{pay-with-exchange-DtT_33kS.js → pay-with-exchange-Dqf9Unk5.js} +1 -1
  141. package/assets/{qr-overlay-BQQepWTP.js → qr-overlay-BBzE6d4w.js} +1 -1
  142. package/assets/{receive-BVLhEkJB.js → receive-DTcWvXo9.js} +1 -1
  143. package/assets/{resolveImplementation-BzA6DVk0.js → resolveImplementation-B4run9SA.js} +1 -1
  144. package/assets/{rpc-CpJFu_5Q.js → rpc-BkTOb0Ae.js} +1 -1
  145. package/assets/{secp256k1-BOve6dCK.js → secp256k1-BKV5oKjd.js} +1 -1
  146. package/assets/{secp256k1-KszxdVzW.js → secp256k1-D40VegOp.js} +1 -1
  147. package/assets/{secp256k1-CK6dHLcj.js → secp256k1-sDtHKyKa.js} +1 -1
  148. package/assets/{send-batch-transaction-dKBIr3el.js → send-batch-transaction-D3IxN4nk.js} +1 -1
  149. package/assets/{send-eip712-transaction-5etOij5y.js → send-eip712-transaction-Ceey9vq_.js} +2 -2
  150. package/assets/{send-gasless-transaction-BT6nlitQ.js → send-gasless-transaction-BksJzQiD.js} +2 -2
  151. package/assets/{send-Cc9g-Ybx.js → send-oN3YL-hJ.js} +1 -1
  152. package/assets/{send-transaction-DvPvL5r6.js → send-transaction-B73fhwe5.js} +2 -2
  153. package/assets/{sendMetaTransaction-BqDdrDif.js → sendMetaTransaction-BqrdflYy.js} +1 -1
  154. package/assets/{sendRawTransaction-CjlOlVJY.js → sendRawTransaction-CGYbLnZb.js} +3 -3
  155. package/assets/{serializeTransaction-DbsZlK6y.js → serializeTransaction-D5Cac03m.js} +1 -1
  156. package/assets/{session-proposal-Bmy5e1Ut.js → session-proposal-CVgUeAZW.js} +1 -1
  157. package/assets/{session-request-DGb_HmsP.js → session-request-Di3dSSrI.js} +2 -2
  158. package/assets/{signing-DFZMg2_O.js → signing-Bdc9gWZa.js} +3 -3
  159. package/assets/{socials-D4orUUKf.js → socials-CmTeJTYn.js} +1 -1
  160. package/assets/{swaps-Dysv__uX.js → swaps-Wtea2NAu.js} +1 -1
  161. package/assets/{thirdweb-BZDXsHNh.js → thirdweb-CERMcOXb.js} +3 -3
  162. package/assets/{to-serializable-transaction-D14tRtKW.js → to-serializable-transaction-DdX40tW9.js} +2 -2
  163. package/assets/trade-encoding-BoHXvOIc.js +1 -0
  164. package/assets/{transactionReceipt-DG4QOjyW.js → transactionReceipt-ibp-LAsQ.js} +1 -1
  165. package/assets/{transactions-DQVhdHWX.js → transactions-CIBv0IDn.js} +1 -1
  166. package/assets/useCreditPacks-Erm2XH9O.js +1 -0
  167. package/assets/{useInfiniteGrid-2YbkQqBo.js → useInfiniteGrid-D2N-648g.js} +1 -1
  168. package/assets/useManaRate-DAS3C4zo.js +1 -0
  169. package/assets/useSecondarySales-i_ahcBp1.js +1 -0
  170. package/assets/{useStore-BI6nsJYk.js → useStore-qQrt-8mX.js} +2 -2
  171. package/assets/useTheme-DbdTKy8O.js +1 -0
  172. package/assets/{verifyHash-KpVQz-WT.js → verifyHash-SsYbACTo.js} +1 -1
  173. package/assets/{w3m-modal-BlFD9ACf.js → w3m-modal-C6arh-dP.js} +1 -1
  174. package/assets/{w3m-modal-DKW5EcgC.js → w3m-modal-U9w4vwW2.js} +1 -1
  175. package/assets/{wait-for-tx-receipt-FGVrufro.js → wait-for-tx-receipt-BeQkCkwD.js} +1 -1
  176. package/assets/{wallets-BktQ5PcV.js → wallets-CkbfkMFt.js} +5 -5
  177. package/assets/{web-connector-B52Gg4wJ.js → web-connector-mK5WyzBm.js} +3 -3
  178. package/assets/{writeContract-DcUDUFj3.js → writeContract-CzlvCXqK.js} +1 -1
  179. package/assets/{zoraTestnet-BlRojFQQ.js → zoraTestnet-uirxtXVm.js} +1 -1
  180. package/index.html +11 -11
  181. package/package.json +2 -2
  182. package/assets/Cart-GkgVaKgN.js +0 -676
  183. package/assets/LoadMore-Bq-1Q2-v.js +0 -7
  184. package/assets/index-9fSuc05f.js +0 -2759
  185. package/assets/loader-logo-BzY9EKdC.js +0 -1
  186. package/assets/trade-encoding-BMjkJRi4.js +0 -1
  187. package/assets/useCreditPacks-DCVckaXX.js +0 -1
  188. package/assets/useManaRate-Bjg8HpCC.js +0 -1
  189. package/assets/useSecondarySales-DYck7_BT.js +0 -1
  190. package/assets/useTheme-BcT4IMUV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s as l,t as o,w as ut,B as ht,l as xt,d,m as pt,u as j,I as g,aF as G,aG as R,aH as mt,y as v,aI as gt,al as E,z as Q,H as ft,aJ as yt,aK as X}from"./index-9fSuc05f.js";import{m as bt}from"./mana-convert-GIWR9f74.js";import{u as jt}from"./useManaRate-Bjg8HpCC.js";import{L as vt}from"./LoadMore-Bq-1Q2-v.js";import{u as f}from"./useInfiniteGrid-2YbkQqBo.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";import"./mana-rate-C2oyZxQp.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=J(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Et(t,i,s=Date.now()){const a=i.txHash?t.get(J(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Tt(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Tt(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/credits-product-vs4Q6u6l.svg",T=ut`
1
+ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aH as lt,s as l,t as o,x as ut,B as ht,m as xt,e as d,n as pt,u as j,I as g,aI as R,aJ as G,aK as mt,z as v,aL as gt,ao as T,D as J,J as ft,aM as yt,aN as Q}from"./index-Wf8RWpZ6.js";import{m as bt}from"./mana-convert-CTsR_3Ej.js";import{u as jt}from"./useManaRate-DAS3C4zo.js";import{L as vt}from"./LoadMore-Bg1WdJa_.js";import{u as f}from"./useInfiniteGrid-D2N-648g.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-rate-C115gAGh.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const X=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=X(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Tt(t,i,s=Date.now()){const a=i.txHash?t.get(X(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Et(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Et(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/credits-product-vs4Q6u6l.svg",E=ut`
2
2
  0% { background-position: 200% 0; }
3
3
  100% { background-position: -200% 0; }
4
4
  `,Ft=l.section`
@@ -220,7 +220,7 @@ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s
220
220
  border-radius: 10px;
221
221
  background: linear-gradient(100deg, ${o.colors.media} 30%, ${o.colors.panel} 50%, ${o.colors.media} 70%);
222
222
  background-size: 200% 100%;
223
- animation: ${T} 1.3s infinite linear;
223
+ animation: ${E} 1.3s infinite linear;
224
224
 
225
225
  @media (prefers-reduced-motion: reduce) {
226
226
  animation: none;
@@ -243,7 +243,7 @@ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s
243
243
  border-radius: 6px;
244
244
  background: linear-gradient(100deg, ${o.colors.media} 30%, ${o.colors.panel} 50%, ${o.colors.media} 70%);
245
245
  background-size: 200% 100%;
246
- animation: ${T} 1.3s infinite linear;
246
+ animation: ${E} 1.3s infinite linear;
247
247
 
248
248
  @media (prefers-reduced-motion: reduce) {
249
249
  animation: none;
@@ -269,7 +269,7 @@ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s
269
269
  border: 1px solid transparent;
270
270
  background: linear-gradient(100deg, ${o.colors.media} 30%, ${o.colors.panel} 50%, ${o.colors.media} 70%);
271
271
  background-size: 200% 100%;
272
- animation: ${T} 1.3s infinite linear;
272
+ animation: ${E} 1.3s infinite linear;
273
273
 
274
274
  @media (prefers-reduced-motion: reduce) {
275
275
  animation: none;
@@ -288,4 +288,4 @@ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s
288
288
  margin: 6px 0 0;
289
289
  `,Bt=l(ht)`
290
290
  margin-top: 12px;
291
- `,q=N.withComponent(_),y=24,Gt=["all","purchases","sales"];function m(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function tt(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function et(t){const i=Number(t)/1e18;return Number.isFinite(i)?i.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const i=b.useRef(null),[s,a]=b.useState(null),n=()=>{var h;const c=(h=i.current)==null?void 0:h.getBoundingClientRect();c&&a({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(qt,{ref:i,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>a(null),onFocus:n,onBlur:()=>a(null),children:[t,s?dt.createPortal(e.jsx(Ot,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Rt({item:t}){const{data:i,isLoading:s}=j({queryKey:["trade-display",t.tradeId],queryFn:()=>yt(t.tradeId),enabled:!!t.tradeId,staleTime:3e5}),a=!!t.tradeId&&s,n=(i==null?void 0:i.name)??d("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",h=E({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"cart",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),t.quantity>1?e.jsx(z,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Wt,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]});return h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})}function Kt({order:t}){const i=At(t.lines),s=i.reduce((a,n)=>a+n.quantity,0);return e.jsxs(k,{"data-testid":"purchase-order",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(p,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(C,{children:i.map(a=>e.jsx(Rt,{item:a},a.key))})]})}function Ut({sale:t}){const{data:i,isLoading:s}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>X(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(i==null?void 0:i.name)??d("activity.itemFallback"),n=(i==null?void 0:i.thumbnail)??"",c=E({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(S,{}):e.jsx(F,{children:n?e.jsx("img",{src:n,alt:a}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[s?e.jsx(H,{}):e.jsx(D,{title:a,children:a}),e.jsx(z,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(k,{"data-testid":"activity-mana-purchase",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.paidWithMana")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(p,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:Q,alt:"MANA"})})]})]})]}),e.jsx(C,{children:c?e.jsx(q,{to:c,"data-link":"true",children:h}):e.jsx(N,{children:h})})]})}function _t({sale:t,payout:i}){const{data:s,isLoading:a}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>X(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??d("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",h=E({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),e.jsxs(z,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),i.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:m(i.availableAt)})}`:""]})]})]});return e.jsxs(k,{"data-testid":"activity-sale",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.saleLabel")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":i.kind==="pending"?"PENDING":"SOLD",children:i.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),i.kind==="direct"?e.jsxs(p,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:Q,alt:"MANA"})})]}):i.credits!==null?e.jsxs(p,{"data-kind":"income",children:[e.jsx(v,{className:"ccy-mark"})," +",ft(i.credits)]}):e.jsx(p,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(C,{children:h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})})]})}function Qt({order:t}){const i=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),a=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(k,{"data-testid":"credit-order",children:e.jsxs(w,{children:[e.jsx(zt,{children:e.jsx("img",{src:Ct,alt:"","aria-hidden":!0})}),e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:i})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":s,children:a}),e.jsxs(p,{"data-kind":"income",children:["+",e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Xt({filter:t}){const i={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[t];return e.jsxs(V,{children:[e.jsx(g,{name:i.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:i.title}),e.jsx("p",{className:"muted",children:i.body}),t!=="sales"?e.jsx(Bt,{as:_,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function oe(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=pt(),[i,s]=b.useState("all"),a=!!t&&i!=="sales",n=!!t&&i!=="purchases",c=f(["purchases",t==null?void 0:t.address],u=>mt(t.address,t.identity,{first:y,skip:u}),{enabled:a}),h=f(["sales",t==null?void 0:t.address],u=>G(t.address,{role:"seller",first:y,skip:u}),{enabled:n}),r=f(["credit-orders",t==null?void 0:t.address],u=>R(t.address,t.identity,{first:y,skip:u}),{enabled:a}),x=f(["mana-purchases",t==null?void 0:t.address],u=>G(t.address,{role:"buyer",first:y,skip:u}),{enabled:a}),{data:O}=j({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>R(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:n,staleTime:6e4}),at=b.useMemo(()=>Nt(O),[O]),{data:nt}=jt(n);if(!t)return e.jsxs(V,{children:[e.jsx(g,{name:"clock",size:40,color:o.colors.muted2}),e.jsx(Y,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const W=Lt(Pt({purchases:a?c.items:[],sales:n?h.items:[],creditOrders:a?r.items:[],manaPurchases:a?x.items:[],rate:nt}),i),st=a&&(c.isLoading||r.isLoading||x.isLoading)||n&&h.isLoading,B=a&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||n&&h.isFetchingNextPage,rt=a&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||n&&h.hasNextPage;function ot(){a&&c.hasNextPage&&c.fetchNextPage(),a&&r.hasNextPage&&r.fetchNextPage(),a&&x.hasNextPage&&x.fetchNextPage(),n&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(Ft,{children:[e.jsx(St,{children:e.jsx(Mt,{children:d("nav.activity")})}),e.jsx(Dt,{role:"tablist","aria-label":d("nav.activity"),children:Gt.map(u=>e.jsx(Ht,{type:"button",role:"tab","aria-selected":i===u,"data-active":i===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),st?e.jsx(K,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):W.length===0?e.jsx(Xt,{filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(K,{children:[W.map(u=>u.kind==="purchase"?e.jsx(Kt,{order:u.order},u.id):u.kind==="credit"?e.jsx(Qt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(_t,{sale:u.sale,payout:Et(at,u.sale)},u.id)),B?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:B,onLoadMore:ot})]})]})}export{oe as Activity};
291
+ `,q=N.withComponent(_),y=24,Rt=["all","purchases","sales"];function m(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function tt(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function et(t){const i=Number(t)/1e18;return Number.isFinite(i)?i.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const i=b.useRef(null),[s,a]=b.useState(null),n=()=>{var h;const c=(h=i.current)==null?void 0:h.getBoundingClientRect();c&&a({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(qt,{ref:i,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>a(null),onFocus:n,onBlur:()=>a(null),children:[t,s?dt.createPortal(e.jsx(Ot,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Gt({item:t}){const{data:i,isLoading:s}=j({queryKey:["trade-display",t.tradeId],queryFn:()=>yt(t.tradeId),enabled:!!t.tradeId,staleTime:3e5}),a=!!t.tradeId&&s,n=(i==null?void 0:i.name)??d("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",h=T({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"cart",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),t.quantity>1?e.jsx(z,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Wt,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]});return h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})}function Kt({order:t}){const i=At(t.lines),s=i.reduce((a,n)=>a+n.quantity,0);return e.jsxs(k,{"data-testid":"purchase-order",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(p,{children:[e.jsx(v,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(C,{children:i.map(a=>e.jsx(Gt,{item:a},a.key))})]})}function Ut({sale:t}){const{data:i,isLoading:s}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>Q(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(i==null?void 0:i.name)??d("activity.itemFallback"),n=(i==null?void 0:i.thumbnail)??"",c=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(S,{}):e.jsx(F,{children:n?e.jsx("img",{src:n,alt:a}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[s?e.jsx(H,{}):e.jsx(D,{title:a,children:a}),e.jsx(z,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(k,{"data-testid":"activity-mana-purchase",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.paidWithMana")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(p,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:J,alt:"MANA"})})]})]})]}),e.jsx(C,{children:c?e.jsx(q,{to:c,"data-link":"true",children:h}):e.jsx(N,{children:h})})]})}function _t({sale:t,payout:i}){const{data:s,isLoading:a}=j({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>Q(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??d("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",h=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,r=e.jsxs(e.Fragment,{children:[a?e.jsx(S,{}):e.jsx(F,{children:c?e.jsx("img",{src:c,alt:n}):e.jsx(g,{name:"offer",size:20})}),e.jsxs(M,{children:[a?e.jsx(H,{}):e.jsx(D,{title:n,children:n}),e.jsxs(z,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),i.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:m(i.availableAt)})}`:""]})]})]});return e.jsxs(k,{"data-testid":"activity-sale",children:[e.jsxs(w,{children:[e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsx($,{children:d("activity.saleLabel")})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":i.kind==="pending"?"PENDING":"SOLD",children:i.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),i.kind==="direct"?e.jsxs(p,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(Z,{src:J,alt:"MANA"})})]}):i.credits!==null?e.jsxs(p,{"data-kind":"income",children:[e.jsx(v,{className:"ccy-mark"})," +",ft(i.credits)]}):e.jsx(p,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(C,{children:h?e.jsx(q,{to:h,"data-link":"true",children:r}):e.jsx(N,{children:r})})]})}function Jt({order:t}){const i=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),a=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(k,{"data-testid":"credit-order",children:e.jsxs(w,{children:[e.jsx(zt,{children:e.jsx("img",{src:Ct,alt:"","aria-hidden":!0})}),e.jsxs(I,{children:[e.jsx(A,{children:m(t.createdAt)}),e.jsxs($,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:i})]})]}),e.jsxs(P,{children:[e.jsx(L,{"data-status":s,children:a}),e.jsxs(p,{"data-kind":"income",children:["+",e.jsx(v,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Qt({filter:t}){const i={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[t];return e.jsxs(V,{children:[e.jsx(g,{name:i.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:i.title}),e.jsx("p",{className:"muted",children:i.body}),t!=="sales"?e.jsx(Bt,{as:_,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function oe(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=pt(),[i,s]=b.useState("all"),a=!!t&&i!=="sales",n=!!t&&i!=="purchases",c=f(["purchases",t==null?void 0:t.address],u=>mt(t.address,t.identity,{first:y,skip:u}),{enabled:a}),h=f(["sales",t==null?void 0:t.address],u=>R(t.address,{role:"seller",first:y,skip:u}),{enabled:n}),r=f(["credit-orders",t==null?void 0:t.address],u=>G(t.address,t.identity,{first:y,skip:u}),{enabled:a}),x=f(["mana-purchases",t==null?void 0:t.address],u=>R(t.address,{role:"buyer",first:y,skip:u}),{enabled:a}),{data:O}=j({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>G(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:n,staleTime:6e4}),at=b.useMemo(()=>Nt(O),[O]),{data:nt}=jt(n);if(!t)return e.jsxs(V,{children:[e.jsx(g,{name:"clock",size:40,color:o.colors.muted2}),e.jsx(Y,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const W=Lt(Pt({purchases:a?c.items:[],sales:n?h.items:[],creditOrders:a?r.items:[],manaPurchases:a?x.items:[],rate:nt}),i),st=a&&(c.isLoading||r.isLoading||x.isLoading)||n&&h.isLoading,B=a&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||n&&h.isFetchingNextPage,rt=a&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||n&&h.hasNextPage;function ot(){a&&c.hasNextPage&&c.fetchNextPage(),a&&r.hasNextPage&&r.fetchNextPage(),a&&x.hasNextPage&&x.fetchNextPage(),n&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(Ft,{children:[e.jsx(St,{children:e.jsx(Mt,{children:d("nav.activity")})}),e.jsx(Dt,{role:"tablist","aria-label":d("nav.activity"),children:Rt.map(u=>e.jsx(Ht,{type:"button",role:"tab","aria-selected":i===u,"data-active":i===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),st?e.jsx(K,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):W.length===0?e.jsx(Qt,{filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(K,{children:[W.map(u=>u.kind==="purchase"?e.jsx(Kt,{order:u.order},u.id):u.kind==="credit"?e.jsx(Jt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(_t,{sale:u.sale,payout:Tt(at,u.sale)},u.id)),B?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:B,onLoadMore:ot})]})]})}export{oe as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-9fSuc05f.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-Wf8RWpZ6.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq as Ze,ar as Ke,b as Je,s as n,t,m as Ie,ai as Qe,D as Xe,H as Ae,x as Ye,d as s,I as R,y as W,aN as he,an as J,au as et,at as tt,l as Ne,n as nt,S as fe,A as O,aO as st,aP as ot}from"./index-9fSuc05f.js";import{u as it}from"./useSecondarySales-DYck7_BT.js";import{a as rt,m as Me}from"./mana-convert-GIWR9f74.js";import{u as Pe}from"./useManaRate-Bjg8HpCC.js";import{g as at,h as lt,i as ct,j as dt,k as pt,C as xt,l as ht,o as ft,m as mt,n as ut,M as gt,p as bt,E as yt,q as wt,r as jt,s as vt,t as $t,u as Ct,v as kt}from"./Assets.styles-Bs38vrbb.js";import{c as me,R as St,F as Et,S as Rt}from"./categories-DEfi9CfU.js";import{L as Tt}from"./LoadMore-Bq-1Q2-v.js";import{u as _t}from"./useInfiniteGrid-2YbkQqBo.js";import{E as zt}from"./ErrorNotice-D1mxPlFl.js";import{d as It}from"./dcl-schemas-BICTSpB5.js";import{s as At,G as Nt,w as Mt,S as Pt}from"./buy-gasless-DScVbMRZ.js";import{s as Wt}from"./buy-NnyfA38F.js";import{i as Bt}from"./trade-encoding-BMjkJRi4.js";import{r as Ft}from"./mana-rate-C2oyZxQp.js";import{f as Lt}from"./errors-BjCeABAr.js";import{J as Ht,C as Ut,B as ee}from"./ethers-CpLYx0ea.js";import{l as Ot}from"./loader-logo-BzY9EKdC.js";import{n as Dt}from"./Tooltip-Br2xIJNX.js";import{G as Gt}from"./grid.styles-D_Jbs44i.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-BSrgiqQQ.js";import"./sendMetaTransaction-BqDdrDif.js";function D(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Kt(){return B.chainId===Number(It.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Jt(o,i={}){var p;const{rpc:l,address:x}=Kt(),c=new Ht(l),d=new Ut(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return rt(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Je(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Bt(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Ft(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await At({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Nt))throw y;f=await Wt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Mt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Pt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Ke(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Lt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
1
+ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,at as Ze,au as Je,d as Ke,s as n,t,n as Ie,al as Qe,E as Xe,J as Ae,y as Ye,e as s,I as R,z as W,aQ as he,aj as et,aq as K,ax as tt,aw as nt,m as Ne,o as st,S as fe,A as O,aR as ot,aS as it}from"./index-Wf8RWpZ6.js";import{u as rt}from"./useSecondarySales-i_ahcBp1.js";import{a as at,m as Me}from"./mana-convert-CTsR_3Ej.js";import{u as Pe}from"./useManaRate-DAS3C4zo.js";import{g as lt,h as ct,i as dt,j as pt,k as xt,C as ht,l as ft,o as mt,m as ut,n as gt,M as bt,p as yt,E as wt,q as jt,r as vt,s as $t,t as Ct,u as kt,v as St}from"./Assets.styles-DPfy47Yz.js";import{c as me,R as Et,F as Rt,S as Tt}from"./categories-B6c_VHlD.js";import{L as _t}from"./LoadMore-Bg1WdJa_.js";import{u as zt}from"./useInfiniteGrid-D2N-648g.js";import{E as It}from"./ErrorNotice-BDPNfqx0.js";import{d as At}from"./dcl-schemas-BICTSpB5.js";import{s as Nt,G as Mt,w as Pt,S as Wt}from"./buy-gasless-D0882Rr8.js";import{s as Bt}from"./buy-CQDvi-Z2.js";import{i as Ft}from"./trade-encoding-BoHXvOIc.js";import{r as Lt}from"./mana-rate-C115gAGh.js";import{f as Ht}from"./errors-Bq2Mu6G5.js";import{J as Ut,C as Ot,B as ee}from"./ethers-CXBJm_wN.js";import{n as Gt}from"./Tooltip-Nt-DyBD0.js";import{G as Dt}from"./grid.styles-DxJ1n2rK.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-CRss4Km2.js";import"./sendMetaTransaction-BqrdflYy.js";function G(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Jt(){return B.chainId===Number(At.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Kt(o,i={}){var p;const{rpc:l,address:x}=Jt(),c=new Ut(l),d=new Ot(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return at(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Ke(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ft(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Lt(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await Nt({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Mt))throw y;f=await Bt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Pt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Wt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Je(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Ht(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -366,7 +366,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
366
366
  flex: none;
367
367
  color: ${t.colors.dclRed};
368
368
  }
369
- `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){J(tt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:et(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:Ot,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30533467189.commit-9c5e50b/assets/governance-DnazlIjy.webp",In=n.div`
369
+ `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),K("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){K(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:et,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30546268577.commit-51c9020/assets/governance-DnazlIjy.webp",In=n.div`
370
370
  width: 100%;
371
371
  min-width: 0;
372
372
  `,An=n.nav`
@@ -460,7 +460,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
460
460
  gap: 12px;
461
461
  `,Un=n.div`
462
462
  position: relative;
463
- `,On=n("div",Dt("invalid"))`
463
+ `,On=n("div",Gt("invalid"))`
464
464
  display: flex;
465
465
  align-items: center;
466
466
  gap: 8px;
@@ -476,7 +476,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
476
476
  ${t.media.maxWidth("mobile")} {
477
477
  border-radius: 16px;
478
478
  }
479
- `,Dn=n.span`
479
+ `,Gn=n.span`
480
480
  position: absolute;
481
481
  left: -9999px;
482
482
  top: 0;
@@ -491,7 +491,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
491
491
  ${t.media.maxWidth("mobile")} {
492
492
  font-size: 16px;
493
493
  }
494
- `,Gn=n.div`
494
+ `,Dn=n.div`
495
495
  position: absolute;
496
496
  top: calc(100% + 8px);
497
497
  left: 0;
@@ -550,7 +550,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
550
550
  ${t.media.maxWidth("mobile")} {
551
551
  font-size: 20px;
552
552
  }
553
- `,Kn=n.input`
553
+ `,Jn=n.input`
554
554
  flex: 0 1 auto;
555
555
  min-width: 0;
556
556
  max-width: 100%;
@@ -572,7 +572,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
572
572
  ${t.media.maxWidth("mobile")} {
573
573
  font-size: 16px;
574
574
  }
575
- `,Jn=n.span`
575
+ `,Kn=n.span`
576
576
  flex: none;
577
577
  margin-left: 2px;
578
578
  font-family: ${t.font.sans};
@@ -716,7 +716,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
716
716
  ${t.media.maxWidth("mobile")} {
717
717
  grid-template-columns: 1fr;
718
718
  }
719
- `,G=n.article`
719
+ `,D=n.article`
720
720
  min-width: 0;
721
721
  display: flex;
722
722
  flex-direction: column;
@@ -743,7 +743,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
743
743
  line-height: 1.57;
744
744
  text-transform: uppercase;
745
745
  color: ${t.colors.text};
746
- `,K=n.p`
746
+ `,J=n.p`
747
747
  margin: 0;
748
748
  font-family: ${t.font.sans};
749
749
  font-weight: 400;
@@ -784,4 +784,4 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq
784
784
  clip: rect(0, 0, 0, 0);
785
785
  white-space: nowrap;
786
786
  border: 0;
787
- `,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Jt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(Un,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Kn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Jn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Gn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(G,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why1Title")}),e.jsx(K,{children:s("names.why1")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why2Title")}),e.jsxs(K,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why3Title")}),e.jsx(K,{children:s("names.why3")})]})]}),e.jsxs(G,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why4Title")}),e.jsx(K,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ps(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",T=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=it(),te=h?Rt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:T,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:He,isFetchingNextPage:ae,fetchNextPage:Ue}=_t(I?["shop-items",se]:["catalog-items",oe],r=>I?st({...se,first:Y,skip:r}):ot({...oe,first:Y,skip:r}),{enabled:c!=="names"}),H=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:De}=Pe(),Ge=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,J("Shop Searched",{query:l,result_count:H}))},[l,_,A,H]);const U=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:T,max:M,sort:C,status:f,smart:v});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,J("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:T??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:H})},[c,h,a,T,M,C,f,v,_,A,H]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(T!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of St)a.includes(r)&&P.push({key:`rarity-${r}`,label:nt(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(at,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(lt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ct,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(dt,{children:[e.jsx(pt,{children:s("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(ft,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(mt,{children:e.jsx(ut,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(gt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Et,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),De&&I&&L.some(r=>r.source==="legacy")?e.jsx(bt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(zt,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(yt,{"data-testid":"browse-empty",children:[e.jsx(wt,{src:ps,alt:""}),e.jsxs(jt,{children:[e.jsx(vt,{children:s("assets.empty.title")}),e.jsx($t,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(Ct,{children:e.jsx(kt,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Gt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},D(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},D(r));const N=Ge(S);return N==null?e.jsx(O,{item:r,mode:"view"},D(r)):e.jsx(O,{item:{...S,priceCredits:N}},D(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(Tt,{hasNextPage:He,isFetching:ae,onLoadMore:()=>void Ue()})]})]})})]})}export{Ps as Assets};
787
+ `,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Kt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(Un,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Gn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Kn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Dn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(D,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why1Title")}),e.jsx(J,{children:s("names.why1")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why2Title")}),e.jsxs(J,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why3Title")}),e.jsx(J,{children:s("names.why3")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why4Title")}),e.jsx(J,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ms(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",T=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=rt(),te=h?Tt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:T,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:He,isFetchingNextPage:ae,fetchNextPage:Ue}=zt(I?["shop-items",se]:["catalog-items",oe],r=>I?ot({...se,first:Y,skip:r}):it({...oe,first:Y,skip:r}),{enabled:c!=="names"}),H=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:Ge}=Pe(),De=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,K("Shop Searched",{query:l,result_count:H}))},[l,_,A,H]);const U=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:T,max:M,sort:C,status:f,smart:v});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,K("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:T??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:H})},[c,h,a,T,M,C,f,v,_,A,H]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(T!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of Et)a.includes(r)&&P.push({key:`rarity-${r}`,label:st(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(lt,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(ct,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(dt,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:s("assets.filters")}),e.jsx(ht,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(mt,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(ut,{children:e.jsx(gt,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(bt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),Ge&&I&&L.some(r=>r.source==="legacy")?e.jsx(yt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(It,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(wt,{"data-testid":"browse-empty",children:[e.jsx(jt,{src:ps,alt:""}),e.jsxs(vt,{children:[e.jsx($t,{children:s("assets.empty.title")}),e.jsx(Ct,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(kt,{children:e.jsx(St,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Dt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},G(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},G(r));const N=De(S);return N==null?e.jsx(O,{item:r,mode:"view"},G(r)):e.jsx(O,{item:{...S,priceCredits:N}},G(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(_t,{hasNextPage:He,isFetching:ae,onLoadMore:()=>void Ue()})]})]})})]})}export{Ms as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-DEfi9CfU.js";import{n as c,T as se}from"./Tooltip-Br2xIJNX.js";import{t as e,s as o,I as g,d as s,n as ae,e as v}from"./index-9fSuc05f.js";const re=o.div`
1
+ import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-B6c_VHlD.js";import{n as c,T as se}from"./Tooltip-Nt-DyBD0.js";import{t as e,s as o,I as g,e as s,o as ae,h as v}from"./index-Wf8RWpZ6.js";const re=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as t,L as q,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as o,w as I,l as B,d as e,m as F,x as W,I as f,y as G,z as K,u as w,D as P,c as Q,E as k,k as H,o as $}from"./index-9fSuc05f.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-BSrgiqQQ.js";import{a as Y}from"./builder-43MkjBkG.js";import{f as Z}from"./errors-BjCeABAr.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BqDdrDif.js";const tt=I`
1
+ import{j as t,L as R,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as o,x as I,m as F,e,n as B,y as W,I as f,z as G,D as K,u as w,E as P,c as Q,F as k,l as H,q as $}from"./index-Wf8RWpZ6.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-CRss4Km2.js";import{a as Y}from"./builder-B_9KaS-W.js";import{f as Z}from"./errors-Bq2Mu6G5.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BqrdflYy.js";const tt=I`
2
2
  to { transform: rotate(360deg); }
3
3
  `,it=I`
4
4
  to { background-position: -200% 0; }
@@ -179,4 +179,4 @@ import{j as t,L as q,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as
179
179
  margin: 6px 0 0;
180
180
  `,S=a(N)`
181
181
  margin-top: 12px;
182
- `;function y({descriptor:i,owner:c,signer:l,name:n,description:r,image:d,icon:h}){const b=P(),[m,x]=M.useState(!1),{data:s,isLoading:u,refetch:D}=w({queryKey:["authorization",i.id,c],queryFn:()=>V(i,c),staleTime:3e4});async function L(){if(m||u)return;const g=!s;x(!0);try{await U({auth:i,signer:l,active:g}),await D(),b.setQueryData(["authorization",i.id,c],g),k.success(g?e("authorizations.toastActivated",{name:n}):e("authorizations.toastDeactivated",{name:n}))}catch(v){H(v,{flow:"authorizations",step:g?"grant":"revoke"}),k.error(Z(v,e("authorizations.errorGeneric")))}finally{x(!1)}}const R=u?e("authorizations.checking"):s?e("authorizations.active"):e("authorizations.inactive");return t.jsxs(st,{"data-testid":`authorization-${i.id}`,"data-active":!!s,children:[t.jsx(ct,{children:d?t.jsx("img",{src:d,alt:""}):h}),t.jsxs(lt,{children:[t.jsx(dt,{title:n,children:n}),t.jsx(ut,{children:r})]}),t.jsxs(pt,{children:[t.jsx(ht,{"data-active":!!s,children:R}),m?t.jsx(xt,{"aria-label":e("authorizations.working")}):t.jsx(mt,{type:"button","data-testid":`authorization-toggle-${i.id}`,"data-active":!!s,role:"switch","aria-checked":!!s,"aria-label":s?e("authorizations.deactivateAria",{name:n}):e("authorizations.activateAria",{name:n}),disabled:u,onClick:()=>void L()})]})]})}function gt(i){return w({queryKey:["owned-collections",i],enabled:!!i,staleTime:6e4,queryFn:async()=>{const[c,l]=await Promise.all([$(i,{category:"wearable",first:96}),$(i,{category:"emote",first:96})]),n=new Map;for(const r of[...c.assets,...l.assets]){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function ft(i,c){return w({queryKey:["creator-collections",i],enabled:!!i&&!!c,staleTime:6e4,queryFn:async()=>{const l=await Y(i,c),n=new Map;for(const r of l){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function Tt(){B({title:e("authorizations.title"),noindex:!0});const{session:i,signIn:c}=F(),l=Q.chainId,n=W(i==null?void 0:i.providerType),{data:r,isLoading:d}=gt(n?i==null?void 0:i.address:void 0),{data:h,isLoading:b}=ft(n?i==null?void 0:i.address:void 0,n?i==null?void 0:i.identity:void 0);if(!i)return t.jsxs(T,{children:[t.jsx(f,{name:"info",size:40,color:o.colors.muted2}),t.jsx(E,{children:e("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),t.jsx(S,{variant:"purple",onClick:()=>c(),children:e("storeSettings.signIn")})]});if(!n)return t.jsxs(T,{children:[t.jsx(f,{name:"check",size:40,color:o.colors.ok}),t.jsx(E,{children:e("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),t.jsx(S,{as:q,to:"/assets",variant:"purple",children:e("authorizations.managedCta")})]});const m=O(l),x=_(l);return t.jsxs(et,{children:[t.jsxs(ot,{children:[t.jsx(at,{children:e("authorizations.title")}),t.jsx(nt,{children:e("authorizations.intro")})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.buyingTitle")}),t.jsxs(p,{children:[t.jsx(y,{descriptor:m,owner:i.address,signer:i.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})}),t.jsx(y,{descriptor:x,owner:i.address,signer:i.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:t.jsx(rt,{src:K,alt:"","aria-hidden":!0})})]})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.sellingTitle")}),d?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,u)=>t.jsx(C,{"aria-hidden":!0},u))}):r&&r.length>0?t.jsx(p,{children:r.map(s=>t.jsx(y,{descriptor:X(s.contractAddress,l),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.sellingDesc"),image:s.image,icon:t.jsx(f,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.sellingEmpty")})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.mintingTitle")}),b?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,u)=>t.jsx(C,{"aria-hidden":!0},u))}):h&&h.length>0?t.jsx(p,{children:h.map(s=>t.jsx(y,{descriptor:J(s.contractAddress,l),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:t.jsx(f,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.mintingEmpty")})]})]})}export{Tt as Authorizations};
182
+ `;function y({descriptor:i,owner:c,signer:l,name:n,description:r,image:d,icon:h}){const b=P(),[m,x]=M.useState(!1),{data:s,isLoading:u,refetch:q}=w({queryKey:["authorization",i.id,c],queryFn:()=>V(i,c),staleTime:3e4});async function D(){if(m||u)return;const g=!s;x(!0);try{await U({auth:i,signer:l,active:g}),await q(),b.setQueryData(["authorization",i.id,c],g),k.success(g?e("authorizations.toastActivated",{name:n}):e("authorizations.toastDeactivated",{name:n}))}catch(v){H(v,{flow:"authorizations",step:g?"grant":"revoke"}),k.error(Z(v,e("authorizations.errorGeneric")))}finally{x(!1)}}const L=u?e("authorizations.checking"):s?e("authorizations.active"):e("authorizations.inactive");return t.jsxs(st,{"data-testid":`authorization-${i.id}`,"data-active":!!s,children:[t.jsx(ct,{children:d?t.jsx("img",{src:d,alt:""}):h}),t.jsxs(lt,{children:[t.jsx(dt,{title:n,children:n}),t.jsx(ut,{children:r})]}),t.jsxs(pt,{children:[t.jsx(ht,{"data-active":!!s,children:L}),m?t.jsx(xt,{"aria-label":e("authorizations.working")}):t.jsx(mt,{type:"button","data-testid":`authorization-toggle-${i.id}`,"data-active":!!s,role:"switch","aria-checked":!!s,"aria-label":s?e("authorizations.deactivateAria",{name:n}):e("authorizations.activateAria",{name:n}),disabled:u,onClick:()=>void D()})]})]})}function gt(i){return w({queryKey:["owned-collections",i],enabled:!!i,staleTime:6e4,queryFn:async()=>{const[c,l]=await Promise.all([$(i,{category:"wearable",first:96}),$(i,{category:"emote",first:96})]),n=new Map;for(const r of[...c.assets,...l.assets]){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function ft(i,c){return w({queryKey:["creator-collections",i],enabled:!!i&&!!c,staleTime:6e4,queryFn:async()=>{const l=await Y(i,c),n=new Map;for(const r of l){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function Tt(){F({title:e("authorizations.title"),noindex:!0});const{session:i,signIn:c}=B(),l=Q.chainId,n=W(i==null?void 0:i.providerType),{data:r,isLoading:d}=gt(n?i==null?void 0:i.address:void 0),{data:h,isLoading:b}=ft(n?i==null?void 0:i.address:void 0,n?i==null?void 0:i.identity:void 0);if(!i)return t.jsxs(T,{children:[t.jsx(f,{name:"info",size:40,color:o.colors.muted2}),t.jsx(E,{children:e("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),t.jsx(S,{variant:"purple",onClick:()=>c(),children:e("storeSettings.signIn")})]});if(!n)return t.jsxs(T,{children:[t.jsx(f,{name:"check",size:40,color:o.colors.ok}),t.jsx(E,{children:e("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),t.jsx(S,{as:R,to:"/assets",variant:"purple",children:e("authorizations.managedCta")})]});const m=O(l),x=_(l);return t.jsxs(et,{children:[t.jsxs(ot,{children:[t.jsx(at,{children:e("authorizations.title")}),t.jsx(nt,{children:e("authorizations.intro")})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.buyingTitle")}),t.jsxs(p,{children:[t.jsx(y,{descriptor:m,owner:i.address,signer:i.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})}),t.jsx(y,{descriptor:x,owner:i.address,signer:i.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:t.jsx(rt,{src:K,alt:"","aria-hidden":!0})})]})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.sellingTitle")}),d?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,u)=>t.jsx(C,{"aria-hidden":!0},u))}):r&&r.length>0?t.jsx(p,{children:r.map(s=>t.jsx(y,{descriptor:X(s.contractAddress,l),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.sellingDesc"),image:s.image,icon:t.jsx(f,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.sellingEmpty")})]}),t.jsxs(z,{children:[t.jsx(j,{children:e("authorizations.mintingTitle")}),b?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,u)=>t.jsx(C,{"aria-hidden":!0},u))}):h&&h.length>0?t.jsx(p,{children:h.map(s=>t.jsx(y,{descriptor:J(s.contractAddress,l),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:t.jsx(f,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.mintingEmpty")})]})]})}export{Tt as Authorizations};