@dcl/shop 1.2.0 → 1.2.1-31141894504.commit-b6f2fa5

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 (178) hide show
  1. package/_assets/{Activity-WzrsBYzd.js → Activity-CM1koIWA.js} +6 -6
  2. package/_assets/{AnimatedBackground-DjLtC0in.js → AnimatedBackground-Dq4kMaMJ.js} +1 -1
  3. package/_assets/{Assets-W5ljHZz_.js → Assets-CrYK64oM.js} +15 -15
  4. package/_assets/{Assets.styles-B1wjUn65.js → Assets.styles-DQJDvpwk.js} +56 -56
  5. package/_assets/{Authorizations-B5p2iUHM.js → Authorizations-CLlifjsF.js} +1 -1
  6. package/_assets/{Cart-Bh-HgdN6.js → Cart-BTdBdLSV.js} +73 -89
  7. package/_assets/{CircularProgress-CRPaZUaF.js → CircularProgress-5u3Axs4r.js} +1 -1
  8. package/_assets/{Collection-BaGhHdl0.js → Collection-CrmOtKVR.js} +1 -1
  9. package/_assets/{CollectionCarousel-TGpCTmUQ.js → CollectionCarousel-BNRsg5LI.js} +2 -2
  10. package/_assets/{Confetti-BN_pNgmM.js → Confetti-CcphdN06.js} +1 -1
  11. package/_assets/{Creator-ciJxZjs_.js → Creator-Cpmty4q3.js} +6 -6
  12. package/_assets/{ErrorNotice-jD-FwtiS.js → ErrorNotice-DcMjmsY0.js} +1 -1
  13. package/_assets/{ExchangeController-OeggugXi.js → ExchangeController-DuNjedyi.js} +1 -1
  14. package/_assets/{Faq-wg7vWcKf.js → Faq-BZT-Tuv2.js} +1 -1
  15. package/_assets/{GetCredits-BAjH3baH.js → GetCredits-CQ4C143X.js} +8 -8
  16. package/_assets/{Grow-BCaCEq9-.js → Grow-C1qF8Gbp.js} +1 -1
  17. package/_assets/{HelpersUtil-gxfrB6dz.js → HelpersUtil-YUnnMEbv.js} +1 -1
  18. package/_assets/{ItemDetail-BvMU6_Oq.js → ItemDetail-DIJVogYi.js} +26 -24
  19. package/_assets/LazyEmoteControls-B9ed76Uk.js +2 -0
  20. package/_assets/{LoadMore-L0jdHqAb.js → LoadMore-ChE3Ywf2.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-BpgJKPnW.js → ManaPricingBanner.styles-YQt9G2FY.js} +1 -1
  22. package/_assets/MyAssets-g4TFZ7e2.js +406 -0
  23. package/_assets/{MyFavorites-4bqQmhDd.js → MyFavorites-BHIx442Q.js} +1 -1
  24. package/_assets/{NotFound-DmWOqezH.js → NotFound-Mnz4Ucj1.js} +1 -1
  25. package/_assets/{NotificationsBell-DzlKi2q2.js → NotificationsBell-Cfum40NV.js} +3 -3
  26. package/_assets/{OutfitDetail-DUkrlHGK.js → OutfitDetail-DYlB-_2t.js} +1 -1
  27. package/_assets/{OutfitPreview-CVrRVAqt.js → OutfitPreview-CKBV79hH.js} +1 -1
  28. package/_assets/{OutfitStudio-_8tw7nfU.js → OutfitStudio-D5ASiVh6.js} +1 -1
  29. package/_assets/{StoreSettings--Y44v8MH.js → StoreSettings-EwiANufQ.js} +21 -21
  30. package/_assets/{Success-Dyq6VNoV.js → Success-DEpy1BVd.js} +1 -1
  31. package/_assets/{SwapController-DT-2LK9L.js → SwapController-CoZyRCI2.js} +1 -1
  32. package/_assets/{Tooltip-BPV6o6wG.js → Tooltip-bEqHt7Cn.js} +1 -1
  33. package/_assets/{TradeService-oPf4Uv1h.js → TradeService-zAix_pZH.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-KChYZ3ey.js → W3MFrameProviderSingleton-DUGxXY3k.js} +3 -3
  35. package/_assets/{WebCryptoP256-DOqIQjou.js → WebCryptoP256-D8VfrUWY.js} +1 -1
  36. package/_assets/{authorizations-_of_k_s-.js → authorizations-BG0JBYIM.js} +1 -1
  37. package/_assets/{basic-BKiPxjPG.js → basic-C5bTQfXn.js} +1 -1
  38. package/_assets/{biconomy-DVmLydy3.js → biconomy-DMDUbT_l.js} +1 -1
  39. package/_assets/{builder-Bxf4v20g.js → builder-J1muoe18.js} +1 -1
  40. package/_assets/{buy-BUDAT54T.js → buy-C7GNfKVo.js} +1 -1
  41. package/_assets/{buy-gasless-lErDvRBB.js → buy-gasless-CGeRTZTF.js} +1 -1
  42. package/_assets/{categories-C7-Px0Cz.js → categories-BvYy29PG.js} +1 -1
  43. package/_assets/{ccip-DJsgfNx_.js → ccip-Be222yLp.js} +1 -1
  44. package/_assets/{ccip-rnalXDmy.js → ccip-nElUyFDJ.js} +1 -1
  45. package/_assets/{collectionPage.styles-CnMRUv4w.js → collectionPage.styles-BbghKEPw.js} +2 -2
  46. package/_assets/{controller-C5lSv65X.js → controller-C2j748IT.js} +2 -2
  47. package/_assets/{core-DFmP0EWm.js → core-f097495A.js} +4 -4
  48. package/_assets/{createSvgIcon-BiLn2Sm6.js → createSvgIcon-BPThy2SY.js} +1 -1
  49. package/_assets/creations-empty-Dg6T0dZl.svg +11 -0
  50. package/_assets/{custom-D6LBCLjl.js → custom-Gy3d1Q7v.js} +1 -1
  51. package/_assets/{data-capture-DnJW2etD.js → data-capture-UKTvYwdc.js} +1 -1
  52. package/_assets/{email-BQMNABmp.js → email-DvKEgj9J.js} +1 -1
  53. package/_assets/{embedded-wallet-BEAvOQ4J.js → embedded-wallet-_WiZLd4T.js} +1 -1
  54. package/_assets/{emotion-styled.browser.esm-DjUJkz5C.js → emotion-styled.browser.esm-D9bzEYCr.js} +1 -1
  55. package/_assets/{engine-Cxz0taSI.js → engine-6_t87ask.js} +1 -1
  56. package/_assets/{errors-C5pxH9hH.js → errors-Cpi20Vs-.js} +1 -1
  57. package/_assets/{estimate-l1-fee-UP3UBoYC.js → estimate-l1-fee-DU4tQjK9.js} +1 -1
  58. package/_assets/{execute-BS0Y5pHb.js → execute-BQ_MXUy5.js} +2 -2
  59. package/_assets/{features-CCkzoVM7.js → features-CK3qf9ZN.js} +1 -1
  60. package/_assets/{fetchTokenMetadata-BTavNlze.js → fetchTokenMetadata-BDm74qDJ.js} +2 -2
  61. package/_assets/{field.styles-Cxl6HEei.js → field.styles-C157dq4J.js} +1 -1
  62. package/_assets/{get-ecosystem-wallet-info-DBkCo9Dd.js → get-ecosystem-wallet-info-B6cEjh69.js} +1 -1
  63. package/_assets/{getBalance-oQUSwk6i.js → getBalance-7z75fs4x.js} +1 -1
  64. package/_assets/{getNFT-DdyxRcHy.js → getNFT-DHw--2hM.js} +1 -1
  65. package/_assets/{getNFT-C7oN1xz2.js → getNFT-kDrfcrTP.js} +1 -1
  66. package/_assets/{grid.styles-BQjREFrV.js → grid.styles-BH-KolVj.js} +1 -1
  67. package/_assets/{hashTypedData-DiCfu9px.js → hashTypedData-BGaOoxNv.js} +1 -1
  68. package/_assets/{hashTypedData-B6zZpjUD.js → hashTypedData-CaDI86G1.js} +1 -1
  69. package/_assets/{in-app-B_q2Ngeh.js → in-app-DrqEBa0Y.js} +1 -1
  70. package/_assets/{in-app-wallet-calls-D_4POGr9.js → in-app-wallet-calls-BAuhvyqE.js} +1 -1
  71. package/_assets/{index-Xusi9FS-.js → index--uqlDZSN.js} +3 -3
  72. package/_assets/{index-B5yDM3Cs.js → index-9sMHHA07.js} +1 -1
  73. package/_assets/{index-prEKQove.js → index-B1zKymDP.js} +1 -1
  74. package/_assets/{index-CaSykQgm.js → index-B2SrFRWu.js} +1 -1
  75. package/_assets/{index-Dffppy0t.js → index-B8eN0pGm.js} +1 -1
  76. package/_assets/{index-DsDbzqMK.js → index-BNYb6-ew.js} +1 -1
  77. package/_assets/{index-DGzakxGf.js → index-BO1L1qum.js} +1 -1
  78. package/_assets/{index-DgCoC9NB.js → index-BOFN8WyJ.js} +1 -1
  79. package/_assets/{index-6BIeeYcK.js → index-BRyz9uc0.js} +1 -1
  80. package/_assets/{index-DiTI5DKB.js → index-BUVnfVaQ.js} +1 -1
  81. package/_assets/{index-D4tyAO9v.js → index-BXKEFlSU.js} +1 -1
  82. package/_assets/{index-BaBVZyxJ.js → index-BcqoTa3F.js} +1 -1
  83. package/_assets/{index-M1o372c7.js → index-Belqsjsz.js} +2 -2
  84. package/_assets/{index-FeLelpWN.js → index-Bi66sVRq.js} +1 -1
  85. package/_assets/{index-BDhI4OFC.js → index-BiduFohT.js} +1 -1
  86. package/_assets/{index-CQ9RhRXs.js → index-BjuwD4ba.js} +1 -1
  87. package/_assets/{index-B8PyPptj.js → index-Bn_uaVAp.js} +1 -1
  88. package/_assets/{index-B4DUxntk.js → index-BvWni_zR.js} +1 -1
  89. package/_assets/{index-CW16IEJ1.js → index-C54FYEkY.js} +1 -1
  90. package/_assets/{index-rynehCHP.js → index-C5p9LpAs.js} +3 -3
  91. package/_assets/{index-DJ2lLMDk.js → index-C83EM4_2.js} +1 -1
  92. package/_assets/{index-CyEy9W2J.js → index-CHtt63_F.js} +1 -1
  93. package/_assets/{index-tZz3YEeL.js → index-CZ3-3d7g.js} +1 -1
  94. package/_assets/{index-BYZ-uB-6.js → index-CgxH7rfI.js} +1 -1
  95. package/_assets/{index-qPWw21a_.js → index-CkMBkM8p.js} +1 -1
  96. package/_assets/{index-B6_DHTJR.js → index-CvCTehG1.js} +1 -1
  97. package/_assets/{index-BRQOOFsy.js → index-Cw_lQM7v.js} +3 -3
  98. package/_assets/{index-DiaaCzn0.js → index-D-gAiVLP.js} +1 -1
  99. package/_assets/{index-DaCjd07S.js → index-D5G95QTd.js} +1 -1
  100. package/_assets/{index-BFPqoraR.js → index-D5jn8moe.js} +1 -1
  101. package/_assets/{index-CF-kXP_a.js → index-DFA-jQh0.js} +1 -1
  102. package/_assets/{index-D0yb7tx6.js → index-DQABJ8K0.js} +554 -534
  103. package/_assets/{index-BpzsK6nD.js → index-DYmMl9gi.js} +2 -2
  104. package/_assets/{index-_IvJKRy-.js → index-DdAqmPp5.js} +1 -1
  105. package/_assets/{index-Dhnm9LzO.js → index-Dl52ODHX.js} +1 -1
  106. package/_assets/{index-BVlv1YIR.js → index-DmNnfRqv.js} +1 -1
  107. package/_assets/{index-PgbjDVbM.js → index-DrKpI5CV.js} +1 -1
  108. package/_assets/{index-B7mvz5SS.js → index-DuI636q2.js} +1 -1
  109. package/_assets/{index-lxi2Pbq1.js → index-I5oIRknD.js} +1 -1
  110. package/_assets/{index-B7wTdynS.js → index-NZ2EL1Va.js} +1 -1
  111. package/_assets/{index-BEprhHZ1.js → index-SJTLPDcF.js} +1 -1
  112. package/_assets/{index-kKHHg57w.js → index-SOqtqcZc.js} +1 -1
  113. package/_assets/{index-DW_rAGmE.js → index-Z9Zfp-cE.js} +1 -1
  114. package/_assets/{index-DEJqqCqu.js → index-dkB19blA.js} +1 -1
  115. package/_assets/{index-B6qnjAt3.js → index-eTdhHjMt.js} +1 -1
  116. package/_assets/{index-BiLeVGAb.js → index-jVj4M1cT.js} +1 -1
  117. package/_assets/index-l2QjlKjX.css +1 -0
  118. package/_assets/{index-DQrAFSz9.js → index-ltLkjfx-.js} +1 -1
  119. package/_assets/{index-B3HeHO54.js → index-nfyZZM7e.js} +1 -1
  120. package/_assets/{index-C3FfSJFt.js → index-sl5wwK2w.js} +1 -1
  121. package/_assets/{index-DVbI8VHx.js → index-weRQS8GT.js} +2 -2
  122. package/_assets/{index-B58dWY5c.js → index-wq8907gu.js} +1 -1
  123. package/_assets/{index-BgYHNOmZ.js → index-xKy8W33s.js} +1 -1
  124. package/_assets/{index.es-Zzz8NtPw.js → index.es-CEBpPlnr.js} +1 -1
  125. package/_assets/{index.es-C4u3tLXm.js → index.es-DNO5glcp.js} +1 -1
  126. package/_assets/{index.es-DAi3k6BS.js → index.es-x1vwNVlm.js} +4 -4
  127. package/_assets/{localBatchGatewayRequest-OZkr4GaA.js → localBatchGatewayRequest-BBjlnRHt.js} +1 -1
  128. package/_assets/{networks-KQJEgu0R.js → networks-C13WwFhP.js} +1 -1
  129. package/_assets/{onramp-D1TyCpmq.js → onramp-CT1_T902.js} +1 -1
  130. package/_assets/{openzeppelin-COMQt6C0.js → openzeppelin-RUjzfcX-.js} +1 -1
  131. package/_assets/{parseNft-BDWge50l.js → parseNft-BAvhvBPX.js} +2 -2
  132. package/_assets/{parseSignature-Wc6hp9uQ.js → parseSignature-BEQJi4cu.js} +3 -3
  133. package/_assets/{parseSignature-BM5NvifW.js → parseSignature-Czi9dqhR.js} +1 -1
  134. package/_assets/{passkeys-DrykTNZ2.js → passkeys-Du42r5sF.js} +1 -1
  135. package/_assets/{pay-with-exchange-XXB29ZOp.js → pay-with-exchange-CrTCM_iG.js} +1 -1
  136. package/_assets/{qr-overlay-bXfX0IcB.js → qr-overlay-CG31oj34.js} +1 -1
  137. package/_assets/{receive-nP-U5W2i.js → receive-DGKxxBjv.js} +1 -1
  138. package/_assets/{resolveImplementation-BBJbUE3Z.js → resolveImplementation-8tujOofo.js} +1 -1
  139. package/_assets/{rpc-DCSM-4bg.js → rpc-sUrtbSyk.js} +1 -1
  140. package/_assets/{secp256k1-C2O_LFWe.js → secp256k1-CvuUaHW6.js} +1 -1
  141. package/_assets/{secp256k1-CgXAHR4D.js → secp256k1-DgwVchLn.js} +1 -1
  142. package/_assets/{secp256k1-DwDjCBcY.js → secp256k1-ilN5uvc6.js} +1 -1
  143. package/_assets/{send-Nwbt1L9h.js → send-OsD6mp8d.js} +1 -1
  144. package/_assets/{send-batch-transaction-B1AHQzYS.js → send-batch-transaction-Dv9gFlBz.js} +1 -1
  145. package/_assets/{send-eip712-transaction-tjLA0QA7.js → send-eip712-transaction-CInEXRsx.js} +2 -2
  146. package/_assets/{send-gasless-transaction-DcMpXxHQ.js → send-gasless-transaction-XefHv_Ab.js} +2 -2
  147. package/_assets/{send-transaction-DKMldJ0x.js → send-transaction-DxKCtc6J.js} +2 -2
  148. package/_assets/{sendMetaTransaction-BMdYRDeG.js → sendMetaTransaction-DeQMn9dR.js} +1 -1
  149. package/_assets/{sendRawTransaction-DCwkPyxN.js → sendRawTransaction-CcN1UESp.js} +3 -3
  150. package/_assets/{serializeTransaction-D7_FswuO.js → serializeTransaction-LQsz0xpR.js} +1 -1
  151. package/_assets/{session-proposal-CuU2AfGE.js → session-proposal-3C-xhn_b.js} +1 -1
  152. package/_assets/{session-request-DyvJhVCV.js → session-request-Bi-TCd-V.js} +2 -2
  153. package/_assets/{signing-NZTFOMTf.js → signing-DTvtfW1Y.js} +3 -3
  154. package/_assets/{skeleton.styles-BxGPvRcr.js → skeleton.styles-BvHHSxH_.js} +1 -1
  155. package/_assets/{socials-DEw3CQ73.js → socials-EGhIb5vA.js} +1 -1
  156. package/_assets/{styled-Dp53Pb8_.js → styled-Dsdo2L_S.js} +1 -1
  157. package/_assets/{swaps-B5ijNnAD.js → swaps-BWOQdX7L.js} +1 -1
  158. package/_assets/{thirdweb-qQf9W59E.js → thirdweb-Bq55eHvp.js} +3 -3
  159. package/_assets/{to-serializable-transaction-w7hB_nia.js → to-serializable-transaction-BdqklZjW.js} +2 -2
  160. package/_assets/{transactionReceipt-DZ540nfl.js → transactionReceipt-C327RjFG.js} +1 -1
  161. package/_assets/{transactions-iaPs2nV1.js → transactions-DH_45ulx.js} +1 -1
  162. package/_assets/{useCreditPacks-CO4R81xj.js → useCreditPacks-ohAn5pNf.js} +1 -1
  163. package/_assets/{useImportable-DxGmRiy1.js → useImportable-CTHYEKOm.js} +1 -1
  164. package/_assets/{useInfiniteGrid-DuP2ljFn.js → useInfiniteGrid-aYtSr9OS.js} +1 -1
  165. package/_assets/{useTheme-BoTQmO03.js → useTheme-DErq2cgw.js} +1 -1
  166. package/_assets/{verifyHash-ChBtWS-V.js → verifyHash-Dmswiq1P.js} +1 -1
  167. package/_assets/{w3m-modal-Cue_2Zn9.js → w3m-modal-CSxNzBHa.js} +1 -1
  168. package/_assets/{w3m-modal-CYiZhvkD.js → w3m-modal-zYlOO-nX.js} +1 -1
  169. package/_assets/{wait-for-tx-receipt-Bswrc--t.js → wait-for-tx-receipt-DUa6TPtN.js} +1 -1
  170. package/_assets/{wallets-CX0kZMtf.js → wallets-D4CLBrkx.js} +5 -5
  171. package/_assets/{web-connector-DbZBNbcb.js → web-connector-DfuXXolQ.js} +3 -3
  172. package/_assets/{writeContract-CyCztfKW.js → writeContract-CuhRFcNu.js} +1 -1
  173. package/_assets/{zoraTestnet-Bhd25heA.js → zoraTestnet-j-CjVgGQ.js} +1 -1
  174. package/index.html +11 -11
  175. package/package.json +2 -2
  176. package/_assets/LazyEmoteControls-DE5H6ZZm.js +0 -2
  177. package/_assets/MyAssets-Dz1TnFDV.js +0 -396
  178. package/_assets/index-DB6GvbxL.css +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,ax as aa,ay as Re,az as sa,J as na,I as O,z as Mt,K as Ke,x as ia,X as H,am as dt,o as ra,q as oa,v as ca,aA as da,A as la,aB as ua,an as ha,aC as pa,aD as lt,aE as ga,aF as ma,y as xa,aG as ut,Z as V,aH as ht,aI as fa,F as ae,r as ya,c as pt,aJ as ba,C as va,aK as gt,aL as qe,aM as wa,aN as xe,aO as fe,aP as mt,g as ye,f as Ca,h as Be,aQ as ja}from"./index-D0yb7tx6.js";import{M as ka,S as $a,C as Sa,H as Ma,a as Ta,T as Ia,X as Pa,b as za,B as Aa,c as Ea,d as xt,e as Ra,f as Ce,P as Tt,m as qa,g as Ba,h as _a,i as Fa,j as Wa,k as It,l as je,L as La,n as Ka,o as ft,p as yt,W as Na,q as Qa,r as Ua,s as Ha,A as Oa,t as Ga,u as Va,v as Da,w as Ja,x as Xa,y as Ya,z as Za,D as es,E as ts,F as as,G as ss,I as ns,J as is,K as rs,N as os,O as cs,Q as _e,R as ds,U as ls,V as us,Y as hs,Z as bt,_ as vt,$ as ps,a0 as gs,a1 as ms}from"./CollectionCarousel-TGpCTmUQ.js";import{f as xs,h as fs,a as ys,n as bs,i as vs,A as ws}from"./authorizations-_of_k_s-.js";import{g as Cs,j as Fe}from"./buy-BUDAT54T.js";import{b as js,w as ks,S as wt,G as $s}from"./buy-gasless-lErDvRBB.js";import{u as Ss,M as Ms,R as be,r as Ts,c as Is,p as Ct}from"./useCreditPacks-CO4R81xj.js";import{i as Ps,a as zs}from"./errors-C5pxH9hH.js";import{E as As}from"./ErrorNotice-jD-FwtiS.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BMdYRDeG.js";const{colors:se,radius:Es}=de,Rs=i.div`
1
+ import{j as e,L as Le,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,ax as aa,ay as Ee,az as sa,J as na,I as O,z as Mt,K as Ke,x as ia,X as H,am as dt,o as ra,q as oa,v as ca,aA as da,A as la,aB as ua,an as ha,aC as pa,aD as lt,aE as ga,aF as ma,y as xa,aG as ut,Z as V,aH as ht,aI as fa,F as ae,r as ya,c as pt,aJ as ba,C as va,aK as gt,aL as Re,aM as wa,aN as xe,aO as fe,aP as mt,g as ye,f as Ca,h as qe,aQ as ja}from"./index-DQABJ8K0.js";import{M as ka,S as Sa,C as $a,H as Ma,a as Ta,T as Ia,X as Pa,b as Aa,B as za,c as Ea,d as xt,e as Ra,f as Ce,P as Tt,m as qa,g as Ba,h as _a,i as Fa,j as Wa,k as It,l as je,L as La,n as Ka,o as ft,p as yt,W as Na,q as Qa,r as Ua,s as Ha,A as Oa,t as Ga,u as Va,v as Da,w as Ja,x as Xa,y as Ya,z as Za,D as es,E as ts,F as as,G as ss,I as ns,J as is,K as rs,N as os,O as cs,Q as Be,R as ds,U as ls,V as us,Y as hs,Z as bt,_ as vt,$ as ps,a0 as gs,a1 as ms}from"./CollectionCarousel-BNRsg5LI.js";import{f as xs,h as fs,a as ys,n as bs,i as vs,A as ws}from"./authorizations-BG0JBYIM.js";import{g as Cs,j as _e}from"./buy-C7GNfKVo.js";import{b as js,w as ks,S as wt,G as Ss}from"./buy-gasless-CGeRTZTF.js";import{u as $s,M as Ms,R as be,r as Ts,c as Is,p as Ct}from"./useCreditPacks-ohAn5pNf.js";import{i as Ps,a as As}from"./errors-Cpi20Vs-.js";import{E as zs}from"./ErrorNotice-DcMjmsY0.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DeQMn9dR.js";const{colors:se,radius:Es}=de,Rs=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 ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `;function Ws(o){const{phase:l,balanceCredits:P,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),J=l==="processing";return e.jsxs(ka,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx($a,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":J||void 0,children:[e.jsxs(Ma,{children:[e.jsxs(Ta,{children:[e.jsx(Ia,{children:D}),!W&&e.jsx(Pa,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(za,{})})]}),e.jsxs(Aa,{children:[e.jsx(Ea,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ra,{children:ce(P)})]})]}),l==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Fs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),ce(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Ls,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ks,{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(Ce,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(_a,{src:Fa,alt:"",width:64,height:80}),e.jsxs(Wa,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Ls({stage:o,step:l,total:P,isSelfCustody:z,signatures:W}){const D=o==="reserving",J=P>0?Math.min(100,Math.round(l/P*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(La,{src:aa,alt:"",width:61,height:61}),e.jsx(Ka,{children:ne}),D?e.jsxs(Rs,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${J}%`}})}),P>1?e.jsxs(qs,{children:[l,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ks({lines:o,shortfallCredits:l,packs:P,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:J}){const A=P.find(n=>n.id===z),ne=o.reduce((n,K)=>n+(K.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Na,{"data-testid":"nofunds-warning",children:[e.jsx(Qa,{}),e.jsxs(Ua,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne}),Re()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Ha,{href:sa("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(Bs,{children:o.map(n=>{const K=n.quantity??1;return e.jsxs(Oa,{children:[e.jsx(Ga,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Va,{children:[e.jsxs("div",{children:[e.jsxs(Da,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),K>1?e.jsx(_s,{children:a("cartCheckout.qty",{count:K})}):null]}),n.item.creator?e.jsx(Ja,{address:n.item.creator}):null]}),e.jsxs(Xa,{children:[e.jsx(Ya,{}),e.jsx("span",{children:ce(n.priceCredits*K)})]})]})]},n.item.id)})}),Re()?null:e.jsxs(e.Fragment,{children:[e.jsx(Za,{children:P.map(n=>{const K=n.id===z;return e.jsxs(es,{"data-testid":"credit-pack","data-on":K||void 0,onClick:()=>W(n.id),children:[e.jsx(ts,{src:as,alt:""}),e.jsx(ss,{children:ce(n.credits)}),e.jsxs(ns,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(is,{children:[e.jsxs(rs,{children:[e.jsx(os,{}),e.jsx("span",{children:ce((A==null?void 0:A.credits)??0)})]}),e.jsxs(cs,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:J,children:a("buyModal.cancel")}),Re()?null:e.jsx(je,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Ns,radius:te}=de,Pt="@media (max-width: 1080px)",I="@media (max-width: 880px)",jt=i.div`
61
+ `;function Ws(r){const{phase:l,balanceCredits:P,onClose:A}=r,F=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),J=l==="processing";return e.jsxs(ka,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(Sa,{onClick:F?void 0:A,"aria-hidden":!0}),e.jsxs($a,{"data-tall":J||void 0,children:[e.jsxs(Ma,{children:[e.jsxs(Ta,{children:[e.jsx(Ia,{children:D}),!F&&e.jsx(Pa,{onClick:A,"aria-label":a("buyModal.close"),children:e.jsx(Aa,{})})]}),e.jsxs(za,{children:[e.jsx(Ea,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ra,{children:ce(P)})]})]}),l==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Fs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),ce(r.totalCredits??0)]})]}),e.jsx(Tt,{options:r.options??[],totalCents:r.totalCents??0,onPay:r.onPay??(()=>{}),rateNote:(()=>{const z=qa(r.totalCents??0,r.totalManaWei??0n);return z!=null?a("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Ls,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody,signatures:r.signatures}),l==="nofunds"&&e.jsx(Ks,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:A}),l==="error"&&e.jsxs(Ce,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(_a,{src:Fa,alt:"",width:64,height:80}),e.jsxs(Wa,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",r.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:A,children:a("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:r.onRetry??A,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Ls({stage:r,step:l,total:P,isSelfCustody:A,signatures:F}){const D=r==="reserving",J=P>0?Math.min(100,Math.round(l/P*100)):0,z=A&&F&&F.total>1,ne=r==="awaiting-signature"?A?z?a("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(La,{src:aa,alt:"",width:61,height:61}),e.jsx(Ka,{children:ne}),D?e.jsxs(Rs,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${J}%`}})}),P>1?e.jsxs(qs,{children:[l,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ks({lines:r,shortfallCredits:l,packs:P,selectedPack:A,onSelectPack:F,onBuyPacks:D,onCancel:J}){const z=P.find(n=>n.id===A),ne=r.reduce((n,K)=>n+(K.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Na,{"data-testid":"nofunds-warning",children:[e.jsx(Qa,{}),e.jsxs(Ua,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne}),Ee()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Ha,{href:sa("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(Bs,{children:r.map(n=>{const K=n.quantity??1;return e.jsxs(Oa,{children:[e.jsx(Ga,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Va,{children:[e.jsxs("div",{children:[e.jsxs(Da,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),K>1?e.jsx(_s,{children:a("cartCheckout.qty",{count:K})}):null]}),n.item.creator?e.jsx(Ja,{address:n.item.creator}):null]}),e.jsxs(Xa,{children:[e.jsx(Ya,{}),e.jsx("span",{children:ce(n.priceCredits*K)})]})]})]},n.item.id)})}),Ee()?null:e.jsxs(e.Fragment,{children:[e.jsx(Za,{children:P.map(n=>{const K=n.id===A;return e.jsxs(es,{"data-testid":"credit-pack","data-on":K||void 0,onClick:()=>F(n.id),children:[e.jsx(ts,{src:as,alt:""}),e.jsx(ss,{children:ce(n.credits)}),e.jsxs(ns,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(is,{children:[e.jsxs(rs,{children:[e.jsx(os,{}),e.jsx("span",{children:ce((z==null?void 0:z.credits)??0)})]}),e.jsxs(cs,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:J,children:a("buyModal.cancel")}),Ee()?null:e.jsx(je,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:Ns,radius:te}=de,Pt="@media (max-width: 1080px)",I="@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
@@ -79,7 +79,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
79
79
  padding: 0;
80
80
  border: 0;
81
81
  background: none;
82
- color: ${r.text2};
82
+ color: ${o.text2};
83
83
  font-size: 14px;
84
84
  font-weight: 600;
85
85
  letter-spacing: 0.02em;
@@ -88,7 +88,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
88
88
  transition: color 0.15s ease;
89
89
 
90
90
  &:hover {
91
- color: ${r.accent};
91
+ color: ${o.accent};
92
92
  }
93
93
  & .ico {
94
94
  width: 18px;
@@ -107,7 +107,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
107
107
  ${Pt} {
108
108
  grid-template-columns: 1fr;
109
109
  }
110
- `,$t=i.div`
110
+ `,St=i.div`
111
111
  position: relative;
112
112
  /* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
113
113
  this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
@@ -127,7 +127,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
127
127
  left: 50%;
128
128
  width: 100vw;
129
129
  transform: translateX(-50%);
130
- background: ${r.media};
130
+ background: ${o.media};
131
131
  z-index: 0;
132
132
  }
133
133
  & > * {
@@ -157,7 +157,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
157
157
  align-items: center;
158
158
  justify-content: space-between;
159
159
  gap: 12px;
160
- background: ${r.white};
160
+ background: ${o.white};
161
161
  border-radius: 16px;
162
162
  padding: 12px 12px 12px 24px;
163
163
 
@@ -165,16 +165,16 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
165
165
  gap: 8px;
166
166
  padding: 8px 16px;
167
167
  }
168
- `,zt=i.section`
168
+ `,At=i.section`
169
169
  min-width: 0;
170
- background: ${r.white};
170
+ background: ${o.white};
171
171
  border-radius: 16px;
172
172
  padding: 24px;
173
173
 
174
174
  ${I} {
175
175
  padding: 16px;
176
176
  }
177
- `,Os=i(zt)`
177
+ `,Os=i(At)`
178
178
  display: flex;
179
179
  flex-direction: column;
180
180
  align-items: center;
@@ -183,7 +183,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
183
183
  min-height: 420px;
184
184
  padding: 48px 16px;
185
185
  text-align: center;
186
- color: ${r.text};
186
+ color: ${o.text};
187
187
 
188
188
  ${de.media.maxWidth("mobile")} {
189
189
  min-height: 320px;
@@ -213,7 +213,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
213
213
  ${de.media.maxWidth("mobile")} {
214
214
  font-size: 16px;
215
215
  }
216
- `,Js=i(ke)`
216
+ `,Js=i(Le)`
217
217
  display: inline-flex;
218
218
  align-items: center;
219
219
  justify-content: center;
@@ -222,8 +222,8 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
222
222
  height: 56px;
223
223
  padding: 0 12px;
224
224
  border-radius: ${te.card};
225
- background: ${r.accent};
226
- color: ${r.softWhite};
225
+ background: ${o.accent};
226
+ color: ${o.softWhite};
227
227
  font-size: 15px;
228
228
  font-weight: 600;
229
229
  line-height: 24px;
@@ -233,10 +233,10 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
233
233
  transition: background 0.15s ease;
234
234
 
235
235
  &:hover {
236
- background: ${r.accentHover};
236
+ background: ${o.accentHover};
237
237
  }
238
238
  &:focus-visible {
239
- outline: 2px solid ${r.accent};
239
+ outline: 2px solid ${o.accent};
240
240
  outline-offset: 2px;
241
241
  }
242
242
  `,Xs=i.button`
@@ -249,7 +249,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
249
249
  border: 0;
250
250
  background: none;
251
251
  padding: 0;
252
- color: ${r.text};
252
+ color: ${o.text};
253
253
  cursor: pointer;
254
254
 
255
255
  & .ico {
@@ -262,7 +262,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
262
262
  font-size: 14px;
263
263
  font-weight: 600;
264
264
  line-height: 1.57;
265
- color: ${r.text};
265
+ color: ${o.text};
266
266
 
267
267
  ${I} {
268
268
  flex: 1;
@@ -276,10 +276,10 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
276
276
  gap: 8px;
277
277
  height: 40px;
278
278
  padding: 0 12px;
279
- border: 2px solid ${r.text2};
279
+ border: 2px solid ${o.text2};
280
280
  border-radius: ${te.btn};
281
281
  background: none;
282
- color: ${r.text2};
282
+ color: ${o.text2};
283
283
  font-size: 13px;
284
284
  font-weight: 600;
285
285
  line-height: 24px;
@@ -307,8 +307,8 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
307
307
  the type, which had it reading smaller than the row title beside it. */
308
308
  ${I} {
309
309
  border-width: 1px;
310
- border-color: ${r.text};
311
- color: ${r.text};
310
+ border-color: ${o.text};
311
+ color: ${o.text};
312
312
  }
313
313
  `,en=i.div`
314
314
  display: flex;
@@ -319,8 +319,8 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
319
319
  display: flex;
320
320
  align-items: stretch;
321
321
  gap: 12px;
322
- background: ${r.white};
323
- border: 1px solid ${r.gray4};
322
+ background: ${o.white};
323
+ border: 1px solid ${o.gray4};
324
324
  border-radius: ${te.card};
325
325
  overflow: hidden;
326
326
 
@@ -338,7 +338,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
338
338
  flex-shrink: 0;
339
339
  width: 137.5px;
340
340
  height: 137px;
341
- background: ${r.media};
341
+ background: ${o.media};
342
342
  border-radius: ${te.card};
343
343
  display: grid;
344
344
  place-items: center;
@@ -355,7 +355,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
355
355
  width: 120px;
356
356
  height: 120px;
357
357
  }
358
- `,sn=i(ke)`
358
+ `,sn=i(Le)`
359
359
  position: absolute;
360
360
  inset: 0;
361
361
  display: grid;
@@ -388,19 +388,19 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
388
388
  gap: 4px;
389
389
  min-width: 0;
390
390
  padding-right: 64px; /* clear the top-right favourite + remove group */
391
- `,At=Ke`
391
+ `,zt=Ke`
392
392
  display: block;
393
393
  font-size: 16px;
394
394
  font-weight: 600;
395
395
  line-height: 1.2;
396
- color: ${r.text};
396
+ color: ${o.text};
397
397
  text-decoration: none;
398
398
  overflow: hidden;
399
399
  text-overflow: ellipsis;
400
400
  white-space: nowrap;
401
401
 
402
402
  a&:hover {
403
- color: ${r.accent};
403
+ color: ${o.accent};
404
404
  }
405
405
 
406
406
  ${I} {
@@ -411,13 +411,13 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
411
411
  -webkit-box-orient: vertical;
412
412
  }
413
413
  `,cn=i.div`
414
- ${At};
415
- `,dn=i(ke)`
416
- ${At};
414
+ ${zt};
415
+ `,dn=i(Le)`
416
+ ${zt};
417
417
  `,ln=i(na)`
418
418
  font-size: 10px;
419
419
  line-height: 1.43;
420
- color: ${r.muted};
420
+ color: ${o.muted};
421
421
 
422
422
  & [data-avatar] {
423
423
  display: none;
@@ -437,9 +437,9 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
437
437
  align-items: center;
438
438
  gap: 8px;
439
439
  padding: 6px;
440
- border: 0.5px solid ${r.muted2};
440
+ border: 0.5px solid ${o.muted2};
441
441
  border-radius: ${te.pill};
442
- `,St=i.button`
442
+ `,$t=i.button`
443
443
  display: grid;
444
444
  place-items: center;
445
445
  width: 16px;
@@ -447,11 +447,11 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
447
447
  padding: 0;
448
448
  border: 0;
449
449
  background: none;
450
- color: ${r.text};
450
+ color: ${o.text};
451
451
  cursor: pointer;
452
452
 
453
453
  &:disabled {
454
- color: ${r.muted2};
454
+ color: ${o.muted2};
455
455
  cursor: default;
456
456
  }
457
457
  `,pn=i.span`
@@ -459,7 +459,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
459
459
  font-size: 14px;
460
460
  font-weight: 500;
461
461
  line-height: 1.2;
462
- color: ${r.text};
462
+ color: ${o.text};
463
463
  text-align: center;
464
464
  `,gn=i.div`
465
465
  display: inline-flex;
@@ -470,7 +470,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
470
470
  margin-left: auto;
471
471
  font-size: 24px;
472
472
  font-weight: 600;
473
- color: ${r.text2};
473
+ color: ${o.text2};
474
474
 
475
475
  ${I} {
476
476
  font-size: 20px;
@@ -478,7 +478,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
478
478
  `,mn=i(Mt)`
479
479
  width: 24px;
480
480
  height: 24px;
481
- background: ${r.text};
481
+ background: ${o.text};
482
482
 
483
483
  ${I} {
484
484
  width: 20px;
@@ -488,7 +488,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
488
488
  margin-left: 6px;
489
489
  font-size: 14px;
490
490
  font-weight: 500;
491
- color: ${r.muted};
491
+ color: ${o.muted};
492
492
  text-decoration: line-through;
493
493
  `,fn=i.div`
494
494
  position: absolute;
@@ -505,26 +505,10 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
505
505
  font-weight: 600;
506
506
  line-height: 1;
507
507
  text-transform: uppercase;
508
- color: ${r.text2};
508
+ color: ${o.text2};
509
509
  `,bn=i(O)`
510
510
  color: #f48221;
511
- `,vn=i(ke)`
512
- font-size: 12px;
513
- font-weight: 600;
514
- line-height: 24px;
515
- letter-spacing: 0.46px;
516
- text-transform: uppercase;
517
- text-decoration: underline;
518
- color: ${r.accent};
519
-
520
- &:hover {
521
- color: ${r.accentHover};
522
- }
523
- &:focus-visible {
524
- outline: 2px solid ${r.accent};
525
- outline-offset: 2px;
526
- }
527
- `,wn=i.span`
511
+ `,vn=i.span`
528
512
  align-self: flex-start;
529
513
  display: inline-flex;
530
514
  align-items: center;
@@ -535,11 +519,11 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
535
519
  font-size: 10px;
536
520
  font-weight: 400;
537
521
  line-height: 14px;
538
- color: ${r.text};
539
- `,Cn=i(O)`
522
+ color: ${o.text};
523
+ `,wn=i(O)`
540
524
  width: 11.31px;
541
525
  height: 10.94px;
542
- background: ${r.text};
526
+ background: ${o.text};
543
527
  `,Et=Ke`
544
528
  display: grid;
545
529
  place-items: center;
@@ -548,7 +532,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
548
532
  padding: 0;
549
533
  border: 0;
550
534
  background: none;
551
- color: ${r.muted};
535
+ color: ${o.muted};
552
536
  cursor: pointer;
553
537
  transition: color 0.12s ease;
554
538
 
@@ -556,40 +540,40 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
556
540
  opacity: 0.5;
557
541
  cursor: default;
558
542
  }
559
- `,jn=i.button`
543
+ `,Cn=i.button`
560
544
  ${Et};
561
545
 
562
546
  &:hover:not(:disabled) {
563
- color: ${r.text};
547
+ color: ${o.text};
564
548
  }
565
549
  &[data-on] {
566
- color: ${r.dclRed};
550
+ color: ${o.dclRed};
567
551
  }
568
- `,kn=i.button`
552
+ `,jn=i.button`
569
553
  ${Et};
570
554
 
571
555
  &:hover:not(:disabled) {
572
- color: ${r.dclRed};
556
+ color: ${o.dclRed};
573
557
  }
574
- `,$n=i.div`
558
+ `,kn=i.div`
575
559
  display: flex;
576
560
  gap: 20px;
577
561
  margin-top: 16px;
578
562
 
579
563
  & .link {
580
564
  font-size: 13px;
581
- color: ${r.muted};
565
+ color: ${o.muted};
582
566
  font-weight: 600;
583
567
  }
584
568
  & .link:hover:not(:disabled) {
585
- color: ${r.text};
569
+ color: ${o.text};
586
570
  }
587
571
  `,Sn=i.aside`
588
572
  position: sticky;
589
573
  top: 172px;
590
574
  display: flex;
591
575
  flex-direction: column;
592
- background: ${r.white};
576
+ background: ${o.white};
593
577
  box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
594
578
  border-radius: 16px;
595
579
  padding: 16px;
@@ -610,13 +594,13 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
610
594
  border-radius: 0;
611
595
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
612
596
  }
613
- `,Mn=i.h2`
597
+ `,$n=i.h2`
614
598
  margin: 0 0 24px;
615
599
  padding-bottom: 16px;
616
- border-bottom: 1px solid ${r.gray4};
600
+ border-bottom: 1px solid ${o.gray4};
617
601
  font-size: 24px;
618
602
  font-weight: 600;
619
- color: ${r.text};
603
+ color: ${o.text};
620
604
 
621
605
  ${I} {
622
606
  margin-bottom: 12px;
@@ -624,27 +608,27 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
624
608
  font-size: 16px;
625
609
  line-height: 1.6;
626
610
  }
627
- `,Tn=i.div`
611
+ `,Mn=i.div`
628
612
  display: flex;
629
613
  flex-direction: column;
630
614
  gap: 12px;
631
- `,In=i.div`
615
+ `,Tn=i.div`
632
616
  display: flex;
633
617
  align-items: flex-start;
634
618
  justify-content: space-between;
635
619
  gap: 12px;
636
- `,Pn=i.span`
620
+ `,In=i.span`
637
621
  font-size: 14px;
638
622
  font-weight: 600;
639
623
  line-height: 1.57;
640
- color: ${r.muted1};
641
- `,zn=i.span`
624
+ color: ${o.muted1};
625
+ `,Pn=i.span`
642
626
  display: inline-flex;
643
627
  align-items: center;
644
628
  gap: 8px;
645
629
  font-size: 24px;
646
630
  font-weight: 700;
647
- color: ${r.text};
631
+ color: ${o.text};
648
632
  `,An=i.span`
649
633
  display: flex;
650
634
  flex-direction: column;
@@ -655,11 +639,11 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
655
639
  font-size: 12px;
656
640
  font-weight: 400;
657
641
  line-height: 1;
658
- color: ${r.muted};
659
- `;const En=i(Mt)`
642
+ color: ${o.muted};
643
+ `;const zn=i(Mt)`
660
644
  width: 30px;
661
645
  height: 30px;
662
- background: ${r.text};
646
+ background: ${o.text};
663
647
  -webkit-mask-size: 24px 24px;
664
648
  mask-size: 24px 24px;
665
649
  -webkit-mask-position: left center;
@@ -670,7 +654,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
670
654
  border: 0;
671
655
  border-radius: ${te.btn};
672
656
  background: ${Ns.buyBtn};
673
- color: ${r.softWhite};
657
+ color: ${o.softWhite};
674
658
  font-size: 15px;
675
659
  font-weight: 600;
676
660
  letter-spacing: 0.046em;
@@ -684,7 +668,7 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
684
668
  still half transparent and the button visibly blinked. Same property both ends = a clean swap. */
685
669
  &:hover:not(:disabled),
686
670
  &:active:not(:disabled) {
687
- background-image: linear-gradient(${r.dclRed}, ${r.dclRed});
671
+ background-image: linear-gradient(${o.dclRed}, ${o.dclRed});
688
672
  }
689
673
  &:disabled {
690
674
  opacity: 0.6;
@@ -695,9 +679,9 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
695
679
  font-size: 13px;
696
680
  `,ve=i.p`
697
681
  ${Rt};
698
- `,Rn=i(As)`
682
+ `,En=i(zs)`
699
683
  ${Rt};
700
- `,qn=i.div`
684
+ `,Rn=i.div`
701
685
  position: relative;
702
686
  flex: 1 0 auto;
703
687
  margin-top: 48px;
@@ -709,4 +693,4 @@ import{j as e,L as ke,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t
709
693
  & section {
710
694
  margin-top: 0;
711
695
  }
712
- `;function We(o){if(Ps(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:va.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const Bn=12e4;function _n(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const Le=o=>o.reduce((l,P)=>l+P.priceCredits*P.quantity,0),we=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Yn(){ia({title:a("nav.cart"),noindex:!0});const o=H(t=>t.items),l=H(t=>t.remove),P=H(t=>t.increment),z=H(t=>t.decrement),W=H(t=>t.clear),D=H(t=>t.restore),J=H(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:K}=ra(),qt=oa(),le=Ss().packs.slice(0,Ms);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:$e}=ca({queryKey:["upsell-listings"],queryFn:()=>ja({first:40}),staleTime:6e4}),{data:$}=da(n),v=la(),X=ea(),{state:E}=ta(),[_t,ie]=T.useState(null),[Ne,ue]=T.useState(null),[Ft,B]=T.useState(!1),[_,G]=T.useState(null),Qe=T.useRef(0),[g,j]=T.useState(null),{data:he}=ua(n),{data:re}=ha(!0),[Se,Ue]=T.useState(""),oe=T.useRef(null),He=pa(o),Oe=t=>ut(He[t.id]),Me=o.filter(Oe),Ge=o.length>0&&Me.length===0,Wt=Me.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Lt=o.reduce((t,s)=>t+s.quantity,0),Kt=Me.reduce((t,s)=>t+s.quantity,0),Ve=_?_.liveTotalCredits:Wt,Nt=new Set(o.map(t=>t.id)),De=(($e==null?void 0:$e.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(_==null?void 0:_.buyable.map(t=>[t.item.id,t])),pe=($==null?void 0:$.credits)??0,Te=Ve*10,Ut=re?lt(Te,re):0n,Ie=_e({priceCents:Te,priceManaWei:Ut,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n}),Ht=t=>t.some(s=>s.acquisition==="store"),Pe=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ot=fa,Gt=t=>ba(t.contractAddress,String(t.itemId));function ge(t){t(),G(null),ue(null),ie(null)}function Vt(){j(null),B(!1)}function Je(t){const s=Le(t),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ue(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:pe,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function ze(t){if(!n||t.length===0)return;const s=we(t),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,F=new Set,R=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let x=0;x<s.length;x++){const p=s[x];j({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:U,maxCreditedValue:ee}=await gt(n.identity,p.usdCents,M,C);u.push({salt:U.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[U],maxCreditedValue:ee,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[U],maxCreditedValue:ee})}catch(M){if(zs(M)){if(u.length){try{await qe(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const m=Cs(y).length,k=x=>m>1?{current:x,total:m}:void 0,L=(x,p)=>j({phase:"processing",stage:x,step:s.length,total:s.length,signatures:k(p)}),N=x=>x<m?L("awaiting-signature",x+1):L("settling",m);L("awaiting-signature",1);let f=[];if(xs())try{const x=new Map;f=await js({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>N(m),onBroadcast:({txHash:C,salts:U})=>{x.set(C,U),U.forEach(ee=>w.add(ee))}});const p=await Promise.allSettled(f.map(C=>ks(C)));p.forEach((C,U)=>{const ee=x.get(f[U])??[];C.status==="fulfilled"?(ee.forEach(Ee=>S.add(Ee)),R.push(f[U])):C.reason instanceof wt||ee.forEach(Ee=>F.add(Ee))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof wt))throw M[0];q=!0}catch(x){if(!(x instanceof $s)||!wa(n.providerType))throw x;f=await Fe({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>S.add(C)),R.push(p)},onReverted:({salts:p})=>p.forEach(M=>F.add(M))})}else f=await Fe({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:x})=>x.forEach(p=>w.add(p)),onSettled:({txHash:x,salts:p})=>{p.forEach(M=>S.add(M)),R.push(x)},onReverted:({salts:x})=>x.forEach(p=>F.add(p))});t.forEach(x=>l(x.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),vt(v);const b=oe.current;oe.current=null,j(null),B(!1);const Q={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};X("/success",{state:Q,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const m=new Set([...w].filter(b=>!F.has(b))),{toRelease:k,boughtItemIds:L}=Ct({reservations:u,spent:m,settled:S}),N=d.filter(b=>L.includes(b.id)),f=d.filter(b=>!L.includes(b.id));if(V(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:mt(y),value_usd:ht(f.reduce((b,Q)=>b+Q.priceCredits,0)),cart_size:s.length,partial:N.length>0}),k.length)try{await qe(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),N.length>0){L.forEach(b=>l(b)),G(null),vt(v),V("Shop Completed Purchase",{...xe(N),payment_type:"credits",no_crypto_step:q,transaction_hash:R[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:We(y)})}}function Xe(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};X("/success",{state:c,replace:!0})}function Ye(t,s){fe(t)||ae(t,{flow:s,step:"submit"}),V(fe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:mt(t)}),j({phase:"error",message:We(t)}),B(!1)}async function Dt(t,s){const d=ye(Be.MANAToken,s),c=ye(Be.CreditsManager,s);await vs({auth:{kind:ws.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Ze(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",pt.chainId],queryFn:()=>ya(pt.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const s=we(t).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Ze():re,u=c?lt(s,c):0n;return{totalCents:s,manaWei:u}}async function et(t,s){const d=Le(t),{totalCents:c,manaWei:u}=await Jt(t),h=_e({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(s&&w.options.some(S=>S.method===s)){if(s==="credits"){ze(t);return}const{spender:S,chainId:F}=tt(s,t);await at(S,F,()=>s==="mana"?void st(t):void nt(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){Je(t);return}ze(t)}function Xt(t){return _e({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=T.useState(null);function tt(t,s){const d=Pe(s)[0].trade;return{spender:t==="mana"?ye(Ca(d.contract),d.chainId).address:ye(Be.CreditsManager,d.chainId).address,chainId:d.chainId}}async function at(t,s,d){const c=fs(s,t),u=n?await ys(c,n.address).catch(()=>!0):!0;if(bs(n==null?void 0:n.providerType,u)){B(!1),me({auth:c,run:d});return}d()}function Yt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){ze(s);return}const{spender:u,chainId:h}=tt(t,s);at(u,h,()=>t==="mana"?void st(s):void nt(s,d,c))}async function st(t){if(!n||t.length===0)return;const s=we(t),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await ps({trades:Pe(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ye(h,"buy_cart_mana")}}async function nt(t,s,d){if(!n||t.length===0)return;const c=we(t),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=gs(c.map(m=>m.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((m,k)=>m+k,0),F=ms(Math.max(0,s-S),s,d),R=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Pe(c),k=[];for(let f=0;f<m.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:m.length});const Q=m[f].item,{credit:x,maxCreditedValue:p}=await gt(n.identity,b,m[f].trade.id,Q.contractAddress&&Q.itemId!=null?{contractAddress:Q.contractAddress,itemId:String(Q.itemId)}:void 0);R.push({salt:x.id,itemId:Q.id}),k.push({kind:"trade",trade:m[f].trade,credits:[x],maxCreditedValue:p})}m.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+F).toString()},await Dt(n.signer,m[0].trade.chainId);const L=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const N=await Fe({purchases:k,buyer:n.address,signer:n.signer,onSigned:L,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),G(null),V("Shop Completed Purchase",{...xe(u),payment_type:"credits_and_mana",transaction_hash:N[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,N)}catch(m){const{toRelease:k}=Ct({reservations:R,spent:new Set([...q].filter(L=>!y.has(L))),settled:new Set});k.length&&qe(n.identity,k).catch(()=>{}),R.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Ye(m,"buy_cart_combined")}}async function Y(t){if(!n){bt({type:"cart-checkout"}),K();return}const s=H.getState().items.filter(Oe);if(s.length===0)return;ie(null),ue(null),B(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:ht(d),has_sufficient_credits:pe>=d});try{const c=await Ts(s,n.address,Ot,await Ze(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(_n(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),G(null);return}if(c.orderChanged){G(c),Qe.current=Date.now();return}await et(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(We(c))}finally{B(!1)}}async function it(){if(_){if(!n){bt({type:"cart-checkout"}),K();return}if(Date.now()-Qe.current>Bn){G(null),ue(null),await Y();return}ie(null),et(_.buyable)}}async function Zt(){if(Se){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}B(!0);try{const t=await Is(Se,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const rt=T.useRef(!1);T.useEffect(()=>{if(!n||rt.current||!ds("cart-checkout"))return;rt.current=!0;const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[n]);const ot=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||ot.current)return;ot.current=!0,oe.current=E.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const ct=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.startCheckout)||ct.current)return;ct.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const Z=Ft||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Os,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Gs,{children:[e.jsx(Vs,{children:a("cart.empty.title")}),e.jsx(Ds,{children:a("cart.empty.body")})]}),e.jsx(Js,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Qs,{children:[e.jsxs(Us,{children:[e.jsxs(Hs,{children:[e.jsx(Xs,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Ys,{children:a("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Zs,{onClick:()=>J(!0),disabled:Z,children:[e.jsx(O,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(zt,{children:[e.jsx(en,{children:o.map(t=>{const s=Qt.get(t.id),d=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,F=ga(t),R=!!F&&!!A[F],q=ma(t),y=He[t.id],m=!ut(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(tn,{"data-unavailable":m||void 0,children:[e.jsxs(an,{"data-thumb":!0,children:[q?e.jsx(sn,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(nn,{"data-check":!0,"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(rn,{children:[e.jsxs(on,{"data-desc":!0,children:[q?e.jsx(dn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(cn,{title:t.name,children:t.name}),t.creator?e.jsx(ln,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(wn,{"data-testid":"cart-creator-tag",children:[e.jsx(Cn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(un,{children:m?e.jsxs(e.Fragment,{children:[e.jsxs(yn,{children:[e.jsx(bn,{name:"warning-fill",size:24}),k]}),q?e.jsx(vn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(hn,{children:[e.jsx(St,{onClick:()=>ge(()=>z(t.id)),disabled:Z||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(pn,{children:h}),e.jsx(St,{onClick:()=>ge(()=>P(t.id)),disabled:Z||w,"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(gn,{children:[e.jsx(mn,{})," ",S,c?e.jsx(xn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(fn,{children:[F?e.jsx(jn,{"data-on":R||void 0,onClick:()=>ne(t),"aria-label":R?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:R?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(O,{name:R?"heart-solid":"heart"})}):null,e.jsx(kn,{onClick:()=>ge(()=>l(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx($n,{children:e.jsx("button",{className:"link",onClick:()=>ge(W),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Sn,{children:[e.jsx(Mn,{children:a("cart.purchaseSummary")}),e.jsxs(Tn,{children:[e.jsxs(In,{children:[e.jsx(Pn,{children:a("cart.totalItems",{count:Kt})}),e.jsx(An,{children:e.jsxs(zn,{children:[e.jsx(En,{})," ",Ve]})})]}),e.jsx(Tt,{options:Ie.options,totalCents:Te,shortfall:Ie.manaShortfall,showCreditsAmount:!1,creditsLabel:_?a("marketCheckout.confirmPurchase"):Ie.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||Ge,onPay:t=>void(_?it():Y(t)),creditsFallback:{label:Z?a("cart.working"):_?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(_?it():Y())}}),Ge?e.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:a("cart.signInHint")}),_?e.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ne?e.jsx(ve,{className:"muted",children:Ne}):null,e.jsx(Rn,{message:_t})]})]})]})]}),De.length>0?e.jsx(qn,{children:e.jsx(ls,{title:a("cart.youMightAlsoLike"),items:De})}):null,Ae&&n?e.jsx(us,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:hs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ae;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Ws,{phase:g.phase,balanceCredits:pe,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:xa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Xt(g).options:void 0,onPay:Yt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Le(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:Se,onSelectPack:Ue,onBuyPacks:()=>void Zt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void Y()}):null]})}export{Yn as Cart};
696
+ `;function Fe(r){if(Ps(r))return a("errors.rejected");const l=(r.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:va.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const qn=12e4;function Bn(r){const l=[];return r.unavailable.length&&l.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&l.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const We=r=>r.reduce((l,P)=>l+P.priceCredits*P.quantity,0),we=r=>r.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Xn(){ia({title:a("nav.cart"),noindex:!0});const r=H(t=>t.items),l=H(t=>t.remove),P=H(t=>t.increment),A=H(t=>t.decrement),F=H(t=>t.clear),D=H(t=>t.restore),J=H(t=>t.setFittingOpen),z=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:K}=ra(),qt=oa(),le=$s().packs.slice(0,Ms);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=r.some(t=>t.category!=="emote"),{data:ke}=ca({queryKey:["upsell-listings"],queryFn:()=>ja({first:40}),staleTime:6e4}),{data:S}=da(n),v=la(),X=ea(),{state:E}=ta(),[_t,ie]=T.useState(null),[Ne,ue]=T.useState(null),[Ft,q]=T.useState(!1),[B,G]=T.useState(null),Qe=T.useRef(0),[g,j]=T.useState(null),{data:he}=ua(n),{data:re}=ha(!0),[Se,Ue]=T.useState(""),oe=T.useRef(null),He=pa(r),Oe=t=>ut(He[t.id]),$e=r.filter(Oe),Ge=r.length>0&&$e.length===0,Wt=$e.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Lt=r.reduce((t,s)=>t+s.quantity,0),Kt=$e.reduce((t,s)=>t+s.quantity,0),Ve=B?B.liveTotalCredits:Wt,Nt=new Set(r.map(t=>t.id)),De=((ke==null?void 0:ke.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),pe=(S==null?void 0:S.credits)??0,Me=Ve*10,Ut=re?lt(Me,re):0n,Te=Be({priceCents:Me,priceManaWei:Ut,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),Ht=t=>t.some(s=>s.acquisition==="store"),Ie=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ot=fa,Gt=t=>ba(t.contractAddress,String(t.itemId));function ge(t){t(),G(null),ue(null),ie(null)}function Vt(){j(null),q(!1)}function Je(t){const s=We(t),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ue(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:pe,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),q(!1)}async function Pe(t){if(!n||t.length===0)return;const s=we(t),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,R=[];let W=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let x=0;x<s.length;x++){const p=s[x];j({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:U,maxCreditedValue:ee}=await gt(n.identity,p.usdCents,M,C);u.push({salt:U.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[U],maxCreditedValue:ee,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[U],maxCreditedValue:ee})}catch(M){if(As(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const m=Cs(y).length,k=x=>m>1?{current:x,total:m}:void 0,L=(x,p)=>j({phase:"processing",stage:x,step:s.length,total:s.length,signatures:k(p)}),N=x=>x<m?L("awaiting-signature",x+1):L("settling",m);L("awaiting-signature",1);let f=[];if(xs())try{const x=new Map;f=await js({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>N(m),onBroadcast:({txHash:C,salts:U})=>{x.set(C,U),U.forEach(ee=>w.add(ee))}});const p=await Promise.allSettled(f.map(C=>ks(C)));p.forEach((C,U)=>{const ee=x.get(f[U])??[];C.status==="fulfilled"?(ee.forEach(ze=>$.add(ze)),R.push(f[U])):C.reason instanceof wt||ee.forEach(ze=>_.add(ze))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof wt))throw M[0];W=!0}catch(x){if(!(x instanceof Ss)||!wa(n.providerType))throw x;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),R.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:x})=>x.forEach(p=>w.add(p)),onSettled:({txHash:x,salts:p})=>{p.forEach(M=>$.add(M)),R.push(x)},onReverted:({salts:x})=>x.forEach(p=>_.add(p))});t.forEach(x=>l(x.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:W,transaction_hash:f[0]??null}),vt(v);const b=oe.current;oe.current=null,j(null),q(!1);const Q={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};X("/success",{state:Q,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const m=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:L}=Ct({reservations:u,spent:m,settled:$}),N=d.filter(b=>L.includes(b.id)),f=d.filter(b=>!L.includes(b.id));if(V(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:mt(y),value_usd:ht(f.reduce((b,Q)=>b+Q.priceCredits,0)),cart_size:s.length,partial:N.length>0}),k.length)try{await Re(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),N.length>0){L.forEach(b=>l(b)),G(null),vt(v),V("Shop Completed Purchase",{...xe(N),payment_type:"credits",no_crypto_step:W,transaction_hash:R[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),q(!1);return}j({phase:"error",message:Fe(y)})}}function Xe(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};X("/success",{state:c,replace:!0})}function Ye(t,s){fe(t)||ae(t,{flow:s,step:"submit"}),V(fe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:mt(t)}),j({phase:"error",message:Fe(t)}),q(!1)}async function Dt(t,s){const d=ye(qe.MANAToken,s),c=ye(qe.CreditsManager,s);await vs({auth:{kind:ws.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Ze(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",pt.chainId],queryFn:()=>ya(pt.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const s=we(t).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Ze():re,u=c?lt(s,c):0n;return{totalCents:s,manaWei:u}}async function et(t,s){const d=We(t),{totalCents:c,manaWei:u}=await Jt(t),h=Be({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),w=Ht(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Pe(t);return}const{spender:$,chainId:_}=tt(s,t);await at($,_,()=>s==="mana"?void st(t):void nt(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),q(!1);return}if(S!=null&&S.credits<d){Je(t);return}Pe(t)}function Xt(t){return Be({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=T.useState(null);function tt(t,s){const d=Ie(s)[0].trade;return{spender:t==="mana"?ye(Ca(d.contract),d.chainId).address:ye(qe.CreditsManager,d.chainId).address,chainId:d.chainId}}async function at(t,s,d){const c=fs(s,t),u=n?await ys(c,n.address).catch(()=>!0):!0;if(bs(n==null?void 0:n.providerType,u)){q(!1),me({auth:c,run:d});return}d()}function Yt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Pe(s);return}const{spender:u,chainId:h}=tt(t,s);at(u,h,()=>t==="mana"?void st(s):void nt(s,d,c))}async function st(t){if(!n||t.length===0)return;const s=we(t),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await ps({trades:Ie(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ye(h,"buy_cart_mana")}}async function nt(t,s,d){if(!n||t.length===0)return;const c=we(t),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=gs(c.map(m=>m.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((m,k)=>m+k,0),_=ms(Math.max(0,s-$),s,d),R=[],W=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Ie(c),k=[];for(let f=0;f<m.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:m.length});const Q=m[f].item,{credit:x,maxCreditedValue:p}=await gt(n.identity,b,m[f].trade.id,Q.contractAddress&&Q.itemId!=null?{contractAddress:Q.contractAddress,itemId:String(Q.itemId)}:void 0);R.push({salt:x.id,itemId:Q.id}),k.push({kind:"trade",trade:m[f].trade,credits:[x],maxCreditedValue:p})}m.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Dt(n.signer,m[0].trade.chainId);const L=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const N=await _e({purchases:k,buyer:n.address,signer:n.signer,onSigned:L,onBroadcast:({salts:f})=>f.forEach(b=>W.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),G(null),V("Shop Completed Purchase",{...xe(u),payment_type:"credits_and_mana",transaction_hash:N[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,N)}catch(m){const{toRelease:k}=Ct({reservations:R,spent:new Set([...W].filter(L=>!y.has(L))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),R.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Ye(m,"buy_cart_combined")}}async function Y(t){if(!n){bt({type:"cart-checkout"}),K();return}const s=H.getState().items.filter(Oe);if(s.length===0)return;ie(null),ue(null),q(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:ht(d),has_sufficient_credits:pe>=d});try{const c=await Ts(s,n.address,Ot,await Ze(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(Bn(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),G(null);return}if(c.orderChanged){G(c),Qe.current=Date.now();return}await et(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{q(!1)}}async function it(){if(B){if(!n){bt({type:"cart-checkout"}),K();return}if(Date.now()-Qe.current>qn){G(null),ue(null),await Y();return}ie(null),et(B.buyable)}}async function Zt(){if(Se){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Is(Se,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const rt=T.useRef(!1);T.useEffect(()=>{if(!n||rt.current||!ds("cart-checkout"))return;rt.current=!0;const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[n]);const ot=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||ot.current)return;ot.current=!0,oe.current=E.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const ct=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.startCheckout)||ct.current)return;ct.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const Z=Ft||(g==null?void 0:g.phase)==="processing";return r.length===0&&!g?e.jsx(jt,{children:e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Os,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Gs,{children:[e.jsx(Vs,{children:a("cart.empty.title")}),e.jsx(Ds,{children:a("cart.empty.body")})]}),e.jsx(Js,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Qs,{children:[e.jsxs(Us,{children:[e.jsxs(Hs,{children:[e.jsx(Xs,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Ys,{children:a("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Zs,{onClick:()=>J(!0),disabled:Z,children:[e.jsx(O,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(en,{children:r.map(t=>{const s=Qt.get(t.id),d=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,$=d*h,_=ga(t),R=!!_&&!!z[_],W=ma(t),y=He[t.id],m=!ut(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(tn,{"data-unavailable":m||void 0,children:[e.jsxs(an,{"data-thumb":!0,children:[W?e.jsx(sn,{to:W,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(nn,{"data-check":!0,"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(rn,{children:[e.jsxs(on,{"data-desc":!0,children:[W?e.jsx(dn,{to:W,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(cn,{title:t.name,children:t.name}),t.creator?e.jsx(ln,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(vn,{"data-testid":"cart-creator-tag",children:[e.jsx(wn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(un,{children:m?e.jsxs(yn,{children:[e.jsx(bn,{name:"warning-fill",size:24}),k]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(hn,{children:[e.jsx($t,{onClick:()=>ge(()=>A(t.id)),disabled:Z||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(pn,{children:h}),e.jsx($t,{onClick:()=>ge(()=>P(t.id)),disabled:Z||w,"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(gn,{children:[e.jsx(mn,{})," ",$,c?e.jsx(xn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(fn,{children:[_?e.jsx(Cn,{"data-on":R||void 0,onClick:()=>ne(t),"aria-label":R?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:R?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(O,{name:R?"heart-solid":"heart"})}):null,e.jsx(jn,{onClick:()=>ge(()=>l(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(kn,{children:e.jsx("button",{className:"link",onClick:()=>ge(F),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Sn,{children:[e.jsx($n,{children:a("cart.purchaseSummary")}),e.jsxs(Mn,{children:[e.jsxs(Tn,{children:[e.jsx(In,{children:a("cart.totalItems",{count:Kt})}),e.jsx(An,{children:e.jsxs(Pn,{children:[e.jsx(zn,{})," ",Ve]})})]}),e.jsx(Tt,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:B?a("marketCheckout.confirmPurchase"):Te.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||Ge,onPay:t=>void(B?it():Y(t)),creditsFallback:{label:Z?a("cart.working"):B?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(B?it():Y())}}),Ge?e.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:a("cart.signInHint")}),B?e.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ne?e.jsx(ve,{className:"muted",children:Ne}):null,e.jsx(En,{message:_t})]})]})]})]}),De.length>0?e.jsx(Rn,{children:e.jsx(ls,{title:a("cart.youMightAlsoLike"),items:De})}):null,Ae&&n?e.jsx(us,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:hs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ae;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Ws,{phase:g.phase,balanceCredits:pe,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:xa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Xt(g).options:void 0,onPay:Yt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?We(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:Se,onSelectPack:Ue,onBuyPacks:()=>void Zt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void Y()}):null]})}export{Xn as Cart};
@@ -1,4 +1,4 @@
1
- import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-D0yb7tx6.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-Dp53Pb8_.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
1
+ import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-DQABJ8K0.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-Dsdo2L_S.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a1 as te,D as T,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ap as z,aq as de,bw as pe,bx as xe}from"./index-D0yb7tx6.js";import{E as he}from"./ErrorNotice-jD-FwtiS.js";import{d as me,P as ge,C as ue,a as be,b as fe}from"./collectionPage.styles-CnMRUv4w.js";import{u as ve,S as W,a as ye,F as je,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-C7-Px0Cz.js";import{L as Se}from"./LoadMore-L0jdHqAb.js";import{u as Pe}from"./useInfiniteGrid-DuP2ljFn.js";import{G as Ae}from"./grid.styles-BQjREFrV.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-BxGPvRcr.js";const Me=s.section`
1
+ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a1 as te,D as T,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ap as z,aq as de,bw as pe,bx as xe}from"./index-DQABJ8K0.js";import{E as he}from"./ErrorNotice-DcMjmsY0.js";import{d as me,P as ge,C as ue,a as be,b as fe}from"./collectionPage.styles-BbghKEPw.js";import{u as ve,S as W,a as ye,F as je,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-BvYy29PG.js";import{L as Se}from"./LoadMore-ChE3Ywf2.js";import{u as Pe}from"./useInfiniteGrid-aYtSr9OS.js";import{G as Ae}from"./grid.styles-BH-KolVj.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-BvHHSxH_.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;