@dcl/shop 0.1.0-30903100943.commit-cfb5121 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/_assets/{Activity-COPN1oEb.js → Activity-BwdIaUnW.js} +1 -1
  2. package/_assets/{AnimatedBackground-D4Ktoyt4.js → AnimatedBackground-DP8XKTVN.js} +1 -1
  3. package/_assets/{Assets-CzRI4yu1.js → Assets-Degiynxt.js} +2 -2
  4. package/_assets/{Assets.styles-DEZ9a_GD.js → Assets.styles-CmDKBB8r.js} +1 -1
  5. package/_assets/{Authorizations-B0Pwosn7.js → Authorizations-CJeq3VNJ.js} +1 -1
  6. package/_assets/{Cart-8yxyOMFq.js → Cart-DsUb4sI3.js} +2 -2
  7. package/_assets/{CircularProgress-_0gSPNcC.js → CircularProgress-CNroeQ3o.js} +1 -1
  8. package/_assets/{Collection-BNupOSqS.js → Collection-CP0tfCsZ.js} +1 -1
  9. package/_assets/{CollectionCarousel-CDNotQwG.js → CollectionCarousel-D36c6dts.js} +1 -1
  10. package/_assets/{Creator-kdxiJJNF.js → Creator-CWs_Cx5f.js} +1 -1
  11. package/_assets/{ErrorNotice-6S2ayRHK.js → ErrorNotice-COIh7ro4.js} +1 -1
  12. package/_assets/{ExchangeController-11B8Didx.js → ExchangeController-DOL-_brz.js} +1 -1
  13. package/_assets/{GetCredits-eFL8Gd7X.js → GetCredits-BkjOQ5or.js} +1 -1
  14. package/_assets/{HelpersUtil-Bto4kwHu.js → HelpersUtil-2hZP33Du.js} +1 -1
  15. package/_assets/{ImportListings-D3H-40Vh.js → ImportListings-DryzCKJV.js} +1 -1
  16. package/_assets/{ItemDetail-qMRlyp0m.js → ItemDetail-D57x9bXl.js} +3 -3
  17. package/_assets/{LoadMore-COkJGWsB.js → LoadMore-BsvftUzw.js} +1 -1
  18. package/_assets/{MenuList-BVkS7rPq.js → MenuList-d6ca0DH6.js} +1 -1
  19. package/_assets/{MyAssets-Bk8E7-3O.js → MyAssets-OTnYju0y.js} +1 -1
  20. package/_assets/{MyFavorites-DxsLDfOF.js → MyFavorites-DxYh88wB.js} +1 -1
  21. package/_assets/{NotFound-BGXTL5g4.js → NotFound-DA15lCMu.js} +1 -1
  22. package/_assets/{NotificationsBell-BdXSXxoi.js → NotificationsBell-C8r1c8mg.js} +1 -1
  23. package/_assets/{StoreSettings-Ct8rsmjt.js → StoreSettings-2jXFUoeV.js} +1 -1
  24. package/_assets/{Success-CVU4jEw2.js → Success-2HbLWhw3.js} +1 -1
  25. package/_assets/{SwapController-DKM9_drr.js → SwapController-CRz8E17o.js} +1 -1
  26. package/_assets/{Tooltip-3y4DnUZl.js → Tooltip-D92WFEmr.js} +1 -1
  27. package/_assets/{TradeService-M0ORTST0.js → TradeService-DIWR3GwD.js} +1 -1
  28. package/_assets/{W3MFrameProviderSingleton-BJW4ebEt.js → W3MFrameProviderSingleton-BuQKbZaF.js} +3 -3
  29. package/_assets/{WebCryptoP256-Q8DCxoH7.js → WebCryptoP256-BFDAPngw.js} +1 -1
  30. package/_assets/{authorizations-JSOY6ArB.js → authorizations-BNs0emga.js} +1 -1
  31. package/_assets/{basic-CL-AAo1G.js → basic-C6XisVyZ.js} +1 -1
  32. package/_assets/{biconomy-8Mt6lCpX.js → biconomy-09nDKxxN.js} +1 -1
  33. package/_assets/{browseLayout.styles-CwDiK1mG.js → browseLayout.styles-CTl6D_zv.js} +1 -1
  34. package/_assets/{builder-Biq1yQgT.js → builder-C8hUH3RB.js} +1 -1
  35. package/_assets/{buy-DTB3xpDX.js → buy-Cl7snZzi.js} +1 -1
  36. package/_assets/{buy-gasless-C9C0u3NU.js → buy-gasless-DVLP7U8S.js} +1 -1
  37. package/_assets/{categories-BqS-qyq6.js → categories-BGGjSLd9.js} +1 -1
  38. package/_assets/{ccip-Dg2AIV_h.js → ccip-DLDLk2fK.js} +1 -1
  39. package/_assets/{ccip-C-gvRqi4.js → ccip-Dx_KcJBs.js} +1 -1
  40. package/_assets/{clsx-3D8Gvjd6.js → clsx-BY1AO2V7.js} +1 -1
  41. package/_assets/{controller-zP9LZHG8.js → controller-ZqrzYJ4o.js} +2 -2
  42. package/_assets/{core-ByomFIcR.js → core-CWR04nJr.js} +4 -4
  43. package/_assets/{createSvgIcon--KCu3mQi.js → createSvgIcon-BUIodiet.js} +1 -1
  44. package/_assets/{custom-DVYkMp5n.js → custom-DMjRmtpL.js} +1 -1
  45. package/_assets/{data-capture-EB6mxn_K.js → data-capture-SoaOqGRY.js} +1 -1
  46. package/_assets/{email-Ye0p9P8Q.js → email-i8v6FMCW.js} +1 -1
  47. package/_assets/{embedded-wallet-CGoVzP7f.js → embedded-wallet-DBT_Ev8g.js} +1 -1
  48. package/_assets/{emotion-styled.browser.esm-Dn08UyTd.js → emotion-styled.browser.esm-C5sYTDtN.js} +1 -1
  49. package/_assets/{engine-Dp6sxgpw.js → engine-Bn2HNIpq.js} +1 -1
  50. package/_assets/{errors-Bj3SjlpX.js → errors-Ce5OngHE.js} +1 -1
  51. package/_assets/{estimate-l1-fee-Cc-Hn0JH.js → estimate-l1-fee-BYqkQ2bZ.js} +1 -1
  52. package/_assets/{execute-DEi9TgB2.js → execute-DO9Rpu0c.js} +2 -2
  53. package/_assets/{features-gpHPkHzw.js → features-5tSUGHg0.js} +1 -1
  54. package/_assets/{fetchTokenMetadata-Ra0c0GwR.js → fetchTokenMetadata-CHnDbBcr.js} +2 -2
  55. package/_assets/{get-ecosystem-wallet-info-9p7i45R2.js → get-ecosystem-wallet-info-43Mjiw6m.js} +1 -1
  56. package/_assets/{getBalance-BPqaF9kw.js → getBalance-BU5lPIM1.js} +1 -1
  57. package/_assets/{getNFT-DLY4PgPX.js → getNFT-Ctbterca.js} +1 -1
  58. package/_assets/{getNFT-Bfk2HgRC.js → getNFT-bNpY4yta.js} +1 -1
  59. package/_assets/{getThemeProps-CnXSHx3q.js → getThemeProps-xrG7EYWl.js} +1 -1
  60. package/_assets/{grid.styles-Dnnyw76z.js → grid.styles-B1mDfzvi.js} +1 -1
  61. package/_assets/{hashTypedData-Dg1gWYZ1.js → hashTypedData-BiojmScK.js} +1 -1
  62. package/_assets/{hashTypedData-h1iD1tUS.js → hashTypedData-DaCcjWXS.js} +1 -1
  63. package/_assets/{import-C0DSObrV.js → import-DbH_aWZX.js} +1 -1
  64. package/_assets/{in-app-Dc0ubTKN.js → in-app-Sb-fFEpv.js} +1 -1
  65. package/_assets/{in-app-wallet-calls-DAEOP0UK.js → in-app-wallet-calls-BYLiaB1J.js} +1 -1
  66. package/_assets/{index-m2y-Tbkf.js → index-6HemuoHH.js} +1 -1
  67. package/_assets/{index-D8q7Jz9s.js → index-B3FH4SmC.js} +1 -1
  68. package/_assets/{index-D3oCO2M2.js → index-B4EKT3oF.js} +1 -1
  69. package/_assets/{index-J95gyscE.js → index-BBM5Da88.js} +1 -1
  70. package/_assets/{index-CKkr1ttw.js → index-BCG-_RTT.js} +1 -1
  71. package/_assets/{index-D4coZIYk.js → index-BEtbI0Zv.js} +1 -1
  72. package/_assets/{index-BhJHWAVJ.js → index-BIJ2qchS.js} +3 -3
  73. package/_assets/{index-CG7tIraF.js → index-BNEWEGXe.js} +1 -1
  74. package/_assets/{index-B6Fs-ly-.js → index-BNnLGudB.js} +1 -1
  75. package/_assets/{index-BOnfcMc4.js → index-BQG7R5QF.js} +1 -1
  76. package/_assets/{index-2pVHJLxW.js → index-BV7d8LIf.js} +1 -1
  77. package/_assets/{index-DwkSO4Fj.js → index-Bb2mLVTh.js} +1 -1
  78. package/_assets/{index-DztT3S7O.js → index-BbxUYBIl.js} +1 -1
  79. package/_assets/{index-BamkywF1.js → index-BdWG2PoE.js} +1 -1
  80. package/_assets/{index-Ao5E92z8.js → index-BgKl-ydS.js} +1 -1
  81. package/_assets/{index-pFuDxg7C.js → index-Bor4cMvk.js} +1 -1
  82. package/_assets/{index-Dy_LMTRI.js → index-BpA1I7hL.js} +1 -1
  83. package/_assets/{index-hqGVy2_2.js → index-BsQQxLJN.js} +1 -1
  84. package/_assets/{index-DH0c2sDT.js → index-C6rpfPMS.js} +1 -1
  85. package/_assets/{index-D8KhhQnq.js → index-CD9t0mSF.js} +1 -1
  86. package/_assets/{index-BQCPF_JE.js → index-CE-Z89iI.js} +1 -1
  87. package/_assets/{index-CfekU9H3.js → index-CKo0vnRV.js} +1 -1
  88. package/_assets/{index-BNtMsGNE.js → index-CSqaG5Rs.js} +1 -1
  89. package/_assets/{index-BM1FRjnS.js → index-CSu0sG0T.js} +1 -1
  90. package/_assets/{index-LeLZ_uWV.js → index-CVMO2zcQ.js} +1 -1
  91. package/_assets/{index-DDvI0nc8.js → index-CcZyuO92.js} +1 -1
  92. package/_assets/{index-DMj5fO9M.js → index-CcrwUr4B.js} +1 -1
  93. package/_assets/{index-B8qQ9Xxb.js → index-Cn-oc3fB.js} +11 -11
  94. package/_assets/{index-CduQbEdH.js → index-CrlwRjah.js} +1 -1
  95. package/_assets/{index-CMIJ-ZVj.js → index-Cso0PIKg.js} +3 -3
  96. package/_assets/{index-C-b_AO6R.js → index-Cv-5v5Ze.js} +1 -1
  97. package/_assets/{index-CXgEBMJX.js → index-CviVJpxw.js} +1 -1
  98. package/_assets/{index-CvBvIAAr.js → index-D20v1ehb.js} +1 -1
  99. package/_assets/{index-gE5SSQSY.js → index-DC-Z7MbP.js} +2 -2
  100. package/_assets/{index-DftWUdZW.js → index-DETprG7w.js} +1 -1
  101. package/_assets/{index-BUZUrnlT.js → index-DLEx9ISf.js} +1 -1
  102. package/_assets/{index-CxY85bhM.js → index-DMKhInQc.js} +2 -2
  103. package/_assets/{index-COHrUo7z.js → index-DNaX9VGC.js} +1 -1
  104. package/_assets/{index-CGW79JV0.js → index-DWFCwLfs.js} +1 -1
  105. package/_assets/{index-DKa2ijHa.js → index-DbkHKS7K.js} +2 -2
  106. package/_assets/{index-BbnJ0vOM.js → index-DjcstBXY.js} +1 -1
  107. package/_assets/{index-Bl758CqY.js → index-DmGcqzuR.js} +1 -1
  108. package/_assets/{index-1pLrpdjR.js → index-DvlgcdsJ.js} +1 -1
  109. package/_assets/{index-B3HbKd_C.js → index-DyGnajSZ.js} +1 -1
  110. package/_assets/{index-BxIpnJ-e.js → index-OiKTI-o_.js} +1 -1
  111. package/_assets/{index-CbtJGEzL.js → index-PJSp7ijP.js} +3 -3
  112. package/_assets/{index-D0MHCwdz.js → index-RSxxMPji.js} +1 -1
  113. package/_assets/{index-DIxy9dSs.js → index-ZoIpzYhg.js} +1 -1
  114. package/_assets/{index-Ck2_-x0t.js → index-cSAleFRI.js} +1 -1
  115. package/_assets/{index-DaOQeGvk.js → index-hesFTmUX.js} +1 -1
  116. package/_assets/{index-BdOwsIe5.js → index-qVmIz0zn.js} +1 -1
  117. package/_assets/{index.es-euS_bME-.js → index.es-4ugP_xPq.js} +1 -1
  118. package/_assets/{index.es-Da4QGzPK.js → index.es-BWoKVfSl.js} +1 -1
  119. package/_assets/{index.es-CJ664SSa.js → index.es-DWjGiGDB.js} +4 -4
  120. package/_assets/{localBatchGatewayRequest-B0RWHv93.js → localBatchGatewayRequest-DxATZPfq.js} +1 -1
  121. package/_assets/{mana-convert-Bbf4K53E.js → mana-convert-BAmJatVq.js} +1 -1
  122. package/_assets/{mana-rate-LTr19y4S.js → mana-rate-COZYJ-5D.js} +1 -1
  123. package/_assets/{networks--5_T3A9T.js → networks-BgOd8fAQ.js} +1 -1
  124. package/_assets/{onramp-9Nrqe-Pb.js → onramp-C1zk7UMI.js} +1 -1
  125. package/_assets/{openzeppelin-D0j0nh8u.js → openzeppelin-JqnI3fjU.js} +1 -1
  126. package/_assets/{parseNft-BSSsDQ8Z.js → parseNft-yDYimY68.js} +2 -2
  127. package/_assets/{parseSignature-DItIXRz8.js → parseSignature-DDl2oW2S.js} +3 -3
  128. package/_assets/{parseSignature-BQoanGXT.js → parseSignature-Zp5jbuFC.js} +1 -1
  129. package/_assets/{passkeys-DVMTGRYE.js → passkeys-D630VzP0.js} +1 -1
  130. package/_assets/{pay-with-exchange-iX-Lps6l.js → pay-with-exchange-DB12e4gP.js} +1 -1
  131. package/_assets/{qr-overlay-CVyo7Lhb.js → qr-overlay-BFMFKV4B.js} +1 -1
  132. package/_assets/{receive-BsGerVVU.js → receive-C0p5nZhH.js} +1 -1
  133. package/_assets/{resolveImplementation-BdMovGG8.js → resolveImplementation-Cpqxrq_P.js} +1 -1
  134. package/_assets/{rpc-C1Rk473V.js → rpc-BGoWvIYj.js} +1 -1
  135. package/_assets/{secp256k1-CwDWkDbO.js → secp256k1-CxwkeDtE.js} +1 -1
  136. package/_assets/{secp256k1-9MwhCLRe.js → secp256k1-DN4fbJll.js} +1 -1
  137. package/_assets/{secp256k1-CXpi7m_i.js → secp256k1-JugqR1gN.js} +1 -1
  138. package/_assets/{send-C1TRj4n-.js → send-DQo6irxp.js} +1 -1
  139. package/_assets/{send-batch-transaction-CDPqPn4J.js → send-batch-transaction-BwQeKmX0.js} +1 -1
  140. package/_assets/{send-eip712-transaction-Mh2T82Oq.js → send-eip712-transaction-Di3Pi2C5.js} +2 -2
  141. package/_assets/{send-gasless-transaction-DtFmbkdG.js → send-gasless-transaction-CCblCzAN.js} +2 -2
  142. package/_assets/{send-transaction-DHjJaG56.js → send-transaction-CboskMcL.js} +2 -2
  143. package/_assets/{sendMetaTransaction-B3nckO8c.js → sendMetaTransaction-DfeiXpP_.js} +1 -1
  144. package/_assets/{sendRawTransaction-D6RRi1sI.js → sendRawTransaction-BgAwN3aK.js} +3 -3
  145. package/_assets/{serializeTransaction-Cd3BF0ey.js → serializeTransaction-Cn_3vzYE.js} +1 -1
  146. package/_assets/{session-proposal-DDdOs_nB.js → session-proposal-B7rpIMJh.js} +1 -1
  147. package/_assets/{session-request-DXQbFUGh.js → session-request--BJtbaZK.js} +2 -2
  148. package/_assets/{signing-DPyzvfGK.js → signing-DiwulEsw.js} +3 -3
  149. package/_assets/{socials-Bxqg_eUk.js → socials-054eJtzB.js} +1 -1
  150. package/_assets/{swaps-C-Cb_93V.js → swaps-BPYOHTwx.js} +1 -1
  151. package/_assets/{thirdweb-B_cmyHun.js → thirdweb-bX_k_ayM.js} +3 -3
  152. package/_assets/{to-serializable-transaction-Ccol8OTd.js → to-serializable-transaction-caU-fqUx.js} +2 -2
  153. package/_assets/{trade-encoding-CjafzO-R.js → trade-encoding-CXbhpVj8.js} +1 -1
  154. package/_assets/{transactionReceipt-DjSnbHOR.js → transactionReceipt-BzQM-iWX.js} +1 -1
  155. package/_assets/{transactions-Cwjx3u4Y.js → transactions-UfEKiBWb.js} +1 -1
  156. package/_assets/{useCreditPacks-CcsRRofr.js → useCreditPacks-Ceg0Oam0.js} +1 -1
  157. package/_assets/{useInfiniteGrid-jYXiF9Ls.js → useInfiniteGrid-YGnKZcnB.js} +1 -1
  158. package/_assets/useManaRate-BhMxx3e3.js +1 -0
  159. package/_assets/{useSecondarySales-DVrg7pqD.js → useSecondarySales-BUPg_0HB.js} +1 -1
  160. package/_assets/{useStore-Du3YYL1J.js → useStore-j0moew7P.js} +1 -1
  161. package/_assets/{useTheme-DPli5iET.js → useTheme-cGCeJmwR.js} +1 -1
  162. package/_assets/{verifyHash-BJtX_GOJ.js → verifyHash-BlPjp8uI.js} +1 -1
  163. package/_assets/{w3m-modal-CkXrZjMo.js → w3m-modal-B1fkdBpv.js} +1 -1
  164. package/_assets/{w3m-modal-BGOVySb5.js → w3m-modal-CJSqLQbS.js} +1 -1
  165. package/_assets/{wait-for-tx-receipt-BXzCDbp8.js → wait-for-tx-receipt-nJ13gHYr.js} +1 -1
  166. package/_assets/{wallets-lC7V_6IF.js → wallets-BfXeGzQ3.js} +5 -5
  167. package/_assets/{web-connector-Cy9zFti1.js → web-connector-D6DeRRYN.js} +3 -3
  168. package/_assets/{writeContract-BZaMqPJ8.js → writeContract-D1XhZg5B.js} +1 -1
  169. package/_assets/{zoraTestnet-CDtuoGbV.js → zoraTestnet-YWrqaPWn.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +1 -1
  172. package/_assets/useManaRate-BezWDX4Q.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as j,j as e,L as Q,d as dt}from"./react-vyZjIDcS.js";import{aK as lt,s as l,t as o,x as ut,B as ht,m as xt,e as d,n as mt,u as v,I as f,aL as G,aM as K,aN as pt,z as k,aO as gt,ap as T,K as ft,aP as yt,aQ as C}from"./index-B8qQ9Xxb.js";import{m as bt}from"./mana-convert-Bbf4K53E.js";import{u as jt}from"./useManaRate-BezWDX4Q.js";import{L as vt}from"./LoadMore-COkJGWsB.js";import{u as y}from"./useInfiniteGrid-jYXiF9Ls.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-rate-LTr19y4S.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?bt(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.0-30903100943.commit-cfb5121/_assets/credits-product-vs4Q6u6l.svg",F=ut`
1
+ import{r as j,j as e,L as Q,d as dt}from"./react-vyZjIDcS.js";import{aK as lt,s as l,t as o,x as ut,B as ht,m as xt,e as d,n as mt,u as v,I as f,aL as G,aM as K,aN as pt,z as k,aO as gt,ap as T,K as ft,aP as yt,aQ as C}from"./index-Cn-oc3fB.js";import{m as bt}from"./mana-convert-BAmJatVq.js";import{u as jt}from"./useManaRate-BhMxx3e3.js";import{L as vt}from"./LoadMore-BsvftUzw.js";import{u as y}from"./useInfiniteGrid-YGnKZcnB.js";import{m as X}from"./mana-matic-C4e1sNO3.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-rate-COZYJ-5D.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?bt(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.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`
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-B8qQ9Xxb.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-Cn-oc3fB.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{b as We,r as m,j as e,u as Je}from"./react-vyZjIDcS.js";import{c as F,av as Qe,aw as Xe,d as Ye,s,t,n as Be,al as et,D as tt,K as ge,e as n,y as nt,I as S,z as M,aT as ne,aj as st,ar as Y,az as ot,ay as it,m as Fe,o as rt,S as Te,A as q,aU as at,aV as lt}from"./index-B8qQ9Xxb.js";import{u as ct}from"./useSecondarySales-DVrg7pqD.js";import{a as dt,m as Le}from"./mana-convert-Bbf4K53E.js";import{u as Ue}from"./useManaRate-BezWDX4Q.js";import{g as pt,h as ht,i as xt,j as ft,k as mt,C as ut,l as gt,o as bt,m as yt,n as wt,M as jt,p as vt,E as $t,q as Ct,r as kt,s as St,t as Et,u as Rt,v as Tt}from"./Assets.styles-DEZ9a_GD.js";import{c as _e,R as _t,F as zt,S as It}from"./categories-BqS-qyq6.js";import{L as At}from"./LoadMore-COkJGWsB.js";import{u as Nt}from"./useInfiniteGrid-jYXiF9Ls.js";import{E as Mt}from"./ErrorNotice-6S2ayRHK.js";import{d as Pt}from"./dcl-schemas-BICTSpB5.js";import{s as Wt,G as Bt,w as Ft,S as Lt}from"./buy-gasless-C9C0u3NU.js";import{s as Ut}from"./buy-DTB3xpDX.js";import{i as Ht}from"./trade-encoding-CjafzO-R.js";import{r as Ot}from"./mana-rate-LTr19y4S.js";import{f as Dt}from"./errors-Bj3SjlpX.js";import{J as Gt,C as qt,B as be}from"./ethers-CXBJm_wN.js";import{n as Vt}from"./Tooltip-3y4DnUZl.js";import{G as Kt}from"./grid.styles-Dnnyw76z.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-JSOY6ArB.js";import"./sendMetaTransaction-B3nckO8c.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,Zt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Zt.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 Jt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Qt=["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 Xt(){return F.chainId===Number(Pt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function Yt(o,i={}){var p;const{rpc:a,address:h}=Xt(),l=new Gt(a),d=new qt(h,Qt,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 en="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 tn(o){return dt(L,o)}async function nn(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 Ye(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 sn(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ht(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 on(o,i={}){const a=en,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 rn(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 Ot(l),g=tn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await nn(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 Qe(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=sn(j.credit,w);let f;try{f=await Wt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Bt))throw b;f=await Ut(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ft(f),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await on(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 Lt)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Xe(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 an=s.div`
1
+ import{b as We,r as m,j as e,u as Je}from"./react-vyZjIDcS.js";import{c as F,av as Qe,aw as Xe,d as Ye,s,t,n as Be,al as et,D as tt,K as ge,e as n,y as nt,I as S,z as M,aT as ne,aj as st,ar as Y,az as ot,ay as it,m as Fe,o as rt,S as Te,A as q,aU as at,aV as lt}from"./index-Cn-oc3fB.js";import{u as ct}from"./useSecondarySales-BUPg_0HB.js";import{a as dt,m as Le}from"./mana-convert-BAmJatVq.js";import{u as Ue}from"./useManaRate-BhMxx3e3.js";import{g as pt,h as ht,i as xt,j as ft,k as mt,C as ut,l as gt,o as bt,m as yt,n as wt,M as jt,p as vt,E as $t,q as Ct,r as kt,s as St,t as Et,u as Rt,v as Tt}from"./Assets.styles-CmDKBB8r.js";import{c as _e,R as _t,F as zt,S as It}from"./categories-BGGjSLd9.js";import{L as At}from"./LoadMore-BsvftUzw.js";import{u as Nt}from"./useInfiniteGrid-YGnKZcnB.js";import{E as Mt}from"./ErrorNotice-COIh7ro4.js";import{d as Pt}from"./dcl-schemas-BICTSpB5.js";import{s as Wt,G as Bt,w as Ft,S as Lt}from"./buy-gasless-DVLP7U8S.js";import{s as Ut}from"./buy-Cl7snZzi.js";import{i as Ht}from"./trade-encoding-CXbhpVj8.js";import{r as Ot}from"./mana-rate-COZYJ-5D.js";import{f as Dt}from"./errors-Ce5OngHE.js";import{J as Gt,C as qt,B as be}from"./ethers-CXBJm_wN.js";import{n as Vt}from"./Tooltip-D92WFEmr.js";import{G as Kt}from"./grid.styles-B1mDfzvi.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-BNs0emga.js";import"./sendMetaTransaction-DfeiXpP_.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,Zt=/^[a-zA-Z0-9]+$/;function ze(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:Zt.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 Jt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Qt=["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 Xt(){return F.chainId===Number(Pt.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function Yt(o,i={}){var p;const{rpc:a,address:h}=Xt(),l=new Gt(a),d=new qt(h,Qt,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 en="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 tn(o){return dt(L,o)}async function nn(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 Ye(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 sn(o,i){const a=be.from(o.availableAmount),l=be.from(L).sub(a);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ht(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 on(o,i={}){const a=en,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 rn(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 Ot(l),g=tn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await nn(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 Qe(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=sn(j.credit,w);let f;try{f=await Wt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Bt))throw b;f=await Ut(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ft(f),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await on(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 Lt)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Xe(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 an=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -379,7 +379,7 @@ import{b as We,r as m,j as e,u as Je}from"./react-vyZjIDcS.js";import{c as F,av
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function Sn({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=et(h),x=tt(),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 rn({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(it(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ot(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=nt(h==null?void 0:h.providerType);return e.jsx(an,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(ln,{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(cn,{children:[e.jsx(dn,{children:n("names.confirmTitle")}),e.jsx(pn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(hn,{children:[e.jsx(xn,{"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(mn,{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(un,{children:[e.jsx(gn,{src:st,alt:"",width:56,height:56}),e.jsx(bn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(jn,{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(vn,{children:[e.jsx($n,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(Cn,{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(kn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/governance-DnazlIjy.webp",In=s.div`
382
+ `;function Sn({name:o,priceCredits:i,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=et(h),x=tt(),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 rn({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(it(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ot(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=nt(h==null?void 0:h.providerType);return e.jsx(an,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(ln,{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(cn,{children:[e.jsx(dn,{children:n("names.confirmTitle")}),e.jsx(pn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(hn,{children:[e.jsx(xn,{"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(mn,{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(un,{children:[e.jsx(gn,{src:st,alt:"",width:56,height:56}),e.jsx(bn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(jn,{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(vn,{children:[e.jsx($n,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(Cn,{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(kn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/governance-DnazlIjy.webp",In=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,An=s.nav`
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-BqS-qyq6.js";import{n as c,T as se}from"./Tooltip-3y4DnUZl.js";import{t as e,s as o,I as g,e as s,o as ae,h as v}from"./index-B8qQ9Xxb.js";const re=o.div`
1
+ import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-BGGjSLd9.js";import{n as c,T as se}from"./Tooltip-D92WFEmr.js";import{t as e,s as o,I as g,e as s,o as ae,h as v}from"./index-Cn-oc3fB.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 F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as a,x as D,m as P,e,n as W,y as O,I as b,z as B,u as w,D as K,c as Q,E as H,F as A,l as X,G as Z,q as E}from"./index-B8qQ9Xxb.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-JSOY6ArB.js";import{a as et}from"./builder-Biq1yQgT.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-Bj3SjlpX.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B3nckO8c.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as a,x as D,m as P,e,n as W,y as O,I as b,z as B,u as w,D as K,c as Q,E as H,F as A,l as X,G as Z,q as E}from"./index-Cn-oc3fB.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-BNs0emga.js";import{a as et}from"./builder-C8hUH3RB.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-Ce5OngHE.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DfeiXpP_.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t as le,s as i,e as s,K as de,aj as aa,H as sa,I as H,z as Mt,J as Ue,m as na,ak as Q,R as dt,n as ia,u as ra,al as oa,D as ca,am as da,an as la,ao as ua,ap as ha,y as pa,aq as lt,ar as G,as as ut,at as ga,l as ae,c as ht,au as xa,h as ma,av as pt,aw as _e,ax as ye,ay as be,az as gt,a as ve,b as fa,C as We,aA as ya}from"./index-B8qQ9Xxb.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 Ra,n as mt,o as ft,W as Ba,p as _a,q as Wa,A as Fa,r as La,s as Ka,t as Na,u as Ua,v as Qa,w as Ha,x as Oa,y as Va,z as Ga,D as Da,E as Ya,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-CDNotQwG.js";import{u as cs}from"./useManaRate-BezWDX4Q.js";import{r as ds}from"./mana-rate-LTr19y4S.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-JSOY6ArB.js";import{g as ms,b as Le}from"./buy-DTB3xpDX.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-C9C0u3NU.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-CcsRRofr.js";import{i as ks,a as $s}from"./errors-Bj3SjlpX.js";import{E as Ss}from"./ErrorNotice-6S2ayRHK.js";import{u as Ct}from"./mana-convert-Bbf4K53E.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CjafzO-R.js";import"./sendMetaTransaction-B3nckO8c.js";const{colors:se,radius:Ms}=le,Ts=i.div`
1
+ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t as le,s as i,e as s,K as de,aj as aa,H as sa,I as H,z as Mt,J as Ue,m as na,ak as Q,R as dt,n as ia,u as ra,al as oa,D as ca,am as da,an as la,ao as ua,ap as ha,y as pa,aq as lt,ar as G,as as ut,at as ga,l as ae,c as ht,au as xa,h as ma,av as pt,aw as _e,ax as ye,ay as be,az as gt,a as ve,b as fa,C as We,aA as ya}from"./index-Cn-oc3fB.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 Ra,n as mt,o as ft,W as Ba,p as _a,q as Wa,A as Fa,r as La,s as Ka,t as Na,u as Ua,v as Qa,w as Ha,x as Oa,y as Va,z as Ga,D as Da,E as Ya,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-D36c6dts.js";import{u as cs}from"./useManaRate-BhMxx3e3.js";import{r as ds}from"./mana-rate-COZYJ-5D.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-BNs0emga.js";import{g as ms,b as Le}from"./buy-Cl7snZzi.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-DVLP7U8S.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-Ceg0Oam0.js";import{i as ks,a as $s}from"./errors-Ce5OngHE.js";import{E as Ss}from"./ErrorNotice-COIh7ro4.js";import{u as Ct}from"./mana-convert-BAmJatVq.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CXbhpVj8.js";import"./sendMetaTransaction-DfeiXpP_.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,b as ea,a as ta}from"./react-vyZjIDcS.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.0-30903100943.commit-cfb5121/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=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":Y||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:D}),!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(Rs,{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 Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?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(Ra,{children:ne}),D?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),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:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(_a,{}),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(Na,{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(Ua,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Oa,{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(Da,{children:de(n.credits)}),e.jsxs(Ya,{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:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,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.1.0/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=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":Y||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:D}),!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(Rs,{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 Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?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(Ra,{children:ne}),D?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),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:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(_a,{}),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(Na,{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(Ua,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Oa,{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(Da,{children:de(n.credits)}),e.jsxs(Ya,{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:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,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{N,O as U,P as o,Q as n,J as D,x as M}from"./index-B8qQ9Xxb.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-3D8Gvjd6.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 t=44,B=M(P||(P=l`
1
+ import{N,O as U,P as o,Q as n,J as D,x as M}from"./index-Cn-oc3fB.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-BY1AO2V7.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 t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,ag as J,E,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as z,A as ie,ah as se,ai as ne}from"./index-B8qQ9Xxb.js";import{E as ce}from"./ErrorNotice-6S2ayRHK.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-CwDiK1mG.js";import{u as ve}from"./useStore-Du3YYL1J.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BqS-qyq6.js";import{L as $e}from"./LoadMore-COkJGWsB.js";import{u as Pe}from"./useInfiniteGrid-jYXiF9Ls.js";import{G as Me}from"./grid.styles-Dnnyw76z.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
1
+ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,ag as J,E,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as z,A as ie,ah as se,ai as ne}from"./index-Cn-oc3fB.js";import{E as ce}from"./ErrorNotice-COIh7ro4.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-CTl6D_zv.js";import{u as ve}from"./useStore-j0moew7P.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BGGjSLd9.js";import{L as $e}from"./LoadMore-BsvftUzw.js";import{u as Pe}from"./useInfiniteGrid-YGnKZcnB.js";import{G as Me}from"./grid.styles-B1mDfzvi.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=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-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,K as j,be as C,h as G,x as Y,I as Q,l as X,a as W,C as E,b as Z,bf as J,bg as F,A as q}from"./index-B8qQ9Xxb.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-JSOY6ArB.js";import{i as ie}from"./errors-Bj3SjlpX.js";import{E as oe}from"./ErrorNotice-6S2ayRHK.js";import{a as se}from"./buy-DTB3xpDX.js";import{g as re,d as ce}from"./trade-encoding-CjafzO-R.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-B3nckO8c.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.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-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,K as j,be as C,h as G,x as Y,I as Q,l as X,a as W,C as E,b as Z,bf as J,bg as F,A as q}from"./index-Cn-oc3fB.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-BNs0emga.js";import{i as ie}from"./errors-Ce5OngHE.js";import{E as oe}from"./ErrorNotice-COIh7ro4.js";import{a as se}from"./buy-Cl7snZzi.js";import{g as re,d as ce}from"./trade-encoding-CXbhpVj8.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-DfeiXpP_.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.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{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as J,aB as we,aC as R,aD as _,s as a,aE as je,H as ve,aF as Ce,e as t,aG as ye,aH as W,B as $e,J as Z,ag as q,n as ke,E as Q,I as T,c as Ne,m as Pe,S,h as Se,A as Le,aA as Ae,aI as Me}from"./index-B8qQ9Xxb.js";import{d as Fe,g as Ee,a as ze,P as Be,C as Ie,b as Re,c as _e,A as We,B as Te,S as He,M as Ge,e as Ue,f as De}from"./browseLayout.styles-CwDiK1mG.js";import{u as Ke,L as Oe}from"./useStore-Du3YYL1J.js";import{c as H,a as Ve,F as Ye,d as Je,P as Ze,e as qe,H as Qe,S as Xe}from"./categories-BqS-qyq6.js";import{L as G}from"./LoadMore-COkJGWsB.js";import{u as U}from"./useInfiniteGrid-jYXiF9Ls.js";import{E as D}from"./ErrorNotice-6S2ayRHK.js";import{G as K}from"./grid.styles-Dnnyw76z.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:et}=J,tt=a.article`
1
+ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as J,aB as we,aC as R,aD as _,s as a,aE as je,H as ve,aF as Ce,e as t,aG as ye,aH as W,B as $e,J as Z,ag as q,n as ke,E as Q,I as T,c as Ne,m as Pe,S,h as Se,A as Le,aA as Ae,aI as Me}from"./index-Cn-oc3fB.js";import{d as Fe,g as Ee,a as ze,P as Be,C as Ie,b as Re,c as _e,A as We,B as Te,S as He,M as Ge,e as Ue,f as De}from"./browseLayout.styles-CTl6D_zv.js";import{u as Ke,L as Oe}from"./useStore-j0moew7P.js";import{c as H,a as Ve,F as Ye,d as Je,P as Ze,e as qe,H as Qe,S as Xe}from"./categories-BGGjSLd9.js";import{L as G}from"./LoadMore-BsvftUzw.js";import{u as U}from"./useInfiniteGrid-YGnKZcnB.js";import{E as D}from"./ErrorNotice-COIh7ro4.js";import{G as K}from"./grid.styles-B1mDfzvi.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:et}=J,tt=a.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-vyZjIDcS.js";import{I as i}from"./index-B8qQ9Xxb.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-vyZjIDcS.js";import{I as i}from"./index-Cn-oc3fB.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-BJW4ebEt.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-CbtJGEzL.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-BuQKbZaF.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-PJSp7ijP.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{b as he,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as ge,D as fe,ar as f,ap as me,l as H,az as N,I as re,aj as D,z as B,aS as K}from"./index-B8qQ9Xxb.js";import{R as O}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-CcsRRofr.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-Bbf4K53E.js";const P="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30903100943.commit-cfb5121/_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.0-30903100943.commit-cfb5121/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
1
+ import{b as he,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as ge,D as fe,ar as f,ap as me,l as H,az as N,I as re,aj as D,z as B,aS as K}from"./index-Cn-oc3fB.js";import{R as O}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-Ceg0Oam0.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-BAmJatVq.js";const P="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.1.0/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.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.1.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-Dy_LMTRI.js";import{d as g,r as v}from"./index-CbtJGEzL.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BJW4ebEt.js";import{au as y}from"./NetworkUtil-HlUKXKcF.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-BpA1I7hL.js";import{d as g,r as v}from"./index-PJSp7ijP.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BuQKbZaF.js";import{au as y}from"./NetworkUtil-HlUKXKcF.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,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as B,B as I,z,ar as ne,aR as K,l as W,m as re,n as oe,D as ae,u as de,F as ce}from"./index-B8qQ9Xxb.js";import{i as le,R as pe,f as ge}from"./import-C0DSObrV.js";import{u as xe}from"./useSecondarySales-DVrg7pqD.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-DTB3xpDX.js";import"./authorizations-JSOY6ArB.js";import"./sendMetaTransaction-B3nckO8c.js";import"./trade-encoding-CjafzO-R.js";import"./mana-rate-LTr19y4S.js";import"./mana-convert-Bbf4K53E.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
1
+ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as B,B as I,z,ar as ne,aR as K,l as W,m as re,n as oe,D as ae,u as de,F as ce}from"./index-Cn-oc3fB.js";import{i as le,R as pe,f as ge}from"./import-DbH_aWZX.js";import{u as xe}from"./useSecondarySales-BUPg_0HB.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-Cl7snZzi.js";import"./authorizations-BNs0emga.js";import"./sendMetaTransaction-DfeiXpP_.js";import"./trade-encoding-CXbhpVj8.js";import"./mana-rate-COZYJ-5D.js";import"./mana-convert-BAmJatVq.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0;
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-B6Fs-ly-.js","_assets/react-vyZjIDcS.js","_assets/dcl-schemas-BICTSpB5.js","_assets/index-B8qQ9Xxb.js","_assets/sentry-B35L1FdR.js","_assets/ethers-CXBJm_wN.js","_assets/intl-CBcMB1D2.js","_assets/index-BMzstP-8.css","_assets/createSvgIcon--KCu3mQi.js","_assets/clsx-3D8Gvjd6.js","_assets/emotion-styled.browser.esm-Dn08UyTd.js","_assets/CircularProgress-_0gSPNcC.js","_assets/index-LeLZ_uWV.js","_assets/useTheme-DPli5iET.js","_assets/getThemeProps-CnXSHx3q.js"])))=>i.map(i=>d[i]);
2
- var Vc=Object.defineProperty;var Uc=(n,a,t)=>a in n?Vc(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var H=(n,a,t)=>Uc(n,typeof a!="symbol"?a+"":a,t);import{r as b,d as Xc,j as s,b as Yt,l as fs,R as S,h as Gc,e as Jc,a as Zc,L as el}from"./react-vyZjIDcS.js";import{s as m,t as d,e as x,I as G,bf as tl,z as Ie,K as Ve,h as bt,be as Lr,n as Ot,al as hs,am as nl,D as Wt,at as rl,a0 as ms,a1 as or,av as ia,ar as le,az as Ge,ay as at,bz as al,l as $e,ax as Fr,aw as gs,aj as ol,c as Zt,a as sa,b as il,C as xs,y as sl,u as we,M as cl,ag as wr,o as kr,E as ga,aR as Xt,p as ys,F as _n,ai as bs,bA as ll,B as Pn,J as In,bB as vs,aS as oo,aT as dl,f as ws,bC as ul,_ as Yr,x as pl,ak as Dn,bD as fl,bE as hl,bF as ml,bG as gl,bH as xl,bI as yl,bJ as ks,bK as bl,bL as vl,d as Ds,bM as wl,bN as kl,bO as Dl,bP as Cl,H as Sl,bQ as Ml,R as _l,bR as Pl,bS as Il,bT as jl,bU as El,bV as Tl,bW as $l,aJ as Nl,m as Ol,bX as Rl,bY as Al,bZ as Ll,b_ as io,ah as Fl,b$ as Yl,c0 as Wl,c1 as Bl,c2 as Hl,c3 as zl,c4 as ql}from"./index-B8qQ9Xxb.js";import{d as Fe,a as so}from"./dcl-schemas-BICTSpB5.js";import{$ as Wr,m as Ql,K as Kl,V as Vl,Q as Cs,R as Ul,M as Xl,S as Gl,C as Jl,H as Zl,a as ed,T as td,X as nd,b as rd,B as ad,c as od,d as id,e as sd,f as qt,j as Bn,k as Qt,W as cd,p as ld,q as dd,P as ud,x as pd,y as fd,z as hd,D as md,E as gd,F as xd,G as yd,I as bd,J as vd,L as wd,l as kd,n as Dd,o as Cd,a0 as Sd,a1 as Md,A as _d,r as Pd,s as Id,t as jd,u as Ed,v as Td,w as $d,a2 as Nd,a3 as Od,a4 as Rd,N as Ad,O as co,U as Ld}from"./CollectionCarousel-CDNotQwG.js";import{a as ir,t as Fd,c as Yd}from"./buy-DTB3xpDX.js";import{f as Wd}from"./builder-Biq1yQgT.js";import{u as Bd,M as Hd,l as zd,c as qd}from"./useCreditPacks-CcsRRofr.js";import{r as Qd}from"./mana-rate-LTr19y4S.js";import{m as lo}from"./mana-matic-C4e1sNO3.js";import{i as Ss,f as Ms,n as Kd,j as Vd,c as uo,g as _s,e as Ud,r as Xd,m as Gd}from"./authorizations-JSOY6ArB.js";import{a as Ps,w as Is,S as js,G as Es}from"./buy-gasless-C9C0u3NU.js";import{R as po}from"./resume-buy-Bf0zIH7y.js";import{a as Jd,f as xt,i as en}from"./errors-Bj3SjlpX.js";import{E as ut}from"./ErrorNotice-6S2ayRHK.js";import{C as Zd}from"./CircularProgress-_0gSPNcC.js";import{a as eu,b as tu,j as nu,e as ru,c as au,d as ou}from"./trade-encoding-CjafzO-R.js";import{M as iu,E as su,s as cu}from"./sendMetaTransaction-B3nckO8c.js";import{C as lu,I as du}from"./ethers-CXBJm_wN.js";import{a as Br}from"./mana-convert-Bbf4K53E.js";import{u as Ts}from"./useManaRate-BezWDX4Q.js";import{u as uu}from"./useSecondarySales-DVrg7pqD.js";import{T as $s}from"./Tooltip-3y4DnUZl.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./clsx-3D8Gvjd6.js";const tn=Math.min,Et=Math.max,sr=Math.round,Hn=Math.floor,it=n=>({x:n,y:n}),pu={left:"right",right:"left",bottom:"top",top:"bottom"};function fu(n,a,t){return Et(n,tn(a,t))}function Dr(n,a){return typeof n=="function"?n(a):n}function nn(n){return n.split("-")[0]}function jn(n){return n.split("-")[1]}function hu(n){return n==="x"?"y":"x"}function xa(n){return n==="y"?"height":"width"}function It(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function ya(n){return hu(It(n))}function mu(n,a,t){t===void 0&&(t=!1);const e=jn(n),r=ya(n),o=xa(r);let i=r==="x"?e===(t?"end":"start")?"right":"left":e==="start"?"bottom":"top";return a.reference[o]>a.floating[o]&&(i=cr(i)),[i,cr(i)]}function gu(n){const a=cr(n);return[ca(n),a,ca(a)]}function ca(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const fo=["left","right"],ho=["right","left"],xu=["top","bottom"],yu=["bottom","top"];function bu(n,a,t){switch(n){case"top":case"bottom":return t?a?ho:fo:a?fo:ho;case"left":case"right":return a?xu:yu;default:return[]}}function vu(n,a,t,e){const r=jn(n);let o=bu(nn(n),t==="start",e);return r&&(o=o.map(i=>i+"-"+r),a&&(o=o.concat(o.map(ca)))),o}function cr(n){const a=nn(n);return pu[a]+n.slice(a.length)}function wu(n){var a,t,e,r;return{top:(a=n.top)!=null?a:0,right:(t=n.right)!=null?t:0,bottom:(e=n.bottom)!=null?e:0,left:(r=n.left)!=null?r:0}}function Ns(n){return typeof n!="number"?wu(n):{top:n,right:n,bottom:n,left:n}}function lr(n){const{x:a,y:t,width:e,height:r}=n;return{width:e,height:r,top:t,left:a,right:a+e,bottom:t+r,x:a,y:t}}function mo(n,a,t){let{reference:e,floating:r}=n;const o=It(a),i=ya(a),c=xa(i),l=nn(a),p=o==="y",u=e.x+e.width/2-r.width/2,h=e.y+e.height/2-r.height/2,y=e[c]/2-r[c]/2;let g;switch(l){case"top":g={x:u,y:e.y-r.height};break;case"bottom":g={x:u,y:e.y+e.height};break;case"right":g={x:e.x+e.width,y:h};break;case"left":g={x:e.x-r.width,y:h};break;default:g={x:e.x,y:e.y}}const v=jn(a);return v&&(g[i]+=y*(v==="end"?1:-1)*(t&&p?-1:1)),g}async function ku(n,a){var t;a===void 0&&(a={});const{x:e,y:r,platform:o,rects:i,elements:c,strategy:l}=n,{boundary:p="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=Dr(a,n),v=Ns(g),f=c[y?h==="floating"?"reference":"floating":h],k=lr(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(f)))==null||t?f:f.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:p,rootBoundary:u,strategy:l})),C=h==="floating"?{x:e,y:r,width:i.floating.width,height:i.floating.height}:i.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),$=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},A=lr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:T,strategy:l}):C);return{top:(k.top-A.top+v.top)/$.y,bottom:(A.bottom-k.bottom+v.bottom)/$.y,left:(k.left-A.left+v.left)/$.x,right:(A.right-k.right+v.right)/$.x}}const Du=50,Cu=async(n,a,t)=>{const{placement:e="bottom",strategy:r="absolute",middleware:o=[],platform:i}=t,c=i.detectOverflow?i:{...i,detectOverflow:ku},l=await(i.isRTL==null?void 0:i.isRTL(a));let p=await i.getElementRects({reference:n,floating:a,strategy:r}),{x:u,y:h}=mo(p,e,l),y=e,g=0;const v={};for(let w=0;w<o.length;w++){const f=o[w];if(!f)continue;const{name:k,fn:C}=f,{x:T,y:$,data:A,reset:N}=await C({x:u,y:h,initialPlacement:e,placement:y,strategy:r,middlewareData:v,rects:p,platform:c,elements:{reference:n,floating:a}});u=T??u,h=$??h,v[k]={...v[k],...A},N&&g<Du&&(g++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await i.getElementRects({reference:n,floating:a,strategy:r}):N.rects),{x:u,y:h}=mo(p,y,l)),w=-1)}return{x:u,y:h,placement:y,strategy:r,middlewareData:v}},Su=n=>({name:"arrow",options:n,async fn(a){const{x:t,y:e,placement:r,rects:o,platform:i,elements:c,middlewareData:l}=a,{element:p,padding:u=0}=Dr(n,a)||{};if(p==null)return{};const h=Ns(u),y={x:t,y:e},g=ya(r),v=xa(g),w=await i.getDimensions(p),f=g==="y",k=f?"top":"left",C=f?"bottom":"right",T=f?"clientHeight":"clientWidth",$=o.reference[v]+o.reference[g]-y[g]-o.floating[v],A=y[g]-o.reference[g],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(p));let M=N?N[T]:0;(!M||!await(i.isElement==null?void 0:i.isElement(N)))&&(M=c.floating[T]||o.floating[v]);const D=$/2-A/2,I=M/2-w[v]/2-1,P=tn(h[k],I),E=tn(h[C],I),O=M-w[v]-E,W=M/2-w[v]/2+D,z=fu(P,W,O),Q=!l.arrow&&jn(r)!=null&&W!==z&&o.reference[v]/2-(W<P?P:E)-w[v]/2<0,R=Q?W<P?W-P:W-O:0;return{[g]:y[g]+R,data:{[g]:z,centerOffset:W-z-R,...Q&&{alignmentOffset:R}},reset:Q}}}),Mu=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var t,e;const{placement:r,middlewareData:o,rects:i,initialPlacement:c,platform:l,elements:p}=a,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...f}=Dr(n,a);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const k=nn(r),C=It(c),T=nn(c)===c,$=await(l.isRTL==null?void 0:l.isRTL(p.floating)),A=y||(T||!w?[cr(c)]:gu(c)),N=v!=="none";!y&&N&&A.push(...vu(c,w,v,$));const M=[c,...A],D=await l.detectOverflow(a,f),I=[];let P=((e=o.flip)==null?void 0:e.overflows)||[];if(u&&I.push(D[k]),h){const z=mu(r,i,$);I.push(D[z[0]],D[z[1]])}if(P=[...P,{placement:r,overflows:I}],!I.every(z=>z<=0)){var E,O;const z=(((E=o.flip)==null?void 0:E.index)||0)+1,Q=M[z];if(Q&&(!(h==="alignment"?C!==It(Q):!1)||P.every(_=>It(_.placement)===C?_.overflows[0]>0:!0)))return{data:{index:z,overflows:P},reset:{placement:Q}};let R=(O=P.filter(V=>V.overflows[0]<=0).sort((V,_)=>V.overflows[1]-_.overflows[1])[0])==null?void 0:O.placement;if(!R)switch(g){case"bestFit":{var W;const V=(W=P.filter(_=>{if(N){const J=It(_.placement);return J===C||J==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(J=>J>0).reduce((J,ge)=>J+ge,0)]).sort((_,J)=>_[1]-J[1])[0])==null?void 0:W[0];V&&(R=V);break}case"initialPlacement":R=c;break}if(r!==R)return{reset:{placement:R}}}return{}}}},_u=new Set(["left","top"]);async function Pu(n,a){const{placement:t,platform:e,elements:r}=n,o=await(e.isRTL==null?void 0:e.isRTL(r.floating)),i=nn(t),c=jn(t),l=It(t)==="y",p=_u.has(i)?-1:1,u=o&&l?-1:1,h=Dr(a,n);let{mainAxis:y,crossAxis:g,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(g=c==="end"?v*-1:v),l?{x:g*u,y:y*p}:{x:y*p,y:g*u}}const Iu=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var t,e;const{x:r,y:o,placement:i,middlewareData:c}=a,l=await Pu(a,n);return i===((t=c.offset)==null?void 0:t.placement)&&(e=c.arrow)!=null&&e.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:i}}}}};function Cr(){return typeof window<"u"}function sn(n){return Os(n)?(n.nodeName||"").toLowerCase():"#document"}function je(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function ht(n){var a;return(a=(Os(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function Os(n){return Cr()?n instanceof Node||n instanceof je(n).Node:!1}function Pe(n){return Cr()?n instanceof Element||n instanceof je(n).Element:!1}function kt(n){return Cr()?n instanceof HTMLElement||n instanceof je(n).HTMLElement:!1}function go(n){return!Cr()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof je(n).ShadowRoot}function Sr(n){const{overflow:a,overflowX:t,overflowY:e,display:r}=We(n);return/auto|scroll|overlay|hidden|clip/.test(a+e+t)&&r!=="inline"&&r!=="contents"}function ju(n){return/^(table|td|th)$/.test(sn(n))}function Mr(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Eu=/transform|translate|scale|rotate|perspective|filter/,Tu=/paint|layout|strict|content/,_t=n=>!!n&&n!=="none";let Hr;function ba(n){const a=Pe(n)?We(n):n;return _t(a.transform)||_t(a.translate)||_t(a.scale)||_t(a.rotate)||_t(a.perspective)||!va()&&(_t(a.backdropFilter)||_t(a.filter))||Eu.test(a.willChange||"")||Tu.test(a.contain||"")}function $u(n){let a=Rt(n);for(;kt(a)&&!Cn(a);){if(ba(a))return a;if(Mr(a))return null;a=Rt(a)}return null}function va(){return Hr==null&&(Hr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hr}function Cn(n){return/^(html|body|#document)$/.test(sn(n))}function We(n){return je(n).getComputedStyle(n)}function _r(n){return Pe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Rt(n){if(sn(n)==="html")return n;const a=n.assignedSlot||n.parentNode||go(n)&&n.host||ht(n);return go(a)?a.host:a}function Rs(n){const a=Rt(n);return Cn(a)?(n.ownerDocument||n).body:kt(a)&&Sr(a)?a:Rs(a)}function Sn(n,a,t){var e;a===void 0&&(a=[]),t===void 0&&(t=!0);const r=Rs(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=je(r);if(o){const c=la(i);return a.concat(i,i.visualViewport||[],Sr(r)?r:[],c&&t?Sn(c):[])}else return a.concat(r,Sn(r,[],t))}function la(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function As(n){const a=We(n);let t=parseFloat(a.width)||0,e=parseFloat(a.height)||0;const r=kt(n),o=r?n.offsetWidth:t,i=r?n.offsetHeight:e,c=sr(t)!==o||sr(e)!==i;return c&&(t=o,e=i),{width:t,height:e,$:c}}function wa(n){return Pe(n)?n:n.contextElement}function Gt(n){const a=wa(n);if(!kt(a))return it(1);const t=a.getBoundingClientRect(),{width:e,height:r,$:o}=As(a);let i=(o?sr(t.width):t.width)/e,c=(o?sr(t.height):t.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Nu=it(0);function Ls(n){const a=je(n);return!va()||!a.visualViewport?Nu:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Ou(n,a,t){return a===void 0&&(a=!1),!!t&&a&&t===je(n)}function At(n,a,t,e){a===void 0&&(a=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=wa(n);let i=it(1);a&&(e?Pe(e)&&(i=Gt(e)):i=Gt(n));const c=Ou(o,t,e)?Ls(o):it(0);let l=(r.left+c.x)/i.x,p=(r.top+c.y)/i.y,u=r.width/i.x,h=r.height/i.y;if(o&&e){const y=je(o),g=Pe(e)?je(e):e;let v=y,w=la(v);for(;w&&g!==v;){const f=Gt(w),k=w.getBoundingClientRect(),C=We(w),T=k.left+(w.clientLeft+parseFloat(C.paddingLeft))*f.x,$=k.top+(w.clientTop+parseFloat(C.paddingTop))*f.y;l*=f.x,p*=f.y,u*=f.x,h*=f.y,l+=T,p+=$,v=je(w),w=la(v)}}return lr({width:u,height:h,x:l,y:p})}function Pr(n,a){const t=_r(n).scrollLeft;return a?a.left+t:At(ht(n)).left+t}function Fs(n,a){const t=n.getBoundingClientRect(),e=t.left+a.scrollLeft-Pr(n,t),r=t.top+a.scrollTop;return{x:e,y:r}}function Ru(n){let{elements:a,rect:t,offsetParent:e,strategy:r}=n;const o=r==="fixed",i=ht(e),c=a?Mr(a.floating):!1;if(e===i||c&&o)return t;let l={scrollLeft:0,scrollTop:0},p=it(1);const u=it(0),h=kt(e);if((h||!o)&&((sn(e)!=="body"||Sr(i))&&(l=_r(e)),h)){const g=At(e);p=Gt(e),u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}const y=i&&!h&&!o?Fs(i,l):it(0);return{width:t.width*p.x,height:t.height*p.y,x:t.x*p.x-l.scrollLeft*p.x+u.x+y.x,y:t.y*p.y-l.scrollTop*p.y+u.y+y.y}}function Au(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function Lu(n){const a=_r(n),t=n.ownerDocument.body,e=Et(n.scrollWidth,n.clientWidth,t.scrollWidth,t.clientWidth),r=Et(n.scrollHeight,n.clientHeight,t.scrollHeight,t.clientHeight);let o=-a.scrollLeft+Pr(n);const i=-a.scrollTop;return We(t).direction==="rtl"&&(o+=Et(n.clientWidth,t.clientWidth)-e),{width:e,height:r,x:o,y:i}}const Fu=25;function Yu(n,a,t){t===void 0&&(t="viewport");const e=t==="layoutViewport",r=je(n),o=ht(n),i=r.visualViewport;let c=o.clientWidth,l=o.clientHeight,p=0,u=0;if(i){const y=!va()||a==="fixed";e?y||(p=-i.offsetLeft,u=-i.offsetTop):(c=i.width,l=i.height,y&&(p=i.offsetLeft,u=i.offsetTop))}if(Pr(o)<=0){const y=o.ownerDocument,g=y.body,v=getComputedStyle(g),w=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,f=Math.abs(o.clientWidth-g.clientWidth-w),k=getComputedStyle(o).scrollbarGutter==="stable both-edges"?f/2:f;k<=Fu&&(c-=k)}return{width:c,height:l,x:p,y:u}}function Wu(n,a){const t=At(n,!0,a==="fixed"),e=t.top+n.clientTop,r=t.left+n.clientLeft,o=Gt(n),i=n.clientWidth*o.x,c=n.clientHeight*o.y,l=r*o.x,p=e*o.y;return{width:i,height:c,x:l,y:p}}function xo(n,a,t){let e;if(a==="viewport"||a==="layoutViewport")e=Yu(n,t,a);else if(a==="document")e=Lu(ht(n));else if(Pe(a))e=Wu(a,t);else{const r=Ls(n);e={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}return lr(e)}function Bu(n,a){const t=a.get(n);if(t)return t;let e=Sn(n,[],!1).filter(c=>Pe(c)&&sn(c)!=="body"),r=null;const o=We(n).position==="fixed";let i=o?Rt(n):n;for(;Pe(i)&&!Cn(i);){const c=We(i),l=ba(i),p=r?r.position:o?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&c.position==="static")?e=e.filter(h=>h!==i):r=c,i=Rt(i)}return a.set(n,e),e}function Hu(n){let{element:a,boundary:t,rootBoundary:e,strategy:r}=n;const i=[...t==="clippingAncestors"?Mr(a)?[]:Bu(a,this._c):[].concat(t),e],c=xo(a,i[0],r);let l=c.top,p=c.right,u=c.bottom,h=c.left;for(let y=1;y<i.length;y++){const g=xo(a,i[y],r);l=Et(g.top,l),p=tn(g.right,p),u=tn(g.bottom,u),h=Et(g.left,h)}return{width:p-h,height:u-l,x:h,y:l}}function zu(n){const{width:a,height:t}=As(n);return{width:a,height:t}}function qu(n,a,t){const e=kt(a),r=ht(a),o=t==="fixed",i=At(n,!0,o,a);let c={scrollLeft:0,scrollTop:0};const l=it(0);if((e||!o)&&((sn(a)!=="body"||Sr(r))&&(c=_r(a)),e)){const y=At(a,!0,o,a);l.x=y.x+a.clientLeft,l.y=y.y+a.clientTop}!e&&r&&(l.x=Pr(r));const p=r&&!e&&!o?Fs(r,c):it(0),u=i.left+c.scrollLeft-l.x-p.x,h=i.top+c.scrollTop-l.y-p.y;return{x:u,y:h,width:i.width,height:i.height}}function zr(n){return We(n).position==="static"}function yo(n,a){if(!kt(n)||We(n).position==="fixed")return null;if(a)return a(n);let t=n.offsetParent;return ht(n)===t&&(t=t.ownerDocument.body),t}function Ys(n,a){const t=je(n);if(Mr(n))return t;if(!kt(n)){let r=Rt(n);for(;r&&!Cn(r);){if(Pe(r)&&!zr(r))return r;r=Rt(r)}return t}let e=yo(n,a);for(;e&&ju(e)&&zr(e);)e=yo(e,a);return e&&Cn(e)&&zr(e)&&!ba(e)?t:e||$u(n)||t}const Qu=async function(n){const a=this.getOffsetParent||Ys,t=this.getDimensions,e=await t(n.floating);return{reference:qu(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:e.width,height:e.height}}};function Ku(n){return We(n).direction==="rtl"}const Vu={convertOffsetParentRelativeRectToViewportRelativeRect:Ru,getDocumentElement:ht,getClippingRect:Hu,getOffsetParent:Ys,getElementRects:Qu,getClientRects:Au,getDimensions:zu,getScale:Gt,isElement:Pe,isRTL:Ku};function Ws(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function Uu(n,a,t){let e=null,r;const o=ht(n);function i(){var u;clearTimeout(r),(u=e)==null||u.disconnect(),e=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),i();const y=n.getBoundingClientRect(),{left:g,top:v,width:w,height:f}=y;if(u||a(),!w||!f)return;const k=Hn(v),C=Hn(o.clientWidth-(g+w)),T=Hn(o.clientHeight-(v+f)),$=Hn(g),N={rootMargin:-k+"px "+-C+"px "+-T+"px "+-$+"px",threshold:Et(0,tn(1,h))||1};let M=!0;function D(I){const P=I[0].intersectionRatio;if(!Ws(y,n.getBoundingClientRect()))return c();if(P!==h){if(!M)return c();P?c(!1,P):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M=!1}try{e=new IntersectionObserver(D,{...N,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,N)}e.observe(n)}const l=je(n),p=()=>c(t);return l.addEventListener("resize",p),c(!0),()=>{l.removeEventListener("resize",p),i()}}function Xu(n,a,t,e){e===void 0&&(e={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=e,p=wa(n),u=r||o?[...p?Sn(p):[],...a?Sn(a):[]]:[];u.forEach(k=>{r&&k.addEventListener("scroll",t),o&&k.addEventListener("resize",t)});const h=p&&c?Uu(p,t,o):null;let y=-1,g=null;i&&(g=new ResizeObserver(k=>{let[C]=k;C&&C.target===p&&g&&a&&(g.unobserve(a),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(a)})),t()}),p&&!l&&g.observe(p),a&&g.observe(a));let v,w=l?At(n):null;l&&f();function f(){const k=At(n);w&&!Ws(w,k)&&t(),w=k,v=requestAnimationFrame(f)}return t(),()=>{var k;u.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h==null||h(),(k=g)==null||k.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const Gu=Iu,Ju=Mu,bo=Su,Zu=(n,a,t)=>{const e=new Map,r=t??{},o={...Vu,...r.platform,_c:e};return Cu(n,a,{...r,platform:o})};var ep=typeof document<"u",tp=function(){},Zn=ep?b.useLayoutEffect:tp;function dr(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let t,e,r;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==a.length)return!1;for(e=t;e--!==0;)if(!dr(n[e],a[e]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(a).length)return!1;for(e=t;e--!==0;)if(!{}.hasOwnProperty.call(a,r[e]))return!1;for(e=t;e--!==0;){const o=r[e];if(!(o==="_owner"&&n.$$typeof)&&!dr(n[o],a[o]))return!1}return!0}return n!==n&&a!==a}function Bs(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function vo(n,a){const t=Bs(n);return Math.round(a*t)/t}function qr(n){const a=b.useRef(n);return Zn(()=>{a.current=n}),a}function np(n){n===void 0&&(n={});const{placement:a="bottom",strategy:t="absolute",middleware:e=[],platform:r,elements:{reference:o,floating:i}={},transform:c=!0,whileElementsMounted:l,open:p}=n,[u,h]=b.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:!1}),[y,g]=b.useState(e);dr(y,e)||g(e);const[v,w]=b.useState(null),[f,k]=b.useState(null),C=b.useCallback(_=>{_!==N.current&&(N.current=_,w(_))},[]),T=b.useCallback(_=>{_!==M.current&&(M.current=_,k(_))},[]),$=o||v,A=i||f,N=b.useRef(null),M=b.useRef(null),D=b.useRef(u),I=l!=null,P=qr(l),E=qr(r),O=qr(p),W=b.useCallback(()=>{if(!N.current||!M.current)return;const _={placement:a,strategy:t,middleware:y};E.current&&(_.platform=E.current),Zu(N.current,M.current,_).then(J=>{const ge={...J,isPositioned:O.current!==!1};z.current&&!dr(D.current,ge)&&(D.current=ge,Xc.flushSync(()=>{h(ge)}))})},[y,a,t,E,O]);Zn(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[p]);const z=b.useRef(!1);Zn(()=>(z.current=!0,()=>{z.current=!1}),[]),Zn(()=>{if($&&(N.current=$),A&&(M.current=A),$&&A){if(P.current)return P.current($,A,W);W()}},[$,A,W,P,I]);const Q=b.useMemo(()=>({reference:N,floating:M,setReference:C,setFloating:T}),[C,T]),R=b.useMemo(()=>({reference:$,floating:A}),[$,A]),V=b.useMemo(()=>{const _={position:t,left:0,top:0};if(!R.floating)return _;const J=vo(R.floating,u.x),ge=vo(R.floating,u.y);return c?{..._,transform:"translate("+J+"px, "+ge+"px)",...Bs(R.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:J,top:ge}},[t,c,R.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:W,refs:Q,elements:R,floatingStyles:V}),[u,W,Q,R,V])}const rp=n=>{function a(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:e,padding:r}=typeof n=="function"?n(t):n;return e&&a(e)?e.current!=null?bo({element:e.current,padding:r}).fn(t):{}:e?bo({element:e,padding:r}).fn(t):{}}}},ap=(n,a)=>{const t=Gu(n);return{name:t.name,fn:t.fn,options:[n,a]}},op=(n,a)=>{const t=Ju(n);return{name:t.name,fn:t.fn,options:[n,a]}},ip=(n,a)=>{const t=rp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Hs=216n,sp=(1n<<Hs)-1n;function cp(n){const a=typeof n=="bigint"?n:BigInt(n.trim());if(a<0n)throw new Error(`Invalid tokenId: ${String(n)}`);return{itemId:(a>>Hs).toString(),issuedId:(a&sp).toString()}}function lp(n){if(!n)return null;try{return cp(n).itemId}catch{return null}}function wo(n,a){return a.kind==="listed"?{...n,isOnSale:!0,listingPrice:a.priceCredits,tradeId:a.tradeId??n.tradeId}:{...n,isOnSale:!1,listingPrice:void 0,tradeId:void 0}}function Qr(n,a,t){const{address:e,contractAddress:r,tokenId:o}=a;if(!r||!o)return;const i=`${r}-${o}`;n.cancelQueries({queryKey:["owned-token",r,o]}),n.cancelQueries({queryKey:["secondary-sale-state"]}),e&&n.cancelQueries({queryKey:["my-assets",e]});const c=t.kind==="gone";n.setQueriesData({queryKey:["owned-token",r,o]},p=>p&&(c?null:wo(p,t)));const l=e?["my-assets",e]:["my-assets"];n.setQueriesData({queryKey:l},p=>p!=null&&p.pages?{...p,pages:p.pages.map(u=>{if(c){const h=u.items.filter(y=>!(y.contractAddress===r&&y.tokenId===o));return{...u,items:h,total:Math.max(0,u.total-(u.items.length-h.length))}}return{...u,items:u.items.map(h=>h.contractAddress===r&&h.tokenId===o?wo(h,t):h)}})}:p),n.setQueriesData({queryKey:["secondary-sale-state"]},p=>{var h;if(!p)return p;const u={...p};return t.kind==="removed"||t.kind==="gone"?delete u[i]:u[i]={priceCredits:t.priceCredits,tradeId:t.tradeId??((h=u[i])==null?void 0:h.tradeId)??""},u})}function dp(n){return!(n.isMarket||n.forSale&&n.priceKnown||n.manage||n.soldOutWithResale||!n.stillResolving&&!n.resolvingTrade&&(n.isTokenRoute?!n.ownedAssetLoading:!n.deepLinkLoading))}const up="data:image/webp;base64,UklGRqgOAABXRUJQVlA4IJwOAACwOwCdASqEAIsAPj0YikMiIaEWuib4IAPEtQBl0QC/bukK7J6X8cPZP5F69/Nvhj8oPlD3odY/QB8RXPv/C+3n59+izzA/0l/3/9064PmD/bH9Zvey/33r8/2PqC/zH/fdaX6EX7O+nP+3Xwlfub+33tOf/+7N8wTMuJT/znss7V9qD/DcDplr/deudN0/Rcajjp49/Q//7vLR70+4X+tP/R9az//+3r9z/Yk/ZVVfCa+jj+kU2kxc+zPDZIZQYWF19BTevkFTZdPnQBT3YukdDX/AtCNcmvBrFJ96eYkUWaCCtnOpfB+/IETSsPYuwsabIrqSWHYoPBskXi/DUubCFDAf/6+0pCLU1kmMIueWH8HebltZsATbIO+vXwG1gHAXjGECElz7j/+GXHZJM9ORAFgOa/b/pGdMUEE9PfuMHx1G3GpnRw8WEP5FknNoUNOyb6iY5VX/W5w6pnS5r1srs4CXTuHzUJLdvXVpyiQNuBwCyLYlukPjvLuqqHRrv5/jHTa1L+iumi2wLA8NzahM3euE6fvC7shIbIWajyLkVYhWOOdMRjOWdhSN1wi7JvE4t+bFXSVHOX+4DnQxVhhUKacLKMYPHhQKLZSdyYzM66dZ22undenNBcAjNHjBW+9t0W2glcAA/v44VaU8mJJP1Vz1l456kKu23B2wH7M9h1OtAwoGAGj8t///XA7H+OEVSxGjYfFAlM1Upvv/NmvKOBdxK8JXyQLqAqwy0bgja/QQTJKOEDkKXVg8HRGbA4YhU/9KZ5ulhbrnm7S6a3XhSmzHNxDfaPRezgQ0/P9ZW+KbLltsoK42ORYMdpD+ZNjvwybgVPBD9EHv+g73MeRCpYGemyJk33SfCLWO6KdUBlYRNr8Mo+qAoyC9JkWFe7IXV7Z97jmAJIiqXCgQLxyeB+hbtaa+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/CMgI0yMNLaq3cJB0CNBsd1hRKl7lZ1wMh16/EZx5jig5JWvlZNPTMuJFHvpW42fyFjIfKslwVHB/SJKWDRr3w9uFCRm/Z3ABn2ydMFGvXjMZEaTsZlqF17J76wjrLkgmgcbtrtL9N8T3dXsKhM4LPscSPo2kc9MfW3dmjuo98vCdxBR/RvMAgm0VzEuXulny1QdmDMzoBUfPseIFkTNYFg89+m4OKn/8Xc28jcPteGx8v0vwYyKNlOAZvi/yt7OImF7kADj+rzqjSoqwVTnCCjOKrF1Gt1i+6oeDggdd5wEh1ghvxdHELxvJeJE8x82cfHEVXhE9Nheu7Q1WycLXUTZA8oZHsdBaBFpk6vyYdYFT8YTShaCjPle1+2DJHzXzhRUQ6ZY/HcDs/vS2V8+jO+pjV23u5WL6yRWULzVi+0qUXIiJzd9qj65YnWPMxIubcSpm+5n8vMpysoMuGzoNwBmNszF+S+b8acZRgm2Gi0UT5OGuYwq4wZ5kmd8OqnDzhze2RxwMRtRm+17eKYWzLWtgVuOca/HWuBI58UC9FNZtBLv1l2htg7Iyehb/cr9uKvXkPXh0LFeyfEc49dOsGvppssGqOAAAAA=",fp=m.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-BNnLGudB.js","_assets/react-vyZjIDcS.js","_assets/dcl-schemas-BICTSpB5.js","_assets/index-Cn-oc3fB.js","_assets/sentry-B35L1FdR.js","_assets/ethers-CXBJm_wN.js","_assets/intl-CBcMB1D2.js","_assets/index-BMzstP-8.css","_assets/createSvgIcon-BUIodiet.js","_assets/clsx-BY1AO2V7.js","_assets/emotion-styled.browser.esm-C5sYTDtN.js","_assets/CircularProgress-CNroeQ3o.js","_assets/index-CVMO2zcQ.js","_assets/useTheme-cGCeJmwR.js","_assets/getThemeProps-xrG7EYWl.js"])))=>i.map(i=>d[i]);
2
+ var Vc=Object.defineProperty;var Uc=(n,a,t)=>a in n?Vc(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var H=(n,a,t)=>Uc(n,typeof a!="symbol"?a+"":a,t);import{r as b,d as Xc,j as s,b as Yt,l as fs,R as S,h as Gc,e as Jc,a as Zc,L as el}from"./react-vyZjIDcS.js";import{s as m,t as d,e as x,I as G,bf as tl,z as Ie,K as Ve,h as bt,be as Lr,n as Ot,al as hs,am as nl,D as Wt,at as rl,a0 as ms,a1 as or,av as ia,ar as le,az as Ge,ay as at,bz as al,l as $e,ax as Fr,aw as gs,aj as ol,c as Zt,a as sa,b as il,C as xs,y as sl,u as we,M as cl,ag as wr,o as kr,E as ga,aR as Xt,p as ys,F as _n,ai as bs,bA as ll,B as Pn,J as In,bB as vs,aS as oo,aT as dl,f as ws,bC as ul,_ as Yr,x as pl,ak as Dn,bD as fl,bE as hl,bF as ml,bG as gl,bH as xl,bI as yl,bJ as ks,bK as bl,bL as vl,d as Ds,bM as wl,bN as kl,bO as Dl,bP as Cl,H as Sl,bQ as Ml,R as _l,bR as Pl,bS as Il,bT as jl,bU as El,bV as Tl,bW as $l,aJ as Nl,m as Ol,bX as Rl,bY as Al,bZ as Ll,b_ as io,ah as Fl,b$ as Yl,c0 as Wl,c1 as Bl,c2 as Hl,c3 as zl,c4 as ql}from"./index-Cn-oc3fB.js";import{d as Fe,a as so}from"./dcl-schemas-BICTSpB5.js";import{$ as Wr,m as Ql,K as Kl,V as Vl,Q as Cs,R as Ul,M as Xl,S as Gl,C as Jl,H as Zl,a as ed,T as td,X as nd,b as rd,B as ad,c as od,d as id,e as sd,f as qt,j as Bn,k as Qt,W as cd,p as ld,q as dd,P as ud,x as pd,y as fd,z as hd,D as md,E as gd,F as xd,G as yd,I as bd,J as vd,L as wd,l as kd,n as Dd,o as Cd,a0 as Sd,a1 as Md,A as _d,r as Pd,s as Id,t as jd,u as Ed,v as Td,w as $d,a2 as Nd,a3 as Od,a4 as Rd,N as Ad,O as co,U as Ld}from"./CollectionCarousel-D36c6dts.js";import{a as ir,t as Fd,c as Yd}from"./buy-Cl7snZzi.js";import{f as Wd}from"./builder-C8hUH3RB.js";import{u as Bd,M as Hd,l as zd,c as qd}from"./useCreditPacks-Ceg0Oam0.js";import{r as Qd}from"./mana-rate-COZYJ-5D.js";import{m as lo}from"./mana-matic-C4e1sNO3.js";import{i as Ss,f as Ms,n as Kd,j as Vd,c as uo,g as _s,e as Ud,r as Xd,m as Gd}from"./authorizations-BNs0emga.js";import{a as Ps,w as Is,S as js,G as Es}from"./buy-gasless-DVLP7U8S.js";import{R as po}from"./resume-buy-Bf0zIH7y.js";import{a as Jd,f as xt,i as en}from"./errors-Ce5OngHE.js";import{E as ut}from"./ErrorNotice-COIh7ro4.js";import{C as Zd}from"./CircularProgress-CNroeQ3o.js";import{a as eu,b as tu,j as nu,e as ru,c as au,d as ou}from"./trade-encoding-CXbhpVj8.js";import{M as iu,E as su,s as cu}from"./sendMetaTransaction-DfeiXpP_.js";import{C as lu,I as du}from"./ethers-CXBJm_wN.js";import{a as Br}from"./mana-convert-BAmJatVq.js";import{u as Ts}from"./useManaRate-BhMxx3e3.js";import{u as uu}from"./useSecondarySales-BUPg_0HB.js";import{T as $s}from"./Tooltip-D92WFEmr.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./clsx-BY1AO2V7.js";const tn=Math.min,Et=Math.max,sr=Math.round,Hn=Math.floor,it=n=>({x:n,y:n}),pu={left:"right",right:"left",bottom:"top",top:"bottom"};function fu(n,a,t){return Et(n,tn(a,t))}function Dr(n,a){return typeof n=="function"?n(a):n}function nn(n){return n.split("-")[0]}function jn(n){return n.split("-")[1]}function hu(n){return n==="x"?"y":"x"}function xa(n){return n==="y"?"height":"width"}function It(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function ya(n){return hu(It(n))}function mu(n,a,t){t===void 0&&(t=!1);const e=jn(n),r=ya(n),o=xa(r);let i=r==="x"?e===(t?"end":"start")?"right":"left":e==="start"?"bottom":"top";return a.reference[o]>a.floating[o]&&(i=cr(i)),[i,cr(i)]}function gu(n){const a=cr(n);return[ca(n),a,ca(a)]}function ca(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const fo=["left","right"],ho=["right","left"],xu=["top","bottom"],yu=["bottom","top"];function bu(n,a,t){switch(n){case"top":case"bottom":return t?a?ho:fo:a?fo:ho;case"left":case"right":return a?xu:yu;default:return[]}}function vu(n,a,t,e){const r=jn(n);let o=bu(nn(n),t==="start",e);return r&&(o=o.map(i=>i+"-"+r),a&&(o=o.concat(o.map(ca)))),o}function cr(n){const a=nn(n);return pu[a]+n.slice(a.length)}function wu(n){var a,t,e,r;return{top:(a=n.top)!=null?a:0,right:(t=n.right)!=null?t:0,bottom:(e=n.bottom)!=null?e:0,left:(r=n.left)!=null?r:0}}function Ns(n){return typeof n!="number"?wu(n):{top:n,right:n,bottom:n,left:n}}function lr(n){const{x:a,y:t,width:e,height:r}=n;return{width:e,height:r,top:t,left:a,right:a+e,bottom:t+r,x:a,y:t}}function mo(n,a,t){let{reference:e,floating:r}=n;const o=It(a),i=ya(a),c=xa(i),l=nn(a),p=o==="y",u=e.x+e.width/2-r.width/2,h=e.y+e.height/2-r.height/2,y=e[c]/2-r[c]/2;let g;switch(l){case"top":g={x:u,y:e.y-r.height};break;case"bottom":g={x:u,y:e.y+e.height};break;case"right":g={x:e.x+e.width,y:h};break;case"left":g={x:e.x-r.width,y:h};break;default:g={x:e.x,y:e.y}}const v=jn(a);return v&&(g[i]+=y*(v==="end"?1:-1)*(t&&p?-1:1)),g}async function ku(n,a){var t;a===void 0&&(a={});const{x:e,y:r,platform:o,rects:i,elements:c,strategy:l}=n,{boundary:p="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=Dr(a,n),v=Ns(g),f=c[y?h==="floating"?"reference":"floating":h],k=lr(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(f)))==null||t?f:f.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:p,rootBoundary:u,strategy:l})),C=h==="floating"?{x:e,y:r,width:i.floating.width,height:i.floating.height}:i.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),$=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},A=lr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:T,strategy:l}):C);return{top:(k.top-A.top+v.top)/$.y,bottom:(A.bottom-k.bottom+v.bottom)/$.y,left:(k.left-A.left+v.left)/$.x,right:(A.right-k.right+v.right)/$.x}}const Du=50,Cu=async(n,a,t)=>{const{placement:e="bottom",strategy:r="absolute",middleware:o=[],platform:i}=t,c=i.detectOverflow?i:{...i,detectOverflow:ku},l=await(i.isRTL==null?void 0:i.isRTL(a));let p=await i.getElementRects({reference:n,floating:a,strategy:r}),{x:u,y:h}=mo(p,e,l),y=e,g=0;const v={};for(let w=0;w<o.length;w++){const f=o[w];if(!f)continue;const{name:k,fn:C}=f,{x:T,y:$,data:A,reset:N}=await C({x:u,y:h,initialPlacement:e,placement:y,strategy:r,middlewareData:v,rects:p,platform:c,elements:{reference:n,floating:a}});u=T??u,h=$??h,v[k]={...v[k],...A},N&&g<Du&&(g++,typeof N=="object"&&(N.placement&&(y=N.placement),N.rects&&(p=N.rects===!0?await i.getElementRects({reference:n,floating:a,strategy:r}):N.rects),{x:u,y:h}=mo(p,y,l)),w=-1)}return{x:u,y:h,placement:y,strategy:r,middlewareData:v}},Su=n=>({name:"arrow",options:n,async fn(a){const{x:t,y:e,placement:r,rects:o,platform:i,elements:c,middlewareData:l}=a,{element:p,padding:u=0}=Dr(n,a)||{};if(p==null)return{};const h=Ns(u),y={x:t,y:e},g=ya(r),v=xa(g),w=await i.getDimensions(p),f=g==="y",k=f?"top":"left",C=f?"bottom":"right",T=f?"clientHeight":"clientWidth",$=o.reference[v]+o.reference[g]-y[g]-o.floating[v],A=y[g]-o.reference[g],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(p));let M=N?N[T]:0;(!M||!await(i.isElement==null?void 0:i.isElement(N)))&&(M=c.floating[T]||o.floating[v]);const D=$/2-A/2,I=M/2-w[v]/2-1,P=tn(h[k],I),E=tn(h[C],I),O=M-w[v]-E,W=M/2-w[v]/2+D,z=fu(P,W,O),Q=!l.arrow&&jn(r)!=null&&W!==z&&o.reference[v]/2-(W<P?P:E)-w[v]/2<0,R=Q?W<P?W-P:W-O:0;return{[g]:y[g]+R,data:{[g]:z,centerOffset:W-z-R,...Q&&{alignmentOffset:R}},reset:Q}}}),Mu=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var t,e;const{placement:r,middlewareData:o,rects:i,initialPlacement:c,platform:l,elements:p}=a,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...f}=Dr(n,a);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const k=nn(r),C=It(c),T=nn(c)===c,$=await(l.isRTL==null?void 0:l.isRTL(p.floating)),A=y||(T||!w?[cr(c)]:gu(c)),N=v!=="none";!y&&N&&A.push(...vu(c,w,v,$));const M=[c,...A],D=await l.detectOverflow(a,f),I=[];let P=((e=o.flip)==null?void 0:e.overflows)||[];if(u&&I.push(D[k]),h){const z=mu(r,i,$);I.push(D[z[0]],D[z[1]])}if(P=[...P,{placement:r,overflows:I}],!I.every(z=>z<=0)){var E,O;const z=(((E=o.flip)==null?void 0:E.index)||0)+1,Q=M[z];if(Q&&(!(h==="alignment"?C!==It(Q):!1)||P.every(_=>It(_.placement)===C?_.overflows[0]>0:!0)))return{data:{index:z,overflows:P},reset:{placement:Q}};let R=(O=P.filter(V=>V.overflows[0]<=0).sort((V,_)=>V.overflows[1]-_.overflows[1])[0])==null?void 0:O.placement;if(!R)switch(g){case"bestFit":{var W;const V=(W=P.filter(_=>{if(N){const J=It(_.placement);return J===C||J==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(J=>J>0).reduce((J,ge)=>J+ge,0)]).sort((_,J)=>_[1]-J[1])[0])==null?void 0:W[0];V&&(R=V);break}case"initialPlacement":R=c;break}if(r!==R)return{reset:{placement:R}}}return{}}}},_u=new Set(["left","top"]);async function Pu(n,a){const{placement:t,platform:e,elements:r}=n,o=await(e.isRTL==null?void 0:e.isRTL(r.floating)),i=nn(t),c=jn(t),l=It(t)==="y",p=_u.has(i)?-1:1,u=o&&l?-1:1,h=Dr(a,n);let{mainAxis:y,crossAxis:g,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(g=c==="end"?v*-1:v),l?{x:g*u,y:y*p}:{x:y*p,y:g*u}}const Iu=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var t,e;const{x:r,y:o,placement:i,middlewareData:c}=a,l=await Pu(a,n);return i===((t=c.offset)==null?void 0:t.placement)&&(e=c.arrow)!=null&&e.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:i}}}}};function Cr(){return typeof window<"u"}function sn(n){return Os(n)?(n.nodeName||"").toLowerCase():"#document"}function je(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function ht(n){var a;return(a=(Os(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function Os(n){return Cr()?n instanceof Node||n instanceof je(n).Node:!1}function Pe(n){return Cr()?n instanceof Element||n instanceof je(n).Element:!1}function kt(n){return Cr()?n instanceof HTMLElement||n instanceof je(n).HTMLElement:!1}function go(n){return!Cr()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof je(n).ShadowRoot}function Sr(n){const{overflow:a,overflowX:t,overflowY:e,display:r}=We(n);return/auto|scroll|overlay|hidden|clip/.test(a+e+t)&&r!=="inline"&&r!=="contents"}function ju(n){return/^(table|td|th)$/.test(sn(n))}function Mr(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Eu=/transform|translate|scale|rotate|perspective|filter/,Tu=/paint|layout|strict|content/,_t=n=>!!n&&n!=="none";let Hr;function ba(n){const a=Pe(n)?We(n):n;return _t(a.transform)||_t(a.translate)||_t(a.scale)||_t(a.rotate)||_t(a.perspective)||!va()&&(_t(a.backdropFilter)||_t(a.filter))||Eu.test(a.willChange||"")||Tu.test(a.contain||"")}function $u(n){let a=Rt(n);for(;kt(a)&&!Cn(a);){if(ba(a))return a;if(Mr(a))return null;a=Rt(a)}return null}function va(){return Hr==null&&(Hr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hr}function Cn(n){return/^(html|body|#document)$/.test(sn(n))}function We(n){return je(n).getComputedStyle(n)}function _r(n){return Pe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Rt(n){if(sn(n)==="html")return n;const a=n.assignedSlot||n.parentNode||go(n)&&n.host||ht(n);return go(a)?a.host:a}function Rs(n){const a=Rt(n);return Cn(a)?(n.ownerDocument||n).body:kt(a)&&Sr(a)?a:Rs(a)}function Sn(n,a,t){var e;a===void 0&&(a=[]),t===void 0&&(t=!0);const r=Rs(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=je(r);if(o){const c=la(i);return a.concat(i,i.visualViewport||[],Sr(r)?r:[],c&&t?Sn(c):[])}else return a.concat(r,Sn(r,[],t))}function la(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function As(n){const a=We(n);let t=parseFloat(a.width)||0,e=parseFloat(a.height)||0;const r=kt(n),o=r?n.offsetWidth:t,i=r?n.offsetHeight:e,c=sr(t)!==o||sr(e)!==i;return c&&(t=o,e=i),{width:t,height:e,$:c}}function wa(n){return Pe(n)?n:n.contextElement}function Gt(n){const a=wa(n);if(!kt(a))return it(1);const t=a.getBoundingClientRect(),{width:e,height:r,$:o}=As(a);let i=(o?sr(t.width):t.width)/e,c=(o?sr(t.height):t.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Nu=it(0);function Ls(n){const a=je(n);return!va()||!a.visualViewport?Nu:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Ou(n,a,t){return a===void 0&&(a=!1),!!t&&a&&t===je(n)}function At(n,a,t,e){a===void 0&&(a=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=wa(n);let i=it(1);a&&(e?Pe(e)&&(i=Gt(e)):i=Gt(n));const c=Ou(o,t,e)?Ls(o):it(0);let l=(r.left+c.x)/i.x,p=(r.top+c.y)/i.y,u=r.width/i.x,h=r.height/i.y;if(o&&e){const y=je(o),g=Pe(e)?je(e):e;let v=y,w=la(v);for(;w&&g!==v;){const f=Gt(w),k=w.getBoundingClientRect(),C=We(w),T=k.left+(w.clientLeft+parseFloat(C.paddingLeft))*f.x,$=k.top+(w.clientTop+parseFloat(C.paddingTop))*f.y;l*=f.x,p*=f.y,u*=f.x,h*=f.y,l+=T,p+=$,v=je(w),w=la(v)}}return lr({width:u,height:h,x:l,y:p})}function Pr(n,a){const t=_r(n).scrollLeft;return a?a.left+t:At(ht(n)).left+t}function Fs(n,a){const t=n.getBoundingClientRect(),e=t.left+a.scrollLeft-Pr(n,t),r=t.top+a.scrollTop;return{x:e,y:r}}function Ru(n){let{elements:a,rect:t,offsetParent:e,strategy:r}=n;const o=r==="fixed",i=ht(e),c=a?Mr(a.floating):!1;if(e===i||c&&o)return t;let l={scrollLeft:0,scrollTop:0},p=it(1);const u=it(0),h=kt(e);if((h||!o)&&((sn(e)!=="body"||Sr(i))&&(l=_r(e)),h)){const g=At(e);p=Gt(e),u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}const y=i&&!h&&!o?Fs(i,l):it(0);return{width:t.width*p.x,height:t.height*p.y,x:t.x*p.x-l.scrollLeft*p.x+u.x+y.x,y:t.y*p.y-l.scrollTop*p.y+u.y+y.y}}function Au(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function Lu(n){const a=_r(n),t=n.ownerDocument.body,e=Et(n.scrollWidth,n.clientWidth,t.scrollWidth,t.clientWidth),r=Et(n.scrollHeight,n.clientHeight,t.scrollHeight,t.clientHeight);let o=-a.scrollLeft+Pr(n);const i=-a.scrollTop;return We(t).direction==="rtl"&&(o+=Et(n.clientWidth,t.clientWidth)-e),{width:e,height:r,x:o,y:i}}const Fu=25;function Yu(n,a,t){t===void 0&&(t="viewport");const e=t==="layoutViewport",r=je(n),o=ht(n),i=r.visualViewport;let c=o.clientWidth,l=o.clientHeight,p=0,u=0;if(i){const y=!va()||a==="fixed";e?y||(p=-i.offsetLeft,u=-i.offsetTop):(c=i.width,l=i.height,y&&(p=i.offsetLeft,u=i.offsetTop))}if(Pr(o)<=0){const y=o.ownerDocument,g=y.body,v=getComputedStyle(g),w=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,f=Math.abs(o.clientWidth-g.clientWidth-w),k=getComputedStyle(o).scrollbarGutter==="stable both-edges"?f/2:f;k<=Fu&&(c-=k)}return{width:c,height:l,x:p,y:u}}function Wu(n,a){const t=At(n,!0,a==="fixed"),e=t.top+n.clientTop,r=t.left+n.clientLeft,o=Gt(n),i=n.clientWidth*o.x,c=n.clientHeight*o.y,l=r*o.x,p=e*o.y;return{width:i,height:c,x:l,y:p}}function xo(n,a,t){let e;if(a==="viewport"||a==="layoutViewport")e=Yu(n,t,a);else if(a==="document")e=Lu(ht(n));else if(Pe(a))e=Wu(a,t);else{const r=Ls(n);e={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}return lr(e)}function Bu(n,a){const t=a.get(n);if(t)return t;let e=Sn(n,[],!1).filter(c=>Pe(c)&&sn(c)!=="body"),r=null;const o=We(n).position==="fixed";let i=o?Rt(n):n;for(;Pe(i)&&!Cn(i);){const c=We(i),l=ba(i),p=r?r.position:o?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&c.position==="static")?e=e.filter(h=>h!==i):r=c,i=Rt(i)}return a.set(n,e),e}function Hu(n){let{element:a,boundary:t,rootBoundary:e,strategy:r}=n;const i=[...t==="clippingAncestors"?Mr(a)?[]:Bu(a,this._c):[].concat(t),e],c=xo(a,i[0],r);let l=c.top,p=c.right,u=c.bottom,h=c.left;for(let y=1;y<i.length;y++){const g=xo(a,i[y],r);l=Et(g.top,l),p=tn(g.right,p),u=tn(g.bottom,u),h=Et(g.left,h)}return{width:p-h,height:u-l,x:h,y:l}}function zu(n){const{width:a,height:t}=As(n);return{width:a,height:t}}function qu(n,a,t){const e=kt(a),r=ht(a),o=t==="fixed",i=At(n,!0,o,a);let c={scrollLeft:0,scrollTop:0};const l=it(0);if((e||!o)&&((sn(a)!=="body"||Sr(r))&&(c=_r(a)),e)){const y=At(a,!0,o,a);l.x=y.x+a.clientLeft,l.y=y.y+a.clientTop}!e&&r&&(l.x=Pr(r));const p=r&&!e&&!o?Fs(r,c):it(0),u=i.left+c.scrollLeft-l.x-p.x,h=i.top+c.scrollTop-l.y-p.y;return{x:u,y:h,width:i.width,height:i.height}}function zr(n){return We(n).position==="static"}function yo(n,a){if(!kt(n)||We(n).position==="fixed")return null;if(a)return a(n);let t=n.offsetParent;return ht(n)===t&&(t=t.ownerDocument.body),t}function Ys(n,a){const t=je(n);if(Mr(n))return t;if(!kt(n)){let r=Rt(n);for(;r&&!Cn(r);){if(Pe(r)&&!zr(r))return r;r=Rt(r)}return t}let e=yo(n,a);for(;e&&ju(e)&&zr(e);)e=yo(e,a);return e&&Cn(e)&&zr(e)&&!ba(e)?t:e||$u(n)||t}const Qu=async function(n){const a=this.getOffsetParent||Ys,t=this.getDimensions,e=await t(n.floating);return{reference:qu(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:e.width,height:e.height}}};function Ku(n){return We(n).direction==="rtl"}const Vu={convertOffsetParentRelativeRectToViewportRelativeRect:Ru,getDocumentElement:ht,getClippingRect:Hu,getOffsetParent:Ys,getElementRects:Qu,getClientRects:Au,getDimensions:zu,getScale:Gt,isElement:Pe,isRTL:Ku};function Ws(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function Uu(n,a,t){let e=null,r;const o=ht(n);function i(){var u;clearTimeout(r),(u=e)==null||u.disconnect(),e=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),i();const y=n.getBoundingClientRect(),{left:g,top:v,width:w,height:f}=y;if(u||a(),!w||!f)return;const k=Hn(v),C=Hn(o.clientWidth-(g+w)),T=Hn(o.clientHeight-(v+f)),$=Hn(g),N={rootMargin:-k+"px "+-C+"px "+-T+"px "+-$+"px",threshold:Et(0,tn(1,h))||1};let M=!0;function D(I){const P=I[0].intersectionRatio;if(!Ws(y,n.getBoundingClientRect()))return c();if(P!==h){if(!M)return c();P?c(!1,P):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M=!1}try{e=new IntersectionObserver(D,{...N,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,N)}e.observe(n)}const l=je(n),p=()=>c(t);return l.addEventListener("resize",p),c(!0),()=>{l.removeEventListener("resize",p),i()}}function Xu(n,a,t,e){e===void 0&&(e={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=e,p=wa(n),u=r||o?[...p?Sn(p):[],...a?Sn(a):[]]:[];u.forEach(k=>{r&&k.addEventListener("scroll",t),o&&k.addEventListener("resize",t)});const h=p&&c?Uu(p,t,o):null;let y=-1,g=null;i&&(g=new ResizeObserver(k=>{let[C]=k;C&&C.target===p&&g&&a&&(g.unobserve(a),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(a)})),t()}),p&&!l&&g.observe(p),a&&g.observe(a));let v,w=l?At(n):null;l&&f();function f(){const k=At(n);w&&!Ws(w,k)&&t(),w=k,v=requestAnimationFrame(f)}return t(),()=>{var k;u.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h==null||h(),(k=g)==null||k.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const Gu=Iu,Ju=Mu,bo=Su,Zu=(n,a,t)=>{const e=new Map,r=t??{},o={...Vu,...r.platform,_c:e};return Cu(n,a,{...r,platform:o})};var ep=typeof document<"u",tp=function(){},Zn=ep?b.useLayoutEffect:tp;function dr(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let t,e,r;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==a.length)return!1;for(e=t;e--!==0;)if(!dr(n[e],a[e]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(a).length)return!1;for(e=t;e--!==0;)if(!{}.hasOwnProperty.call(a,r[e]))return!1;for(e=t;e--!==0;){const o=r[e];if(!(o==="_owner"&&n.$$typeof)&&!dr(n[o],a[o]))return!1}return!0}return n!==n&&a!==a}function Bs(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function vo(n,a){const t=Bs(n);return Math.round(a*t)/t}function qr(n){const a=b.useRef(n);return Zn(()=>{a.current=n}),a}function np(n){n===void 0&&(n={});const{placement:a="bottom",strategy:t="absolute",middleware:e=[],platform:r,elements:{reference:o,floating:i}={},transform:c=!0,whileElementsMounted:l,open:p}=n,[u,h]=b.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:!1}),[y,g]=b.useState(e);dr(y,e)||g(e);const[v,w]=b.useState(null),[f,k]=b.useState(null),C=b.useCallback(_=>{_!==N.current&&(N.current=_,w(_))},[]),T=b.useCallback(_=>{_!==M.current&&(M.current=_,k(_))},[]),$=o||v,A=i||f,N=b.useRef(null),M=b.useRef(null),D=b.useRef(u),I=l!=null,P=qr(l),E=qr(r),O=qr(p),W=b.useCallback(()=>{if(!N.current||!M.current)return;const _={placement:a,strategy:t,middleware:y};E.current&&(_.platform=E.current),Zu(N.current,M.current,_).then(J=>{const ge={...J,isPositioned:O.current!==!1};z.current&&!dr(D.current,ge)&&(D.current=ge,Xc.flushSync(()=>{h(ge)}))})},[y,a,t,E,O]);Zn(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[p]);const z=b.useRef(!1);Zn(()=>(z.current=!0,()=>{z.current=!1}),[]),Zn(()=>{if($&&(N.current=$),A&&(M.current=A),$&&A){if(P.current)return P.current($,A,W);W()}},[$,A,W,P,I]);const Q=b.useMemo(()=>({reference:N,floating:M,setReference:C,setFloating:T}),[C,T]),R=b.useMemo(()=>({reference:$,floating:A}),[$,A]),V=b.useMemo(()=>{const _={position:t,left:0,top:0};if(!R.floating)return _;const J=vo(R.floating,u.x),ge=vo(R.floating,u.y);return c?{..._,transform:"translate("+J+"px, "+ge+"px)",...Bs(R.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:J,top:ge}},[t,c,R.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:W,refs:Q,elements:R,floatingStyles:V}),[u,W,Q,R,V])}const rp=n=>{function a(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:e,padding:r}=typeof n=="function"?n(t):n;return e&&a(e)?e.current!=null?bo({element:e.current,padding:r}).fn(t):{}:e?bo({element:e,padding:r}).fn(t):{}}}},ap=(n,a)=>{const t=Gu(n);return{name:t.name,fn:t.fn,options:[n,a]}},op=(n,a)=>{const t=Ju(n);return{name:t.name,fn:t.fn,options:[n,a]}},ip=(n,a)=>{const t=rp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Hs=216n,sp=(1n<<Hs)-1n;function cp(n){const a=typeof n=="bigint"?n:BigInt(n.trim());if(a<0n)throw new Error(`Invalid tokenId: ${String(n)}`);return{itemId:(a>>Hs).toString(),issuedId:(a&sp).toString()}}function lp(n){if(!n)return null;try{return cp(n).itemId}catch{return null}}function wo(n,a){return a.kind==="listed"?{...n,isOnSale:!0,listingPrice:a.priceCredits,tradeId:a.tradeId??n.tradeId}:{...n,isOnSale:!1,listingPrice:void 0,tradeId:void 0}}function Qr(n,a,t){const{address:e,contractAddress:r,tokenId:o}=a;if(!r||!o)return;const i=`${r}-${o}`;n.cancelQueries({queryKey:["owned-token",r,o]}),n.cancelQueries({queryKey:["secondary-sale-state"]}),e&&n.cancelQueries({queryKey:["my-assets",e]});const c=t.kind==="gone";n.setQueriesData({queryKey:["owned-token",r,o]},p=>p&&(c?null:wo(p,t)));const l=e?["my-assets",e]:["my-assets"];n.setQueriesData({queryKey:l},p=>p!=null&&p.pages?{...p,pages:p.pages.map(u=>{if(c){const h=u.items.filter(y=>!(y.contractAddress===r&&y.tokenId===o));return{...u,items:h,total:Math.max(0,u.total-(u.items.length-h.length))}}return{...u,items:u.items.map(h=>h.contractAddress===r&&h.tokenId===o?wo(h,t):h)}})}:p),n.setQueriesData({queryKey:["secondary-sale-state"]},p=>{var h;if(!p)return p;const u={...p};return t.kind==="removed"||t.kind==="gone"?delete u[i]:u[i]={priceCredits:t.priceCredits,tradeId:t.tradeId??((h=u[i])==null?void 0:h.tradeId)??""},u})}function dp(n){return!(n.isMarket||n.forSale&&n.priceKnown||n.manage||n.soldOutWithResale||!n.stillResolving&&!n.resolvingTrade&&(n.isTokenRoute?!n.ownedAssetLoading:!n.deepLinkLoading))}const up="data:image/webp;base64,UklGRqgOAABXRUJQVlA4IJwOAACwOwCdASqEAIsAPj0YikMiIaEWuib4IAPEtQBl0QC/bukK7J6X8cPZP5F69/Nvhj8oPlD3odY/QB8RXPv/C+3n59+izzA/0l/3/9064PmD/bH9Zvey/33r8/2PqC/zH/fdaX6EX7O+nP+3Xwlfub+33tOf/+7N8wTMuJT/znss7V9qD/DcDplr/deudN0/Rcajjp49/Q//7vLR70+4X+tP/R9az//+3r9z/Yk/ZVVfCa+jj+kU2kxc+zPDZIZQYWF19BTevkFTZdPnQBT3YukdDX/AtCNcmvBrFJ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nWPMxIubcSpm+5n8vMpysoMuGzoNwBmNszF+S+b8acZRgm2Gi0UT5OGuYwq4wZ5kmd8OqnDzhze2RxwMRtRm+17eKYWzLWtgVuOca/HWuBI58UC9FNZtBLv1l2htg7Iyehb/cr9uKvXkPXh0LFeyfEc49dOsGvppssGqOAAAAA=",fp=m.div`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  gap: 24px;
@@ -1705,7 +1705,7 @@ var Vc=Object.defineProperty;var Uc=(n,a,t)=>a in n?Vc(n,a,{enumerable:!0,config
1705
1705
  margin-top: 18px;
1706
1706
  `,Ri=m(Pn)`
1707
1707
  flex: 1;
1708
- `;function Ai(n){if(en(n))return x("errors.rejected");const a=(n.message??"").toLowerCase();return a.includes("insufficient")?x("marketCheckout.error.insufficient",{currency:bt.name}):a.includes("not found")||a.includes("no active listing")||a.includes("404")?x("marketCheckout.error.soldOrRemoved"):a.includes("your own listing")?x("errors.cantBuyOwn"):x("marketCheckout.error.generic")}function ly(n){return{id:n.tradeId,tradeId:n.tradeId,name:n.name,creator:n.creator,contractAddress:n.contractAddress,itemId:n.itemId,category:n.category,wearableCategory:n.wearableCategory??void 0,rarity:n.rarity,network:n.network,chainId:n.chainId,thumbnail:n.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function kc({listing:n,rate:a,onClose:t,onSold:e}){const{session:r}=Ot(),{data:o,isError:i}=hs(r),c=Wt(),l=Yt(),[p,u]=b.useState("confirm"),[h,y]=b.useState(x("marketCheckout.lockingPrice")),[g,v]=b.useState(null),[w,f]=b.useState(null),k=b.useRef(null),C=b.useRef(zs()),T=or(Br(n.manaWei,a));b.useEffect(()=>{let P=!1;if(!r){u("error"),v(x("buyModal.signInToCheckout"));return}return(async()=>{try{const O=await ws(n.tradeId);if(!O)throw new Error("not found");if(ms(O,r.address))throw new Error("You can't buy your own listing.");const W=Br(n.manaWei,a);if(!Number.isFinite(W)||W<=0)throw new Error("price unavailable");const{credit:z,maxCreditedValue:Q,usdCents:R}=await ia(r.identity,W,n.tradeId);if(P){N([z.id]);return}k.current=z.id,f({trade:O,credit:z,maxCreditedValue:Q,usdCents:R,credits:or(R)}),y("")}catch(O){if(P)return;console.error("[market] authorize failed",O),le(at(O)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Ge(O),value_usd:Math.round(Br(n.manaWei,a))/100}),u("error"),v(Ai(O))}})(),()=>{P=!0,k.current&&r&&(M([k.current]),k.current=null)}},[]);const $=!!w&&o!=null&&o.credits<w.credits;async function A(){if(!r||!w)return;if($){le("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:w.credits,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,w.credits-((o==null?void 0:o.credits)??0))}),N([w.credit.id]),k.current=null,l("/credits");return}u("working"),v(null);let P=!1,E;try{y(x("marketCheckout.confirming"));const W={trade:w.trade,buyer:r.address,signer:r.signer,credits:[w.credit],maxCreditedValue:w.maxCreditedValue,onBroadcast:({txHash:z})=>C.current.broadcast(w.credit.id,z),onReverted:({txHash:z})=>{z&&C.current.reverted(z)}};if(C.current.submitStarted(w.credit.id),Ss())try{E=await Ps(W),C.current.broadcast(w.credit.id,E),await Is(E),P=!0}catch(z){if(z instanceof js)P=!0;else if(z instanceof Es){if(z.reason==="relayer-unreachable")throw C.current.unobservable(w.credit.id),z;E=await ir(W)}else throw E&&C.current.reverted(E),z}else E=await ir(W)}catch(W){C.current.submitFinished(w.credit.id),console.error("[market] buy now failed",W),N([w.credit.id]),k.current=null,le(at(W)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Ge(W),value_usd:w.usdCents/100}),c.invalidateQueries({queryKey:["usd-balance"]}),v(Ai(W)),u("error");const z=(W.message??"").toLowerCase();(z.includes("not found")||z.includes("no active listing")||z.includes("404"))&&e();return}C.current.submitFinished(w.credit.id),k.current=null;try{c.invalidateQueries({queryKey:["usd-balance"]}),le("Shop Completed Purchase",{items:[{item_id:n.itemId??null,contract_address:n.contractAddress,token_id:null,price_usd:w.usdCents/100}],value_credits:w.credits,value_usd:w.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:P,transaction_hash:E??null}),c.invalidateQueries({queryKey:["detail-trade"]}),c.invalidateQueries({queryKey:["shop-item"]}),c.invalidateQueries({queryKey:["item-resales",n.contractAddress,n.itemId]}),c.invalidateQueries({queryKey:["shop-items"]}),c.invalidateQueries({queryKey:["catalog-items"]}),c.invalidateQueries({queryKey:["my-assets"]}),c.invalidateQueries({queryKey:["purchases"]})}catch(W){$e(W,{flow:"market_buy_now",step:"post_purchase"})}const O={items:[ly(n)],txHash:E};l("/success",{state:O})}function N(P){if(!r||P.length===0)return;const E=P.filter(O=>!C.current.mayBeConsumed(O));E.length!==0&&gs(r.identity,E).catch(()=>{})}function M(P){N(P.filter(E=>!C.current.isInFlight(E)))}function D(){r&&w&&N([w.credit.id]),k.current=null,t()}const I=p==="working";return s.jsxs(Jx,{role:"dialog","aria-modal":"true","aria-label":x("buyModal.dialogAria",{name:n.name}),children:[s.jsx(Zx,{onClick:I?void 0:D,"aria-hidden":!0}),s.jsxs(ey,{children:[s.jsxs(ty,{children:[s.jsx(ny,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs("div",{children:[s.jsx(ry,{title:n.name,children:n.name||x("buyModal.itemFallback")}),s.jsx(vs,{"data-variant":"rarity",children:n.rarity})]})]}),s.jsx(ay,{children:w?s.jsxs(s.Fragment,{children:[s.jsx(Ei,{children:x("marketCheckout.finalPrice")}),s.jsxs(Ti,{children:[s.jsx($i,{}),oo(w.credits)]}),s.jsxs(Ni,{className:"muted",children:[x("marketCheckout.lockedForPurchase")," · $",(w.usdCents/100).toFixed(2)]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ei,{children:x("marketCheckout.todaysPrice")}),s.jsxs(Ti,{"data-approx":!0,children:[s.jsx(oy,{"aria-hidden":!0,children:"≈"}),s.jsx($i,{}),oo(T)]}),s.jsx(Ni,{className:"muted",children:h||x("marketCheckout.lockingPrice")})]})}),r?s.jsxs(iy,{className:"muted",children:[x("marketCheckout.yourBalance")," ",s.jsx(Ie,{className:"ccy-mark"})," ",dl(o,i)]}):null,$?s.jsx(Oi,{className:"muted",children:x("marketCheckout.needMore",{currency:bt.name})}):null,h&&p==="working"?s.jsx(Oi,{className:"muted",children:h}):null,s.jsx(sy,{message:g}),s.jsxs(cy,{children:[s.jsx(Ri,{variant:"ghost",onClick:D,disabled:I,children:x("buyModal.cancel")}),s.jsx(Ri,{variant:"purple",onClick:()=>void A(),disabled:I||!w,children:I?x("marketCheckout.buying"):$?x("nav.getCredits",{currency:bt.name}):x("marketCheckout.confirmPurchase")})]})]})]})}function dy(n,a,{enabled:t=!0,first:e}={}){const{data:r,isFetched:o}=we({queryKey:["related-items",n,a,e],enabled:t&&!!n&&!!a,staleTime:3e5,queryFn:()=>ul(n,a,{first:e})});return{items:r??[],isFetched:o}}const uy=b.lazy(async()=>{const[{EmoteControls:n},{Experimental_CssVarsProvider:a},{light:t}]=await Promise.all([Yr(()=>import("./index-B6Fs-ly-.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),Yr(()=>import("./index-LeLZ_uWV.js"),__vite__mapDeps([12,3,1,4,2,5,6,7,13,14,9])),Yr(()=>import("./index-B8qQ9Xxb.js").then(e=>e.c8),__vite__mapDeps([3,1,4,2,5,6,7]))]);return{default:e=>s.jsx(a,{theme:t,children:s.jsx(n,{...e})})}});function py(n){return s.jsx(b.Suspense,{fallback:null,children:s.jsx(uy,{...n})})}function fy(){const n=b.useRef(null),[a,t]=b.useState(!0),[e,r]=b.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return b.useEffect(()=>{const o=n.current;if(!o||typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(c=>t(c.some(l=>l.isIntersecting)),{rootMargin:"200px"});return i.observe(o),()=>i.disconnect()},[]),b.useEffect(()=>{if(typeof document>"u")return;const o=()=>r(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[]),{ref:n,active:a&&e}}function hy(n){if(n)try{so.sendMessage(n,so.PreviewMessageType.CONTROLLER_REQUEST,{id:`dispose-${Date.now()}`,namespace:"scene",method:"cleanup",params:[]})}catch{}}const{colors:ce,media:ja}=d,my=pl`
1708
+ `;function Ai(n){if(en(n))return x("errors.rejected");const a=(n.message??"").toLowerCase();return a.includes("insufficient")?x("marketCheckout.error.insufficient",{currency:bt.name}):a.includes("not found")||a.includes("no active listing")||a.includes("404")?x("marketCheckout.error.soldOrRemoved"):a.includes("your own listing")?x("errors.cantBuyOwn"):x("marketCheckout.error.generic")}function ly(n){return{id:n.tradeId,tradeId:n.tradeId,name:n.name,creator:n.creator,contractAddress:n.contractAddress,itemId:n.itemId,category:n.category,wearableCategory:n.wearableCategory??void 0,rarity:n.rarity,network:n.network,chainId:n.chainId,thumbnail:n.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function kc({listing:n,rate:a,onClose:t,onSold:e}){const{session:r}=Ot(),{data:o,isError:i}=hs(r),c=Wt(),l=Yt(),[p,u]=b.useState("confirm"),[h,y]=b.useState(x("marketCheckout.lockingPrice")),[g,v]=b.useState(null),[w,f]=b.useState(null),k=b.useRef(null),C=b.useRef(zs()),T=or(Br(n.manaWei,a));b.useEffect(()=>{let P=!1;if(!r){u("error"),v(x("buyModal.signInToCheckout"));return}return(async()=>{try{const O=await ws(n.tradeId);if(!O)throw new Error("not found");if(ms(O,r.address))throw new Error("You can't buy your own listing.");const W=Br(n.manaWei,a);if(!Number.isFinite(W)||W<=0)throw new Error("price unavailable");const{credit:z,maxCreditedValue:Q,usdCents:R}=await ia(r.identity,W,n.tradeId);if(P){N([z.id]);return}k.current=z.id,f({trade:O,credit:z,maxCreditedValue:Q,usdCents:R,credits:or(R)}),y("")}catch(O){if(P)return;console.error("[market] authorize failed",O),le(at(O)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Ge(O),value_usd:Math.round(Br(n.manaWei,a))/100}),u("error"),v(Ai(O))}})(),()=>{P=!0,k.current&&r&&(M([k.current]),k.current=null)}},[]);const $=!!w&&o!=null&&o.credits<w.credits;async function A(){if(!r||!w)return;if($){le("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:w.credits,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,w.credits-((o==null?void 0:o.credits)??0))}),N([w.credit.id]),k.current=null,l("/credits");return}u("working"),v(null);let P=!1,E;try{y(x("marketCheckout.confirming"));const W={trade:w.trade,buyer:r.address,signer:r.signer,credits:[w.credit],maxCreditedValue:w.maxCreditedValue,onBroadcast:({txHash:z})=>C.current.broadcast(w.credit.id,z),onReverted:({txHash:z})=>{z&&C.current.reverted(z)}};if(C.current.submitStarted(w.credit.id),Ss())try{E=await Ps(W),C.current.broadcast(w.credit.id,E),await Is(E),P=!0}catch(z){if(z instanceof js)P=!0;else if(z instanceof Es){if(z.reason==="relayer-unreachable")throw C.current.unobservable(w.credit.id),z;E=await ir(W)}else throw E&&C.current.reverted(E),z}else E=await ir(W)}catch(W){C.current.submitFinished(w.credit.id),console.error("[market] buy now failed",W),N([w.credit.id]),k.current=null,le(at(W)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Ge(W),value_usd:w.usdCents/100}),c.invalidateQueries({queryKey:["usd-balance"]}),v(Ai(W)),u("error");const z=(W.message??"").toLowerCase();(z.includes("not found")||z.includes("no active listing")||z.includes("404"))&&e();return}C.current.submitFinished(w.credit.id),k.current=null;try{c.invalidateQueries({queryKey:["usd-balance"]}),le("Shop Completed Purchase",{items:[{item_id:n.itemId??null,contract_address:n.contractAddress,token_id:null,price_usd:w.usdCents/100}],value_credits:w.credits,value_usd:w.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:P,transaction_hash:E??null}),c.invalidateQueries({queryKey:["detail-trade"]}),c.invalidateQueries({queryKey:["shop-item"]}),c.invalidateQueries({queryKey:["item-resales",n.contractAddress,n.itemId]}),c.invalidateQueries({queryKey:["shop-items"]}),c.invalidateQueries({queryKey:["catalog-items"]}),c.invalidateQueries({queryKey:["my-assets"]}),c.invalidateQueries({queryKey:["purchases"]})}catch(W){$e(W,{flow:"market_buy_now",step:"post_purchase"})}const O={items:[ly(n)],txHash:E};l("/success",{state:O})}function N(P){if(!r||P.length===0)return;const E=P.filter(O=>!C.current.mayBeConsumed(O));E.length!==0&&gs(r.identity,E).catch(()=>{})}function M(P){N(P.filter(E=>!C.current.isInFlight(E)))}function D(){r&&w&&N([w.credit.id]),k.current=null,t()}const I=p==="working";return s.jsxs(Jx,{role:"dialog","aria-modal":"true","aria-label":x("buyModal.dialogAria",{name:n.name}),children:[s.jsx(Zx,{onClick:I?void 0:D,"aria-hidden":!0}),s.jsxs(ey,{children:[s.jsxs(ty,{children:[s.jsx(ny,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs("div",{children:[s.jsx(ry,{title:n.name,children:n.name||x("buyModal.itemFallback")}),s.jsx(vs,{"data-variant":"rarity",children:n.rarity})]})]}),s.jsx(ay,{children:w?s.jsxs(s.Fragment,{children:[s.jsx(Ei,{children:x("marketCheckout.finalPrice")}),s.jsxs(Ti,{children:[s.jsx($i,{}),oo(w.credits)]}),s.jsxs(Ni,{className:"muted",children:[x("marketCheckout.lockedForPurchase")," · $",(w.usdCents/100).toFixed(2)]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ei,{children:x("marketCheckout.todaysPrice")}),s.jsxs(Ti,{"data-approx":!0,children:[s.jsx(oy,{"aria-hidden":!0,children:"≈"}),s.jsx($i,{}),oo(T)]}),s.jsx(Ni,{className:"muted",children:h||x("marketCheckout.lockingPrice")})]})}),r?s.jsxs(iy,{className:"muted",children:[x("marketCheckout.yourBalance")," ",s.jsx(Ie,{className:"ccy-mark"})," ",dl(o,i)]}):null,$?s.jsx(Oi,{className:"muted",children:x("marketCheckout.needMore",{currency:bt.name})}):null,h&&p==="working"?s.jsx(Oi,{className:"muted",children:h}):null,s.jsx(sy,{message:g}),s.jsxs(cy,{children:[s.jsx(Ri,{variant:"ghost",onClick:D,disabled:I,children:x("buyModal.cancel")}),s.jsx(Ri,{variant:"purple",onClick:()=>void A(),disabled:I||!w,children:I?x("marketCheckout.buying"):$?x("nav.getCredits",{currency:bt.name}):x("marketCheckout.confirmPurchase")})]})]})]})}function dy(n,a,{enabled:t=!0,first:e}={}){const{data:r,isFetched:o}=we({queryKey:["related-items",n,a,e],enabled:t&&!!n&&!!a,staleTime:3e5,queryFn:()=>ul(n,a,{first:e})});return{items:r??[],isFetched:o}}const uy=b.lazy(async()=>{const[{EmoteControls:n},{Experimental_CssVarsProvider:a},{light:t}]=await Promise.all([Yr(()=>import("./index-BNnLGudB.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),Yr(()=>import("./index-CVMO2zcQ.js"),__vite__mapDeps([12,3,1,4,2,5,6,7,13,14,9])),Yr(()=>import("./index-Cn-oc3fB.js").then(e=>e.c8),__vite__mapDeps([3,1,4,2,5,6,7]))]);return{default:e=>s.jsx(a,{theme:t,children:s.jsx(n,{...e})})}});function py(n){return s.jsx(b.Suspense,{fallback:null,children:s.jsx(uy,{...n})})}function fy(){const n=b.useRef(null),[a,t]=b.useState(!0),[e,r]=b.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return b.useEffect(()=>{const o=n.current;if(!o||typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(c=>t(c.some(l=>l.isIntersecting)),{rootMargin:"200px"});return i.observe(o),()=>i.disconnect()},[]),b.useEffect(()=>{if(typeof document>"u")return;const o=()=>r(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[]),{ref:n,active:a&&e}}function hy(n){if(n)try{so.sendMessage(n,so.PreviewMessageType.CONTROLLER_REQUEST,{id:`dispose-${Date.now()}`,namespace:"scene",method:"cleanup",params:[]})}catch{}}const{colors:ce,media:ja}=d,my=pl`
1709
1709
  to {
1710
1710
  transform: rotate(360deg);
1711
1711
  }
@@ -1,4 +1,4 @@
1
- import{r as l,j as c}from"./react-vyZjIDcS.js";import{s as u,B as f,e as d}from"./index-B8qQ9Xxb.js";const p=u.div`
1
+ import{r as l,j as c}from"./react-vyZjIDcS.js";import{s as u,B as f,e as d}from"./index-Cn-oc3fB.js";const p=u.div`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  padding: 28px 0 8px;
@@ -1,4 +1,4 @@
1
- import{O as Y,N as Ke,P as M,bv as vt,b8 as mt,bt as we}from"./index-B8qQ9Xxb.js";import{h as De,R as Me,r as O,j as X,d as nn,i as rn,g as on}from"./react-vyZjIDcS.js";import{g as jt,a as Nt,c as Lt,b as Ye,s as Ze,d as an,f as sn}from"./clsx-3D8Gvjd6.js";import{_ as ln,T as Wt,u as ue,s as ht,o as je,a as un}from"./createSvgIcon--KCu3mQi.js";import{u as cn}from"./useTheme-DPli5iET.js";function fn(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}var Fe={exports:{}},S={};/**
1
+ import{O as Y,N as Ke,P as M,bv as vt,b8 as mt,bt as we}from"./index-Cn-oc3fB.js";import{h as De,R as Me,r as O,j as X,d as nn,i as rn,g as on}from"./react-vyZjIDcS.js";import{g as jt,a as Nt,c as Lt,b as Ye,s as Ze,d as an,f as sn}from"./clsx-BY1AO2V7.js";import{_ as ln,T as Wt,u as ue,s as ht,o as je,a as un}from"./createSvgIcon-BUIodiet.js";import{u as cn}from"./useTheme-cGCeJmwR.js";function fn(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}var Fe={exports:{}},S={};/**
2
2
  * @license React
3
3
  * react-is.production.min.js
4
4
  *
@@ -1,4 +1,4 @@
1
- import{L as be,u as Ue,r as c,j as t}from"./react-vyZjIDcS.js";import{s as a,t as s,I as k,m as He,e as r,n as We,o as re,u as _,B as Ye,S as D,A as U,q as Qe,c as we,v as Ve,w as Ze}from"./index-B8qQ9Xxb.js";import{f as Je}from"./import-C0DSObrV.js";import{f as Xe}from"./builder-Biq1yQgT.js";import{L as et}from"./LoadMore-COkJGWsB.js";import{R as H,C as tt,a as st,F as ot,S as ae}from"./categories-BqS-qyq6.js";import{D as ie,F as le,R as nt,a as rt,b as at,c as it,d as lt,S as ct,e as dt,f as mt,g as pt,h as ut,i as ft,j as xt,k as ht,C as yt,l as gt,m as bt,n as wt,M as St}from"./Assets.styles-DEZ9a_GD.js";import{u as jt}from"./useInfiniteGrid-jYXiF9Ls.js";import{u as $t}from"./useSecondarySales-DVrg7pqD.js";import{E as ce}from"./ErrorNotice-6S2ayRHK.js";import{n as Se}from"./Tooltip-3y4DnUZl.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-DTB3xpDX.js";import"./authorizations-JSOY6ArB.js";import"./sendMetaTransaction-B3nckO8c.js";import"./trade-encoding-CjafzO-R.js";import"./mana-rate-LTr19y4S.js";import"./mana-convert-Bbf4K53E.js";a.div`
1
+ import{L as be,u as Ue,r as c,j as t}from"./react-vyZjIDcS.js";import{s as a,t as s,I as k,m as He,e as r,n as We,o as re,u as _,B as Ye,S as D,A as U,q as Qe,c as we,v as Ve,w as Ze}from"./index-Cn-oc3fB.js";import{f as Je}from"./import-DbH_aWZX.js";import{f as Xe}from"./builder-C8hUH3RB.js";import{L as et}from"./LoadMore-BsvftUzw.js";import{R as H,C as tt,a as st,F as ot,S as ae}from"./categories-BGGjSLd9.js";import{D as ie,F as le,R as nt,a as rt,b as at,c as it,d as lt,S as ct,e as dt,f as mt,g as pt,h as ut,i as ft,j as xt,k as ht,C as yt,l as gt,m as bt,n as wt,M as St}from"./Assets.styles-CmDKBB8r.js";import{u as jt}from"./useInfiniteGrid-YGnKZcnB.js";import{u as $t}from"./useSecondarySales-BUPg_0HB.js";import{E as ce}from"./ErrorNotice-COIh7ro4.js";import{n as Se}from"./Tooltip-D92WFEmr.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-Cl7snZzi.js";import"./authorizations-BNs0emga.js";import"./sendMetaTransaction-DfeiXpP_.js";import"./trade-encoding-CXbhpVj8.js";import"./mana-rate-COZYJ-5D.js";import"./mana-convert-BAmJatVq.js";a.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 4px;
@@ -1,4 +1,4 @@
1
- import{L as h,r as g,j as t}from"./react-vyZjIDcS.js";import{s,t as f,m as u,e as o,R as c,S as y,A as v}from"./index-B8qQ9Xxb.js";import{L as C}from"./LoadMore-COkJGWsB.js";import{E as j}from"./ErrorNotice-6S2ayRHK.js";import{G as b}from"./grid.styles-Dnnyw76z.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:e,radius:p}=f,w=s.div`
1
+ import{L as h,r as g,j as t}from"./react-vyZjIDcS.js";import{s,t as f,m as u,e as o,R as c,S as y,A as v}from"./index-Cn-oc3fB.js";import{L as C}from"./LoadMore-BsvftUzw.js";import{E as j}from"./ErrorNotice-COIh7ro4.js";import{G as b}from"./grid.styles-B1mDfzvi.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:e,radius:p}=f,w=s.div`
2
2
  display: flex;
3
3
  align-items: baseline;
4
4
  gap: 12px;