@dcl/shop 0.1.0-30275838080.commit-dc84870 → 0.1.0-30277401547.commit-e877307

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 (209) hide show
  1. package/assets/Activity-_qlXQij1.js +287 -0
  2. package/assets/{AnimatedBackground-xHNygKQ8.js → AnimatedBackground-DO49gSw8.js} +1 -1
  3. package/assets/Assets-D-VpkQ1l.js +787 -0
  4. package/assets/{Assets.styles-DvPvkguW.js → Assets.styles-BZMkOQeI.js} +94 -21
  5. package/assets/Authorizations-BFWG3QA_.js +182 -0
  6. package/assets/{Button-auVihOkI.js → Button-DvhW1Z1S.js} +3 -3
  7. package/assets/Cart-C_kThny7.css +1 -0
  8. package/assets/Cart-Cz7NK8QL.js +1 -0
  9. package/assets/{CircularProgress-DFdK37rG.js → CircularProgress-BmwVvF17.js} +3 -3
  10. package/assets/{Collection-B3vEoxu6.js → Collection-Bc2CvIur.js} +2 -2
  11. package/assets/CollectionCarousel-DEYFBykF.js +292 -0
  12. package/assets/{Creator-YS98HebA.js → Creator-7vyVsWtE.js} +1 -1
  13. package/assets/{ExchangeController-BDF-2GeF.js → ExchangeController-icK8vQc1.js} +1 -1
  14. package/assets/GetCredits-BE-bIUdj.js +611 -0
  15. package/assets/{HelpersUtil-pH82j1ap.js → HelpersUtil-C_aV_Y-W.js} +1 -1
  16. package/assets/ImportListings-CgB7Xjb_.css +1 -0
  17. package/assets/{ImportListings-D5NXWizQ.js → ImportListings-CusN2RYj.js} +2 -2
  18. package/assets/{ItemDetail-DSWLL-Uv.css → ItemDetail-CkmPrObF.css} +1 -1
  19. package/assets/ItemDetail-blewhWwg.js +2406 -0
  20. package/assets/{LoadMore-C2IGYfn5.js → LoadMore-C2uaqP2N.js} +1 -1
  21. package/assets/{MarketCheckout-BF6QzOp6.js → MarketCheckout-CW6mGgHt.js} +1 -1
  22. package/assets/{MenuList-CuKsDFTR.js → MenuList-mbP1RxaG.js} +2 -2
  23. package/assets/{MyAssets-DzPtnmU-.js → MyAssets-HcHA9d8L.js} +4 -4
  24. package/assets/MyFavorites-DkEAv96J.js +1 -0
  25. package/assets/{NotFound-C6fJPmtm.js → NotFound-B2W2MHR8.js} +1 -1
  26. package/assets/NotificationsBell-BEAvIZcq.js +34 -0
  27. package/assets/{StoreSettings-_eAoEzML.js → StoreSettings-CGc7i0kZ.js} +3 -3
  28. package/assets/{Success-Bx8rXLT9.js → Success-5LiVLOny.js} +2 -2
  29. package/assets/{SwapController-CxLE_1Gs.js → SwapController-BZT-uJE0.js} +1 -1
  30. package/assets/{Tooltip-CTKg0lSi.js → Tooltip-V9fXstBY.js} +1 -1
  31. package/assets/TradeService-D9nuCaGq.js +1 -0
  32. package/assets/{W3MFrameProviderSingleton-B2IDULyh.js → W3MFrameProviderSingleton-Ccq1reIt.js} +3 -3
  33. package/assets/{WebCryptoP256-wzk7delV.js → WebCryptoP256-CrgJppag.js} +1 -1
  34. package/assets/authorizations-t9AL68YM.js +1 -0
  35. package/assets/{basic-Ww-Goaw6.js → basic-BIbSgqQe.js} +1 -1
  36. package/assets/{biconomy-B_JhK1qV.js → biconomy-JEnDnFaz.js} +1 -1
  37. package/assets/{builder-AyiZYpZU.js → builder-uUlDA8Em.js} +1 -1
  38. package/assets/buy-84sizoxr.js +1 -0
  39. package/assets/buy-gasless-oF_YJX_W.js +1 -0
  40. package/assets/{cart-checkout-CWNsZ2Kj.js → cart-checkout-K77UDHy3.js} +1 -1
  41. package/assets/{categories-BtWBqb3o.js → categories-BwvbYi6M.js} +6 -6
  42. package/assets/categories-YFBLpDYC.css +1 -0
  43. package/assets/{ccip-CqHKhzd2.js → ccip-5L0bsS_C.js} +1 -1
  44. package/assets/{ccip-BjXLypPq.js → ccip-wypw12me.js} +1 -1
  45. package/assets/{collection-DOvX-TK6.js → collection-D7HQMUIe.js} +1 -1
  46. package/assets/{controller-C7WZ94lQ.js → controller-Cwg1NxXB.js} +2 -2
  47. package/assets/{core-DxTrqfX4.js → core-3ZRiSdvl.js} +4 -4
  48. package/assets/{custom-4udkoSO3.js → custom-BVE_f5dD.js} +1 -1
  49. package/assets/{data-capture-DDVUgHnH.js → data-capture-BRhsLQVv.js} +1 -1
  50. package/assets/{email-Csl1ng9Z.js → email-CldXoMar.js} +1 -1
  51. package/assets/{embedded-wallet-BkYPvh0b.js → embedded-wallet-vSjh73AM.js} +1 -1
  52. package/assets/{emotion-styled.browser.esm-Cdq1r4Bx.js → emotion-styled.browser.esm-vQZV14Nf.js} +1 -1
  53. package/assets/{engine-D35Ks53W.js → engine-BPP9EW4Q.js} +1 -1
  54. package/assets/{errors-DuOi3T0l.js → errors-D-hio89k.js} +1 -1
  55. package/assets/{estimate-l1-fee-Di371MAc.js → estimate-l1-fee-BLZxmPJY.js} +1 -1
  56. package/assets/{execute-TUXY08B1.js → execute-cH8V-8nL.js} +2 -2
  57. package/assets/{features-B8cziiif.js → features-CJ1tq5LL.js} +1 -1
  58. package/assets/{fetchTokenMetadata-BpxdUfTL.js → fetchTokenMetadata-hD4VNXHw.js} +2 -2
  59. package/assets/{get-ecosystem-wallet-info-B-M4E9jS.js → get-ecosystem-wallet-info-3DZHpSG2.js} +1 -1
  60. package/assets/{getBalance-Bifizyr6.js → getBalance-vjJ5CXDC.js} +1 -1
  61. package/assets/{getNFT-DF6Vq2zI.js → getNFT-BTjIkFXY.js} +1 -1
  62. package/assets/{getNFT-BdLG614g.js → getNFT-D8HIjTde.js} +1 -1
  63. package/assets/{getThemeProps-DxJMDPi7.js → getThemeProps-qmqFWvou.js} +1 -1
  64. package/assets/governance-DnazlIjy.webp +0 -0
  65. package/assets/{hashTypedData-C_DXc5T4.js → hashTypedData-BrvDnrgK.js} +1 -1
  66. package/assets/{hashTypedData-CCVnwMeq.js → hashTypedData-Y2DJnKI9.js} +1 -1
  67. package/assets/identity-B4DXDuJP.webp +0 -0
  68. package/assets/{import-Dk9yGfxG.js → import-AgO0v-a5.js} +1 -1
  69. package/assets/{in-app-9n3fFIsg.js → in-app-C4N5lFwd.js} +1 -1
  70. package/assets/{in-app-wallet-calls-mZphw4u1.js → in-app-wallet-calls-CMBsSG6j.js} +1 -1
  71. package/assets/{index-RdnFDXdw.js → index--8tZMj8Y.js} +1 -1
  72. package/assets/{index-B0_gRdTe.js → index-1cJq3bUz.js} +1 -1
  73. package/assets/{index-Bpy0DTJn.js → index-B8GAuQX3.js} +3 -3
  74. package/assets/{index-B5oo797l.js → index-B96cJA0d.js} +1 -1
  75. package/assets/{index-hgeC0JQZ.js → index-B9AUDrI9.js} +1 -1
  76. package/assets/index-BFPNYe8x.js +312 -0
  77. package/assets/{index-BP7gy2xI.js → index-BGTbU_0B.js} +2 -2
  78. package/assets/{index-DEd7XSCQ.js → index-BKvaZQRw.js} +1 -1
  79. package/assets/index-BQOr-Vwz.js +4 -0
  80. package/assets/{index-BuDF20FB.js → index-BQuXaLZX.js} +1 -1
  81. package/assets/{index-FC51tvWK.js → index-BWgCJZHy.js} +2 -2
  82. package/assets/{index-DA6wQsaR.js → index-B_jKVCv0.js} +1 -1
  83. package/assets/{index-Bkrc7UDL.js → index-BcgMkg8Z.js} +1 -1
  84. package/assets/{index-BAsZQOHh.js → index-BjQNL760.js} +1 -1
  85. package/assets/{index-CQz4TE_L.js → index-BlBoDOVY.js} +1 -1
  86. package/assets/{index-BcCAXEd4.js → index-C-2OENmH.js} +1 -1
  87. package/assets/{index-CxqiofWy.js → index-C7UEmKEb.js} +3 -3
  88. package/assets/{index-BwPtVV-b.js → index-C7gHM4wY.js} +1 -1
  89. package/assets/{index-swIqjzKr.js → index-C8Ua1g52.js} +1 -1
  90. package/assets/{index-DJ5U21fD.js → index-CI-UnS2-.js} +1 -1
  91. package/assets/{index-CmPocwN2.js → index-CV39-lnY.js} +1 -1
  92. package/assets/{index-DsV2STGW.js → index-CcARyxeB.js} +1 -1
  93. package/assets/{index-c9PZfSgh.js → index-Ch88GJdD.js} +1 -1
  94. package/assets/{index-Dxv5sw39.js → index-CiKWw9L3.js} +2 -2
  95. package/assets/{index-D2txhfvA.js → index-CmhYJKse.js} +1 -1
  96. package/assets/{index-BloQv0Rh.js → index-CnIGe1GZ.js} +1 -1
  97. package/assets/index-CsSypry2.js +2 -0
  98. package/assets/{index-dlaqrKGR.js → index-CvkWE_vF.js} +1 -1
  99. package/assets/{index-CSIhwKQ9.js → index-D0cj2XsC.js} +1 -1
  100. package/assets/{index-BWmGCZ1p.js → index-D2-V-v9q.js} +1 -1
  101. package/assets/{index-cBh2qc74.js → index-D2iLR1Fl.js} +1 -1
  102. package/assets/{index-892TBSG5.js → index-D96o2dcC.js} +1 -1
  103. package/assets/{index-D_7jU7Mb.js → index-DCFYAbF4.js} +1 -1
  104. package/assets/{index-Dp1f5mtU.js → index-DGwFgPlc.js} +1 -1
  105. package/assets/{index-CqQDAMpz.js → index-DN-OLR2r.js} +3 -3
  106. package/assets/{index-PtoeaYYN.js → index-DNLIdOOI.js} +1 -1
  107. package/assets/{index-CLAml9VI.js → index-DZxRXkvI.js} +1 -1
  108. package/assets/{index-BYcZdsFn.js → index-Dq7pc9gT.js} +1 -1
  109. package/assets/index-DwufS2l2.css +1 -0
  110. package/assets/{index-2v1NJpk7.js → index-Dx4EbFs-.js} +1 -1
  111. package/assets/{index-D2jkAfLH.js → index-Dz0EI57w.js} +1 -1
  112. package/assets/{index-Clx5uD4u.js → index-E3wxKJyS.js} +1 -1
  113. package/assets/{index-C_nN_7-B.js → index-HMuz0PhO.js} +1 -1
  114. package/assets/{index-BrKWcIRW.js → index-Hb4Ys2Tq.js} +1 -1
  115. package/assets/{index-CpzF0qFB.js → index-Vlg-GpRL.js} +1 -1
  116. package/assets/{index-B2uGwMji.js → index-YHVXMMbH.js} +1 -1
  117. package/assets/{index-BuV9hoRm.js → index-bqj_5mVc.js} +1 -1
  118. package/assets/{index-DFJtxZT4.js → index-jPOTr4Wq.js} +1 -1
  119. package/assets/{index-CKKx-sxY.js → index-qDfBJZD7.js} +1 -1
  120. package/assets/{index-Daa0ny5M.js → index-r7kjVwFs.js} +1 -1
  121. package/assets/{index-B39oAHib.js → index-rjU6xZd8.js} +1 -1
  122. package/assets/{index-mmQp95p3.js → index-trxbKGTp.js} +1 -1
  123. package/assets/{index.es-DmMpOWQ3.js → index.es-BKhU-mgO.js} +1 -1
  124. package/assets/{index.es-CzPV8SvV.js → index.es-DvYEMDdQ.js} +4 -4
  125. package/assets/{index.es-4BADL1wA.js → index.es-magZDVqq.js} +1 -1
  126. package/assets/invite-BfwIhP2C.webp +0 -0
  127. package/assets/{localBatchGatewayRequest-CnnsiZVW.js → localBatchGatewayRequest-CnLOTida.js} +1 -1
  128. package/assets/mana-rate-BpgRIQMS.js +1 -0
  129. package/assets/{networks-B7r9ehKQ.js → networks-BNqJWbtk.js} +1 -1
  130. package/assets/{onramp--n2FS2dI.js → onramp-BYjThZVX.js} +1 -1
  131. package/assets/{openzeppelin-BbXNToq4.js → openzeppelin-Ba3p7TP4.js} +1 -1
  132. package/assets/pack-chest-BX_j84xW.webp +0 -0
  133. package/assets/pack-coins-BDh1ZDbh.webp +0 -0
  134. package/assets/pack-stacks-D-V2jSHW.webp +0 -0
  135. package/assets/packs-backdrop-BcXiUPeP.webp +0 -0
  136. package/assets/{parseNft-BF90Orsn.js → parseNft-CfH76UUp.js} +2 -2
  137. package/assets/{parseSignature-BaWXPhl1.js → parseSignature-CuL9-kIi.js} +1 -1
  138. package/assets/{parseSignature-WOPJhKuP.js → parseSignature-D3qKk3uH.js} +3 -3
  139. package/assets/{passkeys-CkuCBuiV.js → passkeys-DPVQjClK.js} +1 -1
  140. package/assets/{pay-with-exchange-uDtQzLx-.js → pay-with-exchange-MNFdDdCT.js} +1 -1
  141. package/assets/{qr-overlay-BEtM3LtR.js → qr-overlay-DDDT3Q-c.js} +1 -1
  142. package/assets/{receive-DeKeGYSl.js → receive-BU9aVDlN.js} +1 -1
  143. package/assets/{resolveImplementation-C9MSE3Ke.js → resolveImplementation-OjvLy3T5.js} +1 -1
  144. package/assets/{rpc-BvqgbCLc.js → rpc-DjbYCcnH.js} +1 -1
  145. package/assets/{secp256k1-Dr3qxILc.js → secp256k1-Cz5kqQCg.js} +1 -1
  146. package/assets/{secp256k1-C8vAuzgh.js → secp256k1-X13vDEXt.js} +1 -1
  147. package/assets/{secp256k1-BzX_Tu6g.js → secp256k1-w4Bql-wA.js} +1 -1
  148. package/assets/{send-batch-transaction-BuyyUQwP.js → send-batch-transaction-Dxt9X3nj.js} +1 -1
  149. package/assets/{send-eip712-transaction-q9T6NkCK.js → send-eip712-transaction-DaAvg9MZ.js} +2 -2
  150. package/assets/{send-gasless-transaction-qGeRIUzg.js → send-gasless-transaction-BquzQGsb.js} +2 -2
  151. package/assets/{send-DwfQbeLz.js → send-oOaeKGnc.js} +1 -1
  152. package/assets/{send-transaction-au-YwQq3.js → send-transaction-BHdPLXiu.js} +2 -2
  153. package/assets/sendMetaTransaction-DNedK3Cr.js +1 -0
  154. package/assets/{sendRawTransaction-CfnlIDvI.js → sendRawTransaction-DUzMWVdQ.js} +3 -3
  155. package/assets/{serializeTransaction-DfOWev7O.js → serializeTransaction-BfDfoMJJ.js} +1 -1
  156. package/assets/{session-proposal-DlrzMPU6.js → session-proposal-CuVqfqoo.js} +1 -1
  157. package/assets/{session-request-CWIXGzBr.js → session-request-CKwxSrqb.js} +2 -2
  158. package/assets/{signing-Blgmj-ki.js → signing-BjyyWrkp.js} +3 -3
  159. package/assets/{socials-B995t4YH.js → socials-pvmMMGV3.js} +1 -1
  160. package/assets/{swaps-Clq_Nmgr.js → swaps-padIwW3Y.js} +1 -1
  161. package/assets/{thirdweb-ivD78gRL.js → thirdweb-kveVeUIA.js} +3 -3
  162. package/assets/{to-serializable-transaction-DaB5jIxe.js → to-serializable-transaction-108u7zPg.js} +2 -2
  163. package/assets/trade-encoding-DcECym8l.js +1 -0
  164. package/assets/{transactionReceipt-CLWilq6h.js → transactionReceipt-Bs-2Cglz.js} +1 -1
  165. package/assets/{transactions-BpphjA60.js → transactions-dcat6MM1.js} +1 -1
  166. package/assets/useCreditPacks-BAZLy3JX.js +1 -0
  167. package/assets/{useInfiniteGrid-CD-N77Cs.js → useInfiniteGrid-BBNOO0mR.js} +1 -1
  168. package/assets/useManaRate-CGtpZZBQ.js +1 -0
  169. package/assets/{useStore-BLu1YQjn.js → useStore-Bo6L1SFA.js} +1 -1
  170. package/assets/useTheme-CQjQJ5Is.js +1 -0
  171. package/assets/{verifyHash-DRTDPueY.js → verifyHash-BfupbUWA.js} +1 -1
  172. package/assets/{w3m-modal-CyjbWChP.js → w3m-modal-C2yr-A_-.js} +1 -1
  173. package/assets/{w3m-modal-BWS5cBnY.js → w3m-modal-CdtZ4EYL.js} +1 -1
  174. package/assets/{wait-for-tx-receipt-Dwbw_tfy.js → wait-for-tx-receipt-BBOv1oQx.js} +1 -1
  175. package/assets/{wallets-SowU94TA.js → wallets-CcitqMTg.js} +5 -5
  176. package/assets/{web-connector-BQYnWq2A.js → web-connector-BLbBOK88.js} +3 -3
  177. package/assets/world-B-9aPlxu.webp +0 -0
  178. package/assets/{writeContract-BQBB6IQD.js → writeContract-Cke2dgme.js} +1 -1
  179. package/assets/{zoraTestnet-AkjTySo9.js → zoraTestnet-NeGGigN-.js} +1 -1
  180. package/index.html +11 -11
  181. package/package.json +2 -2
  182. package/assets/Activity-zOdV7zID.js +0 -284
  183. package/assets/Assets-BsWk8z8u.js +0 -758
  184. package/assets/Authorizations-WRwO7XIX.js +0 -175
  185. package/assets/Cart-BB2vUnjZ.js +0 -3
  186. package/assets/Cart-BaVkpmjN.css +0 -1
  187. package/assets/CollectionCarousel-c7FA9ke_.js +0 -1
  188. package/assets/GetCredits-DKFHGw4S.js +0 -1
  189. package/assets/ImportListings-Dx8BzO4r.css +0 -1
  190. package/assets/ItemDetail-BFcnjOnk.js +0 -1762
  191. package/assets/MyFavorites-CDL0dF1c.js +0 -3
  192. package/assets/NotificationsBell-B39tpkNG.js +0 -34
  193. package/assets/TradeService-BS4tPzcI.js +0 -1
  194. package/assets/authorizations-DWHCeP7j.js +0 -1
  195. package/assets/buy-B0Piwjmq.js +0 -1
  196. package/assets/buy-gasless-pPTI8u_1.js +0 -1
  197. package/assets/categories-_8oO8Yih.css +0 -1
  198. package/assets/index-B4tgQVEu.js +0 -312
  199. package/assets/index-CuyaFbh3.js +0 -4
  200. package/assets/index-CvuJSryR.js +0 -2
  201. package/assets/index-D3DtvRSj.css +0 -1
  202. package/assets/index-HN6Rk25C.js +0 -1
  203. package/assets/mana-rate-B-Ghbv7a.js +0 -1
  204. package/assets/pack-chips--HnOpf5U.webp +0 -0
  205. package/assets/sendMetaTransaction-CiO3jI6F.js +0 -1
  206. package/assets/trade-encoding-BCN0X2W3.js +0 -1
  207. package/assets/useCreditPacks-CnlSkvVM.js +0 -1
  208. package/assets/useManaRate-Ctm7UARH.js +0 -1
  209. package/assets/useTheme-RtXSDv_5.js +0 -1
@@ -1,175 +0,0 @@
1
- import{j as t,L as D,r as B}from"./react-BW1xvPTF.js";import{s as a,B as F,J as o,O as S,m as N,t as e,u as M,w as P,I as g,C as G,o as w,b as H,p as K,P as k,H as Q,L as $}from"./index-B4tgQVEu.js";import{b as O,c as W,d as _,s as J,f as X}from"./authorizations-DWHCeP7j.js";import{a as U}from"./builder-AyiZYpZU.js";import{f as V}from"./errors-DuOi3T0l.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const Y=S`
2
- to { transform: rotate(360deg); }
3
- `,Z=S`
4
- to { background-position: -200% 0; }
5
- `,tt=a.section`
6
- width: 100%;
7
- min-width: 0;
8
- max-width: 760px;
9
- `,it=a.div`
10
- display: flex;
11
- flex-direction: column;
12
- gap: 6px;
13
- margin-bottom: 24px;
14
- `,et=a.h1`
15
- font-family: ${o.font.sans};
16
- margin: 0;
17
- `,ot=a.p`
18
- color: ${o.colors.muted};
19
- font-size: 14px;
20
- margin: 0;
21
- max-width: 60ch;
22
- `,b=a.div`
23
- margin-bottom: 28px;
24
- `,z=a.h2`
25
- font-family: ${o.font.sans};
26
- font-size: 15px;
27
- font-weight: 700;
28
- color: ${o.colors.text};
29
- margin: 0 0 10px;
30
- `,p=a.div`
31
- display: flex;
32
- flex-direction: column;
33
- gap: 12px;
34
- `,at=a.div`
35
- display: grid;
36
- grid-template-columns: 44px 1fr auto;
37
- align-items: center;
38
- gap: 14px;
39
- padding: 14px 18px;
40
- background: ${o.colors.white};
41
- border: 1px solid ${o.colors.line};
42
- border-radius: 16px;
43
-
44
- ${o.media.down("mobile")} {
45
- grid-template-columns: 44px 1fr;
46
- grid-row-gap: 10px;
47
- }
48
- `,C=a.div`
49
- height: 74px;
50
- border-radius: 16px;
51
- background: linear-gradient(100deg, #efeef2 30%, #e2e0e7 50%, #efeef2 70%);
52
- background-size: 200% 100%;
53
- animation: ${Z} 1.4s infinite linear;
54
-
55
- @media (prefers-reduced-motion: reduce) {
56
- animation: none;
57
- }
58
- `,nt=a.div`
59
- width: 44px;
60
- height: 44px;
61
- border-radius: 10px;
62
- background: ${o.colors.media};
63
- overflow: hidden;
64
- display: flex;
65
- align-items: center;
66
- justify-content: center;
67
- color: ${o.colors.muted2};
68
-
69
- img {
70
- width: 100%;
71
- height: 100%;
72
- object-fit: contain;
73
- }
74
- `,st=a.div`
75
- min-width: 0;
76
- display: flex;
77
- flex-direction: column;
78
- gap: 3px;
79
- `,rt=a.span`
80
- font-weight: 700;
81
- color: ${o.colors.text};
82
- white-space: nowrap;
83
- overflow: hidden;
84
- text-overflow: ellipsis;
85
- `,ct=a.span`
86
- font-size: 13px;
87
- color: ${o.colors.muted};
88
- `,lt=a.span`
89
- font-size: 12px;
90
- font-weight: 700;
91
- color: ${o.colors.muted2};
92
-
93
- &[data-active='true'] {
94
- color: ${o.colors.okStrong};
95
- }
96
- `,dt=a.div`
97
- display: flex;
98
- align-items: center;
99
- gap: 10px;
100
- justify-self: end;
101
-
102
- ${o.media.down("mobile")} {
103
- grid-column: 1 / -1;
104
- justify-self: start;
105
- }
106
- `,ut=a.button`
107
- position: relative;
108
- width: 46px;
109
- height: 26px;
110
- flex: 0 0 auto;
111
- border-radius: ${o.radius.pill};
112
- border: none;
113
- background: ${o.colors.gray4};
114
- cursor: pointer;
115
- transition: background 0.15s;
116
- padding: 0;
117
-
118
- &::after {
119
- content: '';
120
- position: absolute;
121
- top: 3px;
122
- left: 3px;
123
- width: 20px;
124
- height: 20px;
125
- border-radius: 50%;
126
- background: ${o.colors.white};
127
- transition: transform 0.15s;
128
- }
129
-
130
- &[data-active='true'] {
131
- background: ${o.colors.accent};
132
- }
133
- &[data-active='true']::after {
134
- transform: translateX(20px);
135
- }
136
-
137
- &:disabled {
138
- cursor: default;
139
- opacity: 0.6;
140
- }
141
-
142
- &:focus-visible {
143
- outline: 2px solid ${o.colors.accent};
144
- outline-offset: 2px;
145
- }
146
- `,ht=a.span`
147
- width: 16px;
148
- height: 16px;
149
- border-radius: 50%;
150
- border: 2px solid ${o.colors.gray4};
151
- border-top-color: ${o.colors.accent};
152
- animation: ${Y} 0.7s linear infinite;
153
-
154
- @media (prefers-reduced-motion: reduce) {
155
- animation: none;
156
- }
157
- `,A=a.p`
158
- color: ${o.colors.muted};
159
- font-size: 14px;
160
- margin: 0;
161
- `,T=a.div`
162
- display: flex;
163
- flex-direction: column;
164
- align-items: center;
165
- gap: 8px;
166
- text-align: center;
167
- padding: 90px 20px;
168
- min-height: 50vh;
169
- `,I=a.p`
170
- font-size: 22px;
171
- font-weight: 700;
172
- margin: 6px 0 0;
173
- `,E=a(F)`
174
- margin-top: 12px;
175
- `;function j({descriptor:i,owner:l,signer:u,name:n,description:r,image:d,icon:h}){const f=H(),[m,s]=B.useState(!1),{data:c,isLoading:y,refetch:L}=w({queryKey:["authorization",i.id,l],queryFn:()=>X(i,l),staleTime:3e4});async function R(){if(m||y)return;const x=!c;s(!0);try{await J({auth:i,signer:u,active:x}),await L(),f.setQueryData(["authorization",i.id,l],x),k.success(x?e("authorizations.toastActivated",{name:n}):e("authorizations.toastDeactivated",{name:n}))}catch(v){Q(v,{flow:"authorizations",step:x?"grant":"revoke"}),k.error(V(v,e("authorizations.errorGeneric")))}finally{s(!1)}}const q=y?e("authorizations.checking"):c?e("authorizations.active"):e("authorizations.inactive");return t.jsxs(at,{"data-testid":`authorization-${i.id}`,"data-active":!!c,children:[t.jsx(nt,{children:d?t.jsx("img",{src:d,alt:""}):h}),t.jsxs(st,{children:[t.jsx(rt,{title:n,children:n}),t.jsx(ct,{children:r})]}),t.jsxs(dt,{children:[t.jsx(lt,{"data-active":!!c,children:q}),m?t.jsx(ht,{"aria-label":e("authorizations.working")}):t.jsx(ut,{type:"button","data-testid":`authorization-toggle-${i.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?e("authorizations.deactivateAria",{name:n}):e("authorizations.activateAria",{name:n}),disabled:y,onClick:()=>void R()})]})]})}function pt(i){return w({queryKey:["owned-collections",i],enabled:!!i,staleTime:6e4,queryFn:async()=>{const[l,u]=await Promise.all([$(i,{category:"wearable",first:96}),$(i,{category:"emote",first:96})]),n=new Map;for(const r of[...l.assets,...u.assets]){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function mt(i,l){return w({queryKey:["creator-collections",i],enabled:!!i&&!!l,staleTime:6e4,queryFn:async()=>{const u=await U(i,l),n=new Map;for(const r of u){const d=r.contractAddress.toLowerCase();n.has(d)||n.set(d,r)}return[...n.values()]}})}function Ct(){N({title:e("authorizations.title"),noindex:!0});const{session:i,signIn:l}=M(),u=K.chainId,n=P(i==null?void 0:i.providerType),{data:r,isLoading:d}=pt(n?i==null?void 0:i.address:void 0),{data:h,isLoading:f}=mt(n?i==null?void 0:i.address:void 0,n?i==null?void 0:i.identity:void 0);if(!i)return t.jsxs(T,{children:[t.jsx(g,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(I,{children:e("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),t.jsx(E,{variant:"purple",onClick:()=>l(),children:e("storeSettings.signIn")})]});if(!n)return t.jsxs(T,{children:[t.jsx(g,{name:"check",size:40,color:"var(--ok)"}),t.jsx(I,{children:e("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),t.jsx(E,{as:D,to:"/assets",variant:"purple",children:e("authorizations.managedCta")})]});const m=O(u);return t.jsxs(tt,{children:[t.jsxs(it,{children:[t.jsx(et,{children:e("authorizations.title")}),t.jsx(ot,{children:e("authorizations.intro")})]}),t.jsxs(b,{children:[t.jsx(z,{children:e("authorizations.buyingTitle")}),t.jsx(p,{children:t.jsx(j,{descriptor:m,owner:i.address,signer:i.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(b,{children:[t.jsx(z,{children:e("authorizations.sellingTitle")}),d?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,c)=>t.jsx(C,{"aria-hidden":!0},c))}):r&&r.length>0?t.jsx(p,{children:r.map(s=>t.jsx(j,{descriptor:W(s.contractAddress,u),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.sellingDesc"),image:s.image,icon:t.jsx(g,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.sellingEmpty")})]}),t.jsxs(b,{children:[t.jsx(z,{children:e("authorizations.mintingTitle")}),f?t.jsx(p,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((s,c)=>t.jsx(C,{"aria-hidden":!0},c))}):h&&h.length>0?t.jsx(p,{children:h.map(s=>t.jsx(j,{descriptor:_(s.contractAddress,u),owner:i.address,signer:i.signer,name:s.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:t.jsx(g,{name:"pen",size:18})},s.contractAddress))}):t.jsx(A,{children:e("authorizations.mintingEmpty")})]})]})}export{Ct as Authorizations};
@@ -1,3 +0,0 @@
1
- import{j as e,r as m,u as Ae,a as Ue,L as re}from"./react-BW1xvPTF.js";import{t as a,C as F,y as Y,ag as We,m as ze,ae as N,n as pe,u as Oe,o as $e,a as Ge,b as He,ah as De,I as R,ai as Je,x as Ve,w as Ye,aj as ge,j as J,ak as ve,al as Xe,H as U,s as Ze,B as es,e as ss,h as as,c as fe,am as ts,l as xe,k as rs,an as cs}from"./index-B4tgQVEu.js";import{W as ns,t as is,C as ls,s as ke}from"./CollectionCarousel-c7FA9ke_.js";import{a as je}from"./buy-B0Piwjmq.js";import{a as os,w as ds,S as us,G as hs}from"./buy-gasless-pPTI8u_1.js";import{R as V,r as ms}from"./cart-checkout-CWNsZ2Kj.js";import{g as _s}from"./authorizations-DWHCeP7j.js";import{u as ys,M as bs,c as ps}from"./useCreditPacks-CnlSkvVM.js";import{l as gs}from"./loader-logo-BzY9EKdC.js";import{i as vs,a as fs}from"./errors-DuOi3T0l.js";import{E as xs}from"./ErrorNotice-BG40E5Ff.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BCN0X2W3.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const ks="https://cdn.decentraland.org/@dcl/shop/0.1.0-30275838080.commit-dc84870/assets/buy-error-22UunaPC.png";function js(r){const{phase:n,balanceCredits:h,onClose:y}=r,C=n==="processing",S=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),q=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:y,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${q?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:S}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:y,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(F,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:Y(h)})]})]}),n==="processing"&&e.jsx(Ns,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(Cs,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:y}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:ks,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:y,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??y,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Ns({stage:r,step:n,total:h,isSelfCustody:y}){const C=r==="reserving",S=h>0?Math.min(100,Math.round(n/h*100)):0,q=r==="awaiting-signature"?y?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:gs,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:q}),C?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${S}%`}})}),h>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",h]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function Cs({lines:r,shortfallCredits:n,packs:h,selectedPack:y,onSelectPack:C,onBuyPacks:S,onCancel:q}){const w=h.find(t=>t.id===y),X=r.reduce((t,f)=>t+(f.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(ns,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",a("buyModal.warningToPurchase",{count:X})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const f=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),f>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:f})}):null]}),t.item.creator?e.jsx(We,{address:t.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(F,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:Y(t.priceCredits*f)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:h.map(t=>{const f=t.id===y;return e.jsxs("button",{className:`buy-modal__pack${f?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(F,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:Y(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(F,{className:"buy-modal__total-ico"}),e.jsx("span",{children:Y((w==null?void 0:w.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((w==null?void 0:w.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:q,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:S,children:a("buyModal.buy")})]})]})}const ws=Ze(es)`
2
- margin-top: 12px;
3
- `;function Ne(r){if(vs(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:ss.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const Ss=12e4;function qs(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const Ce=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),Ms=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Ds(){ze({title:a("nav.cart"),noindex:!0});const r=N(s=>s.items),n=N(s=>s.remove),h=N(s=>s.increment),y=N(s=>s.decrement),C=N(s=>s.clear),S=N(s=>s.restore),q=N(s=>s.setFittingOpen),w=pe(s=>s.items),X=pe(s=>s.toggle),{session:t,signIn:f}=Oe(),W=ys().packs.slice(0,bs);m.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const we=r.some(s=>s.category!=="emote"),{data:Z}=$e({queryKey:["upsell-listings"],queryFn:()=>cs({first:40}),staleTime:6e4}),{data:T}=Ge(t),d=He(),z=Ae(),{state:M}=Ue(),[ce,B]=m.useState(null),[Se,L]=m.useState(null),[ne,O]=m.useState(null),[qe,E]=m.useState(!1),[x,K]=m.useState(null),ie=m.useRef(0),[o,k]=m.useState(null),[ee,le]=m.useState(""),se=m.useRef(null),oe=De(r),de=s=>ge(oe[s.id]),ae=r.filter(de),ue=r.length>0&&ae.length===0,Me=ae.reduce((s,c)=>s+c.priceCredits*c.quantity,0),Ee=r.reduce((s,c)=>s+c.quantity,0),Pe=ae.reduce((s,c)=>s+c.quantity,0),Ie=x?x.liveTotalCredits:Me,Re=new Set(r.map(s=>s.id)),he=((Z==null?void 0:Z.items)??[]).filter(s=>!Re.has(s.id)).slice(0,12),Fe=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),$=(T==null?void 0:T.credits)??0,Te=Xe;function G(s){s(),K(null),O(null),L(null)}function Be(){k(null),E(!1)}function me(s){const c=Ce(s),i=Math.max(0,c-$),g=W.find(u=>u.credits>=i)??W[W.length-1];le(g.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:i}),E(!1)}async function Le(s){if(!t||s.length===0)return;const c=Ms(s),i=c.map(l=>({...l.item,priceCredits:l.priceCredits})),g=s.map(l=>({...l.item,priceCredits:l.priceCredits,quantity:l.quantity})),u=[];let j="authorize",H=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const l=[];for(let b=0;b<c.length;b++){const I=c[b];k({phase:"processing",stage:"reserving",step:b+1,total:c.length});try{const{credit:p,maxCreditedValue:te}=await as(t.identity,I.usdCents,I.trade.id);u.push(p.id),l.push({trade:I.trade,credits:[p],maxCreditedValue:te})}catch(p){if(fs(p)){if(u.length){try{await fe(t.identity,u)}catch(te){U(te,{flow:"cart_checkout",step:"release"})}d.invalidateQueries({queryKey:["usd-balance"]})}me(s);return}throw p}}j="submit";const v=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let _=[];if(_s())try{_=await os({purchases:l,buyer:t.address,signer:t.signer,onSigned:v});const I=(await Promise.allSettled(_.map(p=>ds(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(I.length&&!I.some(p=>p instanceof us))throw I[0];H=!0}catch(b){if(!(b instanceof hs))throw b;_=await je({purchases:l,buyer:t.address,signer:t.signer,onSigned:v})}else _=await je({purchases:l,buyer:t.address,signer:t.signer});s.forEach(b=>n(b.item.id)),K(null),J("Shop Completed Purchase",{...ts(i),payment_type:"credits",no_crypto_step:H,transaction_hash:_[0]??null}),d.invalidateQueries({queryKey:["usd-balance"]}),d.invalidateQueries({queryKey:["detail-trade"]}),d.invalidateQueries({queryKey:["shop-item"]}),d.invalidateQueries({queryKey:["owned-token"]}),d.invalidateQueries({queryKey:["public-token"]}),d.invalidateQueries({queryKey:["item-resales"]}),d.invalidateQueries({queryKey:["shop-items"]}),d.invalidateQueries({queryKey:["catalog-items"]}),d.invalidateQueries({queryKey:["my-assets"]}),d.invalidateQueries({queryKey:["purchases"]}),d.invalidateQueries({queryKey:["owned-item-count"]}),d.invalidateQueries({queryKey:["overview-listings"]}),d.invalidateQueries({queryKey:["upsell-listings"]});const A=se.current;se.current=null,k(null),E(!1);const D={items:g,txHash:_[0]??void 0,settled:!0,...A?{creditsAdded:A}:{}};z("/success",{state:D,replace:!0})}catch(l){if(xe(l)||U(l,{flow:"cart_checkout",step:j,cart_size:s.length}),J(xe(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:rs(l),value_usd:ve(i.reduce((v,_)=>v+_.priceCredits,0)),cart_size:c.length}),u.length){try{await fe(t.identity,u)}catch(v){U(v,{flow:"cart_checkout",step:"release"})}d.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:Ne(l)})}}function _e(s){const c=Ce(s);if(T!=null&&T.credits<c){me(s);return}Le(s)}async function Q(){if(!t){ke({type:"cart-checkout"}),f();return}const s=N.getState().items.filter(de);if(s.length===0)return;L(null),O(null),E(!0);const c=s.reduce((i,g)=>i+g.priceCredits*g.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:ve(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await ms(s,t.address,Te),g=[...i.unavailable,...i.own];if(g.length&&(g.forEach(u=>n(u.id)),O(qs(i))),i.buyable.length===0){L(a("cart.error.noneAvailable")),K(null),B(null);return}if(i.orderChanged){K(i),ie.current=Date.now(),B(null);return}B(null),_e(i.buyable)}catch(i){U(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),L(Ne(i)),B(null)}finally{E(!1)}}async function Ke(){if(x){if(!t){ke({type:"cart-checkout"}),f();return}if(Date.now()-ie.current>Ss){K(null),O(null),await Q();return}L(null),_e(x.buyable)}}async function Qe(){if(ee){try{sessionStorage.setItem(V,JSON.stringify(N.getState().items))}catch{}E(!0);try{const s=await ps(ee,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(V)}catch{}U(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const ye=m.useRef(!1);m.useEffect(()=>{if(!t||ye.current||!is("cart-checkout"))return;ye.current=!0;const s=setTimeout(()=>void Q(),0);return()=>clearTimeout(s)},[t]);const be=m.useRef(!1);m.useEffect(()=>{if(!(M!=null&&M.resumeCheckout)||be.current)return;be.current=!0,se.current=M.creditsAdded??null;try{const c=sessionStorage.getItem(V);if(c){sessionStorage.removeItem(V);const i=JSON.parse(c);Array.isArray(i)&&i.length&&S(i)}}catch{}d.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void Q(),0);return()=>clearTimeout(s)},[M==null?void 0:M.resumeCheckout]);const P=qe||(o==null?void 0:o.phase)==="processing";return r.length===0&&!o?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(R,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ws,{as:re,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(R,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(R,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:Ee})}),we?e.jsxs("button",{className:"checkout__fitting",onClick:()=>q(!0),disabled:P,children:[e.jsx(R,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=Fe.get(s.id),i=c?c.priceCredits:s.priceCredits,g=!!c&&c.priceCredits!==s.priceCredits,u=!s.tokenId,j=s.quantity,H=typeof s.available=="number"&&j>=s.available,l=i*j,v=!!w[s.id],_=Je(s),A=oe[s.id],D=!ge(A),b=A==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${D?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(re,{className:"checkout__thumb-link",to:_,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(re,{className:"checkout__name",to:_,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Ve,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsx("div",{className:"checkout__foot",children:D?e.jsx("span",{className:"checkout__unavailable",children:b}):e.jsxs(e.Fragment,{children:[u?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>y(s.id)),disabled:P||j<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:j}),e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>h(s.id)),disabled:P||H,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(F,{className:"checkout__price-ico"})," ",l,g?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${v?" is-on":""}`,onClick:()=>X(s),"aria-label":v?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:v?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(R,{name:v?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>G(()=>n(s.id)),disabled:P,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(R,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>G(C),disabled:P,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:Pe})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(F,{className:"checkout__total-ico"})," ",Ie]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(x?Ke():Q()),disabled:P||ue,children:P?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),ue?e.jsx("p",{className:"muted checkout__msg",children:a("cart.allUnavailable")}):null,t?null:e.jsx("p",{className:"muted checkout__msg",children:a("cart.signInHint")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,ne?e.jsx("p",{className:"muted checkout__msg",children:ne}):null,ce?e.jsx("p",{className:"muted checkout__msg",children:ce}):null,e.jsx(xs,{message:Se,className:"checkout__msg"})]})]})]})]}),he.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ls,{title:a("cart.youMightAlsoLike"),items:he})}):null,o?e.jsx(js,{phase:o.phase,balanceCredits:$,onClose:Be,stage:o.phase==="processing"?o.stage:void 0,step:o.phase==="processing"?o.step:void 0,total:o.phase==="processing"?o.total:void 0,isSelfCustody:Ye(t==null?void 0:t.providerType),lines:o.phase==="nofunds"?o.lines:void 0,shortfallCredits:o.phase==="nofunds"?o.shortfall:void 0,packs:W,selectedPack:ee,onSelectPack:le,onBuyPacks:()=>void Qe(),message:o.phase==="error"?o.message:void 0,onRetry:()=>void Q()}):null]})}export{Ds as Cart};
@@ -1 +0,0 @@
1
- body.shop-cart-bg{background:var(--media)}.checkout{max-width:1510px;margin:0 auto}.checkout__top{position:relative}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 615px;gap:24px;align-items:start}.checkout__left{min-width:0;display:flex;flex-direction:column;gap:12px}.checkout__head-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-radius:16px;padding:12px 12px 12px 24px}.checkout__panel{min-width:0;background:#fff;border-radius:16px;padding:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:14px;font-weight:600;line-height:1.57;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:24px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137.5px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__card.is-unavailable{opacity:.6}.checkout__card.is-unavailable .checkout__thumb img{filter:grayscale(1)}.checkout__unavailable{margin-left:auto;font-size:14px;font-weight:600;color:var(--muted)}.checkout__actions{position:absolute;top:9px;right:7px;display:flex;align-items:flex-start;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;box-shadow:0 1px 3px #1615180f;border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:24px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:16px;font-weight:400;color:var(--muted)}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__total-ico{width:30px;height:30px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{position:relative;margin-top:48px;padding:47px 0 24px}.cart-upsell .collection-carousel{margin-top:0}.cart-upsell:before{content:"";position:absolute;top:0;bottom:-80px;left:50%;width:100vw;transform:translate(-50%);background:var(--bg);z-index:0}.cart-upsell>*{position:relative;z-index:1}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__qty-tag{margin-left:6px;font-size:12px;font-weight:600;color:var(--muted)}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
@@ -1 +0,0 @@
1
- import{j as e,r as o}from"./react-BW1xvPTF.js";import{t as i,I as C,ao as g,A as E}from"./index-B4tgQVEu.js";const d="shop:resume_after_signin",N=900*1e3;function I(l){try{sessionStorage.setItem(d,JSON.stringify({...l,at:Date.now()}))}catch{}}function M(l){let c;try{c=sessionStorage.getItem(d)}catch{return null}if(!c)return null;try{sessionStorage.removeItem(d)}catch{}let s;try{s=JSON.parse(c)}catch{return null}return!s||s.type!==l||typeof s.at!="number"||Date.now()-s.at>N?null:s.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:s.path}}function W({className:l}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:l,children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"#691fa9",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v6",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"16.5",r:"1.1",fill:"#691fa9"})]})}function L({title:l,items:c,onViewAll:s}){const a=o.useRef(null),[h,p]=o.useState(1),[f,v]=o.useState(0),[j,k]=o.useState(!0),[w,y]=o.useState(!1),n=o.useCallback(()=>{const r=a.current;if(!r)return;const{scrollLeft:t,scrollWidth:_,clientWidth:u}=r,x=Math.max(1,Math.ceil(_/u));p(x),v(Math.min(x-1,Math.round(t/u))),k(t<=1),y(t+u>=_-1)},[]);if(o.useEffect(()=>{n();const r=a.current;if(r)return r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[n,c.length]),c.length===0)return null;function m(r){const t=a.current;t&&t.scrollBy({left:r*t.clientWidth,behavior:"smooth"})}function b(r){const t=a.current;t&&t.scrollTo({left:r*t.clientWidth,behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:l}),s?e.jsxs("button",{className:"collection-carousel__viewall",onClick:s,children:[i("collectionCarousel.viewAll"),e.jsx(C,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>m(-1),"aria-label":i("collectionCarousel.scrollLeft"),disabled:j,children:e.jsx("img",{src:g,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:a,children:c.map(r=>e.jsx(E,{item:r},r.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>m(1),"aria-label":i("collectionCarousel.scrollRight"),disabled:w,children:e.jsx("img",{src:g,alt:"","aria-hidden":!0})})]}),h>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":i("collectionCarousel.pages"),children:Array.from({length:h}).map((r,t)=>e.jsx("button",{className:`collection-carousel__dot${t===f?" is-active":""}`,"aria-label":i("collectionCarousel.goToPage",{page:t+1}),"aria-current":t===f?"true":void 0,onClick:()=>b(t)},t))}):null]})}export{L as C,W,I as s,M as t};
@@ -1 +0,0 @@
1
- import{u as Y,b as q,r as n,j as e}from"./react-BW1xvPTF.js";import{m as Q,t as s,u as V,b as W,j as g,ai as z,e as d,H as A,k as I,C as D,f as $}from"./index-B4tgQVEu.js";import{R as F}from"./resume-buy-Bf0zIH7y.js";import{R as J}from"./cart-checkout-CWNsZ2Kj.js";import{l as Z}from"./loader-logo-BzY9EKdC.js";import{u as X,p as ee,c as se,i as te}from"./useCreditPacks-CnlSkvVM.js";import{C as re}from"./CircularProgress-DFdK37rG.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-30275838080.commit-dc84870/assets/pack-chips--HnOpf5U.webp",ae="https://cdn.decentraland.org/@dcl/shop/0.1.0-30275838080.commit-dc84870/assets/credit-coin-CmcTCd5i.webp",ce="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",C=te()?"mock":"stripe",ie={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function G(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function ke(){Q({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=Y(),{session:r,signIn:m}=V(),i=W(),[k,S]=q(),{packs:M,isLoading:T}=X(),[p,l]=n.useState("select"),[c,w]=n.useState(null),[E,R]=n.useState(null),[U,h]=n.useState(null),[K,N]=n.useState(!1),f=n.useRef(null);n.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=n.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=n.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await ee(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const _=u.creditsGranted??(c==null?void 0:c.credits)??0;R(_>0?_:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:_>0?_:null,provider:C}),i.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(J)){const j={resumeCheckout:!0,..._>0?{creditsAdded:_}:{}};o("/cart",{state:j});return}}catch{}try{const j=sessionStorage.getItem(F);if(j){sessionStorage.removeItem(F);const P=JSON.parse(j),B=z(P);if(B){o(B,{state:{item:P,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),i.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){A(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),h(G(u)),l("error")}},[c,r,i,o]),H=n.useCallback(async t=>{if(!r){m();return}h(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await se(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){A(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),h(G(a)),l("error")}},[r,m,b]),y=n.useRef(!1);n.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),h(null),N(!1)}const O=p==="select";return e.jsxs("div",{className:"getcredits",children:[O&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(de,{packs:M,loading:T,onSelect:t=>void H(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(re,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:Z,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ce,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ae,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(D,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:v,children:s("getCredits.tryAgain")})})]})]})}function de({packs:o,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(i=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},i))}):e.jsx("div",{className:"packs",children:o.map(i=>e.jsxs("button",{type:"button",className:`pack${i.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(i),"aria-label":s("getCredits.packAria",{amount:$(i.credits),usd:i.usd}),children:[i.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:i.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ie[i.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",i.usd.toFixed(2)]})})]})]},i.id))})}export{ke as GetCredits,ke as default};
@@ -1 +0,0 @@
1
- .imp{max-width:860px;margin:0 auto;padding-bottom:120px}.imp__head{margin-bottom:18px}.imp__eyebrow{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--accent);background:var(--rarity-bg);padding:6px 12px;border-radius:999px;margin-bottom:14px}.imp__title{font-size:clamp(26px,4vw,38px);font-weight:800;letter-spacing:-.02em;line-height:1.08;margin:0 0 10px}.imp__grad{background:var(--amethyst);-webkit-background-clip:text;background-clip:text;color:transparent}.imp__lede{color:var(--muted);max-width:60ch;margin:0}.imp__ratebar{font-size:13px;color:var(--muted);margin:16px 0 8px;display:flex;align-items:center;gap:7px}.imp__diamond{color:var(--accent)}.imp__section{margin-top:26px}.imp__section-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:12px}.imp__section-title{font-size:19px;font-weight:800}.imp__section-sub{color:var(--muted);font-size:14px}.imp__list{display:flex;flex-direction:column;gap:12px}.imp-row{display:grid;grid-template-columns:22px 56px 1fr auto auto;align-items:center;gap:16px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 18px;transition:box-shadow .18s ease,opacity .25s ease}.imp-row:hover{box-shadow:0 10px 28px #2e104a1a}.imp-row.is-off{opacity:.5}.imp-row--skeleton{display:block;height:86px;border-color:transparent;background:linear-gradient(100deg,#ededed 30%,#f7f7f7,#ededed 70%);background-size:200% 100%;animation:shimmer 1.3s infinite linear}.imp-check{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:22px;height:22px;border-radius:7px;border:2px solid var(--line-strong);background:#fff;cursor:pointer;display:grid;place-items:center;flex:none;transition:background .15s,border-color .15s}.imp-check:checked{background:var(--accent);border-color:var(--accent)}.imp-check:checked:after{content:"✓";color:#fff;font-size:13px;font-weight:800}.imp-check:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.imp-thumb{width:56px;height:56px;border-radius:12px;overflow:hidden;flex:none;display:grid;place-items:center;background:radial-gradient(120% 120% at 30% 20%,rgba(165,36,179,.12),var(--media) 70%);border:1px solid var(--line)}.imp-thumb img{width:100%;height:100%;object-fit:contain}.imp-meta{min-width:0}.imp-name{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.imp-chip{display:inline-flex;margin-top:5px;font-size:10.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--rarity);background:var(--rarity-bg);padding:3px 9px;border-radius:5px}.imp-price{display:flex;flex-direction:column;align-items:flex-end;gap:3px}.imp-price__field{display:inline-flex;align-items:center;gap:4px;border:1.5px solid var(--line-strong);border-radius:10px;padding:7px 12px;background:#fff;transition:border-color .15s,box-shadow .15s}.imp-price__field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--rarity-bg)}.imp-price__diamond{color:var(--accent);font-size:15px}.imp-price__input{width:82px;border:0;outline:0;background:transparent;font:inherit;font-weight:800;font-size:17px;color:var(--text);text-align:right;font-variant-numeric:tabular-nums}.imp-price__sub{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}.imp-price__reset{background:none;border:0;padding:0;font:inherit;font-size:12px;font-weight:600;color:var(--accent);cursor:pointer}.imp-action{display:flex;justify-content:flex-end;min-width:74px}.imp-row__list{background:var(--media);color:var(--text-2)}.imp-row__list:hover:not(:disabled){background:#e3e0ea}.imp-dock{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#ffffffe6;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid var(--line)}.imp-dock__inner{max-width:860px;margin:0 auto;padding:15px 20px;display:flex;align-items:center;gap:16px}.imp-dock__total{font-weight:800;font-size:16px}.imp-dock__sub{font-size:13px;color:var(--muted)}.imp-dock__spacer{flex:1 1 auto}.imp-empty{max-width:520px;margin:0 auto;text-align:center;padding:80px 20px;display:flex;flex-direction:column;align-items:center;gap:10px}.imp-empty__ico{font-size:44px}.imp-empty__title{font-size:26px;font-weight:800;margin:4px 0 0}.migrate{width:min(460px,94vw);text-align:left;align-items:stretch}.migrate__progress{height:6px;border-radius:999px;background:var(--line);overflow:hidden;margin:6px 0 14px}.migrate__bar{height:100%;width:0;background:var(--amethyst);border-radius:999px;transition:width .45s ease}.migrate__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;max-height:320px;overflow-y:auto}.migrate__row{display:grid;grid-template-columns:34px 1fr auto auto;align-items:center;gap:10px;padding:8px;border-radius:10px;transition:background .2s}.migrate__row--active{background:var(--rarity-bg)}.migrate__row--done{opacity:.75}.migrate__row--skipped,.migrate__row--failed{opacity:.6}.migrate__thumb{width:34px;height:34px;border-radius:8px;overflow:hidden;background:var(--media);display:grid;place-items:center}.migrate__thumb img{width:100%;height:100%;object-fit:contain}.migrate__name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.migrate__price{font-weight:700;font-size:13px;color:var(--text-2)}.migrate__status{font-size:12px;font-weight:700;color:var(--accent);display:inline-flex;align-items:center;gap:6px;justify-content:flex-end;min-width:74px}.migrate__wait{color:var(--muted-2);font-weight:600}.migrate__skip{color:var(--muted);font-weight:600}.migrate__spin{width:14px;height:14px;margin:0;border-width:2px}.migrate__tick{width:20px;height:20px;border-radius:50%;background:var(--ok);color:#fff;display:grid;place-items:center;font-size:12px}.migrate__hint{margin:12px 0 0}@media(max-width:620px){.imp-row{grid-template-columns:22px 48px 1fr;row-gap:12px}.imp-price{grid-column:2 / 4;align-items:flex-start}.imp-action{grid-column:2 / 4;justify-content:flex-start}}