@dcl/shop 0.1.1-30910936579.commit-bb58bbb → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/_assets/{Activity-BFxuJO2y.js → Activity-DEjmHBhk.js} +3 -3
  2. package/_assets/{AnimatedBackground-VQDTmdjQ.js → AnimatedBackground-CHvLpzUf.js} +2 -2
  3. package/_assets/{Assets-BikrL8IX.js → Assets-DEojVtHO.js} +7 -7
  4. package/_assets/{Assets.styles-Cxk14RF3.js → Assets.styles-B1LMem3Q.js} +1 -1
  5. package/_assets/{Authorizations-BtKTUS-9.js → Authorizations-CTaaCZXi.js} +1 -1
  6. package/_assets/{Cart-BTqp0FRv.js → Cart-AX3HGlh3.js} +2 -2
  7. package/_assets/{CircularProgress-17SCzKSq.js → CircularProgress-BZ7NQch9.js} +1 -1
  8. package/_assets/{Collection-CYIm3Htv.js → Collection-BcbP4dPg.js} +1 -1
  9. package/_assets/{CollectionCarousel-C0LgFQAu.js → CollectionCarousel-jmGi2U05.js} +1 -1
  10. package/_assets/{Creator-DVEvwEf2.js → Creator-CC2tlDlW.js} +1 -1
  11. package/_assets/{ErrorNotice-D6-7YD_C.js → ErrorNotice-BSIjN9FY.js} +1 -1
  12. package/_assets/{ExchangeController-DjKSc6Rd.js → ExchangeController-Yl7Xs6qB.js} +1 -1
  13. package/_assets/{GetCredits-B3XWTumM.js → GetCredits-Bq1y_1so.js} +1 -1
  14. package/_assets/{HelpersUtil-iIr5k8S3.js → HelpersUtil-1_9JDXYM.js} +1 -1
  15. package/_assets/{ImportListings-ZrRXROSR.js → ImportListings-BOHhSYaD.js} +1 -1
  16. package/_assets/{ItemDetail-KjO5zo9p.js → ItemDetail-CI8vL8MT.js} +3 -3
  17. package/_assets/{ItemPreview.styles-Cb0L-oUy.js → ItemPreview.styles-Ct9P1B-d.js} +1 -1
  18. package/_assets/{LoadMore-CUa0BsTv.js → LoadMore-DD6-EqBS.js} +1 -1
  19. package/_assets/{ManaPricingBanner.styles-D8qXS7kM.js → ManaPricingBanner.styles-CW9IN_dA.js} +1 -1
  20. package/_assets/{MenuList-BrAB8iKy.js → MenuList-BccS2Xcz.js} +1 -1
  21. package/_assets/{MyAssets-BOrcLKie.js → MyAssets-8_cluEwM.js} +1 -1
  22. package/_assets/{MyFavorites-D9J7HO-j.js → MyFavorites-D2hqTVxj.js} +1 -1
  23. package/_assets/{NotFound-DOxwZxko.js → NotFound-DhsUg-9v.js} +1 -1
  24. package/_assets/{NotificationsBell-DRP3FzbO.js → NotificationsBell-DL2DHZkV.js} +1 -1
  25. package/_assets/{OutfitDetail-C5eyGpEA.js → OutfitDetail-CTE9Y2YI.js} +1 -1
  26. package/_assets/{OutfitPreview-BL8cCtEn.js → OutfitPreview-DTexJcaC.js} +1 -1
  27. package/_assets/{OutfitStudio-D_CB2QVA.js → OutfitStudio-IUKANtS4.js} +1 -1
  28. package/_assets/{StoreSettings-B6o_W0eW.js → StoreSettings-D8nBhr1U.js} +1 -1
  29. package/_assets/{Success-CXS2Dcqd.js → Success-R1I0qHV7.js} +1 -1
  30. package/_assets/{SwapController-B4ZfPAwx.js → SwapController-BaLokWQK.js} +1 -1
  31. package/_assets/{Tooltip-bl4-JEoI.js → Tooltip-8Rn2EQnm.js} +1 -1
  32. package/_assets/{TradeService-DDRO-auD.js → TradeService-DgaMlENs.js} +1 -1
  33. package/_assets/{W3MFrameProviderSingleton-CNMm9yRj.js → W3MFrameProviderSingleton-BefcEwHF.js} +3 -3
  34. package/_assets/{WebCryptoP256-B6pqCsYE.js → WebCryptoP256-CJnbpGC3.js} +1 -1
  35. package/_assets/authorizations-C1shI8qN.js +1 -0
  36. package/_assets/{basic-C44jT8B4.js → basic-B3K2S7qT.js} +1 -1
  37. package/_assets/{biconomy-eZih2UZJ.js → biconomy-DZYrYjn_.js} +1 -1
  38. package/_assets/{browseLayout.styles-CrLB3Lke.js → browseLayout.styles-CdBFJnD1.js} +1 -1
  39. package/_assets/{builder-WW8inl03.js → builder-CxQSxnbg.js} +1 -1
  40. package/_assets/{buy-D9SdPT0I.js → buy-7YNy1Ky6.js} +1 -1
  41. package/_assets/{buy-gasless-ByVYfkrv.js → buy-gasless-Bgmi9EE6.js} +1 -1
  42. package/_assets/{categories-koDpxIGQ.js → categories-fdqQ1jGj.js} +1 -1
  43. package/_assets/{ccip-BpZ0kBt9.js → ccip-B3flptay.js} +1 -1
  44. package/_assets/{ccip-DecJozf8.js → ccip-D_tGl3BV.js} +1 -1
  45. package/_assets/{clsx-_vaSICRo.js → clsx-DqDJX0Wu.js} +1 -1
  46. package/_assets/{controller-CiF4NSKd.js → controller-B_iikB1D.js} +2 -2
  47. package/_assets/{core-DH1NTGuy.js → core-BU7SnNlk.js} +4 -4
  48. package/_assets/{createSvgIcon-CUzS88Su.js → createSvgIcon-CtLGC3hn.js} +1 -1
  49. package/_assets/{custom-CuL2B_VD.js → custom-BEjNfCl9.js} +1 -1
  50. package/_assets/{data-capture-BbHnyf8W.js → data-capture-B1VhMeC7.js} +1 -1
  51. package/_assets/{email-D8w7eAFp.js → email-B57omyQe.js} +1 -1
  52. package/_assets/{embedded-wallet-DGxnQp0J.js → embedded-wallet-CQkZ1oq_.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-COxDrE1C.js → emotion-styled.browser.esm-D2394E6D.js} +1 -1
  54. package/_assets/{engine-B5M1X4Zk.js → engine-C2DdTaY7.js} +1 -1
  55. package/_assets/{errors-boW7-tfx.js → errors-D_opMycA.js} +1 -1
  56. package/_assets/{estimate-l1-fee-Zly2VYMS.js → estimate-l1-fee-D8xs9cx5.js} +1 -1
  57. package/_assets/{execute-BTxBSnXr.js → execute-CGo5AyiA.js} +2 -2
  58. package/_assets/{features-DqfGz-fi.js → features-D-9rXGGv.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-CGRbolN0.js → fetchTokenMetadata-B7bmvVVs.js} +2 -2
  60. package/_assets/{field.styles-icpuqiLd.js → field.styles-CRXnbqs7.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-zJw2ag43.js → get-ecosystem-wallet-info-B_YL7NbP.js} +1 -1
  62. package/_assets/{getBalance-CykzuUJG.js → getBalance-DobpCh21.js} +1 -1
  63. package/_assets/{getNFT-DIQvefS-.js → getNFT-CE2BQKXd.js} +1 -1
  64. package/_assets/{getNFT-DvHzzPp2.js → getNFT-XA7-jTvL.js} +1 -1
  65. package/_assets/{getThemeProps-B3ytv_sA.js → getThemeProps-CtBrmvfh.js} +1 -1
  66. package/_assets/{grid.styles-DY-TUpQG.js → grid.styles-qz7ti9Zv.js} +1 -1
  67. package/_assets/{hashTypedData-KiRlt_KE.js → hashTypedData-CVAaL5pV.js} +1 -1
  68. package/_assets/{hashTypedData-hmAiNCzj.js → hashTypedData-DBdbd6qS.js} +1 -1
  69. package/_assets/{in-app-DwX-TQ4J.js → in-app-8uY3gq10.js} +1 -1
  70. package/_assets/{in-app-wallet-calls-CeJWzRpW.js → in-app-wallet-calls-DUYtkUWV.js} +1 -1
  71. package/_assets/{index-DrLsGQFY.js → index-0k_Ix9-y.js} +1 -1
  72. package/_assets/{index-Db8XAM6H.js → index-4yxKINQG.js} +1 -1
  73. package/_assets/{index-BeZANkpU.js → index-5BrpwK2E.js} +3 -3
  74. package/_assets/{index-ClhaoFwr.js → index-B3cBw-D7.js} +1 -1
  75. package/_assets/{index-CYA8v3ru.js → index-B52GuR9b.js} +1 -1
  76. package/_assets/{index-DM4q9M_E.js → index-B6UcUowD.js} +1 -1
  77. package/_assets/{index-CThPTHFI.js → index-BcLl5Pcj.js} +1 -1
  78. package/_assets/{index-Bg-QKz9Z.js → index-BdNZtyJQ.js} +1 -1
  79. package/_assets/{index-BGDkYZ9X.js → index-BeU8m41Y.js} +1 -1
  80. package/_assets/{index-2HjgvGE0.js → index-BfMJozQN.js} +1 -1
  81. package/_assets/{index-DQRRTksr.js → index-BfiiGRPB.js} +1 -1
  82. package/_assets/{index-BbJIcREt.js → index-BhjYUrg0.js} +1 -1
  83. package/_assets/{index-DRYUJJ5d.js → index-C1p-YzYG.js} +1 -1
  84. package/_assets/{index-kibPayQR.js → index-C2rfWYTU.js} +1 -1
  85. package/_assets/{index-CljY6PrF.js → index-C3OMForh.js} +1 -1
  86. package/_assets/{index-D5pWb9fn.js → index-C3Y7EEOn.js} +1 -1
  87. package/_assets/{index-CJDQqTIn.js → index-C6oNJ6-K.js} +1 -1
  88. package/_assets/{index-8kcK18dY.js → index-C9P3L7ig.js} +2 -2
  89. package/_assets/{index-RLaXeWRK.js → index-CCG1GoIN.js} +1 -1
  90. package/_assets/{index-CPEUTeuP.js → index-CQSjY0Du.js} +1 -1
  91. package/_assets/{index-CUAlYj50.js → index-Ce7FXMH6.js} +1 -1
  92. package/_assets/{index-5hmoUi31.js → index-CjXgzl0R.js} +3 -3
  93. package/_assets/{index-ocDIHs1j.js → index-ClWeiLd5.js} +1 -1
  94. package/_assets/{index-0hJ-EeUf.js → index-Cm0V-kfI.js} +1 -1
  95. package/_assets/{index-C_k6QnYS.js → index-CnJpbFSz.js} +1 -1
  96. package/_assets/{index-Cz8ctv2n.js → index-CnyZnOze.js} +1 -1
  97. package/_assets/{index-CSsIBkjj.js → index-D5CV5tma.js} +1 -1
  98. package/_assets/{index-8_Ez2ez1.js → index-D5sgkVGL.js} +1 -1
  99. package/_assets/{index-zgoTY9Mb.js → index-DTr5GHSv.js} +1 -1
  100. package/_assets/{index-BKiicFqW.js → index-DV0qYwPA.js} +1 -1
  101. package/_assets/{index-CXnd9PaX.js → index-DcYRP6nf.js} +1 -1
  102. package/_assets/{index-BxIPGFn3.js → index-DoSPE-Ha.js} +1 -1
  103. package/_assets/{index-lSNqSHBI.js → index-DsVYdq6J.js} +1 -1
  104. package/_assets/{index-_H6tRTcn.js → index-DvuYfHQP.js} +2 -2
  105. package/_assets/{index-CrudFoei.js → index-DyqgsK_t.js} +1 -1
  106. package/_assets/{index-BznO72_i.js → index-El7E7gyC.js} +1 -1
  107. package/_assets/{index-DhNBmPpe.js → index-HTR5wu9m.js} +2 -2
  108. package/_assets/index-I4EEqchH.js +3260 -0
  109. package/_assets/{index-PWgePIOy.js → index-LyvizffK.js} +1 -1
  110. package/_assets/{index-B8qNqBrK.js → index-Nm_gGcV-.js} +1 -1
  111. package/_assets/{index-dG4ogQCm.js → index-OkR1-K6e.js} +1 -1
  112. package/_assets/{index-DMpkdgJ2.js → index-RGElQJQM.js} +1 -1
  113. package/_assets/{index-BFGZVce1.js → index-SEqhKb6L.js} +1 -1
  114. package/_assets/{index-DdyXqr-l.js → index-bK2MzhZQ.js} +1 -1
  115. package/_assets/{index-DQvmiIO9.js → index-bxCEY1Kz.js} +1 -1
  116. package/_assets/{index-707cZyU3.js → index-eUea8kWn.js} +1 -1
  117. package/_assets/{index-BZDHc6sA.js → index-kK-ziiji.js} +1 -1
  118. package/_assets/{index-uNbynO8A.js → index-mT-oF00r.js} +1 -1
  119. package/_assets/{index-bMsIU7Dw.js → index-vju3bcbC.js} +1 -1
  120. package/_assets/{index-C_J3Tg-X.js → index-xBX71Czg.js} +1 -1
  121. package/_assets/{index-OzGvz8K0.js → index-y4_ULjVF.js} +3 -3
  122. package/_assets/{index.es-C_UXSWig.js → index.es-CKWyDo1q.js} +4 -4
  123. package/_assets/{index.es-zHc4Qg3k.js → index.es-ClPouKQg.js} +1 -1
  124. package/_assets/{index.es-DGFKmGxx.js → index.es-DF60f2Mp.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-CCfsw-I3.js → localBatchGatewayRequest-OBBcAlGv.js} +1 -1
  126. package/_assets/{mana-convert-C1xSiqqu.js → mana-convert-CmDEKake.js} +1 -1
  127. package/_assets/{mana-rate-BpHfe_iw.js → mana-rate-BjVix_kr.js} +1 -1
  128. package/_assets/{networks-BV-X4qTe.js → networks-wsAhf300.js} +1 -1
  129. package/_assets/{onramp-B_uKFllv.js → onramp-Dm1zvxjw.js} +1 -1
  130. package/_assets/{openzeppelin-Cls--iTO.js → openzeppelin-DBTB-nhA.js} +1 -1
  131. package/_assets/{parseNft-Bnklm1HN.js → parseNft-Be2Jf_xO.js} +2 -2
  132. package/_assets/{parseSignature-B03xBRZR.js → parseSignature-BgK0HNBL.js} +3 -3
  133. package/_assets/{parseSignature-CGE07wnH.js → parseSignature-DUi_JbiE.js} +1 -1
  134. package/_assets/{passkeys-uRKe3IGl.js → passkeys-Cn_zbnFu.js} +1 -1
  135. package/_assets/{pay-with-exchange-ClC7J5eZ.js → pay-with-exchange-BPDG4vuK.js} +1 -1
  136. package/_assets/{qr-overlay-B49rbQOU.js → qr-overlay-YaY3yjB-.js} +1 -1
  137. package/_assets/{receive-D5yoBmvW.js → receive-TvYb15EC.js} +1 -1
  138. package/_assets/{resolveImplementation-zUXnrfgu.js → resolveImplementation-CQV2GLf_.js} +1 -1
  139. package/_assets/{rpc-D5nQZP6e.js → rpc-CItoFNEp.js} +1 -1
  140. package/_assets/{secp256k1-dQSlTzqe.js → secp256k1-DRdrrq5M.js} +1 -1
  141. package/_assets/{secp256k1-C--Hpe6V.js → secp256k1-ivKnCo4o.js} +1 -1
  142. package/_assets/{secp256k1-CeWXTOjm.js → secp256k1-zoeEVUd9.js} +1 -1
  143. package/_assets/{send-DnOBdj_w.js → send-KyJXgfEP.js} +1 -1
  144. package/_assets/{send-batch-transaction-DcYpxyD8.js → send-batch-transaction-CMIoWgH_.js} +1 -1
  145. package/_assets/{send-eip712-transaction-DEyxEhYn.js → send-eip712-transaction-DFA_NvME.js} +2 -2
  146. package/_assets/{send-gasless-transaction-B0KoDSZI.js → send-gasless-transaction-rpDMTChs.js} +2 -2
  147. package/_assets/{send-transaction-DLrp33Ay.js → send-transaction-Bdxf4mR-.js} +2 -2
  148. package/_assets/{sendMetaTransaction-CgzqVu54.js → sendMetaTransaction-Bj0jdOFW.js} +1 -1
  149. package/_assets/{sendRawTransaction-B8yZxOzl.js → sendRawTransaction-BsxjE4-g.js} +3 -3
  150. package/_assets/{serializeTransaction-BoUYQ-jQ.js → serializeTransaction-1erxN0sJ.js} +1 -1
  151. package/_assets/{session-proposal-DMzEaWkq.js → session-proposal-B0iDzfRA.js} +1 -1
  152. package/_assets/{session-request-CtZEDQ6h.js → session-request-BjhyRLM9.js} +2 -2
  153. package/_assets/{signing-DTUoW6Aq.js → signing-CRKINztP.js} +3 -3
  154. package/_assets/{socials-B0V1ulX-.js → socials-1JjCJX93.js} +1 -1
  155. package/_assets/{swaps-CIG58tbY.js → swaps-xl0imKPc.js} +1 -1
  156. package/_assets/{thirdweb-CFdrUc0X.js → thirdweb-EjaBlMwG.js} +3 -3
  157. package/_assets/{to-serializable-transaction-BzLjLX_S.js → to-serializable-transaction-BJbueh8D.js} +2 -2
  158. package/_assets/{trade-encoding-BJEZpBsE.js → trade-encoding-BnDgi1QQ.js} +1 -1
  159. package/_assets/{transactionReceipt-BaDMkEKJ.js → transactionReceipt-BoDpuYqv.js} +1 -1
  160. package/_assets/{transactions-DbSW24RG.js → transactions-mUAXsl3e.js} +1 -1
  161. package/_assets/{useCreditPacks-B9dcdQRV.js → useCreditPacks--aSgsJ92.js} +1 -1
  162. package/_assets/{useInfiniteGrid-DY2zLmAX.js → useInfiniteGrid-Ct3kWony.js} +1 -1
  163. package/_assets/useManaRate-Cfp1rcnf.js +1 -0
  164. package/_assets/{useSecondarySales-T5w4v68V.js → useSecondarySales-CaN1WkpM.js} +1 -1
  165. package/_assets/{useStore-Br1E1f__.js → useStore-ChkmZ3qe.js} +1 -1
  166. package/_assets/{useTheme-CwpMDe-4.js → useTheme-DO90qBa1.js} +1 -1
  167. package/_assets/{verifyHash-B4t13z9H.js → verifyHash-B-yVKa3W.js} +1 -1
  168. package/_assets/{w3m-modal-BqfbNw0J.js → w3m-modal-BLrIcOlj.js} +1 -1
  169. package/_assets/{w3m-modal-BH1vdfAR.js → w3m-modal-CLMDYpCW.js} +1 -1
  170. package/_assets/{wait-for-tx-receipt-mlGWyLwH.js → wait-for-tx-receipt-D1H6U1pd.js} +1 -1
  171. package/_assets/{wallets-Ci88s6wU.js → wallets-BOa-d8wQ.js} +5 -5
  172. package/_assets/{web-connector-8oIz3OFz.js → web-connector-BqHFvU2z.js} +3 -3
  173. package/_assets/{writeContract-f90YYlnO.js → writeContract-BEWlchIW.js} +1 -1
  174. package/_assets/{zoraTestnet-IkEqWruQ.js → zoraTestnet-CKnxxXEw.js} +1 -1
  175. package/index.html +11 -11
  176. package/package.json +2 -2
  177. package/_assets/authorizations-CYYNI-9S.js +0 -1
  178. package/_assets/index-DubLtINT.js +0 -3260
  179. package/_assets/useManaRate-GUe-CE9q.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bl as lt,s as l,t as o,k as ut,B as ht,m as xt,e as d,n as mt,u as v,I as f,bm as G,bn as K,bo as pt,p as k,bp as gt,b1 as T,ao as ft,bq as bt,br as C}from"./index-DubLtINT.js";import{a as yt}from"./mana-convert-C1xSiqqu.js";import{u as jt}from"./useManaRate-GUe-CE9q.js";import{L as vt}from"./LoadMore-CUa0BsTv.js";import{u as b}from"./useInfiniteGrid-DY2zLmAX.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-rate-BpHfe_iw.js";const kt=15e3;function It(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=kt}function At(t){const n=[...t].sort((i,a)=>a.createdAt-i.createdAt),s=[];for(const i of n){const a=s[s.length-1];a&&It(a[a.length-1],i)?a.push(i):s.push([i])}return s.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,h)=>c+h.credits,0),lines:i}})}function wt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function $t(t){const n=[],s=new Map;for(const i of t){const a=wt(i);if(!a){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=s.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const h={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};s.set(a,h),n.push(h)}return n}function Pt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?yt(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Lt(t){const s=At(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=t.sales.map(r=>{const x=Pt(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),a=(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,...i,...a,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Nt(t,n){return n==="all"?t:n==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const Z=t=>t.trim().toLowerCase();function Et(t){const n=new Map;for(const s of t??[]){const i=Z(s.txHash??"");if(!i)continue;const a=n.get(i);a?a.push(s):n.set(i,[s])}return n}function Tt(t,n,s=Date.now()){const i=n.txHash?t.get(Z(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?Ct(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:a};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:a,availableAt:h}}function Ct(t){return lt(t)}const Ft="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/credits-product-vs4Q6u6l.svg",F=ut`
1
+ import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bl as lt,s as l,t as o,k as ut,B as ht,m as xt,e as d,n as pt,u as v,I as f,bm as G,bn as K,bo as mt,p as k,bp as gt,b1 as T,ao as ft,bq as bt,br as C}from"./index-I4EEqchH.js";import{a as yt}from"./mana-convert-CmDEKake.js";import{u as jt}from"./useManaRate-Cfp1rcnf.js";import{L as vt}from"./LoadMore-DD6-EqBS.js";import{u as b}from"./useInfiniteGrid-Ct3kWony.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-rate-BjVix_kr.js";const kt=15e3;function It(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=kt}function At(t){const n=[...t].sort((i,a)=>a.createdAt-i.createdAt),s=[];for(const i of n){const a=s[s.length-1];a&&It(a[a.length-1],i)?a.push(i):s.push([i])}return s.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,h)=>c+h.credits,0),lines:i}})}function wt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function $t(t){const n=[],s=new Map;for(const i of t){const a=wt(i);if(!a){n.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=s.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const h={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};s.set(a,h),n.push(h)}return n}function Pt(t,n){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:n?yt(t.manaWei,n):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Lt(t){const s=At(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=t.sales.map(r=>{const x=Pt(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),a=(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,...i,...a,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Nt(t,n){return n==="all"?t:n==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const Z=t=>t.trim().toLowerCase();function Et(t){const n=new Map;for(const s of t??[]){const i=Z(s.txHash??"");if(!i)continue;const a=n.get(i);a?a.push(s):n.set(i,[s])}return n}function Tt(t,n,s=Date.now()){const i=n.txHash?t.get(Z(n.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?Ct(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:a};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:a,availableAt:h}}function Ct(t){return lt(t)}const Ft="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/credits-product-vs4Q6u6l.svg",F=ut`
2
2
  0% { background-position: 200% 0; }
3
3
  100% { background-position: -200% 0; }
4
4
  `,St=l.section`
@@ -133,7 +133,7 @@ import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bl as lt,s
133
133
  background: rgba(214, 61, 61, 0.14);
134
134
  color: #b02a2a;
135
135
  }
136
- `,m=l.div`
136
+ `,p=l.div`
137
137
  display: flex;
138
138
  align-items: center;
139
139
  gap: 5px;
@@ -288,4 +288,4 @@ import{r as j,j as e,L as Q,a as dt}from"./react-DehiWSvs.js";import{bl as lt,s
288
288
  margin: 6px 0 0;
289
289
  `,Rt=l(ht)`
290
290
  margin-top: 12px;
291
- `,W=E.withComponent(Q),y=24,Gt=["all","purchases","sales"];function g(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 n=Number(t)/1e18;return Number.isFinite(n)?n.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const n=j.useRef(null),[s,i]=j.useState(null),a=()=>{var h;const c=(h=n.current)==null?void 0:h.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(Ot,{ref:n,tabIndex:0,onMouseEnter:a,onMouseLeave:()=>i(null),onFocus:a,onBlur:()=>i(null),children:[t,s?dt.createPortal(e.jsx(Wt,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Kt({item:t}){const n=!!t.contractAddress&&!!t.itemId,s=!!t.tradeId||n,{data:i,isLoading:a}=v({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?bt(t.tradeId):C(t.contractAddress,{itemId:t.itemId}),enabled:s,staleTime:5*6e4}),c=s&&a,h=(i==null?void 0:i.name)??d("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",x=T({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,p=e.jsxs(e.Fragment,{children:[c?e.jsx(D,{}):e.jsx(M,{children:r?e.jsx("img",{src:r,alt:h}):e.jsx(f,{name:"cart",size:20})}),e.jsxs(H,{children:[c?e.jsx(q,{}):e.jsx(z,{title:h,children:h}),t.quantity>1?e.jsx(O,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Bt,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]});return x?e.jsx(W,{to:x,"data-link":"true",children:p}):e.jsx(E,{children:p})}function _t({order:t}){const n=$t(t.lines),s=n.reduce((i,a)=>i+a.quantity,0);return e.jsxs(I,{"data-testid":"purchase-order",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(m,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(S,{children:n.map(i=>e.jsx(Kt,{item:i},i.key))})]})}function Ut({sale:t}){const{data:n,isLoading:s}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(n==null?void 0:n.name)??d("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",c=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(D,{}):e.jsx(M,{children:a?e.jsx("img",{src:a,alt:i}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[s?e.jsx(q,{}):e.jsx(z,{title:i,children:i}),e.jsx(O,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(I,{"data-testid":"activity-mana-purchase",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.paidWithMana")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(m,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]})]})]}),e.jsx(S,{children:c?e.jsx(W,{to:c,"data-link":"true",children:h}):e.jsx(E,{children:h})})]})}function Qt({sale:t,payout:n}){const{data:s,isLoading:i}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(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:[i?e.jsx(D,{}):e.jsx(M,{children:c?e.jsx("img",{src:c,alt:a}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[i?e.jsx(q,{}):e.jsx(z,{title:a,children:a}),e.jsxs(O,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),n.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:g(n.availableAt)})}`:""]})]})]});return e.jsxs(I,{"data-testid":"activity-sale",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.saleLabel")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":n.kind==="pending"?"PENDING":"SOLD",children:n.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),n.kind==="direct"?e.jsxs(m,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]}):n.credits!==null?e.jsxs(m,{"data-kind":"income",children:[e.jsx(k,{className:"ccy-mark"})," +",ft(n.credits)]}):e.jsx(m,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(S,{children:h?e.jsx(W,{to:h,"data-link":"true",children:r}):e.jsx(E,{children:r})})]})}function Xt({order:t}){const n=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),i=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(I,{"data-testid":"credit-order",children:e.jsxs(A,{children:[e.jsx(qt,{children:e.jsx("img",{src:Ft,alt:"","aria-hidden":!0})}),e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:n})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":s,children:i}),e.jsxs(m,{"data-kind":"income",children:["+",e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Zt({filter:t}){const n={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(f,{name:n.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:n.title}),e.jsx("p",{className:"muted",children:n.body}),t!=="sales"?e.jsx(Rt,{as:Q,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function de(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=mt(),[n,s]=j.useState("all"),i=!!t&&n!=="sales",a=!!t&&n!=="purchases",c=b(["purchases",t==null?void 0:t.address],u=>pt(t.address,t.identity,{first:y,skip:u}),{enabled:i}),h=b(["sales",t==null?void 0:t.address],u=>G(t.address,{role:"seller",first:y,skip:u}),{enabled:a}),r=b(["credit-orders",t==null?void 0:t.address],u=>K(t.address,t.identity,{first:y,skip:u}),{enabled:i}),x=b(["mana-purchases",t==null?void 0:t.address],u=>G(t.address,{role:"buyer",first:y,skip:u}),{enabled:i}),{data:p}=v({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>K(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:a,staleTime:6e4}),nt=j.useMemo(()=>Et(p),[p]),{data:st}=jt(a);if(!t)return e.jsxs(V,{children:[e.jsx(f,{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 B=Nt(Lt({purchases:i?c.items:[],sales:a?h.items:[],creditOrders:i?r.items:[],manaPurchases:i?x.items:[],rate:st}),n),at=i&&(c.isLoading||r.isLoading||x.isLoading)||a&&h.isLoading,R=i&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||a&&h.isFetchingNextPage,rt=i&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||a&&h.hasNextPage;function ot(){i&&c.hasNextPage&&c.fetchNextPage(),i&&r.hasNextPage&&r.fetchNextPage(),i&&x.hasNextPage&&x.fetchNextPage(),a&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(St,{children:[e.jsx(Mt,{children:e.jsx(Dt,{children:d("nav.activity")})}),e.jsx(Ht,{role:"tablist","aria-label":d("nav.activity"),children:Gt.map(u=>e.jsx(zt,{type:"button",role:"tab","aria-selected":n===u,"data-active":n===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),at?e.jsx(_,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):B.length===0?e.jsx(Zt,{filter:n}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[B.map(u=>u.kind==="purchase"?e.jsx(_t,{order:u.order},u.id):u.kind==="credit"?e.jsx(Xt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(Qt,{sale:u.sale,payout:Tt(nt,u.sale)},u.id)),R?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:R,onLoadMore:ot})]})]})}export{de as Activity};
291
+ `,W=E.withComponent(Q),y=24,Gt=["all","purchases","sales"];function g(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 n=Number(t)/1e18;return Number.isFinite(n)?n.toLocaleString("en",{maximumFractionDigits:2}):"0"}function it({children:t}){const n=j.useRef(null),[s,i]=j.useState(null),a=()=>{var h;const c=(h=n.current)==null?void 0:h.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return e.jsxs(Ot,{ref:n,tabIndex:0,onMouseEnter:a,onMouseLeave:()=>i(null),onFocus:a,onBlur:()=>i(null),children:[t,s?dt.createPortal(e.jsx(Wt,{style:{top:s.top,left:s.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function Kt({item:t}){const n=!!t.contractAddress&&!!t.itemId,s=!!t.tradeId||n,{data:i,isLoading:a}=v({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?bt(t.tradeId):C(t.contractAddress,{itemId:t.itemId}),enabled:s,staleTime:5*6e4}),c=s&&a,h=(i==null?void 0:i.name)??d("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",x=T({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,m=e.jsxs(e.Fragment,{children:[c?e.jsx(D,{}):e.jsx(M,{children:r?e.jsx("img",{src:r,alt:h}):e.jsx(f,{name:"cart",size:20})}),e.jsxs(H,{children:[c?e.jsx(q,{}):e.jsx(z,{title:h,children:h}),t.quantity>1?e.jsx(O,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(Bt,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]});return x?e.jsx(W,{to:x,"data-link":"true",children:m}):e.jsx(E,{children:m})}function _t({order:t}){const n=$t(t.lines),s=n.reduce((i,a)=>i+a.quantity,0);return e.jsxs(I,{"data-testid":"purchase-order",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:s})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(p,{children:[e.jsx(k,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(S,{children:n.map(i=>e.jsx(Kt,{item:i},i.key))})]})}function Ut({sale:t}){const{data:n,isLoading:s}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(n==null?void 0:n.name)??d("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",c=T({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,h=e.jsxs(e.Fragment,{children:[s?e.jsx(D,{}):e.jsx(M,{children:a?e.jsx("img",{src:a,alt:i}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[s?e.jsx(q,{}):e.jsx(z,{title:i,children:i}),e.jsx(O,{children:d("activity.boughtFrom",{account:tt(t.seller)})})]})]});return e.jsxs(I,{"data-testid":"activity-mana-purchase",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.paidWithMana")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(p,{children:[et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]})]})]}),e.jsx(S,{children:c?e.jsx(W,{to:c,"data-link":"true",children:h}):e.jsx(E,{children:h})})]})}function Qt({sale:t,payout:n}){const{data:s,isLoading:i}=v({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>C(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),a=(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:[i?e.jsx(D,{}):e.jsx(M,{children:c?e.jsx("img",{src:c,alt:a}):e.jsx(f,{name:"offer",size:20})}),e.jsxs(H,{children:[i?e.jsx(q,{}):e.jsx(z,{title:a,children:a}),e.jsxs(O,{children:[d("activity.soldTo",{account:tt(t.counterparty)}),n.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:g(n.availableAt)})}`:""]})]})]});return e.jsxs(I,{"data-testid":"activity-sale",children:[e.jsxs(A,{children:[e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsx(P,{children:d("activity.saleLabel")})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":n.kind==="pending"?"PENDING":"SOLD",children:n.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),n.kind==="direct"?e.jsxs(p,{"data-kind":"income",children:["+",et(t.manaWei)," ",e.jsx(it,{children:e.jsx(J,{src:X,alt:"MANA"})})]}):n.credits!==null?e.jsxs(p,{"data-kind":"income",children:[e.jsx(k,{className:"ccy-mark"})," +",ft(n.credits)]}):e.jsx(p,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(S,{children:h?e.jsx(W,{to:h,"data-link":"true",children:r}):e.jsx(E,{children:r})})]})}function Xt({order:t}){const n=`$${(t.usdCents/100).toFixed(2)}`,s=gt(t.status),i=s==="SETTLED"?d("activity.completed"):s==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(I,{"data-testid":"credit-order",children:e.jsxs(A,{children:[e.jsx(qt,{children:e.jsx("img",{src:Ft,alt:"","aria-hidden":!0})}),e.jsxs(w,{children:[e.jsx($,{children:g(t.createdAt)}),e.jsxs(P,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:n})]})]}),e.jsxs(L,{children:[e.jsx(N,{"data-status":s,children:i}),e.jsxs(p,{"data-kind":"income",children:["+",e.jsx(k,{className:"ccy-mark"})," ",t.credits]})]})]})})}function Zt({filter:t}){const n={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(f,{name:n.icon,size:40,color:o.colors.muted2}),e.jsx(Y,{children:n.title}),e.jsx("p",{className:"muted",children:n.body}),t!=="sales"?e.jsx(Rt,{as:Q,to:"/assets",variant:"purple",children:d("notFound.cta")}):null]})}function de(){xt({title:d("nav.activity"),noindex:!0});const{session:t}=pt(),[n,s]=j.useState("all"),i=!!t&&n!=="sales",a=!!t&&n!=="purchases",c=b(["purchases",t==null?void 0:t.address],u=>mt(t.address,t.identity,{first:y,skip:u}),{enabled:i}),h=b(["sales",t==null?void 0:t.address],u=>G(t.address,{role:"seller",first:y,skip:u}),{enabled:a}),r=b(["credit-orders",t==null?void 0:t.address],u=>K(t.address,t.identity,{first:y,skip:u}),{enabled:i}),x=b(["mana-purchases",t==null?void 0:t.address],u=>G(t.address,{role:"buyer",first:y,skip:u}),{enabled:i}),{data:m}=v({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>K(t.address,t.identity,{first:200}).then(u=>u.payouts),enabled:a,staleTime:6e4}),nt=j.useMemo(()=>Et(m),[m]),{data:st}=jt(a);if(!t)return e.jsxs(V,{children:[e.jsx(f,{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 B=Nt(Lt({purchases:i?c.items:[],sales:a?h.items:[],creditOrders:i?r.items:[],manaPurchases:i?x.items:[],rate:st}),n),at=i&&(c.isLoading||r.isLoading||x.isLoading)||a&&h.isLoading,R=i&&(c.isFetchingNextPage||r.isFetchingNextPage||x.isFetchingNextPage)||a&&h.isFetchingNextPage,rt=i&&(c.hasNextPage||r.hasNextPage||x.hasNextPage)||a&&h.hasNextPage;function ot(){i&&c.hasNextPage&&c.fetchNextPage(),i&&r.hasNextPage&&r.fetchNextPage(),i&&x.hasNextPage&&x.fetchNextPage(),a&&h.hasNextPage&&h.fetchNextPage()}return e.jsxs(St,{children:[e.jsx(Mt,{children:e.jsx(Dt,{children:d("nav.activity")})}),e.jsx(Ht,{role:"tablist","aria-label":d("nav.activity"),children:Gt.map(u=>e.jsx(zt,{type:"button",role:"tab","aria-selected":n===u,"data-active":n===u,"data-testid":`activity-filter-${u}`,onClick:()=>s(u),children:d(`activity.filter.${u}`)},u))}),at?e.jsx(_,{children:Array.from({length:5}).map((u,ct)=>e.jsx(U,{},ct))}):B.length===0?e.jsx(Zt,{filter:n}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[B.map(u=>u.kind==="purchase"?e.jsx(_t,{order:u.order},u.id):u.kind==="credit"?e.jsx(Xt,{order:u.order},u.id):u.kind==="mana-purchase"?e.jsx(Ut,{sale:u.sale},u.id):e.jsx(Qt,{sale:u.sale,payout:Tt(nt,u.sale)},u.id)),R?e.jsx(U,{}):null]}),e.jsx(vt,{hasNextPage:rt,isFetching:R,onLoadMore:ot})]})]})}export{de as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-DubLtINT.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-I4EEqchH.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -94,4 +94,4 @@ void main() {
94
94
  inset: 0;
95
95
  width: 100%;
96
96
  height: 100%;
97
- `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,S,()=>d),b=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},w=performance.now()/1e3,h=()=>{b(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-w),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${A})`}}),v.jsx(I,{ref:t})]})}export{G as default};
97
+ `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,b,()=>d),w=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${S})`}}),v.jsx(I,{ref:t})]})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6 as Xe,b7 as Ye,d as et,s,t,n as Be,aZ as tt,q as nt,ao as ge,e as n,o as st,I as S,p as M,bu as ne,aY as ot,O as Y,ba as it,b9 as rt,m as Fe,aa as at,ac as Te,ad as q,aq as lt,bv as ct}from"./index-DubLtINT.js";import{u as dt}from"./useSecondarySales-T5w4v68V.js";import{m as pt,a as Le}from"./mana-convert-C1xSiqqu.js";import{u as Ue}from"./useManaRate-GUe-CE9q.js";import{g as ht,h as xt,i as mt,j as ft,k as ut,C as gt,l as bt,o as yt,m as wt,n as jt,M as vt,p as $t,E as Ct,q as kt,r as St,s as Et,t as Rt,u as Tt,v as _t}from"./Assets.styles-Cxk14RF3.js";import{S as _e,R as zt,F as It,e as At}from"./categories-koDpxIGQ.js";import{L as Nt}from"./LoadMore-CUa0BsTv.js";import{u as Mt}from"./useInfiniteGrid-DY2zLmAX.js";import{E as Pt}from"./ErrorNotice-D6-7YD_C.js";import{d as Wt}from"./dcl-schemas-Dr9BTjb7.js";import{s as Bt,G as Ft,w as Lt,S as Ut}from"./buy-gasless-ByVYfkrv.js";import{s as Ht}from"./buy-D9SdPT0I.js";import{i as Ot}from"./trade-encoding-BJEZpBsE.js";import{r as Gt}from"./mana-rate-BpHfe_iw.js";import{f as Dt}from"./errors-boW7-tfx.js";import{J as qt,C as Vt,B as be}from"./ethers-CtNGBird.js";import{n as Zt}from"./Tooltip-bl4-JEoI.js";import{G as Kt}from"./grid.styles-DY-TUpQG.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-CYYNI-9S.js";import"./sendMetaTransaction-CgzqVu54.js";function V(o){const i=o.source??"item",a=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${a}`}const L="100000000000000000000",He=2,ee=15,Jt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Jt.test(i)?i.length<He?{ok:!1,reason:"too-short"}:i.length>ee?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Xt=["function available(string _subdomain) view returns (bool)"],Ie={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return F.chainId===Number(Wt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function en(o,i={}){var p;const{rpc:a,address:h}=Yt(),l=new qt(a),d=new Vt(h,Xt,l);console.info(`[names] availability check → DCLRegistrar(${h}).available("${o}") on ${a}`);const x=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class ye extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(o){return pt(L,o)}async function sn(o,i,a={}){var p;const h=a.chainId??F.chainId,l=a.provider??"across",d=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${h}&provider=${l}`,x=await et(d,{method:"GET",identity:o,metadata:{}});if(!x.ok){let r;try{r=(p=await x.json())==null?void 0:p.code}catch{}throw r==="ROUTE_COST_TOO_HIGH"?new ye:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ot(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:l.isNegative()?"0":l.toString(),maxCreditedValue:L}}async function rn(o,i={}){const a=tn,h=i.intervalMs??1e4,l=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const p=await fetch(`${a}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const r=await p.json(),u=(r.status??"pending").toLowerCase(),g=r.fillTx??r.fillTxnRef??null,w=r.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:w}}}catch{}x<l-1&&await new Promise(p=>setTimeout(p,h))}return d}async function an(o){const{name:i,identity:a,signer:h}=o,l=o.chainId??F.chainId,d=o.provider??"across",x=(o.beneficiary??await h.getAddress()).toLowerCase();let p=null,r=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:d});try{const u=await Gt(l),g=nn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await sn(a,i,{chainId:l,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 Xe(a,g);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),be.from(j.maxCreditedValue).lt(L))throw new Error("Credit under-sized for the name price");const k=on(j.credit,w);let m;try{m=await Bt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Ft))throw b;m=await Ht(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:m}),await Lt(m),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:m}),d==="across"){const b=await rn(m,o.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:m};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:m,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:m}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:x,originConfirmed:r}),u instanceof Ut)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Ye(a,[p]).catch(()=>{}),u instanceof ye)throw u;const g=new Error(Dt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=u,g}}const ln=s.div`
1
+ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6 as Xe,b7 as Ye,d as et,s,t,n as Be,aZ as tt,q as nt,ao as ge,e as n,o as st,I as S,p as M,bu as ne,aY as ot,O as Y,ba as it,b9 as rt,m as Fe,aa as at,ac as Te,ad as q,aq as lt,bv as ct}from"./index-I4EEqchH.js";import{u as dt}from"./useSecondarySales-CaN1WkpM.js";import{m as pt,a as Le}from"./mana-convert-CmDEKake.js";import{u as Ue}from"./useManaRate-Cfp1rcnf.js";import{g as ht,h as xt,i as ft,j as mt,k as ut,C as gt,l as bt,o as yt,m as wt,n as jt,M as vt,p as $t,E as Ct,q as kt,r as St,s as Et,t as Rt,u as Tt,v as _t}from"./Assets.styles-B1LMem3Q.js";import{S as _e,R as zt,F as It,e as At}from"./categories-fdqQ1jGj.js";import{L as Nt}from"./LoadMore-DD6-EqBS.js";import{u as Mt}from"./useInfiniteGrid-Ct3kWony.js";import{E as Pt}from"./ErrorNotice-BSIjN9FY.js";import{d as Wt}from"./dcl-schemas-Dr9BTjb7.js";import{s as Bt,G as Ft,w as Lt,S as Ut}from"./buy-gasless-Bgmi9EE6.js";import{s as Ht}from"./buy-7YNy1Ky6.js";import{i as Ot}from"./trade-encoding-BnDgi1QQ.js";import{r as Gt}from"./mana-rate-BjVix_kr.js";import{f as Dt}from"./errors-D_opMycA.js";import{J as qt,C as Vt,B as be}from"./ethers-CtNGBird.js";import{n as Zt}from"./Tooltip-8Rn2EQnm.js";import{G as Kt}from"./grid.styles-qz7ti9Zv.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-C1shI8qN.js";import"./sendMetaTransaction-Bj0jdOFW.js";function V(o){const i=o.source??"item",a=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${a}`}const L="100000000000000000000",He=2,ee=15,Jt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Jt.test(i)?i.length<He?{ok:!1,reason:"too-short"}:i.length>ee?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Xt=["function available(string _subdomain) view returns (bool)"],Ie={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return F.chainId===Number(Wt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function en(o,i={}){var p;const{rpc:a,address:h}=Yt(),l=new qt(a),d=new Vt(h,Xt,l);console.info(`[names] availability check → DCLRegistrar(${h}).available("${o}") on ${a}`);const x=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class ye extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(o){return pt(L,o)}async function sn(o,i,a={}){var p;const h=a.chainId??F.chainId,l=a.provider??"across",d=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${h}&provider=${l}`,x=await et(d,{method:"GET",identity:o,metadata:{}});if(!x.ok){let r;try{r=(p=await x.json())==null?void 0:p.code}catch{}throw r==="ROUTE_COST_TOO_HIGH"?new ye:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ot(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:l.isNegative()?"0":l.toString(),maxCreditedValue:L}}async function rn(o,i={}){const a=tn,h=i.intervalMs??1e4,l=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const p=await fetch(`${a}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const r=await p.json(),u=(r.status??"pending").toLowerCase(),g=r.fillTx??r.fillTxnRef??null,w=r.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:w}}}catch{}x<l-1&&await new Promise(p=>setTimeout(p,h))}return d}async function an(o){const{name:i,identity:a,signer:h}=o,l=o.chainId??F.chainId,d=o.provider??"across",x=(o.beneficiary??await h.getAddress()).toLowerCase();let p=null,r=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:d});try{const u=await Gt(l),g=nn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await sn(a,i,{chainId:l,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 Xe(a,g);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),be.from(j.maxCreditedValue).lt(L))throw new Error("Credit under-sized for the name price");const k=on(j.credit,w);let f;try{f=await Bt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Ft))throw b;f=await Ht(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Lt(f),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await rn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:x,originConfirmed:r}),u instanceof Ut)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Ye(a,[p]).catch(()=>{}),u instanceof ye)throw u;const g=new Error(Dt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=u,g}}const ln=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -161,12 +161,12 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6
161
161
  &:focus-within {
162
162
  border-color: ${t.colors.magenta};
163
163
  }
164
- `,mn=s.span`
164
+ `,fn=s.span`
165
165
  flex: none;
166
166
  font-family: ${t.font.sans};
167
167
  font-size: 18px;
168
168
  color: ${t.colors.muted2};
169
- `,fn=s.input`
169
+ `,mn=s.input`
170
170
  flex: 0 1 auto;
171
171
  min-width: 0;
172
172
  border: 0;
@@ -347,7 +347,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6
347
347
  outline: 2px solid ${t.colors.accent};
348
348
  outline-offset: 2px;
349
349
  }
350
- `,me=s.div`
350
+ `,fe=s.div`
351
351
  display: flex;
352
352
  align-items: flex-start;
353
353
  gap: 12px;
@@ -379,7 +379,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=f.useState("confirm"),[g,w]=f.useState(""),[j,k]=f.useState(null),m=f.useRef(!1),b=g.trim().toLowerCase()===o.toLowerCase(),v=r==="completing",E=i!=null?ge(i):"—",C=i==null,_=l==null?void 0:l.credits,R=i!=null&&_!=null?i-_:0,$=R>0,z=C?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:ge(R)}):null;f.useEffect(()=>{const y=H=>{H.key==="Escape"&&!v&&a()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[v,a]);async function I(){if(!(!h||!b||C||$||m.current)){m.current=!0,u("completing"),k(null);try{const y=await an({name:o,identity:h.identity,signer:h.signer});Y("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:y.status}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),u(y.status==="registered"?"success":"pending")}catch(y){Y(rt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:it(y),purchase_type:"name"}),k(y instanceof ye?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),u("error")}finally{m.current=!1}}}const A=r!=="success"&&r!=="pending",te=st(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:r==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:a,disabled:v,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{})]}),(r==="confirm"||r==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),r==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ae,{onClick:()=>u("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Rn(o)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(fn,{value:g,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),z?e.jsxs(me,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:z})]}):null,e.jsx(Ae,{onClick:()=>void I(),disabled:!b||!h||C||$,children:n("names.buyCta")})]})]}),r==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ot,alt:"",width:56,height:56}),e.jsx(yn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),r==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs(me,{"data-tone":"info",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsx(Ne,{children:e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")})})]}),r==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsxs(Ne,{children:[e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")}),e.jsx(Sn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Rn(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Tn="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/identity-B4DXDuJP.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/governance-DnazlIjy.webp",An=s.div`
382
+ `;function En({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=m.useState("confirm"),[g,w]=m.useState(""),[j,k]=m.useState(null),f=m.useRef(!1),b=g.trim().toLowerCase()===o.toLowerCase(),v=r==="completing",E=i!=null?ge(i):"—",C=i==null,_=l==null?void 0:l.credits,R=i!=null&&_!=null?i-_:0,$=R>0,z=C?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:ge(R)}):null;m.useEffect(()=>{const y=H=>{H.key==="Escape"&&!v&&a()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[v,a]);async function I(){if(!(!h||!b||C||$||f.current)){f.current=!0,u("completing"),k(null);try{const y=await an({name:o,identity:h.identity,signer:h.signer});Y("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:y.status}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),u(y.status==="registered"?"success":"pending")}catch(y){Y(rt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:it(y),purchase_type:"name"}),k(y instanceof ye?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),u("error")}finally{f.current=!1}}}const A=r!=="success"&&r!=="pending",te=st(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:r==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:a,disabled:v,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{})]}),(r==="confirm"||r==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),r==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ae,{onClick:()=>u("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Rn(o)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(fn,{"aria-hidden":!0,children:"@"}),e.jsx(mn,{value:g,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),z?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:z})]}):null,e.jsx(Ae,{onClick:()=>void I(),disabled:!b||!h||C||$,children:n("names.buyCta")})]})]}),r==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ot,alt:"",width:56,height:56}),e.jsx(yn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),r==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsx(Ne,{children:e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")})})]}),r==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsxs(Ne,{children:[e.jsx(Me,{onClick:()=>{a(),p("/my-assets")},children:n("names.myItems")}),e.jsx(Sn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Rn(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Tn="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/identity-B4DXDuJP.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/governance-DnazlIjy.webp",An=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Nn=s.nav`
@@ -658,7 +658,7 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6
658
658
  width: 16px;
659
659
  height: 16px;
660
660
  }
661
- `,fe=s.div`
661
+ `,me=s.div`
662
662
  display: flex;
663
663
  align-items: center;
664
664
  gap: 8px;
@@ -797,4 +797,4 @@ import{d as We,r as f,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b6
797
797
  clip: rect(0, 0, 0, 0);
798
798
  white-space: nowrap;
799
799
  border: 0;
800
- `,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(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 ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=f.useState(""),[p,r]=f.useState("idle"),[u,g]=f.useState(!1),w=f.useRef(null),[j,k]=f.useState(void 0);f.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),f.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const _=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:_.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),_.abort()}},[d]);const m=ze(d),b=m.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(fe,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!m.ok&&m.reason==="too-short"?e.jsx(fe,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="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",ue=48;function Ps(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=f.useState("wearable"),[x,p]=f.useState(null),[r,u]=f.useState([]),[g,w]=f.useState(""),[j,k]=f.useState(""),[m,b]=f.useState("on_sale"),[v,E]=f.useState(!1),[C,_]=f.useState("newest"),[R,$]=f.useState(!1);f.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=T}},[R]);const z=m==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=dt(),y=x?At[x]:void 0,U=(_e.find(c=>c.key===C)??_e[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:m==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Mt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=f.useRef(null);f.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=f.useRef("__init__");f.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:m,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:m,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,m,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(T=>T.includes(c)?T.filter(W=>W!==c):[...T,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of zt)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),m!=="on_sale"&&B.push({key:"status",label:m==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(xt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(ft,{children:[e.jsx(ut,{children:n("assets.filters")}),e.jsx(gt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(bt,{children:e.jsx(yt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:m,onStatus:b,smart:v,onSmart:E})}),e.jsx(wt,{children:e.jsx(jt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(vt,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(It,{sort:C,onSort:_,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx($t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Pt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(Ct,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:hs,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:n("assets.empty.title")}),e.jsx(Rt,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(_t,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(Te,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const T=c;if(T.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(T);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{...T,priceCredits:W}},V(c))}),$e?e.jsx(Te,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ps as Assets};
800
+ `,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(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 ps({onBack:o}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=m.useState(""),[p,r]=m.useState("idle"),[u,g]=m.useState(!1),w=m.useRef(null),[j,k]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const _=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:_.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),_.abort()}},[d]);const f=ze(d),b=f.ok&&(p==="available"||p==="error");function v(){if(b){if(!i){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(me,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(me,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(me,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(os,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="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",ue=48;function Ps(){const[o]=Qe(),i=We(),a=(o.get("q")??"").trim().toLowerCase(),h=(o.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=m.useState("wearable"),[x,p]=m.useState(null),[r,u]=m.useState([]),[g,w]=m.useState(""),[j,k]=m.useState(""),[f,b]=m.useState("on_sale"),[v,E]=m.useState(!1),[C,_]=m.useState("newest"),[R,$]=m.useState(!1);m.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=T}},[R]);const z=f==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=dt(),y=x?At[x]:void 0,U=(_e.find(c=>c.key===C)??_e[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Mt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=m.useRef(null);m.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=m.useRef("__init__");m.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:f,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:f,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,f,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(T=>T.includes(c)?T.filter(W=>W!==c):[...T,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of zt)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),f!=="on_sale"&&B.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(xt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(ft,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(mt,{children:[e.jsx(ut,{children:n("assets.filters")}),e.jsx(gt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(bt,{children:e.jsx(yt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:f,onStatus:b,smart:v,onSmart:E})}),e.jsx(wt,{children:e.jsx(jt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(vt,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(It,{sort:C,onSort:_,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx($t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Pt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(Ct,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:hs,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:n("assets.empty.title")}),e.jsx(Rt,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(_t,{type:"button",onClick:()=>i("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(Te,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const T=c;if(T.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(T);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{...T,priceCredits:W}},V(c))}),$e?e.jsx(Te,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ps as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-koDpxIGQ.js";import{n as c,T as se}from"./Tooltip-bl4-JEoI.js";import{t as e,s as o,I as g,e as s,aa as ae,f as v}from"./index-DubLtINT.js";const re=o.div`
1
+ import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-fdqQ1jGj.js";import{n as c,T as se}from"./Tooltip-8Rn2EQnm.js";import{t as e,s as o,I as g,e as s,aa as ae,f as v}from"./index-I4EEqchH.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 i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,k as R,m as F,e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,l as X,x as Z,y as T}from"./index-DubLtINT.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-CYYNI-9S.js";import{f as et}from"./builder-WW8inl03.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-boW7-tfx.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CgzqVu54.js";const nt=R`
1
+ import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,k as R,m as F,e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,l as X,x as Z,y as T}from"./index-I4EEqchH.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-C1shI8qN.js";import{f as et}from"./builder-CxQSxnbg.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-D_opMycA.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Bj0jdOFW.js";const nt=R`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=R`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,d as ea,b as ta}from"./react-DehiWSvs.js";import{t as le,s as i,e as s,ao as de,aY as aa,an as sa,I as O,p as Mt,a9 as Ne,m as na,L as Q,ab as dt,n as ia,u as ra,aZ as oa,q as ca,a_ as da,a$ as la,b0 as ua,b1 as ha,o as pa,b2 as lt,O as G,b3 as ut,b4 as ga,l as ae,c as ht,b5 as xa,f as ma,b6 as pt,b7 as Re,b8 as ye,b9 as be,ba as gt,a as ve,b as fa,C as We,bb as ya}from"./index-DubLtINT.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as _a,n as mt,o as ft,W as Ba,p as Ra,q as Wa,A as Fa,r as La,s as Ka,t as Ua,u as Na,v as Qa,w as Oa,x as Ha,y as Va,z as Ga,D as Ya,E as Da,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-C0LgFQAu.js";import{u as cs}from"./useManaRate-GUe-CE9q.js";import{r as ds}from"./mana-rate-BpHfe_iw.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-CYYNI-9S.js";import{g as ms,b as Le}from"./buy-D9SdPT0I.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-ByVYfkrv.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-B9dcdQRV.js";import{i as ks,a as $s}from"./errors-boW7-tfx.js";import{E as Ss}from"./ErrorNotice-D6-7YD_C.js";import{u as Ct}from"./mana-convert-C1xSiqqu.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BJEZpBsE.js";import"./sendMetaTransaction-CgzqVu54.js";const{colors:se,radius:Ms}=le,Ts=i.div`
1
+ import{j as e,L as Se,r as P,d as ea,b as ta}from"./react-DehiWSvs.js";import{t as le,s as i,e as s,ao as de,aY as aa,an as sa,I as O,p as Mt,a9 as Ne,m as na,L as Q,ab as dt,n as ia,u as ra,aZ as oa,q as ca,a_ as da,a$ as la,b0 as ua,b1 as ha,o as pa,b2 as lt,O as G,b3 as ut,b4 as ga,l as ae,c as ht,b5 as xa,f as ma,b6 as pt,b7 as Re,b8 as ye,b9 as be,ba as gt,a as ve,b as fa,C as We,bb as ya}from"./index-I4EEqchH.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as _a,n as mt,o as ft,W as Ba,p as Ra,q as Wa,A as Fa,r as La,s as Ka,t as Ua,u as Na,v as Qa,w as Oa,x as Ha,y as Va,z as Ga,D as Ya,E as Da,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-jmGi2U05.js";import{u as cs}from"./useManaRate-Cfp1rcnf.js";import{r as ds}from"./mana-rate-BjVix_kr.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-C1shI8qN.js";import{g as ms,b as Le}from"./buy-7YNy1Ky6.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-Bgmi9EE6.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks--aSgsJ92.js";import{i as ks,a as $s}from"./errors-D_opMycA.js";import{E as Ss}from"./ErrorNotice-BSIjN9FY.js";import{u as Ct}from"./mana-convert-CmDEKake.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BnDgi1QQ.js";import"./sendMetaTransaction-Bj0jdOFW.js";const{colors:se,radius:Ms}=le,Ts=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,d as ea,b as ta}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,Es="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":D||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:Y}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Bs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(_a,{children:ne}),Y?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Bs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(Ra,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Ua,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Na,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Oa,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ha,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Da,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:D,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:Y,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
61
+ `,Es="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":D||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:Y}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Bs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(_a,{children:ne}),Y?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Bs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(Ra,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Ua,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Na,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Oa,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ha,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Da,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:D,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:Y,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -1,4 +1,4 @@
1
- import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-DubLtINT.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-_vaSICRo.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
1
+ import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-I4EEqchH.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-DqDJX0Wu.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,R as X,v as E,I as ee,e as a,c as te,l as ae,u as re,m as oe,f as ie,ac as F,ad as se,aT as ne,aU as ce}from"./index-DubLtINT.js";import{E as le}from"./ErrorNotice-D6-7YD_C.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-CrLB3Lke.js";import{u as ye}from"./useStore-Br1E1f__.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as ke,H as Pe,e as $e}from"./categories-koDpxIGQ.js";import{L as Ae}from"./LoadMore-CUa0BsTv.js";import{u as Me}from"./useInfiniteGrid-DY2zLmAX.js";import{G as Re}from"./grid.styles-DY-TUpQG.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Te=c.section`
1
+ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,R as X,v as E,I as ee,e as a,c as te,l as ae,u as re,m as oe,f as ie,ac as F,ad as se,aT as ne,aU as ce}from"./index-I4EEqchH.js";import{E as le}from"./ErrorNotice-BSIjN9FY.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-CdBFJnD1.js";import{u as ye}from"./useStore-ChkmZ3qe.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as ke,H as Pe,e as $e}from"./categories-fdqQ1jGj.js";import{L as Ae}from"./LoadMore-DD6-EqBS.js";import{u as Me}from"./useInfiniteGrid-Ct3kWony.js";import{G as Re}from"./grid.styles-qz7ti9Zv.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Te=c.section`
2
2
  position: relative;
3
3
  border-radius: ${v.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,e as g,p as k,ao as j,bs as C,f as Y,k as G,I as Q,l as X,a as W,C as E,b as Z,Y as J,bQ as F,ad as q}from"./index-DubLtINT.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-CYYNI-9S.js";import{i as ie}from"./errors-boW7-tfx.js";import{E as oe}from"./ErrorNotice-D6-7YD_C.js";import{a as se}from"./buy-D9SdPT0I.js";import{g as re,a as ce}from"./trade-encoding-BJEZpBsE.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-CgzqVu54.js";import{I as he,C as ue}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,f=fe(l,n,s);d>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(l=>l.method==="credits"))==null?void 0:b.method)??((y=c.find(l=>l.method==="combined"))==null?void 0:y.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,m=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
1
+ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,e as g,p as k,ao as j,bs as C,f as Y,k as G,I as Q,l as X,a as W,C as E,b as Z,Y as J,bQ as F,ad as q}from"./index-I4EEqchH.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-C1shI8qN.js";import{i as ie}from"./errors-D_opMycA.js";import{E as oe}from"./ErrorNotice-BSIjN9FY.js";import{a as se}from"./buy-7YNy1Ky6.js";import{g as re,a as ce}from"./trade-encoding-BnDgi1QQ.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-Bj0jdOFW.js";import{I as he,C as ue}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,f=fe(l,n,s);d>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(l=>l.method==="credits"))==null?void 0:b.method)??((y=c.find(l=>l.method==="combined"))==null?void 0:y.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,m=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Z,A as je,E as I,D as _,s as r,bc as ve,an as Ce,bd as ye,e as t,be as $e,bf as W,B as ke,a9 as q,R as J,n as Ne,v as Q,I as T,c as Pe,m as Se,ac as S,f as Le,ad as Ae,bb as Ee,bg as Fe}from"./index-DubLtINT.js";import{d as Me,g as ze,a as Be,P as Re,C as Ie,b as _e,c as We,A as Te,B as He,S as Ue,M as De,e as Ge,f as Ke}from"./browseLayout.styles-CrLB3Lke.js";import{u as Oe,L as Ve}from"./useStore-Br1E1f__.js";import{S as H,C as Ye,F as Ze,c as qe,P as Je,d as Qe,H as Xe,e as et}from"./categories-koDpxIGQ.js";import{L as U}from"./LoadMore-CUa0BsTv.js";import{u as D}from"./useInfiniteGrid-DY2zLmAX.js";import{E as G}from"./ErrorNotice-D6-7YD_C.js";import{G as K}from"./grid.styles-DY-TUpQG.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:tt}=Z,it=r.article`
1
+ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Z,A as je,E as I,D as _,s as r,bc as ve,an as Ce,bd as ye,e as t,be as $e,bf as W,B as ke,a9 as q,R as J,n as Ne,v as Q,I as T,c as Pe,m as Se,ac as S,f as Le,ad as Ae,bb as Ee,bg as Fe}from"./index-I4EEqchH.js";import{d as Me,g as ze,a as Be,P as Re,C as Ie,b as _e,c as We,A as Te,B as He,S as Ue,M as De,e as Ge,f as Ke}from"./browseLayout.styles-CdBFJnD1.js";import{u as Oe,L as Ve}from"./useStore-ChkmZ3qe.js";import{S as H,C as Ye,F as Ze,c as qe,P as Je,d as Qe,H as Xe,e as et}from"./categories-fdqQ1jGj.js";import{L as U}from"./LoadMore-DD6-EqBS.js";import{u as D}from"./useInfiniteGrid-Ct3kWony.js";import{E as G}from"./ErrorNotice-BSIjN9FY.js";import{G as K}from"./grid.styles-qz7ti9Zv.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:tt}=Z,it=r.article`
2
2
  height: 300px;
3
3
  background: ${u.bg};
4
4
  border-radius: ${X.card};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-DubLtINT.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-I4EEqchH.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-CNMm9yRj.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BeZANkpU.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BefcEwHF.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-5BrpwK2E.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,k as E,m as ue,e as r,f as p,n as ge,q as fe,O as f,b1 as me,l as H,ba as N,I as re,aY as D,p as B,bt as O}from"./index-DubLtINT.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-B9dcdQRV.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-convert-C1xSiqqu.js";const P="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/credit-coin-CmcTCd5i.webp",$e="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Se="https://cdn.decentraland.org/@dcl/shop/0.1.1-30910936579.commit-bb58bbb/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
1
+ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,k as E,m as ue,e as r,f as p,n as ge,q as fe,O as f,b1 as me,l as H,ba as N,I as re,aY as D,p as B,bt as O}from"./index-I4EEqchH.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks--aSgsJ92.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-convert-CmDEKake.js";const P="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/credit-coin-CmcTCd5i.webp",$e="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Se="https://cdn.decentraland.org/@dcl/shop/0.2.0/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-8_Ez2ez1.js";import{d as g,r as v}from"./index-BeZANkpU.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CNMm9yRj.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-D5sgkVGL.js";import{d as g,r as v}from"./index-5BrpwK2E.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BefcEwHF.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{j as e,d as se,r as w,L as ae}from"./react-DehiWSvs.js";import{t as Q,s as t,k as re,o as oe,e as n,f as _,B as S,p as de,O as le,aX as F,l as D,F as ce,m as pe,n as xe,q as he,u as ge,aa as me,I as K,Z as ue,a1 as fe,a2 as we,bs as ye,w as je}from"./index-DubLtINT.js";import{i as be,b as ve,S as ke,C as $e,c as W,f as Ie}from"./ManaPricingBanner.styles-D8qXS7kM.js";import{u as Ce}from"./useSecondarySales-T5w4v68V.js";import{C as U}from"./field.styles-icpuqiLd.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-D9SdPT0I.js";import"./authorizations-CYYNI-9S.js";import"./sendMetaTransaction-CgzqVu54.js";import"./trade-encoding-BJEZpBsE.js";import"./mana-rate-BpHfe_iw.js";import"./mana-convert-C1xSiqqu.js";function O({size:a=12,...v}){return e.jsx("svg",{viewBox:"0 0 20 20",width:a,height:a,fill:"none","aria-hidden":!0,focusable:"false",...v,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:L,radius:Se,z:Le}=Q,Te=re`
1
+ import{j as e,d as se,r as w,L as ae}from"./react-DehiWSvs.js";import{t as Q,s as t,k as re,o as oe,e as n,f as _,B as S,p as de,O as le,aX as F,l as D,F as ce,m as pe,n as xe,q as he,u as ge,aa as me,I as K,Z as ue,a1 as fe,a2 as we,bs as ye,w as je}from"./index-I4EEqchH.js";import{i as be,b as ve,S as ke,C as $e,c as W,f as Ie}from"./ManaPricingBanner.styles-CW9IN_dA.js";import{u as Ce}from"./useSecondarySales-CaN1WkpM.js";import{C as U}from"./field.styles-CRXnbqs7.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-7YNy1Ky6.js";import"./authorizations-C1shI8qN.js";import"./sendMetaTransaction-Bj0jdOFW.js";import"./trade-encoding-BnDgi1QQ.js";import"./mana-rate-BjVix_kr.js";import"./mana-convert-CmDEKake.js";function O({size:a=12,...v}){return e.jsx("svg",{viewBox:"0 0 20 20",width:a,height:a,fill:"none","aria-hidden":!0,focusable:"false",...v,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:L,radius:Se,z:Le}=Q,Te=re`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0;