@dcl/shop 1.3.0 → 1.3.1-31191272241.commit-33233c2
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.
- package/_assets/{Activity-ew3XpoT3.js → Activity-8i9FdngV.js} +5 -5
- package/_assets/{AnimatedBackground-D_nEuM-e.js → AnimatedBackground-B1iDviiG.js} +1 -1
- package/_assets/{Assets-cBlMqNjz.js → Assets-4IZmUsiz.js} +16 -16
- package/_assets/{Assets.styles-CLwfDCDf.js → Assets.styles-m0gk4Vwr.js} +1 -1
- package/_assets/{Authorizations-Cs0nL4Oz.js → Authorizations-BCttd8CW.js} +3 -3
- package/_assets/{Cart-BO4t_lkf.js → Cart-BgXGvv7s.js} +7 -7
- package/_assets/{CircularProgress-GqV7M35A.js → CircularProgress-DDm_y_cx.js} +4 -4
- package/_assets/{Collection-dJYcennk.js → Collection-CYz1Miau.js} +4 -4
- package/_assets/{CollectionCarousel-uJ5UjL8j.js → CollectionCarousel-DM6izEdE.js} +15 -15
- package/_assets/{Confetti-CFn9Pw72.js → Confetti-yVDYrpRF.js} +1 -1
- package/_assets/{Creator-CuGxdrmY.js → Creator-U2Odd2Xn.js} +11 -11
- package/_assets/{ErrorNotice-CJ7LbSaM.js → ErrorNotice-DXA2kUGn.js} +1 -1
- package/_assets/{ExchangeController-CwGAtelJ.js → ExchangeController-CUapamq4.js} +1 -1
- package/_assets/{Faq-CDhDmUOq.js → Faq-D3-Y7L_N.js} +1 -1
- package/_assets/{GetCredits-1I-xEtGF.js → GetCredits-BUPZ8nXe.js} +13 -13
- package/_assets/{Grow-CVnVH5HV.js → Grow-DWhKDYwn.js} +1 -1
- package/_assets/{HelpersUtil-DeEtn4Uv.js → HelpersUtil-BgHry1Zl.js} +1 -1
- package/_assets/{ItemDetail-R2KchS-D.js → ItemDetail-COQMwL0e.js} +1 -1
- package/_assets/LazyEmoteControls-Ds0pyaLH.js +2 -0
- package/_assets/{LoadMore-CRwBs35r.js → LoadMore-DJmWuNsx.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-BlUs3NYz.js → ManaPricingBanner.styles-CqaMAdkf.js} +2 -2
- package/_assets/{MyAssets-Crv1OZqH.js → MyAssets-BJoMoNc-.js} +9 -9
- package/_assets/{MyFavorites-BsDoGy_0.js → MyFavorites-BproSyJE.js} +1 -1
- package/_assets/{NotFound-CTrYO3ch.js → NotFound-BUyr7vAo.js} +1 -1
- package/_assets/{NotificationsBell-DRGgz2iS.js → NotificationsBell-CNXI5jCf.js} +1 -1
- package/_assets/{OutfitDetail-PIgUTZD2.js → OutfitDetail-DFD_3PD6.js} +13 -13
- package/_assets/{OutfitPreview-B7Y1-68b.js → OutfitPreview-DzzGBlLq.js} +2 -2
- package/_assets/{OutfitStudio-Bsv8_JeA.js → OutfitStudio-CIKhRaRR.js} +11 -11
- package/_assets/{StoreSettings-BH1LqeM8.js → StoreSettings-BZvCZhkk.js} +10 -10
- package/_assets/{Success-C0JqrNNn.js → Success-BYEoVFfn.js} +4 -4
- package/_assets/{SwapController-B403gwlM.js → SwapController-RbFspCAC.js} +1 -1
- package/_assets/{Tooltip-Bb6q6TxX.js → Tooltip-Seun6IgZ.js} +1 -1
- package/_assets/{TradeService-BsjSuIVy.js → TradeService-C0kQQCMK.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-B6S06Y_H.js → W3MFrameProviderSingleton-DauKY4Ir.js} +3 -3
- package/_assets/{WebCryptoP256-CI6-qWGK.js → WebCryptoP256-C4hli3xD.js} +1 -1
- package/_assets/authorizations-DPF8ylip.js +1 -0
- package/_assets/{basic-DEn_IlUm.js → basic-CV-oM6kG.js} +1 -1
- package/_assets/{biconomy-DvPM-XBT.js → biconomy-DGVuVSLX.js} +1 -1
- package/_assets/{builder-Npez-0pQ.js → builder-BkQQQzE3.js} +1 -1
- package/_assets/{buy-CRR9-X2w.js → buy-DQop7Gap.js} +1 -1
- package/_assets/{buy-gasless-Cj1VGZpP.js → buy-gasless-CvDYoAre.js} +1 -1
- package/_assets/{categories-CMYRFP-3.js → categories-Dx4OHkSy.js} +4 -4
- package/_assets/{ccip-DFr4gxX6.js → ccip-BGiCuOiS.js} +1 -1
- package/_assets/{ccip-Bvp_nKL6.js → ccip-BcKisox8.js} +1 -1
- package/_assets/{collectionPage.styles-B4iEFMy_.js → collectionPage.styles-CqWYdmnF.js} +4 -4
- package/_assets/{controller-CgyRh-Bw.js → controller-CSLwfM9E.js} +2 -2
- package/_assets/{core-B7wRtbuZ.js → core-CPCg7oPm.js} +4 -4
- package/_assets/{createSvgIcon-Bo9WJgq_.js → createSvgIcon-CN-Kwds3.js} +3 -3
- package/_assets/{custom-CH6sSlIL.js → custom-BPA4R--i.js} +1 -1
- package/_assets/{data-capture-DreW3nks.js → data-capture-CGpBku4P.js} +1 -1
- package/_assets/{email-pIKOIyQR.js → email-BRIoa7rr.js} +1 -1
- package/_assets/{embedded-wallet-CLmF0Kdd.js → embedded-wallet-BAeEpv8n.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-BqTQ5SYv.js → emotion-styled.browser.esm-GGMa6dTF.js} +1 -1
- package/_assets/{engine-D64OXa1r.js → engine-TZZ6iHT4.js} +1 -1
- package/_assets/{errors-BbwwHm_0.js → errors-CDyHuhIX.js} +1 -1
- package/_assets/{estimate-l1-fee-BU85AjOG.js → estimate-l1-fee-DBqnfEaD.js} +1 -1
- package/_assets/{execute-BozDg2yb.js → execute-B4Yh1llw.js} +2 -2
- package/_assets/{features-BDTF_ohu.js → features-BRxQunSh.js} +1 -1
- package/_assets/{fetchTokenMetadata-BT4wvs8u.js → fetchTokenMetadata-Dx8VaO9V.js} +2 -2
- package/_assets/{field.styles-C3qh-tZ2.js → field.styles-RvSTZ9zQ.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-BlqgcGd0.js → get-ecosystem-wallet-info-DCe0P2HA.js} +1 -1
- package/_assets/{getBalance-B89LWv-k.js → getBalance-yW2njh0W.js} +1 -1
- package/_assets/{getNFT-CMlAXi2W.js → getNFT-BOLZHVH5.js} +1 -1
- package/_assets/{getNFT-Cy5QJvSJ.js → getNFT-DuSRVcUI.js} +1 -1
- package/_assets/{grid.styles-B2Eu32l1.js → grid.styles-DTlMjoNy.js} +1 -1
- package/_assets/{hashTypedData-CVMcc6Hz.js → hashTypedData-BaZ-NVSh.js} +1 -1
- package/_assets/{hashTypedData-5hKkNljV.js → hashTypedData-Dn1doKj6.js} +1 -1
- package/_assets/{in-app-BiD_q7tQ.js → in-app-B3Zy_9Up.js} +1 -1
- package/_assets/{in-app-wallet-calls-BxK-hX9G.js → in-app-wallet-calls-BzgEl7Xp.js} +1 -1
- package/_assets/{index-BbAhN-VL.js → index-8G69XLE9.js} +1 -1
- package/_assets/{index-DmJfaFSK.js → index-8zod7QnL.js} +1 -1
- package/_assets/{index-D2gLfWlc.js → index-B5cMAKQz.js} +1 -1
- package/_assets/{index-GomvWLkv.js → index-B7hKU_9p.js} +1 -1
- package/_assets/{index-BvQGZppV.js → index-B8oAyIz8.js} +1 -1
- package/_assets/{index-D4mfZpjO.js → index-BBFb-GHY.js} +2 -2
- package/_assets/{index-bVwIZVq2.js → index-BEjN46BT.js} +1 -1
- package/_assets/{index-DsKwbNYL.js → index-BNetjvSn.js} +1 -1
- package/_assets/{index-DKDGLsyf.js → index-BX2bEUI-.js} +1 -1
- package/_assets/{index-CD88wagS.js → index-BYCN_-Lk.js} +1 -1
- package/_assets/{index-Baqe51s4.js → index-Baf3w05O.js} +1 -1
- package/_assets/{index-Xe0zG67j.js → index-BnBKCQ6R.js} +2 -2
- package/_assets/{index-DnZSYmpU.js → index-Bs5EVwuZ.js} +1 -1
- package/_assets/{index-CRNF_QU5.js → index-BzOkARHI.js} +1 -1
- package/_assets/{index-COl_MS2X.js → index-C1xP7rOI.js} +1 -1
- package/_assets/{index-BS9mRV4X.js → index-C3DZ04sJ.js} +1 -1
- package/_assets/{index-hnGTtZoN.js → index-C9n8rpAQ.js} +3 -3
- package/_assets/{index-Dy-uR3t4.js → index-CABfM9ed.js} +1 -1
- package/_assets/{index-DnhjRPd0.js → index-CCq36Q4n.js} +1 -1
- package/_assets/{index-BU93X1R1.js → index-CCvi817V.js} +1 -1
- package/_assets/{index-D6N8FICT.js → index-CDS3lHjJ.js} +2 -2
- package/_assets/{index-Brr2CMye.js → index-CE3AA7bo.js} +1 -1
- package/_assets/{index-CL_zZiR1.js → index-CFOh8-vc.js} +1 -1
- package/_assets/index-CHVlPVbz.js +3880 -0
- package/_assets/{index-Eas9yoRi.js → index-CKpYDU9O.js} +1 -1
- package/_assets/{index-BawFzGfz.js → index-CMeK1XVC.js} +1 -1
- package/_assets/{index-69aWe7LF.js → index-CPCeNa7L.js} +1 -1
- package/_assets/{index-DRZIPiLU.js → index-CQZJe9kU.js} +13 -13
- package/_assets/{index-tt5vpwow.js → index-CQimoWD2.js} +1 -1
- package/_assets/{index-2KdRKXEu.js → index-C_YJJre1.js} +1 -1
- package/_assets/{index-D7-5iUKs.js → index-Cdylf7p_.js} +1 -1
- package/_assets/{index-ByMxSKoO.js → index-CrL5_xYO.js} +1 -1
- package/_assets/{index-BNtwDdqR.js → index-Cx1mshgQ.js} +1 -1
- package/_assets/{index-E4Z_g959.js → index-D5bDG9XP.js} +3 -3
- package/_assets/{index-CU54HyHs.js → index-DBr4o1MH.js} +1 -1
- package/_assets/{index-BwVlQTGw.js → index-DE-MoPas.js} +1 -1
- package/_assets/{index-DnlLS_ys.js → index-DYM1B0LB.js} +1 -1
- package/_assets/{index-CgPj91Wh.js → index-Dc1SY2tl.js} +1 -1
- package/_assets/{index-BfrZo6vI.js → index-Dm0rNET3.js} +1 -1
- package/_assets/{index-CdmghwAv.js → index-DmtMKf7k.js} +1 -1
- package/_assets/{index-BLQrxn9F.js → index-DqxxfXkG.js} +1 -1
- package/_assets/{index-DRwratoB.js → index-DxZAhQ9S.js} +1 -1
- package/_assets/{index-CoC4ZTSB.js → index-EjOjm1WE.js} +3 -3
- package/_assets/{index-UWPTFHML.js → index-KMn0kKq6.js} +1 -1
- package/_assets/{index-CKJapgfm.js → index-VCROhFqu.js} +1 -1
- package/_assets/{index-Bj_Y4oBT.js → index-YOwv3ov2.js} +1 -1
- package/_assets/{index-DQT21rdJ.js → index-_IId9FPs.js} +1 -1
- package/_assets/{index-CGyHa-8V.js → index-_MeNrzH4.js} +1 -1
- package/_assets/{index-BCSwRUu3.js → index-tfg76WB4.js} +1 -1
- package/_assets/{index-C0Tjm6c2.js → index-vQeO65IH.js} +2 -2
- package/_assets/{index-C54j1-wd.js → index-wVpiAbCV.js} +1 -1
- package/_assets/{index-DxKuqcFg.js → index-zw3MxWrD.js} +1 -1
- package/_assets/{index.es-BYW_XSuo.js → index.es-BRe343gf.js} +4 -4
- package/_assets/{index.es-D0J6Rjn_.js → index.es-C50fJIvV.js} +1 -1
- package/_assets/{index.es-wL4nLZcl.js → index.es-RN4XS4d-.js} +1 -1
- package/_assets/{localBatchGatewayRequest-CBnpaR4-.js → localBatchGatewayRequest-mQE-Ofxj.js} +1 -1
- package/_assets/{networks-D41xdN6D.js → networks-YB7JUKsX.js} +1 -1
- package/_assets/{onramp-DR5Lm3nA.js → onramp-DcdCAuUZ.js} +1 -1
- package/_assets/{openzeppelin-B19X12pO.js → openzeppelin-dAP61G4J.js} +1 -1
- package/_assets/{parseNft-BHr3f8D7.js → parseNft-1wKuLSST.js} +2 -2
- package/_assets/{parseSignature-Cz1WFGnm.js → parseSignature-DToYlmjf.js} +3 -3
- package/_assets/{parseSignature-CRruTE7l.js → parseSignature-zHFOPkYU.js} +1 -1
- package/_assets/{passkeys-BAR54cJC.js → passkeys-BJEIePNG.js} +1 -1
- package/_assets/{pay-with-exchange-zDCz8UbG.js → pay-with-exchange-CyLwDARS.js} +1 -1
- package/_assets/{qr-overlay-DXWbTjg8.js → qr-overlay-D2bTeYBv.js} +1 -1
- package/_assets/{receive-B3ivhPV_.js → receive-W-LqtJ62.js} +1 -1
- package/_assets/{resolveImplementation-ASrjiSw-.js → resolveImplementation-BSqyzFFe.js} +1 -1
- package/_assets/{rpc-r3GlqTct.js → rpc-Dg74XPUL.js} +1 -1
- package/_assets/{secp256k1-ChcROQU5.js → secp256k1-B_xoHIxS.js} +1 -1
- package/_assets/{secp256k1-B5NNIaFX.js → secp256k1-CS73mfL3.js} +1 -1
- package/_assets/{secp256k1-Ch2QO1Jw.js → secp256k1-DadVk9CT.js} +1 -1
- package/_assets/{send-6dgb2b7F.js → send-Cg0sS_p7.js} +1 -1
- package/_assets/{send-batch-transaction-D_JGI6Rn.js → send-batch-transaction-DWWTS0gR.js} +1 -1
- package/_assets/{send-eip712-transaction-BAt6mbHJ.js → send-eip712-transaction-CcbYstq5.js} +2 -2
- package/_assets/{send-gasless-transaction-B6-du22J.js → send-gasless-transaction-B1NQvnVo.js} +2 -2
- package/_assets/{send-transaction-CWeSxAY3.js → send-transaction-C0UOEwny.js} +2 -2
- package/_assets/{sendMetaTransaction-Ds4_qSVu.js → sendMetaTransaction-DtXntIti.js} +1 -1
- package/_assets/{sendRawTransaction-lB8XtpQV.js → sendRawTransaction-BiRTWRI0.js} +3 -3
- package/_assets/{serializeTransaction-sBiqyBXY.js → serializeTransaction-Ba53L0KX.js} +1 -1
- package/_assets/{session-proposal-CtX3xmD3.js → session-proposal-CVkgVukc.js} +1 -1
- package/_assets/{session-request-TgRSx-rm.js → session-request-BwENbDXQ.js} +2 -2
- package/_assets/{signing-BLltMKaw.js → signing-5FpwvlDd.js} +3 -3
- package/_assets/{skeleton.styles-CHtcYOO2.js → skeleton.styles-h9G6h3Tc.js} +1 -1
- package/_assets/{socials-C-PWl5ol.js → socials-DorjGs6r.js} +1 -1
- package/_assets/{styled-ByfFVW_J.js → styled-B1tki3-6.js} +2 -2
- package/_assets/{swaps-cy6g7st6.js → swaps-CennN5F7.js} +1 -1
- package/_assets/{thirdweb-Dw1AnBJt.js → thirdweb-WI6Z07ev.js} +3 -3
- package/_assets/{to-serializable-transaction-BYNNGJgk.js → to-serializable-transaction-C9LYYgyI.js} +2 -2
- package/_assets/{transactionReceipt-D3t9P89G.js → transactionReceipt-DTe94rIE.js} +1 -1
- package/_assets/{transactions-Ci41fiMj.js → transactions-Dh3brWT9.js} +1 -1
- package/_assets/{useCreditPacks-DnkAdSB8.js → useCreditPacks-KSASUf3p.js} +1 -1
- package/_assets/{useImportable-DTHq6mob.js → useImportable-DRSc33Aj.js} +1 -1
- package/_assets/{useInfiniteGrid-C5_gVX8O.js → useInfiniteGrid-2uexVwwc.js} +1 -1
- package/_assets/useStore-DMEMsNdD.js +2 -0
- package/_assets/{useTheme-pA484HjF.js → useTheme-BeHCln35.js} +1 -1
- package/_assets/{verifyHash-Bwromxoc.js → verifyHash-A_t6GvG6.js} +1 -1
- package/_assets/{w3m-modal-yFiS_Jze.js → w3m-modal-kOpidGxt.js} +1 -1
- package/_assets/{w3m-modal-JLRA_T5o.js → w3m-modal-lKQJn3Hv.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BXBtEFR-.js → wait-for-tx-receipt-s1aaFfaz.js} +1 -1
- package/_assets/{wallets-DB4fTO2e.js → wallets-3kLS0TAH.js} +5 -5
- package/_assets/{web-connector-CwHeziUM.js → web-connector-BXc53MpI.js} +3 -3
- package/_assets/{writeContract-lzu9ejzj.js → writeContract-7ZFesM-X.js} +1 -1
- package/_assets/{zoraTestnet-Bhmm9a22.js → zoraTestnet-DP_bnDZl.js} +1 -1
- package/email/credit-glyph.png +0 -0
- package/email/hero-credits.png +0 -0
- package/email/logo.png +0 -0
- package/email/social-discord.png +0 -0
- package/email/social-github.png +0 -0
- package/email/social-instagram.png +0 -0
- package/email/social-linkedin.png +0 -0
- package/email/social-tiktok.png +0 -0
- package/email/social-x.png +0 -0
- package/email/social-youtube.png +0 -0
- package/email/top-bar.png +0 -0
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/LazyEmoteControls-C8q58ZLn.js +0 -2
- package/_assets/authorizations-CRcoV7f0.js +0 -1
- package/_assets/index-CKK-zMqi.js +0 -3880
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t as de,s as i,b as s,
|
|
1
|
+
import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t as de,s as i,b as s,L as le,ax as ia,ay as ze,az as ra,J as oa,I as O,A as Tt,K as Le,y as ca,X as H,am as ot,v as la,w as da,l as ua,aA as ha,D as pa,aB as ga,an as ma,aC as xa,aD as ct,aE as fa,aF as ya,z as ba,aG as lt,Z as V,aH as dt,aI as va,k as ae,r as wa,c as ut,aJ as Ca,C as ja,aK as ht,aL as Ee,aM as ka,aN as fe,aO as ye,aP as pt,g as gt,f as mt,aQ as $a}from"./index-CHVlPVbz.js";import{M as Sa,S as Ma,C as Ta,H as Ia,a as Pa,T as Aa,X as za,b as Ea,B as Ra,c as Ba,d as xt,e as qa,f as Ce,P as It,m as _a,g as Fa,h as Wa,i as La,j as Ka,k as Pt,l as je,L as Na,n as Qa,o as ft,p as yt,W as Ua,q as Ga,r as Ha,s as Oa,A as Da,t as Va,u as Ja,v as Xa,w as Ya,x as Za,y as es,z as ts,D as as,E as ss,F as ns,G as is,I as rs,J as os,K as cs,N as ls,O as ds,Q as Re,R as us,U as hs,V as ps,Y as gs,Z as bt,_ as vt,$ as ms,a0 as xs,a1 as fs,a2 as ys,a3 as wt,a4 as bs}from"./CollectionCarousel-DM6izEdE.js";import{f as vs,h as ws,a as Cs,n as js,i as ks,A as $s}from"./authorizations-DPF8ylip.js";import{g as Ss,h as Be,p as Ms}from"./buy-DQop7Gap.js";import{b as Ts,w as Is,S as Ct,G as Ps}from"./buy-gasless-CvDYoAre.js";import{u as As,M as zs,R as be,r as Es,c as Rs,p as jt,a as qe}from"./useCreditPacks-KSASUf3p.js";import{i as Bs,a as qs}from"./errors-CDyHuhIX.js";import{E as _s}from"./ErrorNotice-DXA2kUGn.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DtXntIti.js";const{colors:se,radius:Fs}=de,Ws=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 We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`;function Us(o){const{phase:d,balanceCredits:P,onClose:A}=o,F=d==="processing",J=d==="error"?s("cartCheckout.errorTitle"):d==="nofunds"?s("cartCheckout.titleNoFunds"):d==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),
|
|
61
|
+
`;function Us(o){const{phase:d,balanceCredits:P,onClose:A}=o,F=d==="processing",J=d==="error"?s("cartCheckout.errorTitle"):d==="nofunds"?s("cartCheckout.titleNoFunds"):d==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),X=d==="processing";return e.jsxs(Sa,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(Ma,{onClick:F?void 0:A,"aria-hidden":!0}),e.jsxs(Ta,{"data-tall":X||void 0,children:[e.jsxs(Ia,{children:[e.jsxs(Pa,{children:[e.jsx(Aa,{children:J}),!F&&e.jsx(za,{onClick:A,"aria-label":s("buyModal.close"),children:e.jsx(Ea,{})})]}),e.jsxs(Ra,{children:[e.jsx(Ba,{children:d==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(qa,{children:le(P)})]})]}),d==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),le(o.totalCredits??0)]})]}),e.jsx(It,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const z=_a(o.totalCents??0,o.totalManaWei??0n);return z!=null?s("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(Gs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),d==="nofunds"&&e.jsx(Hs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:A}),d==="error"&&e.jsxs(Ce,{children:[e.jsxs(Fa,{"data-testid":"buy-error",children:[e.jsx(Wa,{src:La,alt:"",width:64,height:80}),e.jsxs(Ka,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:A,children:s("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:o.onRetry??A,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Gs({stage:o,step:d,total:P,isSelfCustody:A,signatures:F}){const J=o==="reserving",X=P>0?Math.min(100,Math.round(d/P*100)):0,z=A&&F&&F.total>1,ne=o==="awaiting-signature"?A?z?s("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(Na,{src:ia,alt:"",width:61,height:61}),e.jsx(Qa,{children:ne}),J?e.jsxs(Ws,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${X}%`}})}),P>1?e.jsxs(Ls,{children:[d,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Hs({lines:o,shortfallCredits:d,packs:P,selectedPack:A,onSelectPack:F,onBuyPacks:J,onCancel:X}){const z=P.find(n=>n.id===A),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Ua,{"data-testid":"nofunds-warning",children:[e.jsx(Ga,{}),e.jsxs(Ha,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",s("buyModal.warningToPurchase",{count:ne}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Oa,{href:ra("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),e.jsx(Ks,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Da,{children:[e.jsx(Va,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ja,{children:[e.jsxs("div",{children:[e.jsxs(Xa,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Ns,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Ya,{address:n.item.creator}):null]}),e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx(ts,{children:P.map(n=>{const L=n.id===A;return e.jsxs(as,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>F(n.id),children:[e.jsx(ss,{src:ns,alt:""}),e.jsx(is,{children:le(n.credits)}),e.jsxs(rs,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(os,{children:[e.jsxs(cs,{children:[e.jsx(ls,{}),e.jsx("span",{children:le((z==null?void 0:z.credits)??0)})]}),e.jsxs(ds,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:X,children:s("buyModal.cancel")}),ze()?null:e.jsx(je,{"data-variant":"gradient",onClick:J,children:s("buyModal.buy")})]})]})}const{colors:c,gradients:Os,radius:te}=de,At="@media (max-width: 1080px)",I="@media (max-width: 880px)",kt=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
|
|
@@ -98,7 +98,7 @@ import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
98
98
|
${I} {
|
|
99
99
|
display: none;
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,Ds=i.div`
|
|
102
102
|
display: grid;
|
|
103
103
|
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
104
|
gap: 24px;
|
|
@@ -147,7 +147,7 @@ import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
147
147
|
top: -16px; /* .page's mobile padding */
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
`,
|
|
150
|
+
`,Vs=i.div`
|
|
151
151
|
min-width: 0;
|
|
152
152
|
display: flex;
|
|
153
153
|
flex-direction: column;
|
|
@@ -174,7 +174,7 @@ import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
174
174
|
${I} {
|
|
175
175
|
padding: 16px;
|
|
176
176
|
}
|
|
177
|
-
`,
|
|
177
|
+
`,Xs=i(zt)`
|
|
178
178
|
display: flex;
|
|
179
179
|
flex-direction: column;
|
|
180
180
|
align-items: center;
|
|
@@ -189,7 +189,7 @@ import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
189
189
|
min-height: 320px;
|
|
190
190
|
padding: 32px 16px;
|
|
191
191
|
}
|
|
192
|
-
`,
|
|
192
|
+
`,Ys=i.div`
|
|
193
193
|
display: flex;
|
|
194
194
|
flex-direction: column;
|
|
195
195
|
align-items: center;
|
|
@@ -693,4 +693,4 @@ import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t
|
|
|
693
693
|
& section {
|
|
694
694
|
margin-top: 0;
|
|
695
695
|
}
|
|
696
|
-
`;function _e(o){if(Bs(o))return s("errors.rejected");const d=(o.message??"").toLowerCase();return d.includes("insufficient")?s("cart.error.insufficient",{currency:ja.name}):d.includes("no active listing")||d.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const Ln=12e4;function Kn(o){const d=[];return o.unavailable.length&&d.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&d.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:d.join(` ${s("cart.drop.and")} `)})}const Fe=o=>o.reduce((d,P)=>d+P.priceCredits*P.quantity,0),we=o=>o.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function ai(){ca({title:s("nav.cart"),noindex:!0});const o=G(t=>t.items),d=G(t=>t.remove),P=G(t=>t.increment),A=G(t=>t.decrement),F=G(t=>t.clear),J=G(t=>t.restore),Y=G(t=>t.setFittingOpen),z=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=la(),qt=da(),ue=As().packs.slice(0,zs);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:ke}=ua({queryKey:["upsell-listings"],queryFn:()=>$a({first:40}),staleTime:6e4}),{data:k}=ha(n),v=pa(),X=sa(),{state:E}=na(),[Ft,ie]=M.useState(null),[Ke,he]=M.useState(null),[Wt,B]=M.useState(!1),[q,V]=M.useState(null),Ne=M.useRef(0),[p,j]=M.useState(null),{data:pe}=ga(n),{data:re}=ma(!0),[$e,Qe]=M.useState(""),oe=M.useRef(null),Ue=xa(o),He=t=>lt(Ue[t.id]),Se=o.filter(He),Ge=o.length>0&&Se.length===0,Lt=Se.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Nt=Se.reduce((t,a)=>t+a.quantity,0),Oe=q?q.liveTotalCredits:Lt,Qt=new Set(o.map(t=>t.id)),Ve=((ke==null?void 0:ke.items)??[]).filter(t=>!Qt.has(t.id)).slice(0,12),Ut=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),ge=(k==null?void 0:k.credits)??0,Me=Oe*10,Ht=re?ct(Me,re):0n,Te=Re({priceCents:Me,priceManaWei:Ht,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n}),Gt=t=>t.flatMap(a=>{const l=qe(a);return l.kind==="store"?[l.mint]:[]}),Ot=t=>t.flatMap(a=>a.acquisition==="trade"?[a.trade]:[]),Vt=va,Dt=t=>Ca(t.contractAddress,String(t.itemId));function me(t){t(),V(null),he(null),ie(null)}function Jt(){j(null),B(!1)}function De(t){const a=Fe(t),l=Math.max(0,a-ge),r=ue.find(u=>u.credits>=l)??ue[ue.length-1];Qe(r.id),D("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:l}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),B(!1)}async function Ie(t){if(!n||t.length===0)return;const a=we(t),l=a.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let m="authorize";const $=new Set,K=new Set,W=new Set,_=[];let w=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let x=0;x<a.length;x++){const h=a[x];j({phase:"processing",stage:"reserving",step:x+1,total:a.length});try{const C=h.acquisition==="trade"?h.trade.id:void 0,b=h.item.contractAddress&&h.item.itemId!=null?{contractAddress:h.item.contractAddress,itemId:String(h.item.itemId)}:void 0,{credit:T,maxCreditedValue:U}=await ht(n.identity,h.usdCents,C,b);u.push({salt:T.id,itemId:h.item.id}),g.push(h.acquisition==="store"?{kind:"store",item:{collection:h.item.contractAddress,itemId:String(h.item.itemId),priceWei:h.priceWei},credits:[T],maxCreditedValue:U,chainId:h.item.chainId}:{kind:"trade",trade:h.trade,credits:[T],maxCreditedValue:U})}catch(C){if(qs(C)){if(u.length){try{await Ee(n.identity,u.map(b=>b.salt))}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(t);return}throw C}}m="submit";const S=Ss(g).length,N=x=>S>1?{current:x,total:S}:void 0,H=(x,h)=>j({phase:"processing",stage:x,step:a.length,total:a.length,signatures:N(h)}),Q=x=>x<S?H("awaiting-signature",x+1):H("settling",S);H("awaiting-signature",1);let f=[];if(vs())try{const x=new Map;f=await Ts({purchases:g,buyer:n.address,signer:n.signer,onSigned:()=>Q(S),onBroadcast:({txHash:b,salts:T})=>{x.set(b,T),T.forEach(U=>$.add(U))}});const h=await Promise.allSettled(f.map(b=>Is(b)));h.forEach((b,T)=>{const U=x.get(f[T])??[];b.status==="fulfilled"?(U.forEach(ce=>K.add(ce)),_.push(f[T])):b.reason instanceof Ct||U.forEach(ce=>W.add(ce))});const C=h.flatMap(b=>b.status==="rejected"?[b.reason]:[]);if(C.length&&!C.some(b=>b instanceof Ct))throw C[0];w=!0}catch(x){if(!(x instanceof Ps)||!ka(n.providerType))throw x;f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:h})=>h.forEach(C=>$.add(C)),onSettled:({txHash:h,salts:C})=>{C.forEach(b=>K.add(b)),_.push(h)},onReverted:({salts:h})=>h.forEach(C=>W.add(C))})}else f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:x})=>x.forEach(h=>$.add(h)),onSettled:({txHash:x,salts:h})=>{h.forEach(C=>K.add(C)),_.push(x)},onReverted:({salts:x})=>x.forEach(h=>W.add(h))});t.forEach(x=>d(x.item.id)),V(null),D("Shop Completed Purchase",{...fe(l),payment_type:"credits",no_crypto_step:w,transaction_hash:f[0]??null}),vt(v);const y=oe.current;oe.current=null,j(null),B(!1);const R={items:r,txHash:f[0]??void 0,txHashes:f,settled:!0,...y?{creditsAdded:y}:{}};X("/success",{state:R,replace:!0})}catch(g){ye(g)||ae(g,{flow:"cart_checkout",step:m,cart_size:t.length});const S=new Set([...$].filter(y=>!W.has(y))),{toRelease:N,boughtItemIds:H}=jt({reservations:u,spent:S,settled:K}),Q=l.filter(y=>H.includes(y.id)),f=l.filter(y=>!H.includes(y.id));if(D(ye(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:m,error_code:pt(g),value_usd:dt(f.reduce((y,R)=>y+R.priceCredits,0)),cart_size:a.length,partial:Q.length>0}),N.length)try{await Ee(n.identity,N)}catch(y){ae(y,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),Q.length>0){H.forEach(y=>d(y)),V(null),vt(v),D("Shop Completed Purchase",{...fe(Q),payment_type:"credits",no_crypto_step:w,transaction_hash:_[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:_e(g)})}}function Je(t,a){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 l=oe.current;oe.current=null,j(null),B(!1);const r={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...l?{creditsAdded:l}:{}};X("/success",{state:r,replace:!0})}function Ye(t,a){ye(t)||ae(t,{flow:a,step:"submit"}),D(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:_e(t)}),B(!1)}async function Yt(t,a){const l=gt(mt.MANAToken,a),r=gt(mt.CreditsManager,a);await ks({auth:{kind:$s.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:a},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>wa(ut.chainId),staleTime:6e4})}catch{return}}async function Xt(t){const a=we(t).reduce((m,$)=>m+$.usdCents,0),r=(pe??0n)>0n?await Xe():re,u=r?ct(a,r):0n;return{totalCents:a,manaWei:u}}async function Ze(t,a){const l=Fe(t),{totalCents:r,manaWei:u}=await Xt(t),m=Re({priceCents:r,priceManaWei:u,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n});if(a&&m.options.some($=>$.method===a)){if(a==="credits"){Ie(t);return}await Ae(et(a,t),()=>a==="mana"?void tt(t):void at(t,r,u));return}if(m.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:r,manaWei:u}),B(!1);return}if(k!=null&&k.credits<l){De(t);return}Ie(t)}function Zt(t){return Re({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n})}const[Pe,xe]=M.useState(null);function et(t,a){const l=new Map;for(const r of a){const u=ms(t,qe(r));l.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...l.values()]}async function Ae(t,a){const[l,...r]=t;if(!l){a();return}await ea(l.spender,l.chainId,()=>void Ae(r,a))}async function ea(t,a,l){const r=ws(a,t),u=n?await Cs(r,n.address).catch(()=>!0):!0;if(js(n==null?void 0:n.providerType,u)){B(!1),xe({auth:r,run:l});return}l()}function ta(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:l,manaWei:r}=p;if(t==="credits"){Ie(a);return}Ae(et(t,a),()=>t==="mana"?void tt(a):void at(a,l,r))}async function tt(t){if(!n||t.length===0)return;const a=we(t),l=a.map(m=>({...m.item,priceCredits:m.priceCredits})),r=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const m=await xs({trades:Ot(a),mints:Gt(a),buyer:n.address,signer:n.signer,onSigned:u});t.forEach($=>d($.item.id)),V(null),D("Shop Completed Purchase",{...fe(l),payment_type:"mana",transaction_hash:m[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(r,m)}catch(m){Ye(m,"buy_cart_mana")}}async function at(t,a,l){if(!n||t.length===0)return;const r=we(t),u=r.map(w=>({...w.item,priceCredits:w.priceCredits})),m=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),$=fs(r.map(w=>w.usdCents),(k==null?void 0:k.balanceCents)??0),K=[],W=new Set,_=new Set;j({phase:"processing",stage:"reserving",step:1,total:r.length});try{const w=r.map(qe),g=[],S=new Map,N=new Map;for(let f=0;f<r.length;f++){const y=r[f],R=w[f],x=$[f],h=ys(Math.max(0,y.usdCents-x),a,l);let C;if(x<=0)C=wt(R,[],"0");else{j({phase:"processing",stage:"reserving",step:f+1,total:r.length});const T=y.item,{credit:U,maxCreditedValue:ce}=await ht(n.identity,x,R.kind==="trade"?R.trade.id:void 0,T.contractAddress&&T.itemId!=null?{contractAddress:T.contractAddress,itemId:String(T.itemId)}:void 0);K.push({salt:U.id,itemId:T.id}),C=wt(R,[U],ce)}const b=Ms(C);S.set(b,(S.get(b)??0n)+h),N.has(b)||N.set(b,g.length),g.push(C)}for(const[f,y]of S){const R=N.get(f);R==null||y<=0n||(g[R]={...g[R],maxCreditedValue:(BigInt(g[R].maxCreditedValue)+y).toString()})}await Yt(n.signer,bs(w[0]));const H=()=>j({phase:"processing",stage:"settling",step:r.length,total:r.length});j({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const Q=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:H,onBroadcast:({salts:f})=>f.forEach(y=>W.add(y)),onReverted:({salts:f})=>f.forEach(y=>_.add(y))});t.forEach(f=>d(f.item.id)),V(null),D("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:Q[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(m,Q)}catch(w){const{toRelease:g}=jt({reservations:K,spent:new Set([...W].filter(S=>!_.has(S))),settled:new Set});g.length&&Ee(n.identity,g).catch(()=>{}),K.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Ye(w,"buy_cart_combined")}}async function Z(t){if(!n){bt({type:"cart-checkout"}),L();return}const a=G.getState().items.filter(He);if(a.length===0)return;ie(null),he(null),B(!0);const l=a.reduce((r,u)=>r+u.priceCredits*u.quantity,0);D("Shop Started Checkout",{cart_size:a.length,cart_value_credits:l,cart_value_usd:dt(l),has_sufficient_credits:ge>=l});try{const r=await Es(a,n.address,Vt,await Xe(),Dt),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(m=>d(m.id)),he(Kn(r))),r.buyable.length===0){ie(s("cart.error.noneAvailable")),V(null);return}if(r.orderChanged){V(r),Ne.current=Date.now();return}await Ze(r.buyable,t)}catch(r){ae(r,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(_e(r))}finally{B(!1)}}async function st(){if(q){if(!n){bt({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>Ln){V(null),he(null),await Z();return}ie(null),Ze(q.buyable)}}async function aa(){if($e){try{sessionStorage.setItem(be,JSON.stringify(G.getState().items))}catch{}B(!0);try{const t=await Rs($e,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:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const nt=M.useRef(!1);M.useEffect(()=>{if(!n||nt.current||!us("cart-checkout"))return;nt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const it=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||it.current)return;it.current=!0,oe.current=E.creditsAdded??null;try{const a=sessionStorage.getItem(be);if(a){sessionStorage.removeItem(be);const l=JSON.parse(a);Array.isArray(l)&&l.length&&J(l)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const rt=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.startCheckout)||rt.current)return;rt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const ee=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(kt,{children:e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ys,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Xs,{children:[e.jsx(Zs,{children:s("cart.empty.title")}),e.jsx(en,{children:s("cart.empty.body")})]}),e.jsx(tn,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(kt,{children:[e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Vs,{children:[e.jsxs(Ds,{children:[e.jsxs(Js,{children:[e.jsx(an,{onClick:()=>X(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(sn,{children:s("cart.panelTitle",{count:Kt})}),_t?e.jsxs(nn,{onClick:()=>Y(!0),disabled:ee,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(zt,{children:[e.jsx(rn,{children:o.map(t=>{const a=Ut.get(t.id),l=a?a.priceCredits:t.priceCredits,r=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,m=t.quantity,$=typeof t.available=="number"&&m>=t.available,K=l*m,W=fa(t),_=!!W&&!!z[W],w=ya(t),g=Ue[t.id],S=!lt(g),N=g==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(on,{"data-unavailable":S||void 0,children:[e.jsxs(cn,{"data-thumb":!0,children:[w?e.jsx(ln,{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(dn,{"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(un,{children:[e.jsxs(hn,{"data-desc":!0,children:[w?e.jsx(gn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(pn,{title:t.name,children:t.name}),t.creator?e.jsx(mn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs($n,{"data-testid":"cart-creator-tag",children:[e.jsx(Sn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(xn,{children:S?e.jsxs(jn,{children:[e.jsx(kn,{name:"warning-fill",size:24}),N]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(fn,{children:[e.jsx(Mt,{onClick:()=>me(()=>A(t.id)),disabled:ee||m<=1,"aria-label":s("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(yn,{children:m}),e.jsx(Mt,{onClick:()=>me(()=>P(t.id)),disabled:ee||$,"aria-label":s("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(bn,{children:[e.jsx(vn,{})," ",K,r?e.jsx(wn,{children:t.priceCredits*m}):null]})]})})]}),e.jsxs(Cn,{children:[W?e.jsx(Mn,{"data-on":_||void 0,onClick:()=>ne(t),"aria-label":_?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:_?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:_?"heart-solid":"heart"})}):null,e.jsx(Tn,{onClick:()=>me(()=>d(t.id)),disabled:ee,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(In,{children:e.jsx("button",{className:"link",onClick:()=>me(F),disabled:ee,children:s("cart.clearCart")})})]})]}),e.jsxs(Pn,{children:[e.jsx(An,{children:s("cart.purchaseSummary")}),e.jsxs(zn,{children:[e.jsxs(En,{children:[e.jsx(Rn,{children:s("cart.totalItems",{count:Nt})}),e.jsx(qn,{children:e.jsxs(Bn,{children:[e.jsx(_n,{})," ",Oe]})})]}),e.jsx(It,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:q?s("marketCheckout.confirmPurchase"):Te.options.length>1?s("cart.buyWithCredits"):s("cart.checkout"),busy:ee||Ge,onPay:t=>void(q?st():Z(t)),creditsFallback:{label:ee?s("cart.working"):q?s("marketCheckout.confirmPurchase"):s("cart.checkout"),onClick:()=>void(q?st():Z())}}),Ge?e.jsx(ve,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:s("cart.signInHint")}),q?e.jsx(ve,{className:"muted",children:s("cart.priceChanged")}):null,Ke?e.jsx(ve,{className:"muted",children:Ke}):null,e.jsx(Fn,{message:Ft})]})]})]})]}),Ve.length>0?e.jsx(Wn,{children:e.jsx(hs,{title:s("cart.youMightAlsoLike"),items:Ve})}):null,Pe&&n?e.jsx(ps,{auth:Pe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:gs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Pe;xe(null),t()},onCancel:()=>xe(null),onClose:()=>xe(null)}):null,p?e.jsx(Us,{phase:p.phase,balanceCredits:ge,onClose:Jt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ba(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Zt(p).options:void 0,onPay:ta,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Fe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:$e,onSelectPack:Qe,onBuyPacks:()=>void aa(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void Z()}):null]})}export{ai as Cart};
|
|
696
|
+
`;function _e(o){if(Bs(o))return s("errors.rejected");const d=(o.message??"").toLowerCase();return d.includes("insufficient")?s("cart.error.insufficient",{currency:ja.name}):d.includes("no active listing")||d.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const Ln=12e4;function Kn(o){const d=[];return o.unavailable.length&&d.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&d.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:d.join(` ${s("cart.drop.and")} `)})}const Fe=o=>o.reduce((d,P)=>d+P.priceCredits*P.quantity,0),we=o=>o.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function ai(){ca({title:s("nav.cart"),noindex:!0});const o=H(t=>t.items),d=H(t=>t.remove),P=H(t=>t.increment),A=H(t=>t.decrement),F=H(t=>t.clear),J=H(t=>t.restore),X=H(t=>t.setFittingOpen),z=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=la(),qt=da(),ue=As().packs.slice(0,zs);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:ke}=ua({queryKey:["upsell-listings"],queryFn:()=>$a({first:40}),staleTime:6e4}),{data:k}=ha(n),v=pa(),Y=sa(),{state:E}=na(),[Ft,ie]=M.useState(null),[Ke,he]=M.useState(null),[Wt,B]=M.useState(!1),[q,D]=M.useState(null),Ne=M.useRef(0),[p,j]=M.useState(null),{data:pe}=ga(n),{data:re}=ma(!0),[$e,Qe]=M.useState(""),oe=M.useRef(null),Ue=xa(o),Ge=t=>lt(Ue[t.id]),Se=o.filter(Ge),He=o.length>0&&Se.length===0,Lt=Se.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Nt=Se.reduce((t,a)=>t+a.quantity,0),Oe=q?q.liveTotalCredits:Lt,Qt=new Set(o.map(t=>t.id)),De=((ke==null?void 0:ke.items)??[]).filter(t=>!Qt.has(t.id)).slice(0,12),Ut=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),ge=(k==null?void 0:k.credits)??0,Me=Oe*10,Gt=re?ct(Me,re):0n,Te=Re({priceCents:Me,priceManaWei:Gt,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.flatMap(a=>{const l=qe(a);return l.kind==="store"?[l.mint]:[]}),Ot=t=>t.flatMap(a=>a.acquisition==="trade"?[a.trade]:[]),Dt=va,Vt=t=>Ca(t.contractAddress,String(t.itemId));function me(t){t(),D(null),he(null),ie(null)}function Jt(){j(null),B(!1)}function Ve(t){const a=Fe(t),l=Math.max(0,a-ge),r=ue.find(u=>u.credits>=l)??ue[ue.length-1];Qe(r.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:l}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),B(!1)}async function Ie(t){if(!n||t.length===0)return;const a=we(t),l=a.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let m="authorize";const $=new Set,K=new Set,W=new Set,_=[];let w=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let x=0;x<a.length;x++){const h=a[x];j({phase:"processing",stage:"reserving",step:x+1,total:a.length});try{const C=h.acquisition==="trade"?h.trade.id:void 0,b=h.item.contractAddress&&h.item.itemId!=null?{contractAddress:h.item.contractAddress,itemId:String(h.item.itemId)}:void 0,{credit:T,maxCreditedValue:U}=await ht(n.identity,h.usdCents,C,b);u.push({salt:T.id,itemId:h.item.id}),g.push(h.acquisition==="store"?{kind:"store",item:{collection:h.item.contractAddress,itemId:String(h.item.itemId),priceWei:h.priceWei},credits:[T],maxCreditedValue:U,chainId:h.item.chainId}:{kind:"trade",trade:h.trade,credits:[T],maxCreditedValue:U})}catch(C){if(qs(C)){if(u.length){try{await Ee(n.identity,u.map(b=>b.salt))}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Ve(t);return}throw C}}m="submit";const S=Ss(g).length,N=x=>S>1?{current:x,total:S}:void 0,G=(x,h)=>j({phase:"processing",stage:x,step:a.length,total:a.length,signatures:N(h)}),Q=x=>x<S?G("awaiting-signature",x+1):G("settling",S);G("awaiting-signature",1);let f=[];if(vs())try{const x=new Map;f=await Ts({purchases:g,buyer:n.address,signer:n.signer,onSigned:()=>Q(S),onBroadcast:({txHash:b,salts:T})=>{x.set(b,T),T.forEach(U=>$.add(U))}});const h=await Promise.allSettled(f.map(b=>Is(b)));h.forEach((b,T)=>{const U=x.get(f[T])??[];b.status==="fulfilled"?(U.forEach(ce=>K.add(ce)),_.push(f[T])):b.reason instanceof Ct||U.forEach(ce=>W.add(ce))});const C=h.flatMap(b=>b.status==="rejected"?[b.reason]:[]);if(C.length&&!C.some(b=>b instanceof Ct))throw C[0];w=!0}catch(x){if(!(x instanceof Ps)||!ka(n.providerType))throw x;f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:h})=>h.forEach(C=>$.add(C)),onSettled:({txHash:h,salts:C})=>{C.forEach(b=>K.add(b)),_.push(h)},onReverted:({salts:h})=>h.forEach(C=>W.add(C))})}else f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:x})=>x.forEach(h=>$.add(h)),onSettled:({txHash:x,salts:h})=>{h.forEach(C=>K.add(C)),_.push(x)},onReverted:({salts:x})=>x.forEach(h=>W.add(h))});t.forEach(x=>d(x.item.id)),D(null),V("Shop Completed Purchase",{...fe(l),payment_type:"credits",no_crypto_step:w,transaction_hash:f[0]??null}),vt(v);const y=oe.current;oe.current=null,j(null),B(!1);const R={items:r,txHash:f[0]??void 0,txHashes:f,settled:!0,...y?{creditsAdded:y}:{}};Y("/success",{state:R,replace:!0})}catch(g){ye(g)||ae(g,{flow:"cart_checkout",step:m,cart_size:t.length});const S=new Set([...$].filter(y=>!W.has(y))),{toRelease:N,boughtItemIds:G}=jt({reservations:u,spent:S,settled:K}),Q=l.filter(y=>G.includes(y.id)),f=l.filter(y=>!G.includes(y.id));if(V(ye(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:m,error_code:pt(g),value_usd:dt(f.reduce((y,R)=>y+R.priceCredits,0)),cart_size:a.length,partial:Q.length>0}),N.length)try{await Ee(n.identity,N)}catch(y){ae(y,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),Q.length>0){G.forEach(y=>d(y)),D(null),vt(v),V("Shop Completed Purchase",{...fe(Q),payment_type:"credits",no_crypto_step:w,transaction_hash:_[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:_e(g)})}}function Je(t,a){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 l=oe.current;oe.current=null,j(null),B(!1);const r={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...l?{creditsAdded:l}:{}};Y("/success",{state:r,replace:!0})}function Xe(t,a){ye(t)||ae(t,{flow:a,step:"submit"}),V(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:_e(t)}),B(!1)}async function Xt(t,a){const l=gt(mt.MANAToken,a),r=gt(mt.CreditsManager,a);await ks({auth:{kind:$s.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:a},signer:t})}async function Ye(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>wa(ut.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const a=we(t).reduce((m,$)=>m+$.usdCents,0),r=(pe??0n)>0n?await Ye():re,u=r?ct(a,r):0n;return{totalCents:a,manaWei:u}}async function Ze(t,a){const l=Fe(t),{totalCents:r,manaWei:u}=await Yt(t),m=Re({priceCents:r,priceManaWei:u,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n});if(a&&m.options.some($=>$.method===a)){if(a==="credits"){Ie(t);return}await Ae(et(a,t),()=>a==="mana"?void tt(t):void at(t,r,u));return}if(m.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:r,manaWei:u}),B(!1);return}if(k!=null&&k.credits<l){Ve(t);return}Ie(t)}function Zt(t){return Re({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n})}const[Pe,xe]=M.useState(null);function et(t,a){const l=new Map;for(const r of a){const u=ms(t,qe(r));l.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...l.values()]}async function Ae(t,a){const[l,...r]=t;if(!l){a();return}await ea(l.spender,l.chainId,()=>void Ae(r,a))}async function ea(t,a,l){const r=ws(a,t),u=n?await Cs(r,n.address).catch(()=>!0):!0;if(js(n==null?void 0:n.providerType,u)){B(!1),xe({auth:r,run:l});return}l()}function ta(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:l,manaWei:r}=p;if(t==="credits"){Ie(a);return}Ae(et(t,a),()=>t==="mana"?void tt(a):void at(a,l,r))}async function tt(t){if(!n||t.length===0)return;const a=we(t),l=a.map(m=>({...m.item,priceCredits:m.priceCredits})),r=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const m=await xs({trades:Ot(a),mints:Ht(a),buyer:n.address,signer:n.signer,onSigned:u});t.forEach($=>d($.item.id)),D(null),V("Shop Completed Purchase",{...fe(l),payment_type:"mana",transaction_hash:m[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(r,m)}catch(m){Xe(m,"buy_cart_mana")}}async function at(t,a,l){if(!n||t.length===0)return;const r=we(t),u=r.map(w=>({...w.item,priceCredits:w.priceCredits})),m=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),$=fs(r.map(w=>w.usdCents),(k==null?void 0:k.balanceCents)??0),K=[],W=new Set,_=new Set;j({phase:"processing",stage:"reserving",step:1,total:r.length});try{const w=r.map(qe),g=[],S=new Map,N=new Map;for(let f=0;f<r.length;f++){const y=r[f],R=w[f],x=$[f],h=ys(Math.max(0,y.usdCents-x),a,l);let C;if(x<=0)C=wt(R,[],"0");else{j({phase:"processing",stage:"reserving",step:f+1,total:r.length});const T=y.item,{credit:U,maxCreditedValue:ce}=await ht(n.identity,x,R.kind==="trade"?R.trade.id:void 0,T.contractAddress&&T.itemId!=null?{contractAddress:T.contractAddress,itemId:String(T.itemId)}:void 0);K.push({salt:U.id,itemId:T.id}),C=wt(R,[U],ce)}const b=Ms(C);S.set(b,(S.get(b)??0n)+h),N.has(b)||N.set(b,g.length),g.push(C)}for(const[f,y]of S){const R=N.get(f);R==null||y<=0n||(g[R]={...g[R],maxCreditedValue:(BigInt(g[R].maxCreditedValue)+y).toString()})}await Xt(n.signer,bs(w[0]));const G=()=>j({phase:"processing",stage:"settling",step:r.length,total:r.length});j({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const Q=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:G,onBroadcast:({salts:f})=>f.forEach(y=>W.add(y)),onReverted:({salts:f})=>f.forEach(y=>_.add(y))});t.forEach(f=>d(f.item.id)),D(null),V("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:Q[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(m,Q)}catch(w){const{toRelease:g}=jt({reservations:K,spent:new Set([...W].filter(S=>!_.has(S))),settled:new Set});g.length&&Ee(n.identity,g).catch(()=>{}),K.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Xe(w,"buy_cart_combined")}}async function Z(t){if(!n){bt({type:"cart-checkout"}),L();return}const a=H.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const l=a.reduce((r,u)=>r+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{cart_size:a.length,cart_value_credits:l,cart_value_usd:dt(l),has_sufficient_credits:ge>=l});try{const r=await Es(a,n.address,Dt,await Ye(),Vt),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(m=>d(m.id)),he(Kn(r))),r.buyable.length===0){ie(s("cart.error.noneAvailable")),D(null);return}if(r.orderChanged){D(r),Ne.current=Date.now();return}await Ze(r.buyable,t)}catch(r){ae(r,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(_e(r))}finally{B(!1)}}async function st(){if(q){if(!n){bt({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>Ln){D(null),he(null),await Z();return}ie(null),Ze(q.buyable)}}async function aa(){if($e){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}B(!0);try{const t=await Rs($e,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}Y("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const nt=M.useRef(!1);M.useEffect(()=>{if(!n||nt.current||!us("cart-checkout"))return;nt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const it=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||it.current)return;it.current=!0,oe.current=E.creditsAdded??null;try{const a=sessionStorage.getItem(be);if(a){sessionStorage.removeItem(be);const l=JSON.parse(a);Array.isArray(l)&&l.length&&J(l)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const rt=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.startCheckout)||rt.current)return;rt.current=!0,Y(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const ee=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(kt,{children:e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>Y(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Xs,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ys,{children:[e.jsx(Zs,{children:s("cart.empty.title")}),e.jsx(en,{children:s("cart.empty.body")})]}),e.jsx(tn,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(kt,{children:[e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>Y(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ds,{children:[e.jsxs(Vs,{children:[e.jsxs(Js,{children:[e.jsx(an,{onClick:()=>Y(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(sn,{children:s("cart.panelTitle",{count:Kt})}),_t?e.jsxs(nn,{onClick:()=>X(!0),disabled:ee,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(zt,{children:[e.jsx(rn,{children:o.map(t=>{const a=Ut.get(t.id),l=a?a.priceCredits:t.priceCredits,r=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,m=t.quantity,$=typeof t.available=="number"&&m>=t.available,K=l*m,W=fa(t),_=!!W&&!!z[W],w=ya(t),g=Ue[t.id],S=!lt(g),N=g==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(on,{"data-unavailable":S||void 0,children:[e.jsxs(cn,{"data-thumb":!0,children:[w?e.jsx(ln,{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(dn,{"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(un,{children:[e.jsxs(hn,{"data-desc":!0,children:[w?e.jsx(gn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(pn,{title:t.name,children:t.name}),t.creator?e.jsx(mn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs($n,{"data-testid":"cart-creator-tag",children:[e.jsx(Sn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(xn,{children:S?e.jsxs(jn,{children:[e.jsx(kn,{name:"warning-fill",size:24}),N]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(fn,{children:[e.jsx(Mt,{onClick:()=>me(()=>A(t.id)),disabled:ee||m<=1,"aria-label":s("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(yn,{children:m}),e.jsx(Mt,{onClick:()=>me(()=>P(t.id)),disabled:ee||$,"aria-label":s("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(bn,{children:[e.jsx(vn,{})," ",K,r?e.jsx(wn,{children:t.priceCredits*m}):null]})]})})]}),e.jsxs(Cn,{children:[W?e.jsx(Mn,{"data-on":_||void 0,onClick:()=>ne(t),"aria-label":_?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:_?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:_?"heart-solid":"heart"})}):null,e.jsx(Tn,{onClick:()=>me(()=>d(t.id)),disabled:ee,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(In,{children:e.jsx("button",{className:"link",onClick:()=>me(F),disabled:ee,children:s("cart.clearCart")})})]})]}),e.jsxs(Pn,{children:[e.jsx(An,{children:s("cart.purchaseSummary")}),e.jsxs(zn,{children:[e.jsxs(En,{children:[e.jsx(Rn,{children:s("cart.totalItems",{count:Nt})}),e.jsx(qn,{children:e.jsxs(Bn,{children:[e.jsx(_n,{})," ",Oe]})})]}),e.jsx(It,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:q?s("marketCheckout.confirmPurchase"):Te.options.length>1?s("cart.buyWithCredits"):s("cart.checkout"),busy:ee||He,onPay:t=>void(q?st():Z(t)),creditsFallback:{label:ee?s("cart.working"):q?s("marketCheckout.confirmPurchase"):s("cart.checkout"),onClick:()=>void(q?st():Z())}}),He?e.jsx(ve,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:s("cart.signInHint")}),q?e.jsx(ve,{className:"muted",children:s("cart.priceChanged")}):null,Ke?e.jsx(ve,{className:"muted",children:Ke}):null,e.jsx(Fn,{message:Ft})]})]})]})]}),De.length>0?e.jsx(Wn,{children:e.jsx(hs,{title:s("cart.youMightAlsoLike"),items:De})}):null,Pe&&n?e.jsx(ps,{auth:Pe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:gs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Pe;xe(null),t()},onCancel:()=>xe(null),onClose:()=>xe(null)}):null,p?e.jsx(Us,{phase:p.phase,balanceCredits:ge,onClose:Jt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ba(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Zt(p).options:void 0,onPay:ta,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Fe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:$e,onSelectPack:Qe,onBuyPacks:()=>void aa(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void Z()}):null]})}export{ai as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as N,aj as U,ak as o,al as n,K as D,x as M}from"./index-CHVlPVbz.js";import{r as w,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-B1tki3-6.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
|
}
|
|
@@ -21,8 +21,8 @@ import{ah as N,ai as U,aj as o,ak as n,J as D,v as M}from"./index-CKK-zMqi.js";i
|
|
|
21
21
|
stroke-dasharray: 100px, 200px;
|
|
22
22
|
stroke-dashoffset: -125px;
|
|
23
23
|
}
|
|
24
|
-
`)),
|
|
24
|
+
`)),L=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,m={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return K(m,F,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
|
-
`),B)),
|
|
26
|
+
`),B)),Z=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),q=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),G)),Q=w.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=U(a,W),c=o({},a,{color:m,disableShrink:R,size:u,thickness:i,value:p,variant:k}),f=
|
|
28
|
+
`),G)),Q=w.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=U(a,W),c=o({},a,{color:m,disableShrink:R,size:u,thickness:i,value:p,variant:k}),f=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(V,o({className:I(f.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:f.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(q,{className:f.circle,style:h,ownerState:c,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Q as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as
|
|
1
|
+
import{j as e,r as h,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,a1 as ee,E as z,bu as te,bv as ae,I as oe,b as a,c as ie,k as re,l as se,y as ne,C as ce,ap as F,aq as le,bw as de,bx as pe}from"./index-CHVlPVbz.js";import{E as xe}from"./ErrorNotice-DXA2kUGn.js";import{d as me,P as he,C as ge,a as ue,b as be}from"./collectionPage.styles-CqWYdmnF.js";import{u as fe}from"./useStore-DMEMsNdD.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-Dx4OHkSy.js";import{L as Se}from"./LoadMore-DJmWuNsx.js";import{u as Pe}from"./useInfiniteGrid-2uexVwwc.js";import{G as Ae}from"./grid.styles-DTlMjoNy.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-h9G6h3Tc.js";const Me=s.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${b.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -42,7 +42,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt
|
|
|
42
42
|
padding: 24px 16px;
|
|
43
43
|
font-size: 26px;
|
|
44
44
|
}
|
|
45
|
-
`;function Fe({name:o,creator:t}){const{data:n}=
|
|
45
|
+
`;function Fe({name:o,creator:t}){const{data:n}=fe(t),p=(n==null?void 0:n.cover)||me;return e.jsxs(Me,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Re,{src:p,alt:"",loading:"eager"}),e.jsx(Te,{"aria-hidden":!0})]}),e.jsx(ze,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:B}=b,We=s.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
48
|
align-items: center;
|
|
@@ -116,7 +116,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt
|
|
|
116
116
|
background: ${c.softWhite};
|
|
117
117
|
color: ${c.text};
|
|
118
118
|
}
|
|
119
|
-
`;function _e({address:o}){var v,d;const{data:t}=
|
|
119
|
+
`;function _e({address:o}){var v,d;const{data:t}=ee(o),[n,p]=h.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||z(o),g=(d=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:d.face256,u=`${ie.profileUrl}/${o}`,f=te(ae({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),p(!0),window.setTimeout(()=>p(!1),1500)}catch(y){re(y,{flow:"copy_creator_address"})}}return e.jsxs(We,{"data-testid":"creator-card",children:[g?e.jsx(L,{src:g,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(L,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Le,{title:l,children:l}),e.jsxs(Be,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:z(o)}),e.jsx(oe,{name:"copy",size:16})]}),e.jsx(Ie,{"data-testid":"creator-card-view",href:u,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:Ge,media:$}=b,He=s.div`
|
|
120
120
|
position: relative;
|
|
121
121
|
display: flex;
|
|
122
122
|
gap: 32px;
|
|
@@ -159,4 +159,4 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt
|
|
|
159
159
|
visibility: visible;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
`,Ye=48;function
|
|
162
|
+
`,Ye=48;function st(){var T;const{contractAddress:o}=J(),t=X(),[n,p]=h.useState("all"),[l,g]=h.useState(null),[u,f]=h.useState([]),[x,v]=h.useState(""),[d,y]=h.useState(""),[k,I]=h.useState("newest");ve(`${n}:${l??""}`);const N=x&&!Number.isNaN(Number(x))?Number(x):void 0,S=d&&!Number.isNaN(Number(d))?Number(d):void 0,_=l?Ne[l]:void 0,G=(W.find(i=>i.key===k)??W[0]).server,P={category:n,rarities:u.length?u:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:S,sortBy:G},{items:j,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:q,fetchNextPage:Y}=Pe(["collection-page",o,P],i=>de(o,{...P,first:Ye,skip:i}),{enabled:!!o}),{data:r}=se({queryKey:["collection-meta",o],queryFn:()=>pe(o),enabled:!!o,staleTime:5*6e4}),E=(r==null?void 0:r.name)||a("collection.fallbackTitle");ne({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const R=(r==null?void 0:r.creator)||((T=j[0])==null?void 0:T.creator);function K(i){p(i),g(null)}function O(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function D(){p("all"),g(null),f([]),v(""),y("")}const w=!!(N||S),Q=w?`${x||"0"}–${d||"∞"}`:a("filter.price"),V=n!=="all"||!!l||u.length>0||w;return e.jsxs(he,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(ue,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(be,{children:E})]}),e.jsx(Fe,{name:E,creator:R}),e.jsxs(He,{"data-testid":"browse",children:[e.jsxs(qe,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:R}),e.jsx(ye,{category:n,subCategory:l,onCategory:K,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(Ue,{children:[e.jsx(je,{rarities:u,onToggleRarity:O,sort:k,onSort:I,total:H,loading:C,anyActive:V,onClear:D,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:d,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:ce.name})})]})})}),A?e.jsx(xe,{message:a("collection.error")}):null,e.jsx(Ae,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(le,{item:i},i.id)),M?e.jsx(F,{count:6}):null]})}),e.jsx(Se,{hasNextPage:U,isFetching:M,isError:q,onLoadMore:()=>void Y()}),!C&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{st as Collection,st as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,
|
|
1
|
+
import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,A as M,L as A,bV as z,C as ce,x as le,I as K,k as pe,g as j,f as C,aY as U,ar as Q,a9 as he,ck as q,aq as ue}from"./index-CHVlPVbz.js";import{s as xe,i as F,A as V,g as B,r as Z,m as J,k as Y,l as G}from"./authorizations-DPF8ylip.js";import{i as ge}from"./errors-CDyHuhIX.js";import{E as fe}from"./ErrorNotice-DXA2kUGn.js";import{k as me,l as be,m as _,n as we,o as ye}from"./buy-DQop7Gap.js";import{s as ee,M as te,E as ae}from"./sendMetaTransaction-DtXntIti.js";import{I as ve,C as ne}from"./ethers-BDpbhgX6.js";const S="shop:resume_after_signin",ke=900*1e3;function xt(e){try{sessionStorage.setItem(S,JSON.stringify({...e,at:Date.now()}))}catch{}}function gt(e){let t;try{t=sessionStorage.getItem(S)}catch{return null}if(!t)return null;try{sessionStorage.removeItem(S)}catch{}let i;try{i=JSON.parse(t)}catch{return null}return!i||i.type!==e||typeof i.at!="number"||Date.now()-i.at>ke?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function je(e,t){return(e+t-1n)/t}function Ce(e,t,i){return e<=0||t<=0?0n:e>=t?i:je(i*BigInt(e),BigInt(t))}function ft(e){var u,p,y;const t=Number.isFinite(e.priceCents)?Math.max(0,Math.trunc(e.priceCents)):0,i=Number.isFinite(e.balanceCents)?Math.max(0,Math.trunc(e.balanceCents)):0,r=e.priceManaWei>0n?e.priceManaWei:0n,l=e.manaBalanceWei>0n?e.manaBalanceWei:0n;if(t<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=t&&c.push({method:"credits",creditsCents:t,manaWei:0n}),r>0n&&i>0&&i<t){const o=t-i,f=Ce(o,t,r);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}r>0n&&l>=r&&c.push({method:"mana",creditsCents:0,manaWei:r});const h=((u=c.find(o=>o.method==="credits"))==null?void 0:u.method)??((p=c.find(o=>o.method==="combined"))==null?void 0:p.method)??((y=c.find(o=>o.method==="mana"))==null?void 0:y.method)??null,g=!c.some(o=>o.method==="mana"||o.method==="combined")&&r>0n&&l>0n?{manaWei:l,manaCents:Me(l,t,r),priceCents:t}:null;return{options:c,preferred:h,manaShortfall:g}}function Me(e,t,i){return Number(e*BigInt(t)/i)}function mt(e,t){let i=Number.isFinite(t)?Math.max(0,Math.trunc(t)):0;return e.map(r=>{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0,c=Math.min(l,i);return i-=c,c})}function W(e){return Number.isFinite(e)?Math.max(0,e)/10:0}function bt(e,t){return e.options.find(i=>i.method===t)??null}function wt(e,t){if(!Number.isFinite(e)||e<=0||t<=0n)return null;const i=e/10;return Number(t)/1e18/i}const E="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ae=a.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -49,7 +49,7 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
49
49
|
&:hover:not(:disabled) {
|
|
50
50
|
background: ${d.colors.gray0};
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
`,$=a.span`
|
|
53
53
|
display: inline-flex;
|
|
54
54
|
align-items: center;
|
|
55
55
|
gap: 6px;
|
|
@@ -89,11 +89,11 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
89
89
|
font-weight: 600;
|
|
90
90
|
letter-spacing: 0.02em;
|
|
91
91
|
opacity: 0.85;
|
|
92
|
-
|
|
92
|
+
`,We=a.span`
|
|
93
93
|
font-size: 18px;
|
|
94
94
|
font-weight: 600;
|
|
95
95
|
opacity: 0.7;
|
|
96
|
-
|
|
96
|
+
`,$e=a.p`
|
|
97
97
|
margin: 0;
|
|
98
98
|
font-family: ${d.font.sans};
|
|
99
99
|
font-weight: 400;
|
|
@@ -109,7 +109,7 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
109
109
|
line-height: 1.4;
|
|
110
110
|
color: ${d.colors.muted};
|
|
111
111
|
text-align: center;
|
|
112
|
-
`;function yt({options:e,totalCents:t,onPay:i,busy:r=!1,rateNote:l,creditsLabel:c,shortfall:h,showCreditsAmount:w=!0,creditsFallback:g=null}){const u=e.some(p=>p.method==="credits");return n.jsxs(Ae,{children:[!u&&g?n.jsx(X,{type:"button","data-testid":"pay-with-credits-topup",onClick:g.onClick,disabled:r,children:n.jsx("span",{children:g.label})}):null,e.map(p=>p.method==="credits"?n.jsxs(X,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:r,children:[n.jsx("span",{children:c??b("buyModal.buy")}),w?n.jsxs(
|
|
112
|
+
`;function yt({options:e,totalCents:t,onPay:i,busy:r=!1,rateNote:l,creditsLabel:c,shortfall:h,showCreditsAmount:w=!0,creditsFallback:g=null}){const u=e.some(p=>p.method==="credits");return n.jsxs(Ae,{children:[!u&&g?n.jsx(X,{type:"button","data-testid":"pay-with-credits-topup",onClick:g.onClick,disabled:r,children:n.jsx("span",{children:g.label})}):null,e.map(p=>p.method==="credits"?n.jsxs(X,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:r,children:[n.jsx("span",{children:c??b("buyModal.buy")}),w?n.jsxs($,{children:[n.jsx(M,{}),n.jsx("span",{children:A(W(p.creditsCents))})]}):null]},"credits"):p.method==="mana"?n.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:r,children:[n.jsx("span",{children:b("buyModal.buyWithMana")}),n.jsxs($,{children:[n.jsx(P,{children:n.jsx("img",{src:E,alt:"","aria-hidden":!0})}),n.jsx("span",{children:z(p.manaWei)})]})]},"mana"):n.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:r,children:[n.jsx("span",{children:b("buyModal.buyWith")}),n.jsxs($,{children:[n.jsx(M,{}),n.jsx("span",{children:A(W(p.creditsCents))}),n.jsx(We,{children:"+"}),n.jsx(P,{children:n.jsx("img",{src:E,alt:"","aria-hidden":!0})}),n.jsx("span",{children:z(p.manaWei)}),n.jsx(ze,{children:"MANA"})]})]},"combined")),h?n.jsxs(n.Fragment,{children:[n.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[n.jsx("span",{children:b("buyModal.buyWithMana")}),n.jsxs($,{children:[n.jsx(P,{children:n.jsx("img",{src:E,alt:"","aria-hidden":!0})}),n.jsx("span",{children:z(h.manaWei)})]})]},"mana-short"),n.jsx(Te,{"data-testid":"mana-shortfall-note",children:b("buyModal.manaWorth",{mana:z(h.manaWei),credits:A(W(h.manaCents)),price:A(W(h.priceCents)),currency:ce.name})})]}):null,l?n.jsx($e,{"data-testid":"mana-rate-note",children:l}):null,n.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:t})]})}function vt(e,t){const i=(r,...l)=>void e.invalidateQueries({queryKey:t?[r,...l]:[r]});e.invalidateQueries({queryKey:["usd-balance"]}),e.invalidateQueries({queryKey:["detail-trade"]}),e.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),i("public-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),i("item-resales",t==null?void 0:t.contractAddress,t==null?void 0:t.itemId),e.invalidateQueries({queryKey:["shop-items"]}),e.invalidateQueries({queryKey:["catalog-items"]}),e.invalidateQueries({queryKey:["overview-listings"]}),e.invalidateQueries({queryKey:["upsell-listings"]}),e.invalidateQueries({queryKey:["my-assets"]}),e.invalidateQueries({queryKey:["purchases"]}),e.invalidateQueries({queryKey:["owned-item-count"]})}const Be=le`
|
|
113
113
|
to { transform: rotate(360deg); }
|
|
114
114
|
`,Ie=a.div`
|
|
115
115
|
position: fixed;
|
|
@@ -210,12 +210,12 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
210
210
|
font-size: 13px;
|
|
211
211
|
line-height: 1.45;
|
|
212
212
|
color: ${d.colors.muted};
|
|
213
|
-
`,
|
|
213
|
+
`,Oe=a.p`
|
|
214
214
|
margin: 0;
|
|
215
215
|
font-size: 12px;
|
|
216
216
|
line-height: 1.5;
|
|
217
217
|
color: ${d.colors.muted2};
|
|
218
|
-
`,
|
|
218
|
+
`,qe=a.div`
|
|
219
219
|
display: flex;
|
|
220
220
|
gap: 12px;
|
|
221
221
|
|
|
@@ -289,7 +289,7 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function kt({auth:e,signer:t,title:i,reason:r,name:l,image:c,icon:h,onAuthorized:w,onCancel:g,onClose:u}){const[p,y]=k.useState(!1),[o,f]=k.useState(null);async function v(){y(!0),f(null);try{await xe({auth:e,signer:t,active:!0}),w()}catch(x){ge(x)?f(b("authorizeStep.errorRejected")):(pe(x,{flow:"authorize_step",kind:e.kind}),f(b("authorizeStep.errorGeneric"))),y(!1)}}return n.jsx(Ie,{onClick:p?void 0:u,role:"presentation",children:n.jsxs(Ee,{onClick:x=>x.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[n.jsxs(Ne,{children:[n.jsx(Pe,{children:i}),n.jsx(Se,{onClick:u,disabled:p,"aria-label":b("authorizeStep.close"),children:n.jsx(K,{name:"close",className:"ico"})})]}),n.jsxs(Fe,{"data-testid":"authorize-step-row",children:[n.jsx(Ve,{children:c?n.jsx("img",{src:c,alt:""}):h}),n.jsxs(Le,{children:[n.jsx(De,{title:l,children:l}),n.jsx(Re,{children:r})]})]}),n.jsx(
|
|
292
|
+
`;function kt({auth:e,signer:t,title:i,reason:r,name:l,image:c,icon:h,onAuthorized:w,onCancel:g,onClose:u}){const[p,y]=k.useState(!1),[o,f]=k.useState(null);async function v(){y(!0),f(null);try{await xe({auth:e,signer:t,active:!0}),w()}catch(x){ge(x)?f(b("authorizeStep.errorRejected")):(pe(x,{flow:"authorize_step",kind:e.kind}),f(b("authorizeStep.errorGeneric"))),y(!1)}}return n.jsx(Ie,{onClick:p?void 0:u,role:"presentation",children:n.jsxs(Ee,{onClick:x=>x.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[n.jsxs(Ne,{children:[n.jsx(Pe,{children:i}),n.jsx(Se,{onClick:u,disabled:p,"aria-label":b("authorizeStep.close"),children:n.jsx(K,{name:"close",className:"ico"})})]}),n.jsxs(Fe,{"data-testid":"authorize-step-row",children:[n.jsx(Ve,{children:c?n.jsx("img",{src:c,alt:""}):h}),n.jsxs(Le,{children:[n.jsx(De,{title:l,children:l}),n.jsx(Re,{children:r})]})]}),n.jsx(Oe,{children:b("authorizeStep.note")}),n.jsx(fe,{message:o}),n.jsxs(qe,{children:[n.jsx(Xe,{type:"button",onClick:g,disabled:p,children:b("authorizeStep.cancel")}),n.jsx(He,{type:"button","data-testid":"authorize-step-action",onClick:()=>void v(),disabled:p,children:p?n.jsxs(n.Fragment,{children:[n.jsx(Ke,{"aria-hidden":!0}),b("authorizeStep.authorizing")]}):b("authorizeStep.authorize")})]})]})})}const jt="data:image/webp;base64,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",Ct="https://cdn.decentraland.org/@dcl/shop/1.3.1-31191272241.commit-33233c2/_assets/buy-error-22UunaPC.png";async function Mt(e){const[t]=await oe({...e,trades:[e.trade]});return t}async function At(e){const[t]=await oe({...e,trades:[],mints:[e.mint]});return t}async function oe(e){const{trades:t,mints:i=[],buyer:r,signer:l,onSigned:c}=e;if(t.length===0&&i.length===0)throw new Error("No items to buy");const h=new Map;for(const u of t){const p=`${u.chainId}:${u.contract.toLowerCase()}`,y=h.get(p);y?y.push(u):h.set(p,[u])}const w=new Map;for(const u of i){const p=w.get(u.chainId);p?p.push(u):w.set(u.chainId,[u])}const g=[];for(const u of h.values())g.push(await Ue({trades:u,buyer:r,signer:l,onSigned:c}));for(const[u,p]of w)g.push(await Qe({mints:p,chainId:u,buyer:r,signer:l,onSigned:c}));return g}async function Ue(e){const{trades:t,buyer:i,signer:r,onSigned:l}=e,c=t[0],h=j(U(c.contract),c.chainId),w=j(C.MANAToken,c.chainId);await F({auth:{kind:V.Allowance,contractAddress:w.address,spenderAddress:h.address,chainId:c.chainId},signer:r});const g=t.map(o=>be(o,i));if(B.enabled)try{const o=new ve(h.abi).encodeFunctionData("accept",[g]),f=Z(),v=J(r.provider,f),x=await ee(v,f,o,h,{serverURL:B.relayerUrl});return l==null||l(),await Y(x,"the MANA purchase"),x}catch(o){if(o instanceof te&&o.code===ae.USER_DENIED||o instanceof G)throw o;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",o)}await Q(r.provider,c.chainId);const p=await new ne(h.address,h.abi,r).accept(g,_(c.chainId));return l==null||l(),(await p.wait()).transactionHash}async function Qe(e){const{mints:t,chainId:i,buyer:r,signer:l,onSigned:c}=e,h=j(C.CollectionStore,i),w=j(C.MANAToken,i),g=t.map(o=>o.item);if(await F({auth:{kind:V.Allowance,contractAddress:w.address,spenderAddress:h.address,chainId:i},signer:l}),B.enabled)try{const o=we(g,r,h.abi),f=Z(),v=J(l.provider,f),x=await ee(v,f,o,h,{serverURL:B.relayerUrl});return c==null||c(),await Y(x,"the MANA purchase"),x}catch(o){if(o instanceof te&&o.code===ae.USER_DENIED||o instanceof G)throw o;console.warn("[buyMintWithMana] gasless meta-tx failed, falling back to a direct tx:",o)}await Q(l.provider,i);const p=await new ne(h.address,h.abi,l).buy(ye(g,r),_(i));return c==null||c(),(await p.wait()).transactionHash}async function zt(e){const{trade:t,...i}=e;return re({target:{kind:"trade",trade:t},...i})}async function Wt(e){const{mint:t,...i}=e;return re({target:{kind:"store",mint:t},...i})}async function re(e){const{target:t,buyer:i,signer:r,credits:l,manaGapWei:c,onBroadcast:h,onReverted:w}=e;if(l.length===0)throw new Error("No credits to spend — use the MANA-only rail for that");if(c<=0n)throw new Error("No MANA gap to cover — use the credits-only rail for that");const g=se(t),u=j(C.MANAToken,g),p=j(C.CreditsManager,g);await F({auth:{kind:V.Allowance,contractAddress:u.address,spenderAddress:p.address,chainId:g},signer:r});const o=(l.reduce((f,v)=>f+BigInt(v.availableAmount),0n)+c).toString();return me({purchase:Ze(t,l,o),buyer:i,signer:r,onBroadcast:h,onReverted:w})}function se(e){return e.kind==="trade"?e.trade.chainId:e.mint.chainId}function Ze(e,t,i){return e.kind==="trade"?{kind:"trade",trade:e.trade,credits:t,maxCreditedValue:i}:{kind:"store",item:e.mint.item,chainId:e.mint.chainId,credits:t,maxCreditedValue:i}}function $t(e,t){const i=se(t);return e==="combined"?{spender:j(C.CreditsManager,i).address,chainId:i}:{spender:t.kind==="trade"?j(U(t.trade.contract),i).address:j(C.CollectionStore,i).address,chainId:i}}function Tt(e){return n.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...e,children:n.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function Bt(e){return n.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...e,children:n.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:s,gradients:L,radius:de,z:Je}=d,It=a.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
295
|
z-index: ${Je.overlay};
|
|
@@ -366,10 +366,10 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
366
366
|
width: 14px;
|
|
367
367
|
height: 14px;
|
|
368
368
|
background: ${s.text};
|
|
369
|
-
`,
|
|
369
|
+
`,Ot=a.span`
|
|
370
370
|
font-size: 14px;
|
|
371
371
|
color: ${s.text};
|
|
372
|
-
`,
|
|
372
|
+
`,qt=a.div`
|
|
373
373
|
display: flex;
|
|
374
374
|
flex-direction: column;
|
|
375
375
|
gap: 24px;
|
|
@@ -453,7 +453,7 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
453
453
|
width: 18px;
|
|
454
454
|
height: 18px;
|
|
455
455
|
background: ${s.text2};
|
|
456
|
-
`,
|
|
456
|
+
`,Yt=a.div`
|
|
457
457
|
display: flex;
|
|
458
458
|
align-items: flex-start;
|
|
459
459
|
gap: 12px;
|
|
@@ -464,7 +464,7 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
464
464
|
& > svg {
|
|
465
465
|
flex-shrink: 0;
|
|
466
466
|
}
|
|
467
|
-
`,
|
|
467
|
+
`,Gt=a.p`
|
|
468
468
|
margin: 0;
|
|
469
469
|
font-size: 14px;
|
|
470
470
|
line-height: 1.334;
|
|
@@ -733,9 +733,9 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
733
733
|
text-align: center;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
`,{colors:D,media:T}=d,
|
|
736
|
+
`,{colors:D,media:T}=d,Ye=a.section`
|
|
737
737
|
margin-top: 40px;
|
|
738
|
-
`,
|
|
738
|
+
`,Ge=a.div`
|
|
739
739
|
display: flex;
|
|
740
740
|
align-items: center;
|
|
741
741
|
justify-content: space-between;
|
|
@@ -869,4 +869,4 @@ import{j as n,r as k}from"./react-BYHuwl8r.js";import{s as a,t as d,b,y as M,K a
|
|
|
869
869
|
opacity: 1;
|
|
870
870
|
transform: scale(1.1);
|
|
871
871
|
}
|
|
872
|
-
`;function ya({title:e,items:t,onViewAll:i}){const r=k.useRef(null),[l,c]=k.useState(1),[h,w]=k.useState(0),[g,u]=k.useState(!0),[p,y]=k.useState(!1),o=k.useCallback(()=>{const x=r.current;if(!x)return;const{scrollLeft:m,scrollWidth:R,clientWidth:I}=x,
|
|
872
|
+
`;function ya({title:e,items:t,onViewAll:i}){const r=k.useRef(null),[l,c]=k.useState(1),[h,w]=k.useState(0),[g,u]=k.useState(!0),[p,y]=k.useState(!1),o=k.useCallback(()=>{const x=r.current;if(!x)return;const{scrollLeft:m,scrollWidth:R,clientWidth:I}=x,O=Math.max(1,Math.ceil(R/I));c(O),w(Math.min(O-1,Math.round(m/I))),u(m<=1),y(m+I>=R-1)},[]);if(k.useEffect(()=>{o();const x=r.current;if(x)return x.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",o),()=>{x.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t.length]),t.length===0)return null;function f(x){const m=r.current;m&&m.scrollBy({left:x*m.clientWidth,behavior:"smooth"})}function v(x){const m=r.current;m&&m.scrollTo({left:x*m.clientWidth,behavior:"smooth"})}return n.jsxs(Ye,{"data-testid":"carousel",children:[n.jsxs(Ge,{children:[n.jsx(_e,{children:e}),i?n.jsxs(et,{onClick:i,children:[b("collectionCarousel.viewAll"),n.jsx(tt,{name:"chevron-down",size:16})]}):null]}),n.jsxs(at,{children:[n.jsx(H,{"data-side":"left",onClick:()=>f(-1),"aria-label":b("collectionCarousel.scrollLeft"),disabled:g,children:n.jsx("img",{src:q,alt:"","aria-hidden":!0})}),n.jsx(nt,{ref:r,children:t.map(x=>n.jsx(ue,{item:x},x.id))}),n.jsx(H,{"data-side":"right",onClick:()=>f(1),"aria-label":b("collectionCarousel.scrollRight"),disabled:p,children:n.jsx("img",{src:q,alt:"","aria-hidden":!0})})]}),l>1?n.jsx(it,{"aria-label":b("collectionCarousel.pages"),children:Array.from({length:l}).map((x,m)=>n.jsx(ot,{"data-active":m===h||void 0,"aria-label":b("collectionCarousel.goToPage",{page:m+1}),"aria-current":m===h?"true":void 0,onClick:()=>v(m)},m))}):null]})}export{$t as $,Xt as A,Lt as B,Nt as C,ta as D,aa as E,jt as F,na as G,Pt as H,ia as I,oa as J,ra as K,pa as L,It as M,sa as N,da as O,yt as P,ft as Q,gt as R,Et as S,Ft as T,ya as U,kt as V,Yt as W,Vt as X,E as Y,xt as Z,vt as _,St as a,oe as a0,mt as a1,Ce as a2,Ze as a3,se as a4,W as a5,ba as a6,wa as a7,Mt as a8,At as a9,bt as aa,zt as ab,Wt as ac,Tt as b,Dt as c,Rt as d,Ot as e,qt as f,ha as g,ua as h,Ct as i,xa as j,ca as k,la as l,wt as m,ga as n,fa as o,ma as p,Bt as q,Gt as r,_t as s,Ht as t,Kt as u,Ut as v,Qt as w,Zt as x,Jt as y,ea as z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as o,_ as a}from"./index-
|
|
2
|
+
import{s as o,_ as a}from"./index-CHVlPVbz.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|