@dcl/shop 0.5.1-30941423866.commit-16bb43e → 0.5.1-30942080363.commit-5a008a2
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-D6HGEkBY.js → Activity-CfohBp0y.js} +6 -6
- package/_assets/{AnimatedBackground-Bz6-eXM-.js → AnimatedBackground-gpCse7EH.js} +2 -2
- package/_assets/{Assets-91-VU1Yf.js → Assets-IY2PmVDp.js} +7 -7
- package/_assets/{Assets.styles-nkCcUHhi.js → Assets.styles-DU_WP2lv.js} +1 -1
- package/_assets/{Authorizations-CEIgVod3.js → Authorizations-DgmmTCT_.js} +3 -3
- package/_assets/{Cart-bL5VUwar.js → Cart-gTkEGP_-.js} +22 -22
- package/_assets/{CircularProgress-t5C2xMSa.js → CircularProgress-1fPr054_.js} +3 -3
- package/_assets/Collection-BRcUPhzB.js +119 -0
- package/_assets/{CollectionCarousel-BofN3PUd.js → CollectionCarousel-CMmb6-ne.js} +17 -17
- package/_assets/{Creator-BvEpySRn.js → Creator-CFYVnbbD.js} +9 -9
- package/_assets/{ErrorNotice-SoCdrSmZ.js → ErrorNotice-D6PKmOXM.js} +1 -1
- package/_assets/{ExchangeController-CfUvjqK_.js → ExchangeController-DrcHwQX8.js} +1 -1
- package/_assets/{GetCredits-DoaG2_0N.js → GetCredits-X1fDrfGZ.js} +12 -12
- package/_assets/{HelpersUtil-BMGSbn7T.js → HelpersUtil-JE28M1o7.js} +1 -1
- package/_assets/{ItemDetail-DgqMo17C.js → ItemDetail-DeXvVWPr.js} +3 -3
- package/_assets/{LoadMore-QZxbtyl3.js → LoadMore-B2K4UDfe.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CfeNfvcw.js → ManaPricingBanner.styles-eLx-8UKH.js} +3 -3
- package/_assets/{MenuList-3Ove0Kax.js → MenuList-CnBRd37k.js} +1 -1
- package/_assets/{MyAssets-Dfi9GJY7.js → MyAssets-DdRWkVS3.js} +1 -1
- package/_assets/{MyFavorites-4NZPS72p.js → MyFavorites-BlGmxMaR.js} +1 -1
- package/_assets/NotFound-Bz-rDcjH.js +13 -0
- package/_assets/{NotificationsBell-C3ZVZms3.js → NotificationsBell-BrZbQAvI.js} +1 -1
- package/_assets/{OutfitDetail-BnpYR8Sn.js → OutfitDetail-B249K3hQ.js} +4 -4
- package/_assets/{OutfitPreview-Ds73Fyio.js → OutfitPreview-Cdl7SceL.js} +2 -2
- package/_assets/{OutfitStudio-BcZDs5Sw.js → OutfitStudio-YxiNgnnh.js} +13 -13
- package/_assets/{StoreSettings-DgkB-s8z.js → StoreSettings-DopfDTeB.js} +43 -43
- package/_assets/{Success-CFrayKii.js → Success-C5omXUBX.js} +6 -6
- package/_assets/{SwapController-B0I2SBMi.js → SwapController-Bjmuyz_j.js} +1 -1
- package/_assets/{Tooltip-DrwaXxlg.js → Tooltip-D3wp0OFx.js} +1 -1
- package/_assets/{TradeService-wTgWWF_f.js → TradeService-1mcj7EiB.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-DmUcIZ1-.js → W3MFrameProviderSingleton-DHrNy8cB.js} +3 -3
- package/_assets/{WebCryptoP256-Bh90kMb3.js → WebCryptoP256-D9oW_qyA.js} +1 -1
- package/_assets/{authorizations-LULzuipv.js → authorizations-Bx-uumVM.js} +1 -1
- package/_assets/{basic-BJTMzaq4.js → basic-B39QAUZJ.js} +1 -1
- package/_assets/{biconomy-DwCfSXz5.js → biconomy-Bx6Ho69d.js} +1 -1
- package/_assets/browseLayout.styles-DXLz-YlY.js +91 -0
- package/_assets/{builder-CsWf7X7a.js → builder-Czq1-krd.js} +1 -1
- package/_assets/{buy-Cs1e8dwt.js → buy-BDTufK8m.js} +1 -1
- package/_assets/{buy-gasless-nMph8utE.js → buy-gasless-CXKZGuta.js} +1 -1
- package/_assets/{categories-Al7TFiZ3.js → categories-3pKh51AH.js} +1 -1
- package/_assets/{ccip-BwXOtHnt.js → ccip-BDfDn3iK.js} +1 -1
- package/_assets/{ccip-D1z2vDZ1.js → ccip-Co2XroO9.js} +1 -1
- package/_assets/{clsx-CF2rJgou.js → clsx-FFNUV-WB.js} +2 -2
- package/_assets/{controller-Dd98YdMj.js → controller-Bpa17ZZP.js} +2 -2
- package/_assets/{core-D1SojbPa.js → core-BAfyWlVX.js} +4 -4
- package/_assets/{createSvgIcon-BD9EM61r.js → createSvgIcon-B10djVRg.js} +3 -3
- package/_assets/{custom-COzYkjQL.js → custom-B06rMK4w.js} +1 -1
- package/_assets/{data-capture-BjEF_GLG.js → data-capture-BkYxbz02.js} +1 -1
- package/_assets/{email-ps4Ivz5i.js → email-Bknt0jHD.js} +1 -1
- package/_assets/{embedded-wallet-CVLG0kXZ.js → embedded-wallet-o7x5DbDu.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CDuZD50Q.js → emotion-styled.browser.esm-Dpa1iAyn.js} +1 -1
- package/_assets/{engine-pr6_tb_z.js → engine-BNOXJug7.js} +1 -1
- package/_assets/{errors-5vlAB2Zg.js → errors-Cg4Fnsf8.js} +1 -1
- package/_assets/{estimate-l1-fee-B3g-FnFs.js → estimate-l1-fee-DXNJIfzL.js} +1 -1
- package/_assets/{execute-Cel7d92K.js → execute-BFeK7M_Y.js} +2 -2
- package/_assets/{features-D5rLpDoE.js → features-DCfBaiy_.js} +1 -1
- package/_assets/{fetchTokenMetadata-DryrCOLG.js → fetchTokenMetadata-aKrX_QaT.js} +2 -2
- package/_assets/{field.styles-C90By0S4.js → field.styles-tnDxAMEw.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DS2uBDFK.js → get-ecosystem-wallet-info-CCTUHx5Y.js} +1 -1
- package/_assets/{getBalance-DzSIaYv8.js → getBalance-CxkeTHxS.js} +1 -1
- package/_assets/{getNFT-B_38vu3d.js → getNFT-CYunBlyN.js} +1 -1
- package/_assets/{getNFT-BYs-Lc0M.js → getNFT-Dy6NXKIb.js} +1 -1
- package/_assets/{getThemeProps-CMN_iN9O.js → getThemeProps-Bz6-UTTf.js} +1 -1
- package/_assets/{grid.styles-_dq0Z7zy.js → grid.styles-BjSrL-3s.js} +1 -1
- package/_assets/{hashTypedData-U2WpRL9J.js → hashTypedData-Ckb55FUP.js} +1 -1
- package/_assets/{hashTypedData-nZ5SahOR.js → hashTypedData-jiOsNHGE.js} +1 -1
- package/_assets/{in-app-CrkxD8Cc.js → in-app-CBFCQ5yP.js} +1 -1
- package/_assets/{in-app-wallet-calls-Li6zp_GH.js → in-app-wallet-calls-Buf5QRM_.js} +1 -1
- package/_assets/{index-uA72jFdu.js → index-9iEI2jn0.js} +1 -1
- package/_assets/{index-Crfc7kEB.js → index-B0lN-Mk6.js} +2 -2
- package/_assets/{index-BfJ9y_zu.js → index-B14yGzKq.js} +1 -1
- package/_assets/{index-CycLf6t0.js → index-B4h2Nw0d.js} +1 -1
- package/_assets/{index-DNQcT8i8.js → index-BUTTEIUm.js} +3 -3
- package/_assets/{index-EbRcCO2e.js → index-BUelAUn3.js} +1 -1
- package/_assets/{index-AnVlYA8W.js → index-BWaeHJs2.js} +1 -1
- package/_assets/{index-1geQS8z5.js → index-BYy-feq3.js} +1 -1
- package/_assets/{index-CVaetlkF.js → index-Bc5IBzFc.js} +1 -1
- package/_assets/{index-onFl5MgF.js → index-BoBgM1AD.js} +3 -3
- package/_assets/{index-CroRq_48.js → index-BzOyUlEA.js} +1 -1
- package/_assets/{index-Dl3xGhv0.js → index-C3IX0bEG.js} +1 -1
- package/_assets/{index-Cnjifnkg.js → index-C4PvJvch.js} +1 -1
- package/_assets/{index-DhVlJ1ll.js → index-CAP79hiU.js} +1 -1
- package/_assets/{index-BzjKhN7Z.js → index-CMaqcpip.js} +1 -1
- package/_assets/{index-BjGq2FUA.js → index-CWKNVQns.js} +1 -1
- package/_assets/{index-B-cFSgSm.js → index-CWsWvJQR.js} +1 -1
- package/_assets/{index-BRUTO6r3.js → index-CXO-pG6w.js} +1 -1
- package/_assets/{index-C23YPWAe.js → index-Cab_9Z0c.js} +1 -1
- package/_assets/{index-B7jpRyRq.js → index-CcfifGLA.js} +1 -1
- package/_assets/{index-DptqVcuN.js → index-CfiJexEY.js} +2 -2
- package/_assets/{index-BzJy8rqx.js → index-ChdOnCl5.js} +1 -1
- package/_assets/{index-BB2cIvLa.js → index-CpshLABR.js} +1 -1
- package/_assets/{index-BZWjyqNw.js → index-CtMN6sQa.js} +1 -1
- package/_assets/{index-CbbOEMBd.js → index-D2bvSzer.js} +1 -1
- package/_assets/{index-Cl61ltQF.js → index-D7Ov3BOT.js} +1 -1
- package/_assets/{index-DfH6m-Ar.js → index-DG0maXsi.js} +1 -1
- package/_assets/{index-ChlDHmTZ.js → index-DHfu_49i.js} +1 -1
- package/_assets/{index-CkDVG_a0.js → index-DI8pHoj5.js} +1 -1
- package/_assets/{index-DI5MJwtI.js → index-DUecvlpK.js} +1 -1
- package/_assets/{index-CtSdDkYg.js → index-DZq6_deL.js} +2 -2
- package/_assets/{index-Dy8SH7iw.js → index-DcGjcsc6.js} +1 -1
- package/_assets/{index-B5d3bUu8.js → index-DinK4F_L.js} +3 -3
- package/_assets/{index-T4DelPen.js → index-Dl80d6_E.js} +1 -1
- package/_assets/{index-CIJrlsx5.js → index-DmwDbAPX.js} +1 -1
- package/_assets/{index-DxPgc0KP.js → index-Dokx6uQZ.js} +1 -1
- package/_assets/{index-C9YePsjK.js → index-Dt_NBFaG.js} +1 -1
- package/_assets/{index-CZ-oyr8d.js → index-DvFfsS8l.js} +1 -1
- package/_assets/{index-Bie49yv7.js → index-DxEYKwRl.js} +2 -2
- package/_assets/{index-CPEW56oC.js → index-DzJCqD2K.js} +1 -1
- package/_assets/{index-3p-1HM0o.js → index-RDFBoQxi.js} +1 -1
- package/_assets/{index-BXLMe2R7.js → index-RQ6uZEar.js} +1 -1
- package/_assets/{index-DqDSn6aV.js → index-SERS6_dB.js} +1 -1
- package/_assets/{index-18uEK4oZ.js → index-STO6kbYe.js} +1 -1
- package/_assets/index-UGlpWu7U.js +3306 -0
- package/_assets/{index-BpktVBiY.js → index-_RCROc0P.js} +1 -1
- package/_assets/{index-voVSpMmf.js → index-he_m0Fl-.js} +1 -1
- package/_assets/{index-3swvxeAv.js → index-nI7p19n6.js} +1 -1
- package/_assets/{index-YQoU1Oij.js → index-nuT17Odj.js} +1 -1
- package/_assets/{index-Ccc-pGrt.js → index-qGfC-M8O.js} +1 -1
- package/_assets/{index-Z5BMZOu5.js → index-sItL3uzy.js} +16 -16
- package/_assets/{index-C6vWyFJn.js → index-wxVvLfDd.js} +2 -2
- package/_assets/{index.es-CToxxyBw.js → index.es-DThH2vFQ.js} +1 -1
- package/_assets/{index.es-DRByKX1-.js → index.es-MdcUrD81.js} +4 -4
- package/_assets/{index.es-CvbAgxyC.js → index.es-v1HXELTh.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DTJgI3xj.js → localBatchGatewayRequest-CgJUOzba.js} +1 -1
- package/_assets/{mana-convert-BvzeO7sG.js → mana-convert-C0Bze7yJ.js} +1 -1
- package/_assets/{networks-CFK3bJYy.js → networks-D-bNskAV.js} +1 -1
- package/_assets/{onramp-okVUuWV0.js → onramp-B_PP9t-6.js} +1 -1
- package/_assets/{openzeppelin-De_HqqIc.js → openzeppelin-CP5bQyOk.js} +1 -1
- package/_assets/{parseNft-q8FmdH8G.js → parseNft-Dj-N28Ic.js} +2 -2
- package/_assets/{parseSignature-CqPrGTDR.js → parseSignature-DlXx8lne.js} +3 -3
- package/_assets/{parseSignature-B5R6ASNp.js → parseSignature-Dp9TGASb.js} +1 -1
- package/_assets/{passkeys-DSnfSnMU.js → passkeys-D4vOQZOp.js} +1 -1
- package/_assets/{pay-with-exchange-W6o_xhiT.js → pay-with-exchange-BlkoZTrJ.js} +1 -1
- package/_assets/{qr-overlay-yLQ0IoEW.js → qr-overlay-B77wg9uX.js} +1 -1
- package/_assets/{receive-B1if_96A.js → receive-fChjzOcU.js} +1 -1
- package/_assets/{resolveImplementation-DO2_Regw.js → resolveImplementation-DB1To9fC.js} +1 -1
- package/_assets/{rpc-Byx0dACz.js → rpc-Dtph7Sn-.js} +1 -1
- package/_assets/{secp256k1-qgQXh0MJ.js → secp256k1-7hf5kymY.js} +1 -1
- package/_assets/{secp256k1-DZugY34I.js → secp256k1-B54M-EJX.js} +1 -1
- package/_assets/{secp256k1-DdXA0G93.js → secp256k1-RKrSZRhb.js} +1 -1
- package/_assets/{send-batch-transaction-_L7mjvMY.js → send-batch-transaction-Dsnq3698.js} +1 -1
- package/_assets/{send-eip712-transaction-DurwgWTK.js → send-eip712-transaction-Bk870_4c.js} +2 -2
- package/_assets/{send-DtosPy0k.js → send-ekbhdMTX.js} +1 -1
- package/_assets/{send-gasless-transaction-B3bmXUxJ.js → send-gasless-transaction-mhZcHIOy.js} +2 -2
- package/_assets/{send-transaction-CZKkuF5l.js → send-transaction-DLfuM_nJ.js} +2 -2
- package/_assets/{sendMetaTransaction-4my7kZiF.js → sendMetaTransaction-CbxpNfVY.js} +1 -1
- package/_assets/{sendRawTransaction-BwVANbYg.js → sendRawTransaction-Dq6iLNOF.js} +3 -3
- package/_assets/{serializeTransaction-cVp_FJox.js → serializeTransaction-D0Ct49e0.js} +1 -1
- package/_assets/{session-proposal-CYvptxU7.js → session-proposal-C_FAURhx.js} +1 -1
- package/_assets/{session-request-Bn37Dem4.js → session-request-Bdn2jF6v.js} +2 -2
- package/_assets/{signing-DEItZ-F3.js → signing-BKBKIDWR.js} +3 -3
- package/_assets/{socials-CdpDKKrQ.js → socials-DDmkzfIp.js} +1 -1
- package/_assets/{swaps-DnenFD5w.js → swaps-BZjTE4Lo.js} +1 -1
- package/_assets/{thirdweb-Bp130Dcj.js → thirdweb-BRgX__sH.js} +3 -3
- package/_assets/{to-serializable-transaction-CcF0iJ96.js → to-serializable-transaction-D0EMGY08.js} +2 -2
- package/_assets/{trade-encoding-BRe43PSw.js → trade-encoding-Dw1x271X.js} +1 -1
- package/_assets/{transactionReceipt-lMu7BRwr.js → transactionReceipt-MJ3mbhdi.js} +1 -1
- package/_assets/{transactions-B14lINkM.js → transactions-DaDqXmUP.js} +1 -1
- package/_assets/{useCreditPacks-C5VR3CBS.js → useCreditPacks-CPOVN7Gq.js} +1 -1
- package/_assets/{useImportable-B5bQ22LQ.js → useImportable-BElQRFOW.js} +1 -1
- package/_assets/{useInfiniteGrid-eJ_aRWUt.js → useInfiniteGrid-7hiVU_K4.js} +1 -1
- package/_assets/useManaRate-bDKCffp4.js +1 -0
- package/_assets/{useTheme--KekSHIk.js → useTheme-C7dqsuDI.js} +1 -1
- package/_assets/{verifyHash-Bt7jFOSN.js → verifyHash-DcTMzSLu.js} +1 -1
- package/_assets/{w3m-modal-Dn7of9MZ.js → w3m-modal-Qporq01P.js} +1 -1
- package/_assets/{w3m-modal-CDIk6daa.js → w3m-modal-gRdkhlg8.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BUw9UtP4.js → wait-for-tx-receipt-Zm4DabEW.js} +1 -1
- package/_assets/{wallets-A7pRwPiu.js → wallets-vgey4Pk4.js} +5 -5
- package/_assets/{web-connector-P4z47D9H.js → web-connector-DkrfZGZ4.js} +3 -3
- package/_assets/{writeContract-Bx4xVEvO.js → writeContract-CYVoU1GT.js} +1 -1
- package/_assets/{zoraTestnet-CuzBONzv.js → zoraTestnet-B5TlluZS.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-B3QlNwPP.js +0 -119
- package/_assets/NotFound-BJON5Kwq.js +0 -13
- package/_assets/browseLayout.styles-Cb1bSjYL.js +0 -91
- package/_assets/index-CqLzAYYu.js +0 -3482
- package/_assets/useManaRate-CEsFS4D7.js +0 -1
- package/_assets/useStore-BZhz06Vz.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as
|
|
1
|
+
import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,aq as de,b2 as sa,ap as na,I as H,q as Mt,ab as Qe,n as ia,N as U,ad as dt,l as ra,u as oa,b3 as ca,v as da,b4 as la,b5 as ua,b6 as ha,b7 as pa,o as ga,b8 as lt,Q as G,b9 as ut,ba as xa,y as ae,c as ht,bb as ma,C as fa,bc as pt,bd as _e,be as ye,bf as be,bg as gt,g as ve,d as ya,e as We,bh as ba}from"./index-UGlpWu7U.js";import{M as va,S as wa,C as Ca,H as ja,a as ka,T as Sa,X as $a,b as Ma,B as Ta,c as Ia,d as xt,e as Pa,f as ke,P as Tt,m as za,g as Aa,h as Ea,i as qa,j as It,k as Se,L as Ba,l as Ra,n as mt,o as ft,W as _a,p as Wa,q as Fa,A as La,r as Ka,s as Na,t as Qa,u as Ua,v as Ha,w as Oa,x as Va,y as Ga,z as Da,D as Ya,E as Ja,F as Xa,G as Za,I as es,J as ts,K as Fe,N as as,O as ss,Q as ns,R as is,U as yt,V as bt,Y as rs,Z as os,_ as cs}from"./CollectionCarousel-CMmb6-ne.js";import{u as ds}from"./useManaRate-bDKCffp4.js";import{u as ls,r as us,g as hs,b as Le}from"./buy-BDTufK8m.js";import{j as ps,k as gs,a as xs,n as ms,f as fs,A as ys}from"./authorizations-Bx-uumVM.js";import{b as bs,w as vs,S as vt,G as ws}from"./buy-gasless-CXKZGuta.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as wt}from"./useCreditPacks-CPOVN7Gq.js";import{i as $s,a as Ms}from"./errors-Cg4Fnsf8.js";import{E as Ts}from"./ErrorNotice-D6PKmOXM.js";import{u as Ct}from"./mana-convert-C0Bze7yJ.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Dw1x271X.js";import"./sendMetaTransaction-CbxpNfVY.js";const{colors:se,radius:Is}=le,Ps=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,Bs="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(va,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(wa,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Ca,{"data-tall":Y||void 0,children:[e.jsxs(ja,{children:[e.jsxs(ka,{children:[e.jsx(Sa,{children:D}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Ma,{})})]}),e.jsxs(Ta,{children:[e.jsx(Ia,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Pa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=za(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Aa,{"data-testid":"buy-error",children:[e.jsx(Ea,{src:Bs,alt:"",width:64,height:80}),e.jsxs(qa,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Ba,{src:sa,alt:"",width:61,height:61}),e.jsx(Ra,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(_a,{"data-testid":"nofunds-warning",children:[e.jsx(Wa,{}),e.jsxs(Fa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(La,{children:[e.jsx(Ka,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Na,{children:[e.jsxs("div",{children:[e.jsxs(Qa,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Es,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Ua,{address:n.item.creator}):null]}),e.jsxs(Ha,{children:[e.jsx(Oa,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Va,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ga,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Da,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Ja,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Xa,{children:[e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ts,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
62
|
max-width: 1510px;
|
|
63
63
|
margin: 0 auto;
|
|
64
64
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -107,7 +107,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
107
107
|
${zt} {
|
|
108
108
|
grid-template-columns: 1fr;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
`,St=i.div`
|
|
111
111
|
position: relative;
|
|
112
112
|
/* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
|
|
113
113
|
this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
|
|
@@ -147,7 +147,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
147
147
|
${T} {
|
|
148
148
|
padding: 16px;
|
|
149
149
|
}
|
|
150
|
-
`,
|
|
150
|
+
`,Ns=i(At)`
|
|
151
151
|
display: flex;
|
|
152
152
|
flex-direction: column;
|
|
153
153
|
align-items: center;
|
|
@@ -162,13 +162,13 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
162
162
|
min-height: 320px;
|
|
163
163
|
padding: 32px 16px;
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,Qs=i.div`
|
|
166
166
|
display: flex;
|
|
167
167
|
flex-direction: column;
|
|
168
168
|
align-items: center;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding-bottom: 16px;
|
|
171
|
-
`,
|
|
171
|
+
`,Us=i.p`
|
|
172
172
|
margin: 0;
|
|
173
173
|
font-size: 24px;
|
|
174
174
|
font-weight: 700;
|
|
@@ -177,7 +177,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
177
177
|
${le.media.maxWidth("mobile")} {
|
|
178
178
|
font-size: 20px;
|
|
179
179
|
}
|
|
180
|
-
`,
|
|
180
|
+
`,Hs=i.p`
|
|
181
181
|
margin: 0;
|
|
182
182
|
font-size: 20px;
|
|
183
183
|
font-weight: 400;
|
|
@@ -186,7 +186,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
186
186
|
${le.media.maxWidth("mobile")} {
|
|
187
187
|
font-size: 16px;
|
|
188
188
|
}
|
|
189
|
-
`,
|
|
189
|
+
`,Os=i($e)`
|
|
190
190
|
display: inline-flex;
|
|
191
191
|
align-items: center;
|
|
192
192
|
justify-content: center;
|
|
@@ -327,7 +327,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
327
327
|
width: 120px;
|
|
328
328
|
height: 120px;
|
|
329
329
|
}
|
|
330
|
-
`,Zs=i(
|
|
330
|
+
`,Zs=i($e)`
|
|
331
331
|
position: absolute;
|
|
332
332
|
inset: 0;
|
|
333
333
|
display: grid;
|
|
@@ -360,7 +360,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
360
360
|
gap: 4px;
|
|
361
361
|
min-width: 0;
|
|
362
362
|
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
-
`,Et=
|
|
363
|
+
`,Et=Qe`
|
|
364
364
|
display: block;
|
|
365
365
|
font-size: 16px;
|
|
366
366
|
font-weight: 600;
|
|
@@ -384,7 +384,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
384
384
|
}
|
|
385
385
|
`,sn=i.div`
|
|
386
386
|
${Et};
|
|
387
|
-
`,nn=i(
|
|
387
|
+
`,nn=i($e)`
|
|
388
388
|
${Et};
|
|
389
389
|
`,rn=i(na)`
|
|
390
390
|
font-size: 10px;
|
|
@@ -411,7 +411,7 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
411
411
|
padding: 6px;
|
|
412
412
|
border: 0.5px solid ${r.muted2};
|
|
413
413
|
border-radius: ${Z.pill};
|
|
414
|
-
|
|
414
|
+
`,$t=i.button`
|
|
415
415
|
display: grid;
|
|
416
416
|
place-items: center;
|
|
417
417
|
width: 16px;
|
|
@@ -478,9 +478,9 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
478
478
|
line-height: 1;
|
|
479
479
|
text-transform: uppercase;
|
|
480
480
|
color: ${r.text2};
|
|
481
|
-
`,xn=i(
|
|
481
|
+
`,xn=i(H)`
|
|
482
482
|
color: #f48221;
|
|
483
|
-
`,mn=i(
|
|
483
|
+
`,mn=i($e)`
|
|
484
484
|
font-size: 12px;
|
|
485
485
|
font-weight: 600;
|
|
486
486
|
line-height: 24px;
|
|
@@ -508,11 +508,11 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
508
508
|
font-weight: 400;
|
|
509
509
|
line-height: 14px;
|
|
510
510
|
color: ${r.text};
|
|
511
|
-
`,yn=i(
|
|
511
|
+
`,yn=i(H)`
|
|
512
512
|
width: 11.31px;
|
|
513
513
|
height: 10.94px;
|
|
514
514
|
background: ${r.text};
|
|
515
|
-
`,qt=
|
|
515
|
+
`,qt=Qe`
|
|
516
516
|
display: grid;
|
|
517
517
|
place-items: center;
|
|
518
518
|
width: 24px;
|
|
@@ -596,12 +596,12 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
596
596
|
display: flex;
|
|
597
597
|
flex-direction: column;
|
|
598
598
|
gap: 12px;
|
|
599
|
-
|
|
599
|
+
`,Sn=i.div`
|
|
600
600
|
display: flex;
|
|
601
601
|
align-items: flex-start;
|
|
602
602
|
justify-content: space-between;
|
|
603
603
|
gap: 12px;
|
|
604
|
-
|
|
604
|
+
`,$n=i.span`
|
|
605
605
|
font-size: 14px;
|
|
606
606
|
font-weight: 600;
|
|
607
607
|
line-height: 1.57;
|
|
@@ -658,13 +658,13 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
658
658
|
opacity: 0.6;
|
|
659
659
|
cursor: default;
|
|
660
660
|
}
|
|
661
|
-
`,
|
|
661
|
+
`,Bt=Qe`
|
|
662
662
|
margin: 0;
|
|
663
663
|
font-size: 13px;
|
|
664
664
|
`,Ce=i.p`
|
|
665
|
-
${
|
|
665
|
+
${Bt};
|
|
666
666
|
`,zn=i(Ts)`
|
|
667
|
-
${
|
|
667
|
+
${Bt};
|
|
668
668
|
`,An=i.div`
|
|
669
669
|
position: relative;
|
|
670
670
|
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
|
|
|
692
692
|
& section {
|
|
693
693
|
margin-top: 0;
|
|
694
694
|
}
|
|
695
|
-
`;function Ke(o){if(Ss(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Xn(){ia({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),_t=ls(),ue=Cs().packs.slice(0,js);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:Me}=oa({queryKey:["upsell-listings"],queryFn:()=>ba({first:40}),staleTime:6e4}),{data:$}=ca(n),b=da(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Ft,R]=P.useState(!1),[_,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=la(n),{data:re}=ds(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=ua(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Ut=Ie.reduce((t,a)=>t+a.quantity,0),De=_?_.liveTotalCredits:Lt,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(_==null?void 0:_.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Ot=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ot,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Vt=xa,Gt=t=>ma(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Dt(){j(null),R(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),R(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,B=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await Be(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=hs(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ps()&&!v)try{const m=new Map;f=await bs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(_e=>S.add(_e)),E.push(f[N])):C.reason instanceof vt||X.forEach(_e=>B.add(_e))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>B.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>B.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),R(!1);const Re={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Re,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!B.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Be(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),R(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),R(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),R(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await fs({auth:{kind:ys.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>us(ht.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:B}=at(a,t);await st(S,B,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),R(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(ya(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=gs(a,t),u=n?await xs(c,n.address).catch(()=>!0):!0;if(ms(n==null?void 0:n.providerType,u)){R(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.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:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await rs({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=os(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),B=cs(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:Re}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Re})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+B).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Be(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),R(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await ks(a,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(qn(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{R(!1)}}async function rt(){if(_){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>En){H(null),he(null),await te();return}ie(null),tt(_.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}R(!0);try{const t=await $s(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{R(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!as("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Us,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ns,{children:[e.jsx(Qs,{children:s("cart.empty.title")}),e.jsx(Os,{children:s("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Gs,{children:s("cart.panelTitle",{count:Kt})}),Bt?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const a=Qt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,B=ha(t),E=!!B&&!!A[B],q=pa(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(en,{"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(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,_t&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=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(dn,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"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(ln,{children:[e.jsx(un,{})," ",S,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[B?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:s("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs($n,{children:[e.jsx(Sn,{children:s("cart.totalItems",{count:Ut})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:_?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(_?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(_?rt():te()),disabled:V||Pe,children:V?s("cart.working"):_?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),_?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(ss,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ns,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:is,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(_s,{phase:p.phase,balanceCredits:ge,onClose:Dt,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:ga(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Xn as Cart};
|
|
695
|
+
`;function Ke(o){if($s(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ne=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Xn(){ia({title:s("nav.cart"),noindex:!0});const o=U(t=>t.items),l=U(t=>t.remove),I=U(t=>t.increment),z=U(t=>t.decrement),W=U(t=>t.clear),D=U(t=>t.restore),Y=U(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),Rt=ls(),ue=Cs().packs.slice(0,js);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:Me}=oa({queryKey:["upsell-listings"],queryFn:()=>ba({first:40}),staleTime:6e4}),{data:S}=ca(n),b=da(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Ue,he]=P.useState(null),[Ft,B]=P.useState(!1),[R,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:pe}=la(n),{data:re}=ds(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=ua(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Nt=Ie.reduce((t,a)=>t+a.quantity,0),De=R?R.liveTotalCredits:Lt,Qt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Qt.has(t.id)).slice(0,12),Ut=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=(S==null?void 0:S.credits)??0,ze=De*10,Ht=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ht,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),Ot=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Vt=xa,Gt=t=>ma(t.contractAddress,String(t.itemId));function me(t){t(),O(null),he(null),ie(null)}function Dt(){j(null),B(!1)}function Je(t){const a=Ne(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.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,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:Q,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:Q.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[Q],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[Q],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=hs(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),N=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ps()&&!v)try{const m=new Map;f=await bs({purchases:N,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:Q})=>{m.set(C,Q),Q.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,Q)=>{const X=m.get(f[Q])??[];C.status==="fulfilled"?(X.forEach(Re=>$.add(Re)),E.push(f[Q])):C.reason instanceof vt||X.forEach(Re=>_.add(Re))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>$.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),B(!1);const Be={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Be,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:$}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,N)=>v+N.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),B(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await fs({auth:{kind:ys.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>us(ht.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ne(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ot(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(a&&w.options.some($=>$.method===a)){if(a==="credits"){Ee(t);return}const{spender:$,chainId:_}=at(a,t);await st($,_,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if(S!=null&&S.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(ya(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=gs(a,t),u=n?await xs(c,n.address).catch(()=>!0):!0;if(ms(n==null?void 0:n.providerType,u)){B(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.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:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await rs({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=os(c.map(g=>g.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((g,k)=>g+k,0),_=cs(Math.max(0,a-$),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const N=g[f].item,{credit:ce,maxCreditedValue:Be}=await pt(n.identity,v,g[f].trade.id,N.contractAddress&&N.itemId!=null?{contractAddress:N.contractAddress,itemId:String(N.itemId)}:void 0);E.push({salt:ce.id,itemId:N.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Be})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=U.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await ks(a,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(qn(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{B(!1)}}async function rt(){if(R){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>En){O(null),he(null),await te();return}ie(null),tt(R.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(U.getState().items))}catch{}B(!0);try{const t=await Ss(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!as("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ns,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Qs,{children:[e.jsx(Us,{children:s("cart.empty.title")}),e.jsx(Hs,{children:s("cart.empty.body")})]}),e.jsx(Os,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Gs,{children:s("cart.panelTitle",{count:Kt})}),_t?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const a=Ut.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,$=d*h,_=ha(t),E=!!_&&!!A[_],q=pa(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(en,{"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(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,Rt&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx($t,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=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(dn,{children:h}),e.jsx($t,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"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(ln,{children:[e.jsx(un,{})," ",$,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[_?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:s("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx($n,{children:s("cart.totalItems",{count:Nt})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:R?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(R?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(R?rt():te()),disabled:V||Pe,children:V?s("cart.working"):R?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),R?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Ue?e.jsx(Ce,{className:"muted",children:Ue}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(ss,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ns,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:is,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(Rs,{phase:p.phase,balanceCredits:ge,onClose:Dt,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:ga(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ne(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Xn as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a7 as N,a8 as U,a9 as o,aa as n,ab as D,m as M}from"./index-UGlpWu7U.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-FFNUV-WB.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const a=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -21,8 +21,8 @@ import{a8 as N,a9 as U,aa as o,ab as n,ac as D,o as M}from"./index-CqLzAYYu.js";
|
|
|
21
21
|
stroke-dasharray: 100px, 200px;
|
|
22
22
|
stroke-dashoffset: -125px;
|
|
23
23
|
}
|
|
24
|
-
`)),L=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,
|
|
24
|
+
`)),L=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,m={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,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
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)),O=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:
|
|
28
|
+
`),G)),O=w.forwardRef(function(e,s){const t=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"}=t,j=U(t,W),c=o({},t,{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*((a-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:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(q,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{O as C};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import{j as e,r as m,u as Q,d as X}from"./react-DehiWSvs.js";import{t as v,s as c,aX as J,V as ee,w as T,aY as te,aZ as ae,I as re,b as a,c as oe,y as ie,u as se,n as ne,C as ce,ae as F,af as le,a_ as de,a$ as pe}from"./index-UGlpWu7U.js";import{E as xe}from"./ErrorNotice-D6PKmOXM.js";import{d as ue,P as me,C as ge,a as he,b as be,B as fe,S as je,M as ve,A as ye}from"./browseLayout.styles-DXLz-YlY.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as $e,H as ke,e as Pe}from"./categories-3pKh51AH.js";import{L as Ae}from"./LoadMore-B2K4UDfe.js";import{u as Me}from"./useInfiniteGrid-7hiVU_K4.js";import{G as Ee}from"./grid.styles-BjSrL-3s.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Re=c.section`
|
|
2
|
+
position: relative;
|
|
3
|
+
border-radius: ${v.radius.card};
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
margin-bottom: 24px;
|
|
6
|
+
min-height: 200px;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
|
|
11
|
+
${v.media.maxWidth("mobile")} {
|
|
12
|
+
min-height: 140px;
|
|
13
|
+
}
|
|
14
|
+
`,Te=c.div`
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
z-index: 0;
|
|
18
|
+
`,Fe=c.img`
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
object-fit: cover;
|
|
22
|
+
display: block;
|
|
23
|
+
`,ze=c.div`
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset: 0;
|
|
26
|
+
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
|
|
27
|
+
`,Be=c.h1`
|
|
28
|
+
position: relative;
|
|
29
|
+
z-index: 1;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 32px 24px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
color: ${v.colors.white};
|
|
34
|
+
font-size: 40px;
|
|
35
|
+
font-weight: 800;
|
|
36
|
+
line-height: 1.2;
|
|
37
|
+
letter-spacing: 0.02em;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
|
|
40
|
+
|
|
41
|
+
${v.media.maxWidth("mobile")} {
|
|
42
|
+
padding: 24px 16px;
|
|
43
|
+
font-size: 26px;
|
|
44
|
+
}
|
|
45
|
+
`;function Le({name:r,creator:t}){const{data:s}=J(t),d=(s==null?void 0:s.cover)||ue;return e.jsxs(Re,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Te,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(ze,{"aria-hidden":!0})]}),e.jsx(Be,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Ie=c.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
text-align: center;
|
|
50
|
+
gap: 12px;
|
|
51
|
+
padding-bottom: 24px;
|
|
52
|
+
/* Lift so the avatar half-overlaps the 24px-below cover hero (24px + half the 110px avatar). */
|
|
53
|
+
margin-top: -79px;
|
|
54
|
+
margin-bottom: 8px;
|
|
55
|
+
border-bottom: 1px solid ${n.line};
|
|
56
|
+
`,B=c.img`
|
|
57
|
+
display: block;
|
|
58
|
+
width: 110px;
|
|
59
|
+
height: 110px;
|
|
60
|
+
border-radius: 50%;
|
|
61
|
+
object-fit: cover;
|
|
62
|
+
border: 5px solid ${n.white};
|
|
63
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
|
|
64
|
+
background: #ff4bed;
|
|
65
|
+
`,_e=c.h2`
|
|
66
|
+
margin: 0;
|
|
67
|
+
font-size: 20px;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
line-height: 1.3;
|
|
70
|
+
color: ${n.text};
|
|
71
|
+
max-width: 100%;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
`,Ge=c.button`
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 8px;
|
|
79
|
+
padding: 4px 8px;
|
|
80
|
+
border: 0;
|
|
81
|
+
border-radius: ${L.btn};
|
|
82
|
+
background: none;
|
|
83
|
+
color: ${n.muted};
|
|
84
|
+
font: inherit;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition:
|
|
88
|
+
color 0.15s ease,
|
|
89
|
+
background 0.15s ease;
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
color: ${n.text};
|
|
93
|
+
background: ${n.media};
|
|
94
|
+
}
|
|
95
|
+
`,He=c.a`
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 44px;
|
|
101
|
+
padding: 0 20px;
|
|
102
|
+
border: 2px solid ${n.accent};
|
|
103
|
+
border-radius: ${L.btn};
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: ${n.accent};
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
font-size: 13px;
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
letter-spacing: 0.046em;
|
|
110
|
+
text-decoration: none;
|
|
111
|
+
transition:
|
|
112
|
+
background 0.15s ease,
|
|
113
|
+
color 0.15s ease;
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
background: ${n.accent};
|
|
117
|
+
color: ${n.white};
|
|
118
|
+
}
|
|
119
|
+
`;function Ue({address:r}){var f,l;const{data:t}=ee(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||T(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${oe.profileUrl}/${r}`,b=te(ae({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){ie(y,{flow:"copy_creator_address"})}}return e.jsxs(Ie,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(_e,{title:p,children:p}),e.jsxs(Ge,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:T(r)}),e.jsx(re,{name:"copy",size:16})]}),e.jsx(He,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const qe=48;function at(){var R;const{contractAddress:r}=Q(),t=X(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[N,I]=m.useState("newest"),S=x&&!Number.isNaN(Number(x))?Number(x):void 0,$=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Pe[p]:void 0,G=(z.find(o=>o.key===N)??z[0]).server,k={category:s,rarities:h.length?h:void 0,wearableCategories:_,minPriceCredits:S,maxPriceCredits:$,sortBy:G},{items:j,total:H,isLoading:C,error:P,hasNextPage:U,isFetchingNextPage:A,isFetchNextPageError:q,fetchNextPage:K}=Me(["collection-page",r,k],o=>de(r,{...k,first:qe,skip:o}),{enabled:!!r}),{data:i}=se({queryKey:["collection-meta",r],queryFn:()=>pe(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");ne({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const E=(i==null?void 0:i.creator)||((R=j[0])==null?void 0:R.creator);function V(o){d(o),g(null)}function W(o){b(u=>u.includes(o)?u.filter(O=>O!==o):[...u,o])}function Y(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(S||$),Z=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),D=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(me,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(he,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(be,{children:M})]}),e.jsx(Le,{name:M,creator:E}),e.jsxs(fe,{"data-testid":"browse",children:[e.jsxs(je,{"data-testid":"browse-sidebar",children:[e.jsx(Ue,{address:E}),e.jsx(Ce,{category:s,subCategory:p,onCategory:V,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(ve,{children:[!C&&j.length>0?e.jsx(ye,{items:j,source:"collection"}):null,e.jsx(we,{rarities:h,onToggleRarity:W,sort:N,onSort:I,total:H,loading:C,anyActive:D,onClear:Y,renderTrailing:o=>e.jsx(Ne,{panelKey:"price",label:Z,active:w,panel:o,children:e.jsxs(Se,{"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:u=>f(u.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:u=>y(u.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:ce.name})})]})})}),P?e.jsx(xe,{message:a("collection.error")}):null,e.jsx(Ee,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(le,{item:o},o.id)),A?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:U,isFetching:A,isError:q,onLoadMore:()=>void K()}),!C&&!P&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{at as Collection,at as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,
|
|
1
|
+
import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as k,aq as j,bC as C,C as G,m as Y,I as Q,y as X,g as W,e as B,d as q,$ as Z,b_ as F,af as J}from"./index-UGlpWu7U.js";import{s as ee,f as U,A as _,g as K,r as te,m as ne,i as ae,M as ie,h as oe}from"./authorizations-Bx-uumVM.js";import{i as se}from"./errors-Cg4Fnsf8.js";import{E as re}from"./ErrorNotice-D6PKmOXM.js";import{a as ce}from"./buy-BDTufK8m.js";import{g as de,f as le}from"./trade-encoding-Dw1x271X.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-CbxpNfVY.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function pt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,f=be(d,n,s);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,m=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
5
5
|
align-items: stretch;
|
|
6
6
|
width: 100%;
|
|
7
|
-
`,
|
|
7
|
+
`,H=`
|
|
8
8
|
width: 100%;
|
|
9
9
|
min-height: 56px;
|
|
10
10
|
display: flex;
|
|
@@ -36,14 +36,14 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
36
36
|
cursor: default;
|
|
37
37
|
}
|
|
38
38
|
`,ve=e.button`
|
|
39
|
-
${
|
|
39
|
+
${H}
|
|
40
40
|
background: ${o.gradients.amethyst};
|
|
41
41
|
|
|
42
42
|
&:hover:not(:disabled) {
|
|
43
43
|
filter: brightness(1.08);
|
|
44
44
|
}
|
|
45
45
|
`,N=e.button`
|
|
46
|
-
${
|
|
46
|
+
${H}
|
|
47
47
|
background: ${o.colors.text2};
|
|
48
48
|
|
|
49
49
|
&:hover:not(:disabled) {
|
|
@@ -289,10 +289,10 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[d,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){se(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:g("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function bt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const m=`${h.chainId}:${h.contract.toLowerCase()}`,b=c.get(m);b?b.push(h):c.set(m,[h])}const p=[];for(const h of c.values())p.push(await Ue({trades:h,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(
|
|
292
|
+
`;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[d,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){se(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:g("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function bt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const m=`${h.chainId}:${h.contract.toLowerCase()}`,b=c.get(m);b?b.push(h):c.set(m,[h])}const p=[];for(const h of c.values())p.push(await Ue({trades:h,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(q(c.contract),c.chainId),h=W(B.MANAToken,c.chainId);await U({auth:{kind:_.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const m=n.map(d=>de(d,i));if(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[m]),f=te(),$=ne(s.provider,f),u=await pe($,f,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ae(u,"the MANA purchase"),u}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(m,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function yt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:h}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const m=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:_.Allowance,contractAddress:m.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,f)=>d+BigInt(f.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:h})}function wt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function vt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:_e}=o,kt=e.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
|
-
z-index: ${
|
|
295
|
+
z-index: ${_e.overlay};
|
|
296
296
|
display: flex;
|
|
297
297
|
overflow-y: auto;
|
|
298
298
|
padding: 20px;
|
|
@@ -422,7 +422,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
422
422
|
color: ${r.text};
|
|
423
423
|
overflow: hidden;
|
|
424
424
|
text-overflow: ellipsis;
|
|
425
|
-
`,Pt=e(
|
|
425
|
+
`,Pt=e(Z)`
|
|
426
426
|
font-size: 10px;
|
|
427
427
|
line-height: 1.43;
|
|
428
428
|
color: ${r.muted};
|
|
@@ -461,7 +461,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
461
461
|
`,Ut=e.div`
|
|
462
462
|
display: flex;
|
|
463
463
|
gap: 12px;
|
|
464
|
-
`,
|
|
464
|
+
`,_t=e.button`
|
|
465
465
|
flex: 1;
|
|
466
466
|
height: 109px;
|
|
467
467
|
border: 1px solid ${r.muted2};
|
|
@@ -477,7 +477,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
477
477
|
&[data-on] {
|
|
478
478
|
border: 4px solid ${r.magenta};
|
|
479
479
|
}
|
|
480
|
-
`,
|
|
480
|
+
`,Ht=e(k)`
|
|
481
481
|
width: 24px;
|
|
482
482
|
height: 24px;
|
|
483
483
|
background: ${r.text};
|
|
@@ -505,11 +505,11 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
505
505
|
width: 30px;
|
|
506
506
|
height: 30px;
|
|
507
507
|
background: ${r.text};
|
|
508
|
-
`,
|
|
508
|
+
`,qt=e.span`
|
|
509
509
|
font-size: 14px;
|
|
510
510
|
font-weight: 600;
|
|
511
511
|
color: ${r.muted1};
|
|
512
|
-
`,
|
|
512
|
+
`,Zt=e.div`
|
|
513
513
|
position: sticky;
|
|
514
514
|
bottom: 0;
|
|
515
515
|
display: flex;
|
|
@@ -517,7 +517,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
517
517
|
margin-top: -8px;
|
|
518
518
|
padding-top: 8px;
|
|
519
519
|
background: ${r.white};
|
|
520
|
-
`,
|
|
520
|
+
`,Jt=e.button`
|
|
521
521
|
flex: 1;
|
|
522
522
|
/* Let the CTAs shrink so their min-content can't widen the modal past the viewport on mobile. */
|
|
523
523
|
min-width: 0;
|
|
@@ -665,7 +665,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
665
665
|
text-align: center;
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
`,{colors:I,media:A}=o,
|
|
668
|
+
`,{colors:I,media:A}=o,He=e.section`
|
|
669
669
|
margin-top: 40px;
|
|
670
670
|
`,Oe=e.div`
|
|
671
671
|
display: flex;
|
|
@@ -745,7 +745,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
745
745
|
${A.maxWidth("lg")} {
|
|
746
746
|
display: none;
|
|
747
747
|
}
|
|
748
|
-
`,
|
|
748
|
+
`,qe=e.div`
|
|
749
749
|
display: grid;
|
|
750
750
|
grid-auto-flow: column;
|
|
751
751
|
grid-auto-columns: calc((100% - 64px) / 5);
|
|
@@ -773,13 +773,13 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
773
773
|
${A.maxWidth("sm")} {
|
|
774
774
|
grid-auto-columns: calc((100% - 16px) / 2);
|
|
775
775
|
}
|
|
776
|
-
`,
|
|
776
|
+
`,Ze=e.div`
|
|
777
777
|
display: flex;
|
|
778
778
|
align-items: center;
|
|
779
779
|
justify-content: center;
|
|
780
780
|
gap: 8px;
|
|
781
781
|
margin-top: 18px;
|
|
782
|
-
`,
|
|
782
|
+
`,Je=e.button`
|
|
783
783
|
width: 10px;
|
|
784
784
|
height: 10px;
|
|
785
785
|
border-radius: 50%;
|
|
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,w as
|
|
|
801
801
|
opacity: 1;
|
|
802
802
|
transform: scale(1.1);
|
|
803
803
|
}
|
|
804
|
-
`;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(
|
|
804
|
+
`;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(He,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(qe,{ref:s,children:n.map(u=>t.jsx(J,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Ze,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:l}).map((u,x)=>t.jsx(Je,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Gt as F,Yt as G,Ct as H,Xt as I,qt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Dt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,Zt as j,Jt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Ft as v,Kt as w,Ut as x,_t as y,Ht as z};
|