@dcl/shop 1.2.1-31141894504.commit-b6f2fa5 → 1.2.1-31142439693.commit-a969523
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-CM1koIWA.js → Activity-DtAgXXCT.js} +6 -6
- package/_assets/{AnimatedBackground-Dq4kMaMJ.js → AnimatedBackground-CnnsXeoK.js} +1 -1
- package/_assets/{Assets-CrYK64oM.js → Assets-hx7JMCN0.js} +14 -14
- package/_assets/{Assets.styles-DQJDvpwk.js → Assets.styles-DtgnO29f.js} +1 -1
- package/_assets/{Authorizations-CLlifjsF.js → Authorizations-DzTKBSVf.js} +3 -3
- package/_assets/Cart-BqUoFGZz.js +696 -0
- package/_assets/{CircularProgress-5u3Axs4r.js → CircularProgress-Bt02mjw_.js} +4 -4
- package/_assets/{Collection-CrmOtKVR.js → Collection-CSymTeiW.js} +7 -7
- package/_assets/CollectionCarousel-BHi1lOAm.js +872 -0
- package/_assets/{Confetti-CcphdN06.js → Confetti-CSaXhKTq.js} +1 -1
- package/_assets/{Creator-Cpmty4q3.js → Creator-2cfgxPtY.js} +23 -23
- package/_assets/{ErrorNotice-DcMjmsY0.js → ErrorNotice-0NvsaYP0.js} +1 -1
- package/_assets/{ExchangeController-DuNjedyi.js → ExchangeController-B0-44Nrf.js} +1 -1
- package/_assets/{Faq-BZT-Tuv2.js → Faq-mzdsoq0B.js} +1 -1
- package/_assets/{GetCredits-CQ4C143X.js → GetCredits-BSJYerKi.js} +18 -18
- package/_assets/{Grow-C1qF8Gbp.js → Grow-Da4gzbLC.js} +1 -1
- package/_assets/{HelpersUtil-YUnnMEbv.js → HelpersUtil-BLIxVj9G.js} +1 -1
- package/_assets/ItemDetail-kGFBR3jS.js +3577 -0
- package/_assets/LazyEmoteControls-BnECp0aE.js +2 -0
- package/_assets/{LoadMore-ChE3Ywf2.js → LoadMore-BfbFOkVA.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-YQt9G2FY.js → ManaPricingBanner.styles-eTz7141b.js} +1 -1
- package/_assets/{MyAssets-g4TFZ7e2.js → MyAssets-BQBGBYJ4.js} +5 -5
- package/_assets/{MyFavorites-BHIx442Q.js → MyFavorites-itVWbQyG.js} +1 -1
- package/_assets/{NotFound-Mnz4Ucj1.js → NotFound-ClcitxX9.js} +1 -1
- package/_assets/{NotificationsBell-Cfum40NV.js → NotificationsBell-DYyz5Z30.js} +1 -1
- package/_assets/{OutfitDetail-DYlB-_2t.js → OutfitDetail-rhuHdZzd.js} +13 -13
- package/_assets/{OutfitPreview-CKBV79hH.js → OutfitPreview-xwSnAhYs.js} +2 -2
- package/_assets/{OutfitStudio-D5ASiVh6.js → OutfitStudio-DWy69hUm.js} +11 -11
- package/_assets/{StoreSettings-EwiANufQ.js → StoreSettings-DsGSXrBp.js} +5 -5
- package/_assets/{Success-DEpy1BVd.js → Success-G5l6QxgG.js} +4 -4
- package/_assets/{SwapController-CoZyRCI2.js → SwapController-hERckBOO.js} +1 -1
- package/_assets/{Tooltip-bEqHt7Cn.js → Tooltip-s0TNYj5M.js} +1 -1
- package/_assets/TradeService-Deg8nYhU.js +1 -0
- package/_assets/{W3MFrameProviderSingleton-DUGxXY3k.js → W3MFrameProviderSingleton-D_Fx5Qnc.js} +3 -3
- package/_assets/{WebCryptoP256-D8VfrUWY.js → WebCryptoP256-DQLZJbaq.js} +1 -1
- package/_assets/authorizations-wKbFlO5x.js +1 -0
- package/_assets/{basic-C5bTQfXn.js → basic-Bpe6qcyh.js} +1 -1
- package/_assets/{biconomy-DMDUbT_l.js → biconomy-BTJZXNhm.js} +1 -1
- package/_assets/{builder-J1muoe18.js → builder-BS9Rx5sx.js} +1 -1
- package/_assets/buy-UqWzJLrd.js +1 -0
- package/_assets/buy-gasless-Bd8h9qj8.js +1 -0
- package/_assets/{categories-BvYy29PG.js → categories-_W94SZgq.js} +4 -4
- package/_assets/{ccip-Be222yLp.js → ccip-02nRZYa-.js} +1 -1
- package/_assets/{ccip-nElUyFDJ.js → ccip-BiSZjZqZ.js} +1 -1
- package/_assets/{collectionPage.styles-BbghKEPw.js → collectionPage.styles-DhEeJdUw.js} +1 -1
- package/_assets/{controller-C2j748IT.js → controller-CggAxrrE.js} +2 -2
- package/_assets/{core-f097495A.js → core-CZyP8iSR.js} +4 -4
- package/_assets/{createSvgIcon-BPThy2SY.js → createSvgIcon-BtYVYbOo.js} +4 -4
- package/_assets/{custom-Gy3d1Q7v.js → custom-kCagVi4J.js} +1 -1
- package/_assets/{data-capture-UKTvYwdc.js → data-capture-DHwSNcSI.js} +1 -1
- package/_assets/{email-DvKEgj9J.js → email-DiYf0nSr.js} +1 -1
- package/_assets/{embedded-wallet-_WiZLd4T.js → embedded-wallet-C1yc5YyF.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-D9bzEYCr.js → emotion-styled.browser.esm-CAcmb0zG.js} +1 -1
- package/_assets/{engine-6_t87ask.js → engine-DRKb0ESa.js} +1 -1
- package/_assets/{errors-Cpi20Vs-.js → errors-6i2tBDe2.js} +1 -1
- package/_assets/{estimate-l1-fee-DU4tQjK9.js → estimate-l1-fee-CbMRkZFx.js} +1 -1
- package/_assets/{execute-BQ_MXUy5.js → execute-DeKFAmT2.js} +2 -2
- package/_assets/{features-CK3qf9ZN.js → features-Df09iw3V.js} +1 -1
- package/_assets/{fetchTokenMetadata-BDm74qDJ.js → fetchTokenMetadata-CkFILxzR.js} +2 -2
- package/_assets/{field.styles-C157dq4J.js → field.styles-DgkVbXZK.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-B6cEjh69.js → get-ecosystem-wallet-info-06X4fJ1f.js} +1 -1
- package/_assets/{getBalance-7z75fs4x.js → getBalance-QURTYeZM.js} +1 -1
- package/_assets/{getNFT-kDrfcrTP.js → getNFT-BpsWGLZ0.js} +1 -1
- package/_assets/{getNFT-DHw--2hM.js → getNFT-n4tZruUk.js} +1 -1
- package/_assets/{grid.styles-BH-KolVj.js → grid.styles-DIsQjilj.js} +1 -1
- package/_assets/{hashTypedData-CaDI86G1.js → hashTypedData-C3bdM-ed.js} +1 -1
- package/_assets/{hashTypedData-BGaOoxNv.js → hashTypedData-hmrLDeWw.js} +1 -1
- package/_assets/{in-app-DrqEBa0Y.js → in-app-Dop16F3m.js} +1 -1
- package/_assets/{in-app-wallet-calls-BAuhvyqE.js → in-app-wallet-calls-qrIakhGH.js} +1 -1
- package/_assets/{index-DrKpI5CV.js → index--pbtXnHr.js} +1 -1
- package/_assets/{index-CkMBkM8p.js → index-1UvbgdV7.js} +1 -1
- package/_assets/{index-9sMHHA07.js → index-B24uRN2L.js} +1 -1
- package/_assets/{index-D5jn8moe.js → index-B63wWKv3.js} +1 -1
- package/_assets/{index-C54FYEkY.js → index-BIT2fuop.js} +1 -1
- package/_assets/{index-DYmMl9gi.js → index-BTpOCv_G.js} +2 -2
- package/_assets/{index-DmNnfRqv.js → index-Ba5mX7GE.js} +1 -1
- package/_assets/{index-CHtt63_F.js → index-BaV7GHs7.js} +1 -1
- package/_assets/{index-CZ3-3d7g.js → index-BcIU81N1.js} +1 -1
- package/_assets/{index-BUVnfVaQ.js → index-BqnKsNGN.js} +11 -11
- package/_assets/{index-B8eN0pGm.js → index-Bu_nC2zh.js} +1 -1
- package/_assets/{index-Belqsjsz.js → index-C1M1vpF2.js} +2 -2
- package/_assets/{index-I5oIRknD.js → index-C3Qst7_u.js} +1 -1
- package/_assets/{index-SOqtqcZc.js → index-CDWYqM-R.js} +1 -1
- package/_assets/{index-BcqoTa3F.js → index-CMpfyfVH.js} +1 -1
- package/_assets/{index-Cw_lQM7v.js → index-CRM0tQuJ.js} +3 -3
- package/_assets/{index-xKy8W33s.js → index-CYXkwKDK.js} +1 -1
- package/_assets/{index-SJTLPDcF.js → index-CaxXXe8a.js} +1 -1
- package/_assets/{index-NZ2EL1Va.js → index-CbnwOaSO.js} +1 -1
- package/_assets/{index--uqlDZSN.js → index-Ch8RmoYB.js} +3 -3
- package/_assets/{index-BRyz9uc0.js → index-CrnN4D6t.js} +1 -1
- package/_assets/{index-Z9Zfp-cE.js → index-CsWQDO0p.js} +1 -1
- package/_assets/{index-CvCTehG1.js → index-D0HBofqu.js} +1 -1
- package/_assets/{index-DdAqmPp5.js → index-D1jSn17G.js} +1 -1
- package/_assets/{index-B2SrFRWu.js → index-D6W-ssbk.js} +1 -1
- package/_assets/{index-weRQS8GT.js → index-D90XRm-b.js} +2 -2
- package/_assets/{index-BvWni_zR.js → index-DA3RHBR9.js} +1 -1
- package/_assets/{index-nfyZZM7e.js → index-DKeNYaIv.js} +1 -1
- package/_assets/{index-BNYb6-ew.js → index-DLLMEbOW.js} +1 -1
- package/_assets/{index-ltLkjfx-.js → index-DO6dqxin.js} +1 -1
- package/_assets/{index-BjuwD4ba.js → index-DPgJwAOQ.js} +1 -1
- package/_assets/{index-BOFN8WyJ.js → index-DRGYHCXS.js} +1 -1
- package/_assets/{index-CgxH7rfI.js → index-DTvpdZer.js} +1 -1
- package/_assets/{index-D5G95QTd.js → index-DcZ5vB6B.js} +1 -1
- package/_assets/{index-wq8907gu.js → index-DjINSqpE.js} +1 -1
- package/_assets/{index-C83EM4_2.js → index-DkWl1-aW.js} +1 -1
- package/_assets/{index-sl5wwK2w.js → index-DlEvJaCI.js} +1 -1
- package/_assets/{index-DQABJ8K0.js → index-DpGCSQLE.js} +15 -15
- package/_assets/{index-DuI636q2.js → index-DrDh6kJD.js} +1 -1
- package/_assets/{index-DFA-jQh0.js → index-Dy6UVXdT.js} +1 -1
- package/_assets/{index-Bn_uaVAp.js → index-Gh2kxtZ1.js} +1 -1
- package/_assets/{index-Dl52ODHX.js → index-Hj_qmrz7.js} +1 -1
- package/_assets/{index-eTdhHjMt.js → index-OjaAcTcB.js} +1 -1
- package/_assets/{index-dkB19blA.js → index-hzSqXU_z.js} +1 -1
- package/_assets/{index-Bi66sVRq.js → index-m_WXdpSW.js} +1 -1
- package/_assets/{index-BO1L1qum.js → index-neSmYai8.js} +1 -1
- package/_assets/{index-BiduFohT.js → index-p3jzX3Dp.js} +1 -1
- package/_assets/{index-D-gAiVLP.js → index-pLQZDPby.js} +1 -1
- package/_assets/{index-B1zKymDP.js → index-uw4A4GZs.js} +1 -1
- package/_assets/{index-BXKEFlSU.js → index-vluHWSLX.js} +1 -1
- package/_assets/{index-C5p9LpAs.js → index-xzlBx1sl.js} +3 -3
- package/_assets/{index-jVj4M1cT.js → index-zVh5mssM.js} +2 -2
- package/_assets/{index.es-CEBpPlnr.js → index.es-BbmCqadP.js} +1 -1
- package/_assets/{index.es-x1vwNVlm.js → index.es-BeBKvNCp.js} +4 -4
- package/_assets/{index.es-DNO5glcp.js → index.es-GKA-mQNj.js} +1 -1
- package/_assets/{localBatchGatewayRequest-BBjlnRHt.js → localBatchGatewayRequest-pu8z2ERk.js} +1 -1
- package/_assets/{networks-C13WwFhP.js → networks-DH7iisn_.js} +1 -1
- package/_assets/{onramp-CT1_T902.js → onramp-CO5njnwi.js} +1 -1
- package/_assets/{openzeppelin-RUjzfcX-.js → openzeppelin-DCWYE1qx.js} +1 -1
- package/_assets/{parseNft-BAvhvBPX.js → parseNft-z460Co-M.js} +2 -2
- package/_assets/{parseSignature-Czi9dqhR.js → parseSignature-Cu26nEOr.js} +1 -1
- package/_assets/{parseSignature-BEQJi4cu.js → parseSignature-mSTxabCk.js} +3 -3
- package/_assets/{passkeys-Du42r5sF.js → passkeys-DEfVOHaG.js} +1 -1
- package/_assets/{pay-with-exchange-CrTCM_iG.js → pay-with-exchange-LJPmHLUo.js} +1 -1
- package/_assets/{qr-overlay-CG31oj34.js → qr-overlay-WuQCOEnK.js} +1 -1
- package/_assets/{receive-DGKxxBjv.js → receive-CZY82LDL.js} +1 -1
- package/_assets/{resolveImplementation-8tujOofo.js → resolveImplementation-Br9IvPvw.js} +1 -1
- package/_assets/{rpc-sUrtbSyk.js → rpc-BuUGT4bd.js} +1 -1
- package/_assets/{secp256k1-CvuUaHW6.js → secp256k1-C8sSBqLR.js} +1 -1
- package/_assets/{secp256k1-DgwVchLn.js → secp256k1-D5Uouftx.js} +1 -1
- package/_assets/{secp256k1-ilN5uvc6.js → secp256k1-xdcv-1Zc.js} +1 -1
- package/_assets/{send-OsD6mp8d.js → send-DASjwbkR.js} +1 -1
- package/_assets/{send-batch-transaction-Dv9gFlBz.js → send-batch-transaction-Bkd7YxmR.js} +1 -1
- package/_assets/{send-eip712-transaction-CInEXRsx.js → send-eip712-transaction-lClcIpxR.js} +2 -2
- package/_assets/{send-gasless-transaction-XefHv_Ab.js → send-gasless-transaction-DiXCfoWk.js} +2 -2
- package/_assets/{send-transaction-DxKCtc6J.js → send-transaction-DBwREW4f.js} +2 -2
- package/_assets/{sendMetaTransaction-DeQMn9dR.js → sendMetaTransaction-DpQSFeja.js} +1 -1
- package/_assets/{sendRawTransaction-CcN1UESp.js → sendRawTransaction-QjR7Mrk5.js} +3 -3
- package/_assets/{serializeTransaction-LQsz0xpR.js → serializeTransaction-3ucIMkUg.js} +1 -1
- package/_assets/{session-proposal-3C-xhn_b.js → session-proposal-Dxff0Akg.js} +1 -1
- package/_assets/{session-request-Bi-TCd-V.js → session-request-ssiJ7nbB.js} +2 -2
- package/_assets/{signing-DTvtfW1Y.js → signing-E5Tx4fnq.js} +3 -3
- package/_assets/{skeleton.styles-BvHHSxH_.js → skeleton.styles-DSss7Hvt.js} +1 -1
- package/_assets/{socials-EGhIb5vA.js → socials-CZtXsWFj.js} +1 -1
- package/_assets/{styled-Dsdo2L_S.js → styled-mpKAKymu.js} +1 -1
- package/_assets/{swaps-BWOQdX7L.js → swaps-DhqmU1zN.js} +1 -1
- package/_assets/{thirdweb-Bq55eHvp.js → thirdweb-C9XFAOy-.js} +3 -3
- package/_assets/{to-serializable-transaction-BdqklZjW.js → to-serializable-transaction-B1znWVBM.js} +2 -2
- package/_assets/{transactionReceipt-C327RjFG.js → transactionReceipt-AJBmmU6y.js} +1 -1
- package/_assets/{transactions-DH_45ulx.js → transactions-C7NN4Hbg.js} +1 -1
- package/_assets/useCreditPacks-Xxhfshoe.js +1 -0
- package/_assets/useImportable-L61GtYLe.js +1 -0
- package/_assets/{useInfiniteGrid-aYtSr9OS.js → useInfiniteGrid-BpmrN-OG.js} +1 -1
- package/_assets/useTheme-CS8bbfCV.js +1 -0
- package/_assets/{verifyHash-Dmswiq1P.js → verifyHash-y4_EC9ki.js} +1 -1
- package/_assets/{w3m-modal-zYlOO-nX.js → w3m-modal-DMYEmTSP.js} +1 -1
- package/_assets/{w3m-modal-CSxNzBHa.js → w3m-modal-ioH5fU7r.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DUa6TPtN.js → wait-for-tx-receipt--im-EDrb.js} +1 -1
- package/_assets/{wallets-D4CLBrkx.js → wallets-Bw_sdm6c.js} +5 -5
- package/_assets/{web-connector-DfuXXolQ.js → web-connector-BPwfErmk.js} +3 -3
- package/_assets/{writeContract-CuhRFcNu.js → writeContract-DPM8gJaJ.js} +1 -1
- package/_assets/{zoraTestnet-j-CjVgGQ.js → zoraTestnet-DglcCRA9.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-BTdBdLSV.js +0 -696
- package/_assets/CollectionCarousel-BNRsg5LI.js +0 -872
- package/_assets/ItemDetail-DIJVogYi.js +0 -3577
- package/_assets/LazyEmoteControls-B9ed76Uk.js +0 -2
- package/_assets/TradeService-zAix_pZH.js +0 -1
- package/_assets/authorizations-BG0JBYIM.js +0 -1
- package/_assets/buy-C7GNfKVo.js +0 -1
- package/_assets/buy-gasless-CGeRTZTF.js +0 -1
- package/_assets/useCreditPacks-ohAn5pNf.js +0 -1
- package/_assets/useImportable-CTHYEKOm.js +0 -1
- package/_assets/useTheme-DErq2cgw.js +0 -1
package/_assets/Cart-BTdBdLSV.js
DELETED
|
@@ -1,696 +0,0 @@
|
|
|
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
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,qs=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${se.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,Bs=i.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 12px;
|
|
17
|
-
/* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
|
|
18
|
-
the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
|
|
19
|
-
explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
|
|
20
|
-
collapse to nothing on a short screen. */
|
|
21
|
-
min-height: 120px;
|
|
22
|
-
max-height: 360px;
|
|
23
|
-
overflow-y: auto;
|
|
24
|
-
width: 100%;
|
|
25
|
-
scrollbar-width: thin;
|
|
26
|
-
scrollbar-color: #a2a2a2 ${se.media};
|
|
27
|
-
|
|
28
|
-
&::-webkit-scrollbar {
|
|
29
|
-
width: 8px;
|
|
30
|
-
}
|
|
31
|
-
&::-webkit-scrollbar-track {
|
|
32
|
-
background: ${se.media};
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
}
|
|
35
|
-
&::-webkit-scrollbar-thumb {
|
|
36
|
-
background: #a2a2a2;
|
|
37
|
-
border-radius: ${Es.btn};
|
|
38
|
-
}
|
|
39
|
-
`,_s=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${se.muted};
|
|
44
|
-
`,Fs=i.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
gap: 12px;
|
|
49
|
-
padding: 0 0 12px;
|
|
50
|
-
font-size: 14px;
|
|
51
|
-
color: ${se.muted};
|
|
52
|
-
|
|
53
|
-
& strong {
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 6px;
|
|
57
|
-
font-size: 20px;
|
|
58
|
-
font-weight: 700;
|
|
59
|
-
color: ${se.text};
|
|
60
|
-
}
|
|
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
|
-
max-width: 1510px;
|
|
63
|
-
margin: 0 auto;
|
|
64
|
-
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
-
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
-
width: 100%;
|
|
67
|
-
flex: 1 0 auto;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
|
|
71
|
-
${I} {
|
|
72
|
-
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
-
}
|
|
74
|
-
`,kt=i.button`
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 6px;
|
|
78
|
-
margin: 0 0 16px;
|
|
79
|
-
padding: 0;
|
|
80
|
-
border: 0;
|
|
81
|
-
background: none;
|
|
82
|
-
color: ${o.text2};
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
letter-spacing: 0.02em;
|
|
86
|
-
text-transform: uppercase;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
transition: color 0.15s ease;
|
|
89
|
-
|
|
90
|
-
&:hover {
|
|
91
|
-
color: ${o.accent};
|
|
92
|
-
}
|
|
93
|
-
& .ico {
|
|
94
|
-
width: 18px;
|
|
95
|
-
height: 18px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${I} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,Qs=i.div`
|
|
102
|
-
display: grid;
|
|
103
|
-
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
-
gap: 24px;
|
|
105
|
-
align-items: start;
|
|
106
|
-
|
|
107
|
-
${Pt} {
|
|
108
|
-
grid-template-columns: 1fr;
|
|
109
|
-
}
|
|
110
|
-
`,St=i.div`
|
|
111
|
-
position: relative;
|
|
112
|
-
/* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
|
|
113
|
-
this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
|
|
114
|
-
the page out BELOW the cross-sell, so a strip of gray showed under "You might also like" instead of the
|
|
115
|
-
footer. Giving the band its designed height puts the leftover space where the design wants it. */
|
|
116
|
-
min-height: 733px;
|
|
117
|
-
/* Gray below the panels so the band never hugs the last card: Figma's band runs y152–950 with the
|
|
118
|
-
content ending at 854. The min-height above only covers a SHORT cart — once the list outgrows it
|
|
119
|
-
the band tracks the content, and without this padding it would butt straight into the purple. */
|
|
120
|
-
padding-bottom: 96px;
|
|
121
|
-
|
|
122
|
-
&::before {
|
|
123
|
-
content: '';
|
|
124
|
-
position: absolute;
|
|
125
|
-
top: -28px;
|
|
126
|
-
bottom: 0;
|
|
127
|
-
left: 50%;
|
|
128
|
-
width: 100vw;
|
|
129
|
-
transform: translateX(-50%);
|
|
130
|
-
background: ${o.media};
|
|
131
|
-
z-index: 0;
|
|
132
|
-
}
|
|
133
|
-
& > * {
|
|
134
|
-
position: relative;
|
|
135
|
-
z-index: 1;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
${I} {
|
|
139
|
-
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
140
|
-
the bottom of it — a floor here would only add empty gray. */
|
|
141
|
-
min-height: 0;
|
|
142
|
-
|
|
143
|
-
/* The fixed summary bar already reserves room at the bottom on mobile (see Checkout). */
|
|
144
|
-
padding-bottom: 32px;
|
|
145
|
-
|
|
146
|
-
&::before {
|
|
147
|
-
top: -16px; /* .page's mobile padding */
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
`,Us=i.div`
|
|
151
|
-
min-width: 0;
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
gap: 12px;
|
|
155
|
-
`,Hs=i.div`
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
justify-content: space-between;
|
|
159
|
-
gap: 12px;
|
|
160
|
-
background: ${o.white};
|
|
161
|
-
border-radius: 16px;
|
|
162
|
-
padding: 12px 12px 12px 24px;
|
|
163
|
-
|
|
164
|
-
${I} {
|
|
165
|
-
gap: 8px;
|
|
166
|
-
padding: 8px 16px;
|
|
167
|
-
}
|
|
168
|
-
`,At=i.section`
|
|
169
|
-
min-width: 0;
|
|
170
|
-
background: ${o.white};
|
|
171
|
-
border-radius: 16px;
|
|
172
|
-
padding: 24px;
|
|
173
|
-
|
|
174
|
-
${I} {
|
|
175
|
-
padding: 16px;
|
|
176
|
-
}
|
|
177
|
-
`,Os=i(At)`
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-direction: column;
|
|
180
|
-
align-items: center;
|
|
181
|
-
justify-content: center;
|
|
182
|
-
gap: 24px;
|
|
183
|
-
min-height: 420px;
|
|
184
|
-
padding: 48px 16px;
|
|
185
|
-
text-align: center;
|
|
186
|
-
color: ${o.text};
|
|
187
|
-
|
|
188
|
-
${de.media.maxWidth("mobile")} {
|
|
189
|
-
min-height: 320px;
|
|
190
|
-
padding: 32px 16px;
|
|
191
|
-
}
|
|
192
|
-
`,Gs=i.div`
|
|
193
|
-
display: flex;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
align-items: center;
|
|
196
|
-
gap: 12px;
|
|
197
|
-
padding-bottom: 16px;
|
|
198
|
-
`,Vs=i.p`
|
|
199
|
-
margin: 0;
|
|
200
|
-
font-size: 24px;
|
|
201
|
-
font-weight: 700;
|
|
202
|
-
line-height: 1.6;
|
|
203
|
-
|
|
204
|
-
${de.media.maxWidth("mobile")} {
|
|
205
|
-
font-size: 20px;
|
|
206
|
-
}
|
|
207
|
-
`,Ds=i.p`
|
|
208
|
-
margin: 0;
|
|
209
|
-
font-size: 20px;
|
|
210
|
-
font-weight: 400;
|
|
211
|
-
line-height: 1.6;
|
|
212
|
-
|
|
213
|
-
${de.media.maxWidth("mobile")} {
|
|
214
|
-
font-size: 16px;
|
|
215
|
-
}
|
|
216
|
-
`,Js=i(Le)`
|
|
217
|
-
display: inline-flex;
|
|
218
|
-
align-items: center;
|
|
219
|
-
justify-content: center;
|
|
220
|
-
width: 310px;
|
|
221
|
-
max-width: 100%;
|
|
222
|
-
height: 56px;
|
|
223
|
-
padding: 0 12px;
|
|
224
|
-
border-radius: ${te.card};
|
|
225
|
-
background: ${o.accent};
|
|
226
|
-
color: ${o.softWhite};
|
|
227
|
-
font-size: 15px;
|
|
228
|
-
font-weight: 600;
|
|
229
|
-
line-height: 24px;
|
|
230
|
-
letter-spacing: 0.46px;
|
|
231
|
-
text-transform: uppercase;
|
|
232
|
-
text-decoration: none;
|
|
233
|
-
transition: background 0.15s ease;
|
|
234
|
-
|
|
235
|
-
&:hover {
|
|
236
|
-
background: ${o.accentHover};
|
|
237
|
-
}
|
|
238
|
-
&:focus-visible {
|
|
239
|
-
outline: 2px solid ${o.accent};
|
|
240
|
-
outline-offset: 2px;
|
|
241
|
-
}
|
|
242
|
-
`,Xs=i.button`
|
|
243
|
-
display: none;
|
|
244
|
-
|
|
245
|
-
${I} {
|
|
246
|
-
display: inline-flex;
|
|
247
|
-
align-items: center;
|
|
248
|
-
flex-shrink: 0;
|
|
249
|
-
border: 0;
|
|
250
|
-
background: none;
|
|
251
|
-
padding: 0;
|
|
252
|
-
color: ${o.text};
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
|
|
255
|
-
& .ico {
|
|
256
|
-
width: 20px;
|
|
257
|
-
height: 20px;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
`,Ys=i.h1`
|
|
261
|
-
margin: 0;
|
|
262
|
-
font-size: 14px;
|
|
263
|
-
font-weight: 600;
|
|
264
|
-
line-height: 1.57;
|
|
265
|
-
color: ${o.text};
|
|
266
|
-
|
|
267
|
-
${I} {
|
|
268
|
-
flex: 1;
|
|
269
|
-
min-width: 0;
|
|
270
|
-
font-size: 16px;
|
|
271
|
-
}
|
|
272
|
-
`,Zs=i.button`
|
|
273
|
-
display: inline-flex;
|
|
274
|
-
align-items: center;
|
|
275
|
-
justify-content: center;
|
|
276
|
-
gap: 8px;
|
|
277
|
-
height: 40px;
|
|
278
|
-
padding: 0 12px;
|
|
279
|
-
border: 2px solid ${o.text2};
|
|
280
|
-
border-radius: ${te.btn};
|
|
281
|
-
background: none;
|
|
282
|
-
color: ${o.text2};
|
|
283
|
-
font-size: 13px;
|
|
284
|
-
font-weight: 600;
|
|
285
|
-
line-height: 24px;
|
|
286
|
-
letter-spacing: 0.46px;
|
|
287
|
-
text-transform: uppercase;
|
|
288
|
-
white-space: nowrap;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
transition:
|
|
291
|
-
background 0.15s ease,
|
|
292
|
-
filter 0.15s ease;
|
|
293
|
-
|
|
294
|
-
/* Mixed from currentColor so the wash cannot drift from the border colour. */
|
|
295
|
-
&:hover:not(:disabled) {
|
|
296
|
-
background: color-mix(in srgb, currentColor 6%, transparent);
|
|
297
|
-
}
|
|
298
|
-
&:active:not(:disabled) {
|
|
299
|
-
filter: brightness(0.97);
|
|
300
|
-
}
|
|
301
|
-
&:disabled {
|
|
302
|
-
opacity: 0.55;
|
|
303
|
-
cursor: default;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/* Mobile keeps the full 40px button and thins the outline to 1px (1182:236892) rather than shrinking
|
|
307
|
-
the type, which had it reading smaller than the row title beside it. */
|
|
308
|
-
${I} {
|
|
309
|
-
border-width: 1px;
|
|
310
|
-
border-color: ${o.text};
|
|
311
|
-
color: ${o.text};
|
|
312
|
-
}
|
|
313
|
-
`,en=i.div`
|
|
314
|
-
display: flex;
|
|
315
|
-
flex-direction: column;
|
|
316
|
-
gap: 24px;
|
|
317
|
-
`,tn=i.div`
|
|
318
|
-
position: relative;
|
|
319
|
-
display: flex;
|
|
320
|
-
align-items: stretch;
|
|
321
|
-
gap: 12px;
|
|
322
|
-
background: ${o.white};
|
|
323
|
-
border: 1px solid ${o.gray4};
|
|
324
|
-
border-radius: ${te.card};
|
|
325
|
-
overflow: hidden;
|
|
326
|
-
|
|
327
|
-
&[data-unavailable] [data-thumb] {
|
|
328
|
-
opacity: 0.5;
|
|
329
|
-
}
|
|
330
|
-
&[data-unavailable] [data-check] {
|
|
331
|
-
display: none;
|
|
332
|
-
}
|
|
333
|
-
&[data-unavailable] [data-desc] {
|
|
334
|
-
opacity: 0.7;
|
|
335
|
-
}
|
|
336
|
-
`,an=i.div`
|
|
337
|
-
position: relative;
|
|
338
|
-
flex-shrink: 0;
|
|
339
|
-
width: 137.5px;
|
|
340
|
-
height: 137px;
|
|
341
|
-
background: ${o.media};
|
|
342
|
-
border-radius: ${te.card};
|
|
343
|
-
display: grid;
|
|
344
|
-
place-items: center;
|
|
345
|
-
overflow: hidden;
|
|
346
|
-
|
|
347
|
-
& img {
|
|
348
|
-
width: 83%;
|
|
349
|
-
height: 83%;
|
|
350
|
-
object-fit: contain;
|
|
351
|
-
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
${I} {
|
|
355
|
-
width: 120px;
|
|
356
|
-
height: 120px;
|
|
357
|
-
}
|
|
358
|
-
`,sn=i(Le)`
|
|
359
|
-
position: absolute;
|
|
360
|
-
inset: 0;
|
|
361
|
-
display: grid;
|
|
362
|
-
place-items: center;
|
|
363
|
-
`,nn=i.span`
|
|
364
|
-
position: absolute;
|
|
365
|
-
top: 7.5px;
|
|
366
|
-
left: 7.5px;
|
|
367
|
-
width: 20px;
|
|
368
|
-
height: 20px;
|
|
369
|
-
border-radius: 50%;
|
|
370
|
-
background: #34ce77;
|
|
371
|
-
display: grid;
|
|
372
|
-
place-items: center;
|
|
373
|
-
`,rn=i.div`
|
|
374
|
-
flex: 1;
|
|
375
|
-
min-width: 0;
|
|
376
|
-
display: flex;
|
|
377
|
-
flex-direction: column;
|
|
378
|
-
justify-content: space-between;
|
|
379
|
-
gap: 8px;
|
|
380
|
-
padding: 16px 8px;
|
|
381
|
-
|
|
382
|
-
${I} {
|
|
383
|
-
padding: 12px 4px 12px 0;
|
|
384
|
-
}
|
|
385
|
-
`,on=i.div`
|
|
386
|
-
display: flex;
|
|
387
|
-
flex-direction: column;
|
|
388
|
-
gap: 4px;
|
|
389
|
-
min-width: 0;
|
|
390
|
-
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
391
|
-
`,zt=Ke`
|
|
392
|
-
display: block;
|
|
393
|
-
font-size: 16px;
|
|
394
|
-
font-weight: 600;
|
|
395
|
-
line-height: 1.2;
|
|
396
|
-
color: ${o.text};
|
|
397
|
-
text-decoration: none;
|
|
398
|
-
overflow: hidden;
|
|
399
|
-
text-overflow: ellipsis;
|
|
400
|
-
white-space: nowrap;
|
|
401
|
-
|
|
402
|
-
a&:hover {
|
|
403
|
-
color: ${o.accent};
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
${I} {
|
|
407
|
-
white-space: normal;
|
|
408
|
-
display: -webkit-box;
|
|
409
|
-
-webkit-line-clamp: 2;
|
|
410
|
-
line-clamp: 2;
|
|
411
|
-
-webkit-box-orient: vertical;
|
|
412
|
-
}
|
|
413
|
-
`,cn=i.div`
|
|
414
|
-
${zt};
|
|
415
|
-
`,dn=i(Le)`
|
|
416
|
-
${zt};
|
|
417
|
-
`,ln=i(na)`
|
|
418
|
-
font-size: 10px;
|
|
419
|
-
line-height: 1.43;
|
|
420
|
-
color: ${o.muted};
|
|
421
|
-
|
|
422
|
-
& [data-avatar] {
|
|
423
|
-
display: none;
|
|
424
|
-
}
|
|
425
|
-
& [data-testid='creator-name'] {
|
|
426
|
-
font-size: 10px;
|
|
427
|
-
line-height: 1.43;
|
|
428
|
-
}
|
|
429
|
-
`,un=i.div`
|
|
430
|
-
display: flex;
|
|
431
|
-
align-items: center;
|
|
432
|
-
justify-content: space-between;
|
|
433
|
-
gap: 12px;
|
|
434
|
-
padding-right: 8px;
|
|
435
|
-
`,hn=i.div`
|
|
436
|
-
display: inline-flex;
|
|
437
|
-
align-items: center;
|
|
438
|
-
gap: 8px;
|
|
439
|
-
padding: 6px;
|
|
440
|
-
border: 0.5px solid ${o.muted2};
|
|
441
|
-
border-radius: ${te.pill};
|
|
442
|
-
`,$t=i.button`
|
|
443
|
-
display: grid;
|
|
444
|
-
place-items: center;
|
|
445
|
-
width: 16px;
|
|
446
|
-
height: 16px;
|
|
447
|
-
padding: 0;
|
|
448
|
-
border: 0;
|
|
449
|
-
background: none;
|
|
450
|
-
color: ${o.text};
|
|
451
|
-
cursor: pointer;
|
|
452
|
-
|
|
453
|
-
&:disabled {
|
|
454
|
-
color: ${o.muted2};
|
|
455
|
-
cursor: default;
|
|
456
|
-
}
|
|
457
|
-
`,pn=i.span`
|
|
458
|
-
min-width: 12px;
|
|
459
|
-
font-size: 14px;
|
|
460
|
-
font-weight: 500;
|
|
461
|
-
line-height: 1.2;
|
|
462
|
-
color: ${o.text};
|
|
463
|
-
text-align: center;
|
|
464
|
-
`,gn=i.div`
|
|
465
|
-
display: inline-flex;
|
|
466
|
-
align-items: center;
|
|
467
|
-
gap: 4px;
|
|
468
|
-
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
469
|
-
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
470
|
-
margin-left: auto;
|
|
471
|
-
font-size: 24px;
|
|
472
|
-
font-weight: 600;
|
|
473
|
-
color: ${o.text2};
|
|
474
|
-
|
|
475
|
-
${I} {
|
|
476
|
-
font-size: 20px;
|
|
477
|
-
}
|
|
478
|
-
`,mn=i(Mt)`
|
|
479
|
-
width: 24px;
|
|
480
|
-
height: 24px;
|
|
481
|
-
background: ${o.text};
|
|
482
|
-
|
|
483
|
-
${I} {
|
|
484
|
-
width: 20px;
|
|
485
|
-
height: 20px;
|
|
486
|
-
}
|
|
487
|
-
`,xn=i.span`
|
|
488
|
-
margin-left: 6px;
|
|
489
|
-
font-size: 14px;
|
|
490
|
-
font-weight: 500;
|
|
491
|
-
color: ${o.muted};
|
|
492
|
-
text-decoration: line-through;
|
|
493
|
-
`,fn=i.div`
|
|
494
|
-
position: absolute;
|
|
495
|
-
top: 9px;
|
|
496
|
-
right: 7px;
|
|
497
|
-
display: flex;
|
|
498
|
-
align-items: flex-start;
|
|
499
|
-
gap: 12px;
|
|
500
|
-
`,yn=i.span`
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
gap: 4px;
|
|
504
|
-
font-size: 12px;
|
|
505
|
-
font-weight: 600;
|
|
506
|
-
line-height: 1;
|
|
507
|
-
text-transform: uppercase;
|
|
508
|
-
color: ${o.text2};
|
|
509
|
-
`,bn=i(O)`
|
|
510
|
-
color: #f48221;
|
|
511
|
-
`,vn=i.span`
|
|
512
|
-
align-self: flex-start;
|
|
513
|
-
display: inline-flex;
|
|
514
|
-
align-items: center;
|
|
515
|
-
gap: 4px;
|
|
516
|
-
padding: 2px 4px;
|
|
517
|
-
border-radius: ${te.chip};
|
|
518
|
-
background: #f4e9ff;
|
|
519
|
-
font-size: 10px;
|
|
520
|
-
font-weight: 400;
|
|
521
|
-
line-height: 14px;
|
|
522
|
-
color: ${o.text};
|
|
523
|
-
`,wn=i(O)`
|
|
524
|
-
width: 11.31px;
|
|
525
|
-
height: 10.94px;
|
|
526
|
-
background: ${o.text};
|
|
527
|
-
`,Et=Ke`
|
|
528
|
-
display: grid;
|
|
529
|
-
place-items: center;
|
|
530
|
-
width: 24px;
|
|
531
|
-
height: 24px;
|
|
532
|
-
padding: 0;
|
|
533
|
-
border: 0;
|
|
534
|
-
background: none;
|
|
535
|
-
color: ${o.muted};
|
|
536
|
-
cursor: pointer;
|
|
537
|
-
transition: color 0.12s ease;
|
|
538
|
-
|
|
539
|
-
&:disabled {
|
|
540
|
-
opacity: 0.5;
|
|
541
|
-
cursor: default;
|
|
542
|
-
}
|
|
543
|
-
`,Cn=i.button`
|
|
544
|
-
${Et};
|
|
545
|
-
|
|
546
|
-
&:hover:not(:disabled) {
|
|
547
|
-
color: ${o.text};
|
|
548
|
-
}
|
|
549
|
-
&[data-on] {
|
|
550
|
-
color: ${o.dclRed};
|
|
551
|
-
}
|
|
552
|
-
`,jn=i.button`
|
|
553
|
-
${Et};
|
|
554
|
-
|
|
555
|
-
&:hover:not(:disabled) {
|
|
556
|
-
color: ${o.dclRed};
|
|
557
|
-
}
|
|
558
|
-
`,kn=i.div`
|
|
559
|
-
display: flex;
|
|
560
|
-
gap: 20px;
|
|
561
|
-
margin-top: 16px;
|
|
562
|
-
|
|
563
|
-
& .link {
|
|
564
|
-
font-size: 13px;
|
|
565
|
-
color: ${o.muted};
|
|
566
|
-
font-weight: 600;
|
|
567
|
-
}
|
|
568
|
-
& .link:hover:not(:disabled) {
|
|
569
|
-
color: ${o.text};
|
|
570
|
-
}
|
|
571
|
-
`,Sn=i.aside`
|
|
572
|
-
position: sticky;
|
|
573
|
-
top: 172px;
|
|
574
|
-
display: flex;
|
|
575
|
-
flex-direction: column;
|
|
576
|
-
background: ${o.white};
|
|
577
|
-
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
578
|
-
border-radius: 16px;
|
|
579
|
-
padding: 16px;
|
|
580
|
-
|
|
581
|
-
${Pt} {
|
|
582
|
-
position: static;
|
|
583
|
-
}
|
|
584
|
-
${I} {
|
|
585
|
-
position: fixed;
|
|
586
|
-
left: 0;
|
|
587
|
-
right: 0;
|
|
588
|
-
top: auto;
|
|
589
|
-
bottom: 0;
|
|
590
|
-
z-index: 30;
|
|
591
|
-
border: 0;
|
|
592
|
-
/* Square and hard-edged against the page (1182:236910): it is a bar docked to the bottom, not a sheet
|
|
593
|
-
lifted off it. */
|
|
594
|
-
border-radius: 0;
|
|
595
|
-
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
|
|
596
|
-
}
|
|
597
|
-
`,$n=i.h2`
|
|
598
|
-
margin: 0 0 24px;
|
|
599
|
-
padding-bottom: 16px;
|
|
600
|
-
border-bottom: 1px solid ${o.gray4};
|
|
601
|
-
font-size: 24px;
|
|
602
|
-
font-weight: 600;
|
|
603
|
-
color: ${o.text};
|
|
604
|
-
|
|
605
|
-
${I} {
|
|
606
|
-
margin-bottom: 12px;
|
|
607
|
-
padding-bottom: 8px;
|
|
608
|
-
font-size: 16px;
|
|
609
|
-
line-height: 1.6;
|
|
610
|
-
}
|
|
611
|
-
`,Mn=i.div`
|
|
612
|
-
display: flex;
|
|
613
|
-
flex-direction: column;
|
|
614
|
-
gap: 12px;
|
|
615
|
-
`,Tn=i.div`
|
|
616
|
-
display: flex;
|
|
617
|
-
align-items: flex-start;
|
|
618
|
-
justify-content: space-between;
|
|
619
|
-
gap: 12px;
|
|
620
|
-
`,In=i.span`
|
|
621
|
-
font-size: 14px;
|
|
622
|
-
font-weight: 600;
|
|
623
|
-
line-height: 1.57;
|
|
624
|
-
color: ${o.muted1};
|
|
625
|
-
`,Pn=i.span`
|
|
626
|
-
display: inline-flex;
|
|
627
|
-
align-items: center;
|
|
628
|
-
gap: 8px;
|
|
629
|
-
font-size: 24px;
|
|
630
|
-
font-weight: 700;
|
|
631
|
-
color: ${o.text};
|
|
632
|
-
`,An=i.span`
|
|
633
|
-
display: flex;
|
|
634
|
-
flex-direction: column;
|
|
635
|
-
align-items: flex-end;
|
|
636
|
-
justify-content: center;
|
|
637
|
-
gap: 4px;
|
|
638
|
-
`;i.span`
|
|
639
|
-
font-size: 12px;
|
|
640
|
-
font-weight: 400;
|
|
641
|
-
line-height: 1;
|
|
642
|
-
color: ${o.muted};
|
|
643
|
-
`;const zn=i(Mt)`
|
|
644
|
-
width: 30px;
|
|
645
|
-
height: 30px;
|
|
646
|
-
background: ${o.text};
|
|
647
|
-
-webkit-mask-size: 24px 24px;
|
|
648
|
-
mask-size: 24px 24px;
|
|
649
|
-
-webkit-mask-position: left center;
|
|
650
|
-
mask-position: left center;
|
|
651
|
-
`;i.button`
|
|
652
|
-
width: 100%;
|
|
653
|
-
height: 56px;
|
|
654
|
-
border: 0;
|
|
655
|
-
border-radius: ${te.btn};
|
|
656
|
-
background: ${Ns.buyBtn};
|
|
657
|
-
color: ${o.softWhite};
|
|
658
|
-
font-size: 15px;
|
|
659
|
-
font-weight: 600;
|
|
660
|
-
letter-spacing: 0.046em;
|
|
661
|
-
text-transform: uppercase;
|
|
662
|
-
cursor: pointer;
|
|
663
|
-
transition: background-image 0.15s ease;
|
|
664
|
-
|
|
665
|
-
/* Primary hover/pressed is the solid Primary red (Figma 738:53252 / 738:53262) — the gradient is
|
|
666
|
-
the RESTING fill only. Painted as a flat GRADIENT, not a background-color: the shorthand can't
|
|
667
|
-
interpolate background-image, so gradient -> colour dropped the image midway while the colour was
|
|
668
|
-
still half transparent and the button visibly blinked. Same property both ends = a clean swap. */
|
|
669
|
-
&:hover:not(:disabled),
|
|
670
|
-
&:active:not(:disabled) {
|
|
671
|
-
background-image: linear-gradient(${o.dclRed}, ${o.dclRed});
|
|
672
|
-
}
|
|
673
|
-
&:disabled {
|
|
674
|
-
opacity: 0.6;
|
|
675
|
-
cursor: default;
|
|
676
|
-
}
|
|
677
|
-
`;const Rt=Ke`
|
|
678
|
-
margin: 0;
|
|
679
|
-
font-size: 13px;
|
|
680
|
-
`,ve=i.p`
|
|
681
|
-
${Rt};
|
|
682
|
-
`,En=i(zs)`
|
|
683
|
-
${Rt};
|
|
684
|
-
`,Rn=i.div`
|
|
685
|
-
position: relative;
|
|
686
|
-
flex: 1 0 auto;
|
|
687
|
-
margin-top: 48px;
|
|
688
|
-
/* Below the gray band the cross-sell sits straight on the purple field (Figma) — hence no band of its
|
|
689
|
-
own. The padding is the whole gap from the top of the section to the heading; the shared carousel's
|
|
690
|
-
own top margin is zeroed below so the two don't stack. */
|
|
691
|
-
padding: 47px 0 24px;
|
|
692
|
-
|
|
693
|
-
& section {
|
|
694
|
-
margin-top: 0;
|
|
695
|
-
}
|
|
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};
|