@dcl/shop 1.0.2-31055297774.commit-b808071 → 1.0.2-31061952187.commit-8d8b09e
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-BGVAnqbp.js → Activity-D_fQdZon.js} +8 -8
- package/_assets/{AnimatedBackground-BacIzfr9.js → AnimatedBackground-C9W4RBcZ.js} +1 -1
- package/_assets/{Assets-Bs3sIn09.js → Assets-CvZql_4R.js} +10 -9
- package/_assets/{Assets.styles-CkO8eYMZ.js → Assets.styles-BBWJCcMx.js} +1 -1
- package/_assets/Authorizations-DVwQ95Ww.js +191 -0
- package/_assets/{Cart-CfbLgf8G.js → Cart-CBLHJRVj.js} +6 -6
- package/_assets/{CircularProgress-1YXgiQtT.js → CircularProgress-D09608yv.js} +1 -1
- package/_assets/{Collection-DKA_h7HO.js → Collection-DllncUVv.js} +10 -10
- package/_assets/{CollectionCarousel-COMBJtj4.js → CollectionCarousel-B9HmGuVb.js} +6 -6
- package/_assets/{Confetti-BSUE6v15.js → Confetti-Dl6FT7nL.js} +1 -1
- package/_assets/{Creator-Chfg4XCW.js → Creator-BreBnKPX.js} +5 -5
- package/_assets/{ErrorNotice-aOead5te.js → ErrorNotice-OUNK486K.js} +1 -1
- package/_assets/{ExchangeController-D9wO5y3j.js → ExchangeController-Cp3qbfAM.js} +1 -1
- package/_assets/{Faq-BUcIgNDP.js → Faq-DXtTtsuA.js} +1 -1
- package/_assets/{GetCredits-BLECOB-N.js → GetCredits-BhRNCaTG.js} +10 -10
- package/_assets/{Grow-zqUJtnL7.js → Grow-DXdR0gI9.js} +1 -1
- package/_assets/{HelpersUtil-BrmwLkkp.js → HelpersUtil-rQp5uDAx.js} +1 -1
- package/_assets/{ItemDetail-B2vKg-9Z.js → ItemDetail-clRbfaLQ.js} +241 -236
- package/_assets/LazyEmoteControls-B7UYn8xk.js +2 -0
- package/_assets/{LoadMore-Cy9OoEJz.js → LoadMore-jSNRJiwZ.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-B9-hTa3D.js → ManaPricingBanner.styles-vDUAKLLe.js} +1 -1
- package/_assets/{MyAssets-CHgc1ZcI.js → MyAssets-CsWhc-qa.js} +4 -4
- package/_assets/{MyFavorites-DWo1mliw.js → MyFavorites-BLrz2vwY.js} +1 -1
- package/_assets/NotFound-DP4nosOd.js +17 -0
- package/_assets/{NotificationsBell-Cg5PqU4H.js → NotificationsBell-ARziPv8W.js} +1 -1
- package/_assets/OutfitDetail-CLmuEgB3.js +374 -0
- package/_assets/{OutfitPreview-IPt5zFQ2.js → OutfitPreview-PWdXvCaE.js} +2 -2
- package/_assets/OutfitStudio-Cx3Xm6ff.js +556 -0
- package/_assets/StoreSettings-BQtEgWRm.js +243 -0
- package/_assets/{Success-B_ZedKxN.js → Success-BWfI3_Mu.js} +1 -1
- package/_assets/{SwapController-DEl6q4-5.js → SwapController-Bf58lQ6b.js} +1 -1
- package/_assets/{Tooltip-CfAbMWhJ.js → Tooltip-BDmKiALz.js} +1 -1
- package/_assets/{TradeService-DCGCUpYo.js → TradeService-Yecm1OxI.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BEUP6hLZ.js → W3MFrameProviderSingleton-BQyeyr-U.js} +3 -3
- package/_assets/{WebCryptoP256-2ShtCeVF.js → WebCryptoP256-Ou_F2OJp.js} +1 -1
- package/_assets/{authorizations-B17B7Njo.js → authorizations-B3AvOvOm.js} +1 -1
- package/_assets/{basic-Dr3bEQfu.js → basic-DTDRwam-.js} +1 -1
- package/_assets/{biconomy-3Y8X7VlC.js → biconomy-DaLi1O64.js} +1 -1
- package/_assets/{builder-jjuFCu3k.js → builder-DxumJmKw.js} +1 -1
- package/_assets/{buy-wdud8pnf.js → buy-BHkfYJLe.js} +1 -1
- package/_assets/{buy-gasless-DoSh-tFa.js → buy-gasless-BfTEWjT9.js} +1 -1
- package/_assets/{categories-DGIg36Oc.js → categories-D23W_J-A.js} +1 -1
- package/_assets/{ccip-BKrghWQj.js → ccip-DGVhZCZ4.js} +1 -1
- package/_assets/{ccip-CXCfMVYe.js → ccip-qhHiv1gU.js} +1 -1
- package/_assets/{collectionPage.styles-DwFPJPce.js → collectionPage.styles-CoEdrsfq.js} +3 -3
- package/_assets/{controller-DdgkWKgL.js → controller-DGtmLk4f.js} +2 -2
- package/_assets/{core-C8S2mN1s.js → core-BAqS3vu7.js} +4 -4
- package/_assets/{createSvgIcon-Cg8ZliIm.js → createSvgIcon-Bm9nxGqG.js} +2 -2
- package/_assets/{custom-X9wHG9wg.js → custom-MaGTnz7S.js} +1 -1
- package/_assets/{data-capture-BgPNXS18.js → data-capture-5Vi1cyBa.js} +1 -1
- package/_assets/{email-BGdZRw8p.js → email-BG6hRXMo.js} +1 -1
- package/_assets/{embedded-wallet-CqIU9APg.js → embedded-wallet-CfnknCH8.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-DZbIWeAZ.js → emotion-styled.browser.esm-CoxAZUrJ.js} +1 -1
- package/_assets/{engine-CBG8_pF-.js → engine-nQGCV50K.js} +1 -1
- package/_assets/{errors-BruxKfZB.js → errors-DZ_QWsza.js} +1 -1
- package/_assets/{estimate-l1-fee-k3exg7PR.js → estimate-l1-fee-CVpJ9ym5.js} +1 -1
- package/_assets/{execute-RjH3kC63.js → execute-DFvUDrLY.js} +2 -2
- package/_assets/{features-BnDZm8if.js → features-BXUedULM.js} +1 -1
- package/_assets/{fetchTokenMetadata-CdUuHqIj.js → fetchTokenMetadata-CkQcnzmO.js} +2 -2
- package/_assets/{field.styles-l0zobCFG.js → field.styles-PE4ZasC2.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DALoL3Hc.js → get-ecosystem-wallet-info-CRLH8I6C.js} +1 -1
- package/_assets/{getBalance-CefhuKko.js → getBalance-CiV48JsZ.js} +1 -1
- package/_assets/{getNFT-D-L5zgdP.js → getNFT-C3ucNb89.js} +1 -1
- package/_assets/{getNFT-nev9rcin.js → getNFT-CV3N9TTA.js} +1 -1
- package/_assets/{grid.styles-DhFwhKRo.js → grid.styles-hOZTJ80g.js} +1 -1
- package/_assets/{hashTypedData-BEKwcmlS.js → hashTypedData-BtF2J233.js} +1 -1
- package/_assets/{hashTypedData-li6aoa3o.js → hashTypedData-gTABcRB5.js} +1 -1
- package/_assets/{in-app-DUJu2O6v.js → in-app-CSDr4Blb.js} +1 -1
- package/_assets/{in-app-wallet-calls-C9Jxi05O.js → in-app-wallet-calls-Crivl9zc.js} +1 -1
- package/_assets/{index-CvPkDtGf.js → index-1oceTWwb.js} +3 -3
- package/_assets/{index-1--tLqz8.js → index-9_4ZEs3N.js} +1 -1
- package/_assets/{index-Dd4KtrAw.js → index-9x1mGBeU.js} +1 -1
- package/_assets/{index-CE124P9G.js → index-BBbwMaBz.js} +1 -1
- package/_assets/{index-d570G5B7.js → index-BNBzDf6z.js} +1 -1
- package/_assets/{index-dr6fXYBx.js → index-BTDIKmoC.js} +1 -1
- package/_assets/{index-CV1_E3wb.js → index-Bg_gOSx_.js} +1 -1
- package/_assets/{index-DU9MjygG.js → index-BniGBCAO.js} +1 -1
- package/_assets/{index-Dar3bPlr.js → index-Bs4LvV4K.js} +2 -2
- package/_assets/{index-ChBwA1h2.js → index-C0pcaEQl.js} +1 -1
- package/_assets/{index-CpjzOH1b.js → index-C23D_vyT.js} +1 -1
- package/_assets/{index-vQ65olfe.js → index-C5Evg5sh.js} +1 -1
- package/_assets/{index-3PUZ8U0R.js → index-C7hpB9s1.js} +3 -3
- package/_assets/{index-BAyG95nG.js → index-CGBg3yUz.js} +11 -11
- package/_assets/{index-DAnXL5-b.js → index-CHf7lsmp.js} +1 -1
- package/_assets/{index-CkF3QZy9.js → index-CHolIX6U.js} +1 -1
- package/_assets/{index-CTfBCyyR.js → index-CKUuopSw.js} +319 -315
- package/_assets/{index-CVqec2h5.js → index-CS27am7J.js} +1 -1
- package/_assets/{index-CFEHIoaL.js → index-Cf-gi-Qq.js} +1 -1
- package/_assets/{index-BwjISY1Q.js → index-CkGO7qOd.js} +1 -1
- package/_assets/{index-DecRfVMx.js → index-ClUPCoEW.js} +1 -1
- package/_assets/{index-DjqUHVKK.js → index-CmY0V0eX.js} +1 -1
- package/_assets/{index-syneNMGM.js → index-CvwosU6Y.js} +1 -1
- package/_assets/{index-5uftLGuI.js → index-CwRTjZPC.js} +3 -3
- package/_assets/{index-n49vue3k.js → index-CyRHowbs.js} +1 -1
- package/_assets/{index-JG0FDNiP.js → index-D5eMvKb_.js} +1 -1
- package/_assets/{index-BfqVu35d.js → index-D769FdFr.js} +1 -1
- package/_assets/{index-1wf8L6YU.js → index-D7LYoLo4.js} +1 -1
- package/_assets/{index-HaAGk4bQ.js → index-DKHMu0o3.js} +1 -1
- package/_assets/{index-AKUvJK7K.js → index-DKdQUEzy.js} +1 -1
- package/_assets/{index-Ctoo8CLR.js → index-DLFQdlEW.js} +1 -1
- package/_assets/{index-DrWim4p_.js → index-DSuiX4WG.js} +1 -1
- package/_assets/{index-DDLK5XSq.js → index-DXRL-4ld.js} +1 -1
- package/_assets/{index-1nKs4-Ix.js → index-DY1xBku2.js} +1 -1
- package/_assets/{index-z7leYudl.js → index-DdmULNRk.js} +2 -2
- package/_assets/{index-Bl-qZqD6.js → index-DgOiZShm.js} +1 -1
- package/_assets/{index-C2_mL_dX.js → index-Dh85kccn.js} +1 -1
- package/_assets/{index-WSwhnTRZ.js → index-DjTNPtj2.js} +1 -1
- package/_assets/{index-DXWzE47h.js → index-DkV5TYom.js} +1 -1
- package/_assets/{index-BlmfBcG1.js → index-DnJJn52L.js} +1 -1
- package/_assets/{index-Xuxrb8Q0.js → index-DoGz07sk.js} +1 -1
- package/_assets/{index-B2O7gZoQ.js → index-Dp2641E3.js} +1 -1
- package/_assets/{index-DWiRe-sp.js → index-DwX-9Zo4.js} +1 -1
- package/_assets/{index-3_UdO-zA.js → index-EKmmXx1j.js} +1 -1
- package/_assets/{index-DbrCcWJ3.js → index-HAEoS9R6.js} +1 -1
- package/_assets/{index-BXykQ7Kr.js → index-ItjVcw1b.js} +1 -1
- package/_assets/{index-zDqeLkyG.js → index-KWEbYeSY.js} +1 -1
- package/_assets/{index-C7AFAxAx.js → index-S0X-BG2b.js} +1 -1
- package/_assets/{index-BOgrc04A.js → index-UyXkCiLs.js} +1 -1
- package/_assets/{index-BBNLswz5.js → index-hKv-BpxY.js} +1 -1
- package/_assets/{index-DoVK9CTx.js → index-qGMuaBIs.js} +1 -1
- package/_assets/{index-D-wVNkf3.js → index-wRmEiTlP.js} +2 -2
- package/_assets/{index.es-CE2sG7i4.js → index.es-DnMGDxtr.js} +1 -1
- package/_assets/{index.es-DbgkC7jp.js → index.es-g_bB-nFv.js} +1 -1
- package/_assets/{index.es-yWYRmppU.js → index.es-wpL2Ycto.js} +4 -4
- package/_assets/{localBatchGatewayRequest-VK-lqBeb.js → localBatchGatewayRequest-DtELSHiE.js} +1 -1
- package/_assets/{networks-DlOv_Jl5.js → networks-ZmRqsvV6.js} +1 -1
- package/_assets/{onramp-15oxC79b.js → onramp-Bffl3qa3.js} +1 -1
- package/_assets/{openzeppelin-BpuVaBDh.js → openzeppelin-BmH-LNci.js} +1 -1
- package/_assets/{parseNft-D06uX5gG.js → parseNft-PSjb4qKi.js} +2 -2
- package/_assets/{parseSignature-CnSs3XPr.js → parseSignature-D947kFfv.js} +3 -3
- package/_assets/{parseSignature-DGgCDYUH.js → parseSignature-IigTmAp7.js} +1 -1
- package/_assets/{passkeys-B8jZMST_.js → passkeys-BsJVcpuM.js} +1 -1
- package/_assets/{pay-with-exchange-DzV0qz9m.js → pay-with-exchange-CU_HZd9F.js} +1 -1
- package/_assets/{qr-overlay-FhG6DCeK.js → qr-overlay-EMShc5uE.js} +1 -1
- package/_assets/{receive-Bf8iJtVw.js → receive-CO6WElZa.js} +1 -1
- package/_assets/{resolveImplementation-DdV3P3Xk.js → resolveImplementation-CUngPhAv.js} +1 -1
- package/_assets/{rpc-BZX60R_2.js → rpc-BqH_VMy9.js} +1 -1
- package/_assets/{secp256k1-ChfCRMNj.js → secp256k1-CTsmRKJj.js} +1 -1
- package/_assets/{secp256k1-BLNizqyz.js → secp256k1-D7kpLshE.js} +1 -1
- package/_assets/{secp256k1-BpFoXgJs.js → secp256k1-DneM3aYG.js} +1 -1
- package/_assets/{send-CE26RsoC.js → send-DnwW2LgN.js} +1 -1
- package/_assets/{send-batch-transaction-CdcLTVn2.js → send-batch-transaction-BgJnfEM8.js} +1 -1
- package/_assets/{send-eip712-transaction-DFbUyBnM.js → send-eip712-transaction-Cw3ykz5y.js} +2 -2
- package/_assets/{send-gasless-transaction-IULoS1Vn.js → send-gasless-transaction-BjGhnCwR.js} +2 -2
- package/_assets/{send-transaction-vCrIjEYg.js → send-transaction-COKVeGfk.js} +2 -2
- package/_assets/{sendMetaTransaction-C5CWJOs0.js → sendMetaTransaction-Bp3kwdLJ.js} +1 -1
- package/_assets/{sendRawTransaction-BnXA-t5g.js → sendRawTransaction-eVli2oE3.js} +3 -3
- package/_assets/{serializeTransaction-BuP136Wz.js → serializeTransaction-CIM9i_-w.js} +1 -1
- package/_assets/{session-proposal-CnATfxsE.js → session-proposal-KGl_Ah2b.js} +1 -1
- package/_assets/{session-request-PJjSNFhP.js → session-request-VAEXTksW.js} +2 -2
- package/_assets/{signing-DVSxcG9z.js → signing-Cgx49_1X.js} +3 -3
- package/_assets/{skeleton.styles-CLtTv572.js → skeleton.styles-BXNXDWEi.js} +1 -1
- package/_assets/{socials-Bf2bVkOp.js → socials-oKAOeF-k.js} +1 -1
- package/_assets/{styled-DUDTxrNz.js → styled-pD_2hanx.js} +1 -1
- package/_assets/{swaps-CfzGwDGN.js → swaps-BcAY_D99.js} +1 -1
- package/_assets/{thirdweb-fPfEaf4k.js → thirdweb-ChAqWFCO.js} +3 -3
- package/_assets/{to-serializable-transaction-DXr6jbkS.js → to-serializable-transaction-D9qGbcrS.js} +2 -2
- package/_assets/{transactionReceipt-eQP54mTE.js → transactionReceipt-BMw52z-f.js} +1 -1
- package/_assets/{transactions-CGh5C6RL.js → transactions-CeENvGIt.js} +1 -1
- package/_assets/{useCreditPacks-CasKnCD5.js → useCreditPacks-BcavayJ3.js} +1 -1
- package/_assets/{useImportable-SR1m5Hwh.js → useImportable-CqnIvzif.js} +1 -1
- package/_assets/{useInfiniteGrid-Cy1tipbK.js → useInfiniteGrid-BjEQAabI.js} +1 -1
- package/_assets/{useTheme-BvkrK9YA.js → useTheme-BnnteKI4.js} +1 -1
- package/_assets/{verifyHash-Bi_3pzoI.js → verifyHash-CuRmy06R.js} +1 -1
- package/_assets/{w3m-modal-DAkUUjAI.js → w3m-modal-BvOCJx7k.js} +1 -1
- package/_assets/{w3m-modal-D57uPD-0.js → w3m-modal-CkBFH4cA.js} +1 -1
- package/_assets/{wait-for-tx-receipt-ByVNtVUa.js → wait-for-tx-receipt-B2KaPYJT.js} +1 -1
- package/_assets/{wallets-DHJBT8N-.js → wallets-CpXU08d2.js} +5 -5
- package/_assets/{web-connector-zzH3rfgh.js → web-connector-BHRkWbB9.js} +3 -3
- package/_assets/{writeContract-BeuidFa5.js → writeContract-DNDGvg0r.js} +1 -1
- package/_assets/{zoraTestnet-D4oN56a_.js → zoraTestnet-CCn01jlp.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Authorizations-CLC0gP2S.js +0 -188
- package/_assets/LazyEmoteControls-DnvyzyyY.js +0 -2
- package/_assets/NotFound-CIGIbTGI.js +0 -13
- package/_assets/OutfitDetail-DF87HN6H.js +0 -334
- package/_assets/OutfitStudio-DHyzlXbm.js +0 -537
- package/_assets/StoreSettings-SFcLGWm7.js +0 -239
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as ke,r as P,b as
|
|
1
|
+
import{j as t,L as ke,r as P,b as Yt,a as Zt}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,bb as ea,J as ta,I as H,z as St,K as Le,x as aa,X as Q,am as ot,o as sa,q as na,v as ia,bc as ra,A as oa,bd as ca,an as da,be as la,bf as ct,bg as ua,bh as ha,y as pa,bi as dt,Z as G,bj as lt,bk as ga,F as ae,r as ma,c as ut,bl as xa,C as fa,bm as ht,bn as Re,bo as ya,bp as xe,bq as fe,br as pt,g as ye,f as ba,h as qe,bs as va}from"./index-CKUuopSw.js";import{M as wa,S as Ca,C as ja,H as ka,a as Sa,T as $a,X as Ta,b as Ma,B as Ia,c as Pa,d as gt,e as za,f as Ce,P as $t,m as Aa,g as Ea,h as Ra,i as qa,j as Tt,k as je,L as Ba,l as _a,n as mt,o as xt,W as Fa,p as Wa,q as La,A as Ka,r as Na,s as Ua,t as Qa,u as Ha,v as Oa,w as Ga,x as Va,y as Da,z as Ja,D as Xa,E as Ya,F as Za,G as es,I as ts,J as as,K as ss,N as Be,O as ns,Q as is,R as rs,U as os,V as ft,Y as yt,Z as cs,_ as ds,$ as ls}from"./CollectionCarousel-B9HmGuVb.js";import{k as us,l as hs,a as ps,n as gs,f as ms,A as xs}from"./authorizations-B3AvOvOm.js";import{g as fs,j as _e}from"./buy-BHkfYJLe.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-BfTEWjT9.js";import{u as ws,M as Cs,R as be,r as js,c as ks,p as vt}from"./useCreditPacks-BcavayJ3.js";import{i as Ss,a as $s}from"./errors-DZ_QWsza.js";import{E as Ts}from"./ErrorNotice-OUNK486K.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Bp3kwdLJ.js";const{colors:se,radius:Ms}=de,Is=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -58,7 +58,7 @@ import{j as t,L as ke,r as P,b as Xt,a as Zt}from"./react-BYHuwl8r.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`,Rs="https://cdn.decentraland.org/@dcl/shop/1.0.2-
|
|
61
|
+
`,Rs="https://cdn.decentraland.org/@dcl/shop/1.0.2-31061952187.commit-8d8b09e/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,F=l==="processing",V=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),D=l==="processing";return t.jsxs(wa,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[t.jsx(Ca,{onClick:F?void 0:z,"aria-hidden":!0}),t.jsxs(ja,{"data-tall":D||void 0,children:[t.jsxs(ka,{children:[t.jsxs(Sa,{children:[t.jsx($a,{children:V}),!F&&t.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:t.jsx(Ma,{})})]}),t.jsxs(Ia,{children:[t.jsx(Pa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),t.jsx(gt,{}),t.jsx(za,{children:ce(I)})]})]}),l==="choose"&&t.jsxs(Ce,{children:[t.jsxs(Es,{children:[t.jsx("span",{children:a("cart.purchaseSummary")}),t.jsxs("strong",{children:[t.jsx(gt,{}),ce(o.totalCredits??0)]})]}),t.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Aa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&t.jsx(Bs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&t.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&t.jsxs(Ce,{children:[t.jsxs(Ea,{"data-testid":"buy-error",children:[t.jsx(Ra,{src:Rs,alt:"",width:64,height:80}),t.jsxs(qa,{children:[t.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),t.jsxs(Tt,{children:[t.jsx(je,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),t.jsx(je,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Bs({stage:o,step:l,total:I,isSelfCustody:z,signatures:F}){const V=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&F&&F.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return t.jsxs(Ce,{"data-processing":!0,children:[t.jsx(Ba,{src:ea,alt:"",width:61,height:61}),t.jsx(_a,{children:ne}),V?t.jsxs(Is,{children:[t.jsx(mt,{"aria-hidden":!0,children:t.jsx(xt,{"data-step":!0,style:{width:`${D}%`}})}),I>1?t.jsxs(Ps,{children:[l,"/",I]}):null]}):t.jsx(mt,{"aria-hidden":!0,children:t.jsx(xt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:F,onBuyPacks:V,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return t.jsxs(Ce,{children:[t.jsxs(Fa,{"data-testid":"nofunds-warning",children:[t.jsx(Wa,{}),t.jsxs(La,{children:[t.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",t.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),t.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return t.jsxs(Ka,{children:[t.jsx(Na,{children:n.item.thumbnail?t.jsx("img",{src:n.item.thumbnail,alt:""}):null}),t.jsxs(Ua,{children:[t.jsxs("div",{children:[t.jsxs(Qa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?t.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?t.jsx(Ha,{address:n.item.creator}):null]}),t.jsxs(Oa,{children:[t.jsx(Ga,{}),t.jsx("span",{children:ce(n.priceCredits*L)})]})]})]},n.item.id)})}),t.jsx(Va,{children:I.map(n=>{const L=n.id===z;return t.jsxs(Da,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>F(n.id),children:[t.jsx(Ja,{src:Xa,alt:""}),t.jsx(Ya,{children:ce(n.credits)}),t.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),t.jsxs(es,{children:[t.jsxs(ts,{children:[t.jsx(as,{}),t.jsx("span",{children:ce((A==null?void 0:A.credits)??0)})]}),t.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),t.jsxs(Tt,{children:[t.jsx(je,{"data-variant":"outline",onClick:D,children:a("buyModal.cancel")}),t.jsx(je,{"data-variant":"gradient",onClick:V,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Fs,radius:Z}=de,Mt="@media (max-width: 1080px)",M="@media (max-width: 880px)",wt=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
|
|
@@ -308,11 +308,11 @@ import{j as t,L as ke,r as P,b as Xt,a as Zt}from"./react-BYHuwl8r.js";import{t
|
|
|
308
308
|
padding: 0 10px;
|
|
309
309
|
font-size: 12px;
|
|
310
310
|
}
|
|
311
|
-
`,
|
|
311
|
+
`,Js=i.div`
|
|
312
312
|
display: flex;
|
|
313
313
|
flex-direction: column;
|
|
314
314
|
gap: 24px;
|
|
315
|
-
`,
|
|
315
|
+
`,Xs=i.div`
|
|
316
316
|
position: relative;
|
|
317
317
|
display: flex;
|
|
318
318
|
align-items: stretch;
|
|
@@ -331,7 +331,7 @@ import{j as t,L as ke,r as P,b as Xt,a as Zt}from"./react-BYHuwl8r.js";import{t
|
|
|
331
331
|
&[data-unavailable] [data-desc] {
|
|
332
332
|
opacity: 0.7;
|
|
333
333
|
}
|
|
334
|
-
`,
|
|
334
|
+
`,Ys=i.div`
|
|
335
335
|
position: relative;
|
|
336
336
|
flex-shrink: 0;
|
|
337
337
|
width: 137.5px;
|
|
@@ -703,4 +703,4 @@ import{j as t,L as ke,r as P,b as Xt,a as Zt}from"./react-BYHuwl8r.js";import{t
|
|
|
703
703
|
& section {
|
|
704
704
|
margin-top: 0;
|
|
705
705
|
}
|
|
706
|
-
`;function Fe(o){if(Ss(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const We=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),we=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Vn(){aa({title:a("nav.cart"),noindex:!0});const o=Q(e=>e.items),l=Q(e=>e.remove),I=Q(e=>e.increment),z=Q(e=>e.decrement),F=Q(e=>e.clear),V=Q(e=>e.restore),D=Q(e=>e.setFittingOpen),A=ot(e=>e.items),ne=ot(e=>e.toggle),{session:n,signIn:L}=sa(),Et=na(),le=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(e=>e.category!=="emote"),{data:Se}=ia({queryKey:["upsell-listings"],queryFn:()=>va({first:40}),staleTime:6e4}),{data:S}=ra(n),v=oa(),ee=Xt(),{state:Y}=Zt(),[qt,ie]=P.useState(null),[Ke,ue]=P.useState(null),[Bt,q]=P.useState(!1),[B,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:he}=ca(n),{data:re}=da(!0),[$e,Ue]=P.useState(""),oe=P.useRef(null),Qe=la(o),He=e=>dt(Qe[e.id]),Te=o.filter(He),Oe=o.length>0&&Te.length===0,_t=Te.reduce((e,s)=>e+s.priceCredits*s.quantity,0),Ft=o.reduce((e,s)=>e+s.quantity,0),Wt=Te.reduce((e,s)=>e+s.quantity,0),Ge=B?B.liveTotalCredits:_t,Lt=new Set(o.map(e=>e.id)),Ve=((Se==null?void 0:Se.items)??[]).filter(e=>!Lt.has(e.id)).slice(0,12),Kt=new Map(B==null?void 0:B.buyable.map(e=>[e.item.id,e])),pe=(S==null?void 0:S.credits)??0,Me=Ge*10,Nt=re?ct(Me,re):0n,Ie=Be({priceCents:Me,priceManaWei:Nt,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),Ut=e=>e.some(s=>s.acquisition==="store"),Pe=e=>e.flatMap(s=>s.acquisition==="trade"?[s]:[]),Qt=ga,Ht=e=>xa(e.contractAddress,String(e.itemId));function ge(e){e(),O(null),ue(null),ie(null)}function Ot(){j(null),q(!1)}function De(e){const s=We(e),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ue(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:pe,shortfall:d}),j({phase:"nofunds",lines:e.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),q(!1)}async function ze(e){if(!n||e.length===0)return;const s=we(e),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=e.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,E=[];let R=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let x=0;x<s.length;x++){const p=s[x];j({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const T=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:U,maxCreditedValue:X}=await ht(n.identity,p.usdCents,T,C);u.push({salt:U.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[U],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[U],maxCreditedValue:X})}catch(T){if($s(T)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(e);return}throw T}}h="submit";const m=fs(y).length,k=x=>m>1?{current:x,total:m}:void 0,W=(x,p)=>j({phase:"processing",stage:x,step:s.length,total:s.length,signatures:k(p)}),K=x=>x<m?W("awaiting-signature",x+1):W("settling",m);W("awaiting-signature",1);let f=[];if(us())try{const x=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(m),onBroadcast:({txHash:C,salts:U})=>{x.set(C,U),U.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,U)=>{const X=x.get(f[U])??[];C.status==="fulfilled"?(X.forEach(Ee=>$.add(Ee)),E.push(f[U])):C.reason instanceof bt||X.forEach(Ee=>_.add(Ee))});const T=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(T.length&&!T.some(C=>C instanceof bt))throw T[0];R=!0}catch(x){if(!(x instanceof vs)||!ya(n.providerType))throw x;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(T=>w.add(T)),onSettled:({txHash:p,salts:T})=>{T.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(T=>_.add(T))})}else f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(p=>w.add(p)),onSettled:({txHash:x,salts:p})=>{p.forEach(T=>$.add(T)),E.push(x)},onReverted:({salts:x})=>x.forEach(p=>_.add(p))});e.forEach(x=>l(x.item.id)),O(null),G("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:R,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),q(!1);const N={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:N,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:e.length});const m=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:W}=vt({reservations:u,spent:m,settled:$}),K=d.filter(b=>W.includes(b.id)),f=d.filter(b=>!W.includes(b.id));if(G(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,N)=>b+N.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){W.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...xe(K),payment_type:"credits",no_crypto_step:R,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),q(!1);return}j({phase:"error",message:Fe(y)})}}function Ye(e,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),q(!1);const c={items:e,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Je(e,s){fe(e)||ae(e,{flow:s,step:"submit"}),G(fe(e)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(e)}),j({phase:"error",message:Fe(e)}),q(!1)}async function Gt(e,s){const d=ye(qe.MANAToken,s),c=ye(qe.CreditsManager,s);await ms({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:e})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Vt(e){const s=we(e).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(e,s){const d=We(e),{totalCents:c,manaWei:u}=await Vt(e),h=Be({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),w=Ut(e)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){ze(e);return}const{spender:$,chainId:_}=et(s,e);await tt($,_,()=>s==="mana"?void at(e):void st(e,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:e,totalCents:c,manaWei:u}),q(!1);return}if(S!=null&&S.credits<d){De(e);return}ze(e)}function Dt(e){return Be({priceCents:e.totalCents,priceManaWei:e.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=P.useState(null);function et(e,s){const d=Pe(s)[0].trade;return{spender:e==="mana"?ye(ba(d.contract),d.chainId).address:ye(qe.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(e,s,d){const c=hs(s,e),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){q(!1),me({auth:c,run:d});return}d()}function Yt(e){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(e==="credits"){ze(s);return}const{spender:u,chainId:h}=et(e,s);tt(u,h,()=>e==="mana"?void at(s):void st(s,d,c))}async function at(e){if(!n||e.length===0)return;const s=we(e),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=e.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await cs({trades:Pe(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});e.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...xe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(e,s,d){if(!n||e.length===0)return;const c=we(e),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=e.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=ds(c.map(m=>m.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((m,k)=>m+k,0),_=ls(Math.max(0,s-$),s,d),E=[],R=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Pe(c),k=[];for(let f=0;f<m.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:m.length});const N=m[f].item,{credit:x,maxCreditedValue:p}=await ht(n.identity,b,m[f].trade.id,N.contractAddress&&N.itemId!=null?{contractAddress:N.contractAddress,itemId:String(N.itemId)}:void 0);E.push({salt:x.id,itemId:N.id}),k.push({kind:"trade",trade:m[f].trade,credits:[x],maxCreditedValue:p})}m.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,m[0].trade.chainId);const W=()=>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 _e({purchases:k,buyer:n.address,signer:n.signer,onSigned:W,onBroadcast:({salts:f})=>f.forEach(b=>R.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});e.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...xe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(h,K)}catch(m){const{toRelease:k}=vt({reservations:E,spent:new Set([...R].filter(W=>!y.has(W))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(m,"buy_cart_combined")}}async function te(e){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(He);if(s.length===0)return;ie(null),ue(null),q(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:lt(d),has_sufficient_credits:pe>=d});try{const c=await js(s,n.address,Qt,await Xe(),Ht),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,e)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{q(!1)}}async function nt(){if(B){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),ue(null),await te();return}ie(null),Ze(B.buyable)}}async function Jt(){if($e){try{sessionStorage.setItem(be,JSON.stringify(Q.getState().items))}catch{}q(!0);try{const e=await ks($e,n?{address:n.address,identity:n.identity}:void 0);if(e.url){window.location.href=e.url;return}ee("/credits")}catch(e){try{sessionStorage.removeItem(be)}catch{}ae(e,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const e=setTimeout(()=>void te(),0);return()=>clearTimeout(e)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(Y!=null&&Y.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=Y.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&V(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const e=setTimeout(()=>void te(),0);return()=>clearTimeout(e)},[Y==null?void 0:Y.resumeCheckout]);const J=Bt||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?t.jsx(wt,{children:t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ns,{"data-testid":"cart-empty",children:[t.jsx(H,{name:"cart-plus",size:110}),t.jsxs(Us,{children:[t.jsx(Qs,{children:a("cart.empty.title")}),t.jsx(Hs,{children:a("cart.empty.body")})]}),t.jsx(Os,{to:"/items",children:a("cart.empty.cta")})]})]})}):t.jsxs(wt,{children:[t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ws,{children:[t.jsxs(Ls,{children:[t.jsxs(Ks,{children:[t.jsx(Gs,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:t.jsx(H,{name:"arrow-left"})}),t.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Rt?t.jsxs(Ds,{onClick:()=>D(!0),disabled:J,children:[t.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),t.jsxs(It,{children:[t.jsx(Ys,{children:o.map(e=>{const s=Kt.get(e.id),d=s?s.priceCredits:e.priceCredits,c=!!s&&s.priceCredits!==e.priceCredits,u=!e.tokenId,h=e.quantity,w=typeof e.available=="number"&&h>=e.available,$=d*h,_=ua(e),E=!!_&&!!A[_],R=ha(e),y=Qe[e.id],m=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return t.jsxs(Js,{"data-unavailable":m||void 0,children:[t.jsxs(Xs,{"data-thumb":!0,children:[R?t.jsx(Zs,{to:R,state:{item:e,tradeId:e.tradeId},"aria-label":e.name,children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null}):e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null,t.jsx(en,{"data-check":!0,"aria-hidden":!0,children:t.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:t.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsxs(tn,{children:[t.jsxs(an,{"data-desc":!0,children:[R?t.jsx(nn,{to:R,state:{item:e,tradeId:e.tradeId},title:e.name,children:e.name}):t.jsx(sn,{title:e.name,children:e.name}),e.creator?t.jsx(rn,{address:e.creator,linkToProfile:!0}):null,Et&&u?t.jsxs(fn,{"data-testid":"cart-creator-tag",children:[t.jsx(yn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),t.jsx(on,{children:m?t.jsxs(t.Fragment,{children:[t.jsxs(gn,{children:[t.jsx(mn,{name:"warning-fill",size:24}),k]}),R?t.jsx(xn,{to:R,state:{item:e,tradeId:e.tradeId},children:a("cart.availability.viewResales")}):null]}):t.jsxs(t.Fragment,{children:[u?t.jsxs(cn,{children:[t.jsx(kt,{onClick:()=>ge(()=>z(e.id)),disabled:J||h<=1,"aria-label":a("cart.decreaseQuantity",{name:e.name}),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),t.jsx(dn,{children:h}),t.jsx(kt,{onClick:()=>ge(()=>I(e.id)),disabled:J||w,"aria-label":a("cart.increaseQuantity"),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,t.jsxs(ln,{children:[t.jsx(un,{})," ",$,c?t.jsx(hn,{children:e.priceCredits*h}):null]})]})})]}),t.jsxs(pn,{children:[_?t.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(e),"aria-label":E?a("cart.removeFromFavorites",{name:e.name}):a("cart.addToFavorites",{name:e.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:t.jsx(H,{name:E?"heart-solid":"heart"})}):null,t.jsx(vn,{onClick:()=>ge(()=>l(e.id)),disabled:J,"aria-label":a("cart.remove",{name:e.name}),title:a("cart.removeTitle"),children:t.jsx(H,{name:"trash",size:24})})]})]},e.id)})}),t.jsx(wn,{children:t.jsx("button",{className:"link",onClick:()=>ge(F),disabled:J,children:a("cart.clearCart")})})]})]}),t.jsxs(Cn,{children:[t.jsx(jn,{children:a("cart.purchaseSummary")}),t.jsxs(kn,{children:[t.jsxs(Sn,{children:[t.jsx($n,{children:a("cart.totalItems",{count:Wt})}),t.jsx(Mn,{children:t.jsxs(Tn,{children:[t.jsx(In,{})," ",Ge]})})]}),t.jsx($t,{options:Ie.options,totalCents:Me,shortfall:Ie.manaShortfall,showCreditsAmount:!1,creditsLabel:B?a("marketCheckout.confirmPurchase"):Ie.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:J||Oe,onPay:e=>void(B?nt():te(e)),creditsFallback:{label:J?a("cart.working"):B?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(B?nt():te())}}),Oe?t.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:t.jsx(ve,{className:"muted",children:a("cart.signInHint")}),B?t.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ke?t.jsx(ve,{className:"muted",children:Ke}):null,t.jsx(Pn,{message:qt})]})]})]})]}),Ve.length>0?t.jsx(zn,{children:t.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ve})}):null,Ae&&n?t.jsx(rs,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:t.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:e}=Ae;me(null),e()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?t.jsx(qs,{phase:g.phase,balanceCredits:pe,onClose:Ot,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Dt(g).options:void 0,onPay:Yt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?We(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:$e,onSelectPack:Ue,onBuyPacks:()=>void Jt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Vn as Cart};
|
|
706
|
+
`;function Fe(o){if(Ss(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const We=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),we=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Vn(){aa({title:a("nav.cart"),noindex:!0});const o=Q(e=>e.items),l=Q(e=>e.remove),I=Q(e=>e.increment),z=Q(e=>e.decrement),F=Q(e=>e.clear),V=Q(e=>e.restore),D=Q(e=>e.setFittingOpen),A=ot(e=>e.items),ne=ot(e=>e.toggle),{session:n,signIn:L}=sa(),Et=na(),le=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(e=>e.category!=="emote"),{data:Se}=ia({queryKey:["upsell-listings"],queryFn:()=>va({first:40}),staleTime:6e4}),{data:S}=ra(n),v=oa(),ee=Yt(),{state:J}=Zt(),[qt,ie]=P.useState(null),[Ke,ue]=P.useState(null),[Bt,q]=P.useState(!1),[B,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:he}=ca(n),{data:re}=da(!0),[$e,Ue]=P.useState(""),oe=P.useRef(null),Qe=la(o),He=e=>dt(Qe[e.id]),Te=o.filter(He),Oe=o.length>0&&Te.length===0,_t=Te.reduce((e,s)=>e+s.priceCredits*s.quantity,0),Ft=o.reduce((e,s)=>e+s.quantity,0),Wt=Te.reduce((e,s)=>e+s.quantity,0),Ge=B?B.liveTotalCredits:_t,Lt=new Set(o.map(e=>e.id)),Ve=((Se==null?void 0:Se.items)??[]).filter(e=>!Lt.has(e.id)).slice(0,12),Kt=new Map(B==null?void 0:B.buyable.map(e=>[e.item.id,e])),pe=(S==null?void 0:S.credits)??0,Me=Ge*10,Nt=re?ct(Me,re):0n,Ie=Be({priceCents:Me,priceManaWei:Nt,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),Ut=e=>e.some(s=>s.acquisition==="store"),Pe=e=>e.flatMap(s=>s.acquisition==="trade"?[s]:[]),Qt=ga,Ht=e=>xa(e.contractAddress,String(e.itemId));function ge(e){e(),O(null),ue(null),ie(null)}function Ot(){j(null),q(!1)}function De(e){const s=We(e),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ue(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:pe,shortfall:d}),j({phase:"nofunds",lines:e.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),q(!1)}async function ze(e){if(!n||e.length===0)return;const s=we(e),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=e.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,E=[];let R=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let x=0;x<s.length;x++){const p=s[x];j({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const T=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:U,maxCreditedValue:Y}=await ht(n.identity,p.usdCents,T,C);u.push({salt:U.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[U],maxCreditedValue:Y,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[U],maxCreditedValue:Y})}catch(T){if($s(T)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(e);return}throw T}}h="submit";const m=fs(y).length,k=x=>m>1?{current:x,total:m}:void 0,W=(x,p)=>j({phase:"processing",stage:x,step:s.length,total:s.length,signatures:k(p)}),K=x=>x<m?W("awaiting-signature",x+1):W("settling",m);W("awaiting-signature",1);let f=[];if(us())try{const x=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(m),onBroadcast:({txHash:C,salts:U})=>{x.set(C,U),U.forEach(Y=>w.add(Y))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,U)=>{const Y=x.get(f[U])??[];C.status==="fulfilled"?(Y.forEach(Ee=>$.add(Ee)),E.push(f[U])):C.reason instanceof bt||Y.forEach(Ee=>_.add(Ee))});const T=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(T.length&&!T.some(C=>C instanceof bt))throw T[0];R=!0}catch(x){if(!(x instanceof vs)||!ya(n.providerType))throw x;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(T=>w.add(T)),onSettled:({txHash:p,salts:T})=>{T.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(T=>_.add(T))})}else f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(p=>w.add(p)),onSettled:({txHash:x,salts:p})=>{p.forEach(T=>$.add(T)),E.push(x)},onReverted:({salts:x})=>x.forEach(p=>_.add(p))});e.forEach(x=>l(x.item.id)),O(null),G("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:R,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),q(!1);const N={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:N,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:e.length});const m=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:W}=vt({reservations:u,spent:m,settled:$}),K=d.filter(b=>W.includes(b.id)),f=d.filter(b=>!W.includes(b.id));if(G(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,N)=>b+N.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){W.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...xe(K),payment_type:"credits",no_crypto_step:R,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),q(!1);return}j({phase:"error",message:Fe(y)})}}function Je(e,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),q(!1);const c={items:e,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Xe(e,s){fe(e)||ae(e,{flow:s,step:"submit"}),G(fe(e)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(e)}),j({phase:"error",message:Fe(e)}),q(!1)}async function Gt(e,s){const d=ye(qe.MANAToken,s),c=ye(qe.CreditsManager,s);await ms({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:e})}async function Ye(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Vt(e){const s=we(e).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Ye():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(e,s){const d=We(e),{totalCents:c,manaWei:u}=await Vt(e),h=Be({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),w=Ut(e)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){ze(e);return}const{spender:$,chainId:_}=et(s,e);await tt($,_,()=>s==="mana"?void at(e):void st(e,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:e,totalCents:c,manaWei:u}),q(!1);return}if(S!=null&&S.credits<d){De(e);return}ze(e)}function Dt(e){return Be({priceCents:e.totalCents,priceManaWei:e.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=P.useState(null);function et(e,s){const d=Pe(s)[0].trade;return{spender:e==="mana"?ye(ba(d.contract),d.chainId).address:ye(qe.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(e,s,d){const c=hs(s,e),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){q(!1),me({auth:c,run:d});return}d()}function Jt(e){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(e==="credits"){ze(s);return}const{spender:u,chainId:h}=et(e,s);tt(u,h,()=>e==="mana"?void at(s):void st(s,d,c))}async function at(e){if(!n||e.length===0)return;const s=we(e),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=e.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await cs({trades:Pe(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});e.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...xe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(c,h)}catch(h){Xe(h,"buy_cart_mana")}}async function st(e,s,d){if(!n||e.length===0)return;const c=we(e),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=e.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=ds(c.map(m=>m.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((m,k)=>m+k,0),_=ls(Math.max(0,s-$),s,d),E=[],R=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Pe(c),k=[];for(let f=0;f<m.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:m.length});const N=m[f].item,{credit:x,maxCreditedValue:p}=await ht(n.identity,b,m[f].trade.id,N.contractAddress&&N.itemId!=null?{contractAddress:N.contractAddress,itemId:String(N.itemId)}:void 0);E.push({salt:x.id,itemId:N.id}),k.push({kind:"trade",trade:m[f].trade,credits:[x],maxCreditedValue:p})}m.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,m[0].trade.chainId);const W=()=>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 _e({purchases:k,buyer:n.address,signer:n.signer,onSigned:W,onBroadcast:({salts:f})=>f.forEach(b=>R.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});e.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...xe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(h,K)}catch(m){const{toRelease:k}=vt({reservations:E,spent:new Set([...R].filter(W=>!y.has(W))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Xe(m,"buy_cart_combined")}}async function te(e){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(He);if(s.length===0)return;ie(null),ue(null),q(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:lt(d),has_sufficient_credits:pe>=d});try{const c=await js(s,n.address,Qt,await Ye(),Ht),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,e)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{q(!1)}}async function nt(){if(B){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),ue(null),await te();return}ie(null),Ze(B.buyable)}}async function Xt(){if($e){try{sessionStorage.setItem(be,JSON.stringify(Q.getState().items))}catch{}q(!0);try{const e=await ks($e,n?{address:n.address,identity:n.identity}:void 0);if(e.url){window.location.href=e.url;return}ee("/credits")}catch(e){try{sessionStorage.removeItem(be)}catch{}ae(e,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const e=setTimeout(()=>void te(),0);return()=>clearTimeout(e)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&V(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const e=setTimeout(()=>void te(),0);return()=>clearTimeout(e)},[J==null?void 0:J.resumeCheckout]);const X=Bt||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?t.jsx(wt,{children:t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ns,{"data-testid":"cart-empty",children:[t.jsx(H,{name:"cart-plus",size:110}),t.jsxs(Us,{children:[t.jsx(Qs,{children:a("cart.empty.title")}),t.jsx(Hs,{children:a("cart.empty.body")})]}),t.jsx(Os,{to:"/items",children:a("cart.empty.cta")})]})]})}):t.jsxs(wt,{children:[t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ws,{children:[t.jsxs(Ls,{children:[t.jsxs(Ks,{children:[t.jsx(Gs,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:t.jsx(H,{name:"arrow-left"})}),t.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Rt?t.jsxs(Ds,{onClick:()=>D(!0),disabled:X,children:[t.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),t.jsxs(It,{children:[t.jsx(Js,{children:o.map(e=>{const s=Kt.get(e.id),d=s?s.priceCredits:e.priceCredits,c=!!s&&s.priceCredits!==e.priceCredits,u=!e.tokenId,h=e.quantity,w=typeof e.available=="number"&&h>=e.available,$=d*h,_=ua(e),E=!!_&&!!A[_],R=ha(e),y=Qe[e.id],m=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return t.jsxs(Xs,{"data-unavailable":m||void 0,children:[t.jsxs(Ys,{"data-thumb":!0,children:[R?t.jsx(Zs,{to:R,state:{item:e,tradeId:e.tradeId},"aria-label":e.name,children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null}):e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null,t.jsx(en,{"data-check":!0,"aria-hidden":!0,children:t.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:t.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsxs(tn,{children:[t.jsxs(an,{"data-desc":!0,children:[R?t.jsx(nn,{to:R,state:{item:e,tradeId:e.tradeId},title:e.name,children:e.name}):t.jsx(sn,{title:e.name,children:e.name}),e.creator?t.jsx(rn,{address:e.creator,linkToProfile:!0}):null,Et&&u?t.jsxs(fn,{"data-testid":"cart-creator-tag",children:[t.jsx(yn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),t.jsx(on,{children:m?t.jsxs(t.Fragment,{children:[t.jsxs(gn,{children:[t.jsx(mn,{name:"warning-fill",size:24}),k]}),R?t.jsx(xn,{to:R,state:{item:e,tradeId:e.tradeId},children:a("cart.availability.viewResales")}):null]}):t.jsxs(t.Fragment,{children:[u?t.jsxs(cn,{children:[t.jsx(kt,{onClick:()=>ge(()=>z(e.id)),disabled:X||h<=1,"aria-label":a("cart.decreaseQuantity",{name:e.name}),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),t.jsx(dn,{children:h}),t.jsx(kt,{onClick:()=>ge(()=>I(e.id)),disabled:X||w,"aria-label":a("cart.increaseQuantity"),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,t.jsxs(ln,{children:[t.jsx(un,{})," ",$,c?t.jsx(hn,{children:e.priceCredits*h}):null]})]})})]}),t.jsxs(pn,{children:[_?t.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(e),"aria-label":E?a("cart.removeFromFavorites",{name:e.name}):a("cart.addToFavorites",{name:e.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:t.jsx(H,{name:E?"heart-solid":"heart"})}):null,t.jsx(vn,{onClick:()=>ge(()=>l(e.id)),disabled:X,"aria-label":a("cart.remove",{name:e.name}),title:a("cart.removeTitle"),children:t.jsx(H,{name:"trash",size:24})})]})]},e.id)})}),t.jsx(wn,{children:t.jsx("button",{className:"link",onClick:()=>ge(F),disabled:X,children:a("cart.clearCart")})})]})]}),t.jsxs(Cn,{children:[t.jsx(jn,{children:a("cart.purchaseSummary")}),t.jsxs(kn,{children:[t.jsxs(Sn,{children:[t.jsx($n,{children:a("cart.totalItems",{count:Wt})}),t.jsx(Mn,{children:t.jsxs(Tn,{children:[t.jsx(In,{})," ",Ge]})})]}),t.jsx($t,{options:Ie.options,totalCents:Me,shortfall:Ie.manaShortfall,showCreditsAmount:!1,creditsLabel:B?a("marketCheckout.confirmPurchase"):Ie.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:X||Oe,onPay:e=>void(B?nt():te(e)),creditsFallback:{label:X?a("cart.working"):B?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(B?nt():te())}}),Oe?t.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:t.jsx(ve,{className:"muted",children:a("cart.signInHint")}),B?t.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ke?t.jsx(ve,{className:"muted",children:Ke}):null,t.jsx(Pn,{message:qt})]})]})]})]}),Ve.length>0?t.jsx(zn,{children:t.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ve})}):null,Ae&&n?t.jsx(rs,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:t.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:e}=Ae;me(null),e()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?t.jsx(qs,{phase:g.phase,balanceCredits:pe,onClose:Ot,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Dt(g).options:void 0,onPay:Jt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?We(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:$e,onSelectPack:Ue,onBuyPacks:()=>void Xt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Vn as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-CKUuopSw.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-pD_2hanx.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,
|
|
1
|
+
import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a1 as te,D as R,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ap as z,aq as de,bw as pe,bx as xe}from"./index-CKUuopSw.js";import{E as he}from"./ErrorNotice-OUNK486K.js";import{d as me,P as ge,C as ue,a as be,b as fe,A as ve}from"./collectionPage.styles-CoEdrsfq.js";import{u as ye,S as W,a as je,F as Ce,c as we,P as $e,d as ke,H as Ne,e as Se}from"./categories-D23W_J-A.js";import{L as Pe}from"./LoadMore-jSNRJiwZ.js";import{u as Ae}from"./useInfiniteGrid-BjEQAabI.js";import{G as Me}from"./grid.styles-hOZTJ80g.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-BXNXDWEi.js";const Te=s.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${b.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -11,20 +11,20 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv
|
|
|
11
11
|
${b.media.maxWidth("mobile")} {
|
|
12
12
|
min-height: 140px;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,Ee=s.div`
|
|
15
15
|
position: absolute;
|
|
16
16
|
inset: 0;
|
|
17
17
|
z-index: 0;
|
|
18
|
-
`,
|
|
18
|
+
`,Fe=s.img`
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
object-fit: cover;
|
|
22
22
|
display: block;
|
|
23
|
-
`,
|
|
23
|
+
`,Re=s.div`
|
|
24
24
|
position: absolute;
|
|
25
25
|
inset: 0;
|
|
26
26
|
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
|
|
27
|
-
`,
|
|
27
|
+
`,ze=s.h1`
|
|
28
28
|
position: relative;
|
|
29
29
|
z-index: 1;
|
|
30
30
|
margin: 0;
|
|
@@ -42,7 +42,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv
|
|
|
42
42
|
padding: 24px 16px;
|
|
43
43
|
font-size: 26px;
|
|
44
44
|
}
|
|
45
|
-
`;function We({name:o,creator:t}){const{data:n}=ee(t),p=(n==null?void 0:n.cover)||me;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(
|
|
45
|
+
`;function We({name:o,creator:t}){const{data:n}=ee(t),p=(n==null?void 0:n.cover)||me;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Fe,{src:p,alt:"",loading:"eager"}),e.jsx(Re,{"aria-hidden":!0})]}),e.jsx(ze,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:B}=b,Le=s.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
48
|
align-items: center;
|
|
@@ -116,7 +116,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv
|
|
|
116
116
|
background: ${c.softWhite};
|
|
117
117
|
color: ${c.text};
|
|
118
118
|
}
|
|
119
|
-
`;function Ge({address:o}){var v,d;const{data:t}=te(o),[n,p]=m.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||
|
|
119
|
+
`;function Ge({address:o}){var v,d;const{data:t}=te(o),[n,p]=m.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||R(o),g=(d=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:d.face256,u=`${re.profileUrl}/${o}`,f=ae(oe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),p(!0),window.setTimeout(()=>p(!1),1500)}catch(j){se(j,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[g?e.jsx(L,{src:g,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(L,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Be,{title:l,children:l}),e.jsxs(Ie,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:R(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(_e,{"data-testid":"creator-card-view",href:u,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:He,media:$}=b,Ue=s.div`
|
|
120
120
|
position: relative;
|
|
121
121
|
display: flex;
|
|
122
122
|
gap: 32px;
|
|
@@ -125,14 +125,14 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv
|
|
|
125
125
|
${$.maxWidth("lg")} {
|
|
126
126
|
display: block;
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`,qe=s.div`
|
|
129
129
|
flex: 1;
|
|
130
130
|
min-width: 0;
|
|
131
131
|
|
|
132
132
|
${$.maxWidth("lg")} {
|
|
133
133
|
width: 100%;
|
|
134
134
|
}
|
|
135
|
-
`,
|
|
135
|
+
`,Ye=s.aside`
|
|
136
136
|
flex: none;
|
|
137
137
|
width: 265px;
|
|
138
138
|
|
|
@@ -159,4 +159,4 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv
|
|
|
159
159
|
visibility: visible;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
`,De=48;function st(){var
|
|
162
|
+
`,De=48;function st(){var F;const{contractAddress:o}=J(),t=X(),[n,p]=m.useState("all"),[l,g]=m.useState(null),[u,f]=m.useState([]),[x,v]=m.useState(""),[d,j]=m.useState(""),[k,I]=m.useState("newest");ye(`${n}:${l??""}`);const N=x&&!Number.isNaN(Number(x))?Number(x):void 0,S=d&&!Number.isNaN(Number(d))?Number(d):void 0,_=l?Se[l]:void 0,G=(W.find(i=>i.key===k)??W[0]).server,P={category:n,rarities:u.length?u:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:S,sortBy:G},{items:y,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:q,fetchNextPage:Y}=Ae(["collection-page",o,P],i=>pe(o,{...P,first:De,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),T=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const E=(r==null?void 0:r.creator)||((F=y[0])==null?void 0:F.creator);function D(i){p(i),g(null)}function K(i){f(h=>h.includes(i)?h.filter(Z=>Z!==i):[...h,i])}function O(){p("all"),g(null),f([]),v(""),j("")}const w=!!(N||S),Q=w?`${x||"0"}–${d||"∞"}`:a("filter.price"),V=n!=="all"||!!l||u.length>0||w;return e.jsxs(ge,{"data-testid":"collection-page",children:[e.jsxs(ue,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:T})]}),e.jsx(We,{name:T,creator:E}),e.jsxs(Ue,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(Ge,{address:E}),e.jsx(je,{category:n,subCategory:l,onCategory:D,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(qe,{children:[!C&&y.length>0?e.jsx(ve,{items:y,source:"collection"}):null,e.jsx(Ce,{rarities:u,onToggleRarity:K,sort:k,onSort:I,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(we,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs($e,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:h=>v(h.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:d,onChange:h=>j(h.target.value)})]}),e.jsx(Ne,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(he,{message:a("collection.error")}):null,e.jsx(Me,{"data-testid":"grid",children:C?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[y.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(z,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:q,onLoadMore:()=>void Y()}),!C&&!A&&y.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{st as Collection,st as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,
|
|
1
|
+
import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,b$ as M,C as Z,w as J,I as X,F as Y,g as W,h as I,f as G,ar as _,a9 as ee,co as F,aq as te}from"./index-CKUuopSw.js";import{s as ne,f as q,A as D,g as L,r as ae,m as ie,i as oe,j as se}from"./authorizations-B3AvOvOm.js";import{i as re}from"./errors-DZ_QWsza.js";import{E as de}from"./ErrorNotice-OUNK486K.js";import{l as ce,m as le,n as pe}from"./buy-BHkfYJLe.js";import{s as he,M as ue,E as xe}from"./sendMetaTransaction-Bp3kwdLJ.js";import{I as ge,C as fe}from"./ethers-BDpbhgX6.js";const P="shop:resume_after_signin",me=900*1e3;function dt(a){try{sessionStorage.setItem(P,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(P)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(P)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>me?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function be(a,n){return(a+n-1n)/n}function we(a,n,i){return a<=0||n<=0?0n:a>=n?i:be(i*BigInt(a),BigInt(n))}function lt(a){var b,h,y;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,o=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const d=[];if(i>=n&&d.push({method:"credits",creditsCents:n,manaWei:0n}),o>0n&&i>0&&i<n){const c=n-i,w=we(c,n,o);l>=w&&d.push({method:"combined",creditsCents:i,manaWei:w})}o>0n&&l>=o&&d.push({method:"mana",creditsCents:0,manaWei:o});const p=((b=d.find(c=>c.method==="credits"))==null?void 0:b.method)??((h=d.find(c=>c.method==="combined"))==null?void 0:h.method)??((y=d.find(c=>c.method==="mana"))==null?void 0:y.method)??null,g=!d.some(c=>c.method==="mana"||c.method==="combined")&&o>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,o),priceCents:n}:null;return{options:d,preferred:p,manaShortfall:g}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(o=>{const l=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,d=Math.min(l,i);return i-=d,d})}function A(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const B="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",ve=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -289,10 +289,10 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function ft({auth:a,signer:n,title:i,reason:o,name:l,image:d,icon:p,onAuthorized:x,onCancel:g,onClose:b}){const[h,y]=v.useState(!1),[c,w]=v.useState(null);async function k(){y(!0),w(null);try{await ne({auth:a,signer:n,active:!0}),x()}catch(u){re(u)?w(m("authorizeStep.errorRejected")):(Y(u,{flow:"authorize_step",kind:a.kind}),w(m("authorizeStep.errorGeneric"))),y(!1)}}return t.jsx(ze,{onClick:h?void 0:b,role:"presentation",children:t.jsxs(Te,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx($e,{children:i}),t.jsx(Be,{onClick:b,disabled:h,"aria-label":m("authorizeStep.close"),children:t.jsx(X,{name:"close",className:"ico"})})]}),t.jsxs(Ne,{"data-testid":"authorize-step-row",children:[t.jsx(Ee,{children:d?t.jsx("img",{src:d,alt:""}):p}),t.jsxs(Ie,{children:[t.jsx(Pe,{title:l,children:l}),t.jsx(Se,{children:o})]})]}),t.jsx(Ve,{children:m("authorizeStep.note")}),t.jsx(de,{message:c}),t.jsxs(Fe,{children:[t.jsx(Le,{type:"button",onClick:g,disabled:h,children:m("authorizeStep.cancel")}),t.jsx(Oe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void k(),disabled:h,children:h?t.jsxs(t.Fragment,{children:[t.jsx(Re,{"aria-hidden":!0}),m("authorizeStep.authorizing")]}):m("authorizeStep.authorize")})]})]})})}const mt="data:image/webp;base64,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";async function bt(a){const[n]=await Xe({...a,trades:[a.trade]});return n}async function Xe(a){const{trades:n,buyer:i,signer:o,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const d=new Map;for(const x of n){const g=`${x.chainId}:${x.contract.toLowerCase()}`,b=d.get(g);b?b.push(x):d.set(g,[x])}const p=[];for(const x of d.values())p.push(await
|
|
292
|
+
`;function ft({auth:a,signer:n,title:i,reason:o,name:l,image:d,icon:p,onAuthorized:x,onCancel:g,onClose:b}){const[h,y]=v.useState(!1),[c,w]=v.useState(null);async function k(){y(!0),w(null);try{await ne({auth:a,signer:n,active:!0}),x()}catch(u){re(u)?w(m("authorizeStep.errorRejected")):(Y(u,{flow:"authorize_step",kind:a.kind}),w(m("authorizeStep.errorGeneric"))),y(!1)}}return t.jsx(ze,{onClick:h?void 0:b,role:"presentation",children:t.jsxs(Te,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx($e,{children:i}),t.jsx(Be,{onClick:b,disabled:h,"aria-label":m("authorizeStep.close"),children:t.jsx(X,{name:"close",className:"ico"})})]}),t.jsxs(Ne,{"data-testid":"authorize-step-row",children:[t.jsx(Ee,{children:d?t.jsx("img",{src:d,alt:""}):p}),t.jsxs(Ie,{children:[t.jsx(Pe,{title:l,children:l}),t.jsx(Se,{children:o})]})]}),t.jsx(Ve,{children:m("authorizeStep.note")}),t.jsx(de,{message:c}),t.jsxs(Fe,{children:[t.jsx(Le,{type:"button",onClick:g,disabled:h,children:m("authorizeStep.cancel")}),t.jsx(Oe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void k(),disabled:h,children:h?t.jsxs(t.Fragment,{children:[t.jsx(Re,{"aria-hidden":!0}),m("authorizeStep.authorizing")]}):m("authorizeStep.authorize")})]})]})})}const mt="data:image/webp;base64,UklGRvgKAABXRUJQVlA4IOwKAADQKwCdASpgAGUAPjEUiEKiISEUnq8wIAMEtgBkC7j/3+G/I38cvlZrz9m/Bv7ucdsZLtP/U/cL2pPMH/Tb/Nfar3MfMJ+1P7ge7h/p/W5/dvUF/ln/R60X0FfLU/cP4VP2y/bv2Zf//dh/DX9N2THgHQ12q7Xn+Y33EAH0+/4PqITRFa4zT/1eWj619gr9Vf+j6x/rq/cX2Hv1j//7lHMptECj4S9oGS9bHSMqnYSXt0dT9/kqkBaEohWLz5fYi/Xc3O4w88eWX2PNn6f6HvokNQLshYmWuZVr+fWvmb8Mxmef32yaJFKhIrqBLsKH0p5i3G0l0My3DEGl5xNk8x8K5XQfwFnKNgmq56O8EtvsHrECHmK24etcKyXmPUNXqKG2wZt46qpzuG9FVqioXjkt+Ml5ZFMcX4Qt/gSM/pW5noqKyz52OQ+lnhtm6rvL/2wg1r915uiwJUqVqwoeahezVpjC5WF8gAD+//5xQfuw+m9CcVG4VSUxpYVbr28IJLI3JdtWufv0qzX1l/3///nmDOH9JxLbHvzElYZJh+KXu/Vm+DvLe+P3f899UasoAiqy0L6a080Zavene3J0LDFVwNKwBgTJhhnyHyXiivUCl9zFEJexNTm1uifLMn5AZB2Xhc14br6GW53pQRv/ZFIb42GbedOasp2CIgHD1AJtyBg/Yezhfuezuqo6BepEhErXb16zn+iTu/Au8DBrwz0ECgvcMrvW3Tl0jCaZqgsLwX93iEett0p1YS4pccTTlEJdxO4akcHPIoqkIq4x6COqE3W7HJ8lENPyAK9D22Zm6RAw7y23dzUt3eFk2R8ispGWbqcc/Bc4vmwZoglkFKho1lkVGOPPKjEME6mh3us+O7/UujXlQwLOh2O1Z37xfMuHPssVRIhAo8JjaMNPeY1Gc8OnuRjPp1KMfXaYQMqEVVqX7+p63Vg8xE7pnolcBqsi2123Sd1YQoFY/IdzmOWPpd1ArCvv7AJu1XlsrEbcbPt77rTmXqXgL7MTdrLwJTHSa9eMkhjkVSL2kQmiIeLlnlCTSDBW2VUJk70ZkAh1pxjwg7vagecieGvdjVPsg3qs4KdFjz8mQwdlU7nYiRLy4fs5XeEPHwuNRjqTZLmR4+P+g4i7Zld4R0BKjaNzU6io3Wg4nbeKP4Y+odsQRWTiMmULla/V5U4+shB6rhSyyxah5qNb8JF/AeM/ZEMC/ruNHFVt2z99+G334RjV11a2DLmDOKk9ULgM+aE+Yvf5FamiiBHu2zJyVP7tAllsCtG9RNmH0r5gx4OhIh17p5dfa8U78wK4Jbvcq14Zo7vgs1XwYcWKO2paQrmjei9+P5hbMwOlwQa5W1hnpxBU9gySq2/opHOaHYFiFqD8b9OReysGuVclXPTDKmqtCUHVSZYHmKP9SHubBuavbErBRmVY+Nmz5/B5SzRCnPk3+cfd7wYriQaMwOS/BOCOBvr1SO0gSrIIx4DZCbhAqPUhV9emH31oXt5i1r88/lsQKPT0LrwlaJslMnvEkMbyD9UoApwbtAZqvqugP84V2o6mM62j670PrgZQEfdrfU/Brf0uTzjZCvCUbO9oEswXg6unROfjUtgZnghqpTXVvThkder6/50kGKJje5eoSL8jwIInxFI/v/5hPjsO29Tu1V+3cT5pJ2NkOia+rW+0X3pvw9VEWQQngLrTZhrPuNAcaAWSvy+dppsI+zNXiWwCFwO+p9LyTusGvrw3oYM1FvmXff91gzvOTnyjBAeVacK1AOLetlzmatqtuQysM9IxbOLVnQ9tffTmqDbxmQTY36WqDIp2rFx05HMlrdU8jV2cl4FL70S9JSuBRoGBUYYTK1i94k3Gr2foiVl/1sktnyF95b+foK2ThVL47hB+FjNZl/Q5hTnB53rn1EppKC3jDCjN0RwIG+xO3/iwvVmdA1FEPlB/m+7K/PplluG+hMXZdqh3Vb9jGlnL1G331f68q/T4Nn53VaedqyO+K/EaZOEfFwFWbD3J0XY7eklhHvnvN+GHzT/+1ZZ/iSjsT5VcncMxDkPVAEE5+Iv8DKGs//vXXfBMs7evhxSafUuPe7x7/VPkmKnd3V+Ibc3YympmNS6TDTxtAQWCBWgJ+ZQPXvrj4Xg8lb5ZDvvVDXrXN+VzCMqq54jt2MMdkjh3QMHo32O5bPYOnQl9zl+KmVQf7XNUE3O2MxAzv2dA7w6RPbOP2OOIWRgwLdNy6OIn23vTZOirV3ufMnGIjTehD8YrfBtMhQjIpRyvVuNf8YzYoCwF8ybfcFoatV5hvAaQwhruxLD0XRSM+oAGPo44Kl6q8jz7/Qp2PtBCFVj56ostyJs0hg3PAAg+YjMvWuQMecMhPjns/mX//5XmYe9lHvfe79d91n/0puJ8C/mfnuGOTRostWX6xRZd2og1rRieHnM/8dJ58g7leMFibJD2gtq8r7n9Ce+wpYNpznRUmHcU/mP5Wlfbs/hGxk2K82pViHQElv+AumJhHOSR4Skb42vDdVFDsDyCYpN6qcJDwaDExGlckHBj2YfMCfhNFmFnEO/exYslmeNN7+UzbSW8dI1W5F/5JxVmygNHYODYFCxBcfUBf/KSOXMy+FnP9BXJx1JWZwFMeYk0JLF0cXByy84zX4WNi5IDCH6JVMx+EAzKiYrqFbfkqqWXPYzyyTFD7DQX9noCFp43nE3GNFJ/1Hg3aiFUzJuhIiBOcVnmdqcSXZmaoVN83qTB/UlqZlreRNmYOMhP1mB30Ap9yebO12VCfQ/t59iX/JHZAV4DOn3Wj10EdAmiJ4LIM7FFZuVoHwTIVBtCluMMQ5hm5kGsCp7tSnG6tgKv6r699n4BwegEJxjIBln/anJbwVigZdYOv9MJ9SmBt2yFttw3Ar3Aw1+o3Ux0CqBc23d3/urM30mJNJUyaHfuTVBXmKInUWQnT05RzFvEbS2qnBEiicuXN+h0dTN3MCAdChkQvF4nn7WeJDvg4KEdS6FN0s4TiFuWQVhloZV/3+PzN4lqrKEXSLCdzrf/gK1i2fVuLsZTulPvvcz6hhhKfA4Fni6xlMZqxVIsYoUySePySdGiyRwpzFmi3yeInf75Z8T3uqtArQNMwe3glLiiS5PUy7Y8Svsbg5xwXhr6aOPuUvj4NrXNcSgefLeNmL680LGBzBGg2M9qv2auWIpJohW8LDNngafslp+2ydYZ60t+jonPHmMDTK1R/BkkDSoxfARfSpzxRoQqCibQ/i/KfV3hnGHLWJQ9L9CaFbMy/xF1JrNXwBpZVVIEt3ivU4LwEGnaDWcgbd2t+QbDsrepZNFW9PsCU4T7IEvTthlSDAqV8HTsoCcCc0t2vD3+G8gy8h32cZaYPvipwofQ+Zd23iBld0QOVDxEDGInn4CucUTfC3/c9tjfveCPuFQTdp7Wrc2qmpty8Kn7IJOa+Hy3xJuNHAW7yTU8KHJTrxD/9fvFMkH6eDgNbEzJ5NOCoxFFplGXuhHd8jxk9u/k3bBVF6oLskpdipOj9NqvNNv7Dy1cNnPGqKJSTZ01tIQ7lIcMeBvj6Ov6rRVP4ue+EW7a/VxCfsIzlgflFXrjoKLs1k1hQW83BtGjQ37OmBhgI+6ULvZAWhooUlzBa7n+F/yXGW5dmI1gA3TANbTih2YGTLfBnAI9Z7QHGSJh6CMgmUr2kMgJYoxGft2beB7EXyDAwxQmjAEpZ2zFRVHDTYDjyz+H094nbYcAhgAAAAA=";async function bt(a){const[n]=await Xe({...a,trades:[a.trade]});return n}async function Xe(a){const{trades:n,buyer:i,signer:o,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const d=new Map;for(const x of n){const g=`${x.chainId}:${x.contract.toLowerCase()}`,b=d.get(g);b?b.push(x):d.set(g,[x])}const p=[];for(const x of d.values())p.push(await qe({trades:x,buyer:i,signer:o,onSigned:l}));return p}async function qe(a){const{trades:n,buyer:i,signer:o,onSigned:l}=a,d=n[0],p=W(G(d.contract),d.chainId),x=W(I.MANAToken,d.chainId);await q({auth:{kind:D.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:d.chainId},signer:o});const g=n.map(c=>le(c,i));if(L.enabled)try{const c=new ge(p.abi).encodeFunctionData("accept",[g]),w=ae(),k=ie(o.provider,w),u=await he(k,w,c,p,{serverURL:L.relayerUrl});return l==null||l(),await oe(u,"the MANA purchase"),u}catch(c){if(c instanceof ue&&c.code===xe.USER_DENIED||c instanceof se)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await _(o.provider,d.chainId);const h=await new fe(p.address,p.abi,o).accept(g,pe(d.chainId));return l==null||l(),(await h.wait()).transactionHash}async function wt(a){const{trade:n,buyer:i,signer:o,credits:l,manaGapWei:d,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(d<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const g=W(I.MANAToken,n.chainId),b=W(I.CreditsManager,n.chainId);await q({auth:{kind:D.Allowance,contractAddress:g.address,spenderAddress:b.address,chainId:n.chainId},signer:o});const y=(l.reduce((c,w)=>c+BigInt(w.availableAmount),0n)+d).toString();return ce({trade:n,buyer:i,signer:o,credits:l,maxCreditedValue:y,onBroadcast:p,onReverted:x})}function yt(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.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...a,children:t.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:s,gradients:Q,radius:H,z:De}=r,kt=e.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
|
-
z-index: ${
|
|
295
|
+
z-index: ${De.overlay};
|
|
296
296
|
display: flex;
|
|
297
297
|
overflow-y: auto;
|
|
298
298
|
padding: 20px;
|
|
@@ -457,10 +457,10 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
457
457
|
& b {
|
|
458
458
|
font-weight: 700;
|
|
459
459
|
}
|
|
460
|
-
`,
|
|
460
|
+
`,qt=e.div`
|
|
461
461
|
display: flex;
|
|
462
462
|
gap: 12px;
|
|
463
|
-
`,
|
|
463
|
+
`,Dt=e.button`
|
|
464
464
|
flex: 1;
|
|
465
465
|
height: 109px;
|
|
466
466
|
border: 1px solid ${s.muted2};
|
|
@@ -813,4 +813,4 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
813
813
|
opacity: 1;
|
|
814
814
|
transform: scale(1.1);
|
|
815
815
|
}
|
|
816
|
-
`;function ln({title:a,items:n,onViewAll:i}){const o=v.useRef(null),[l,d]=v.useState(1),[p,x]=v.useState(0),[g,b]=v.useState(!0),[h,y]=v.useState(!1),c=v.useCallback(()=>{const u=o.current;if(!u)return;const{scrollLeft:f,scrollWidth:S,clientWidth:$}=u,V=Math.max(1,Math.ceil(S/$));d(V),x(Math.min(V-1,Math.round(f/$))),b(f<=1),y(f+$>=S-1)},[]);if(v.useEffect(()=>{c();const u=o.current;if(u)return u.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{u.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,n.length]),n.length===0)return null;function w(u){const f=o.current;f&&f.scrollBy({left:u*f.clientWidth,behavior:"smooth"})}function k(u){const f=o.current;f&&f.scrollTo({left:u*f.clientWidth,behavior:"smooth"})}return t.jsxs(Ke,{"data-testid":"carousel",children:[t.jsxs(Qe,{children:[t.jsx(He,{children:a}),i?t.jsxs(Ue,{onClick:i,children:[m("collectionCarousel.viewAll"),t.jsx(Ze,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Je,{children:[t.jsx(R,{"data-side":"left",onClick:()=>w(-1),"aria-label":m("collectionCarousel.scrollLeft"),disabled:g,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:o,children:n.map(u=>t.jsx(te,{item:u},u.id))}),t.jsx(R,{"data-side":"right",onClick:()=>w(1),"aria-label":m("collectionCarousel.scrollRight"),disabled:h,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Ge,{"aria-label":m("collectionCarousel.pages"),children:Array.from({length:l}).map((u,f)=>t.jsx(_e,{"data-active":f===p||void 0,"aria-label":m("collectionCarousel.goToPage",{page:f+1}),"aria-current":f===p?"true":void 0,onClick:()=>k(f)},f))}):null]})}export{we as $,It as A,Wt as B,Ct as C,mt as D,Qt as E,Ht as F,Ut as G,Mt as H,Zt as I,Jt as J,Yt as K,en as L,kt as M,lt as N,ct as O,xt as P,ln as Q,ft as R,jt as S,zt as T,B as U,dt as V,Rt as W,Tt as X,gt as Y,Xe as Z,pt as _,At as a,A as a0,dn as a1,cn as a2,bt as a3,ht as a4,wt as a5,yt as b,$t as c,Bt as d,Nt as e,Et as f,tn as g,nn as h,an as i,Gt as j,_t as k,on as l,ut as m,sn as n,rn as o,vt as p,Xt as q,Pt as r,St as s,Vt as t,Ft as u,Lt as v,Ot as w,
|
|
816
|
+
`;function ln({title:a,items:n,onViewAll:i}){const o=v.useRef(null),[l,d]=v.useState(1),[p,x]=v.useState(0),[g,b]=v.useState(!0),[h,y]=v.useState(!1),c=v.useCallback(()=>{const u=o.current;if(!u)return;const{scrollLeft:f,scrollWidth:S,clientWidth:$}=u,V=Math.max(1,Math.ceil(S/$));d(V),x(Math.min(V-1,Math.round(f/$))),b(f<=1),y(f+$>=S-1)},[]);if(v.useEffect(()=>{c();const u=o.current;if(u)return u.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{u.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,n.length]),n.length===0)return null;function w(u){const f=o.current;f&&f.scrollBy({left:u*f.clientWidth,behavior:"smooth"})}function k(u){const f=o.current;f&&f.scrollTo({left:u*f.clientWidth,behavior:"smooth"})}return t.jsxs(Ke,{"data-testid":"carousel",children:[t.jsxs(Qe,{children:[t.jsx(He,{children:a}),i?t.jsxs(Ue,{onClick:i,children:[m("collectionCarousel.viewAll"),t.jsx(Ze,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Je,{children:[t.jsx(R,{"data-side":"left",onClick:()=>w(-1),"aria-label":m("collectionCarousel.scrollLeft"),disabled:g,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:o,children:n.map(u=>t.jsx(te,{item:u},u.id))}),t.jsx(R,{"data-side":"right",onClick:()=>w(1),"aria-label":m("collectionCarousel.scrollRight"),disabled:h,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Ge,{"aria-label":m("collectionCarousel.pages"),children:Array.from({length:l}).map((u,f)=>t.jsx(_e,{"data-active":f===p||void 0,"aria-label":m("collectionCarousel.goToPage",{page:f+1}),"aria-current":f===p?"true":void 0,onClick:()=>k(f)},f))}):null]})}export{we as $,It as A,Wt as B,Ct as C,mt as D,Qt as E,Ht as F,Ut as G,Mt as H,Zt as I,Jt as J,Yt as K,en as L,kt as M,lt as N,ct as O,xt as P,ln as Q,ft as R,jt as S,zt as T,B as U,dt as V,Rt as W,Tt as X,gt as Y,Xe as Z,pt as _,At as a,A as a0,dn as a1,cn as a2,bt as a3,ht as a4,wt as a5,yt as b,$t as c,Bt as d,Nt as e,Et as f,tn as g,nn as h,an as i,Gt as j,_t as k,on as l,ut as m,sn as n,rn as o,vt as p,Xt as q,Pt as r,St as s,Vt as t,Ft as u,Lt as v,Ot as w,qt as x,Dt as y,Kt as z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as o,_ as a}from"./index-
|
|
2
|
+
import{s as o,_ as a}from"./index-CKUuopSw.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Z,R as Be,F as Te,e as _e}from"./categories-
|
|
1
|
+
import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Z,R as Be,F as Te,e as _e}from"./categories-D23W_J-A.js";import{t as he,bG as ze,P as X,O as ee,s as i,bH as We,J as De,bI as Oe,b as o,bJ as Ke,bK as te,B as Ge,K as ue,a1 as me,bt as Ue,o as He,D as xe,bA as qe,bu as Ve,bv as Je,I as oe,c as Qe,x as Ye,v as Ze,ac as Xe,an as et,ao as tt,ap as M,aq as re,bL as se,bM as ot}from"./index-CKUuopSw.js";import{T as pe}from"./skeleton.styles-BXNXDWEi.js";import{d as rt,P as st,C as it,a as at,b as nt,A as lt,c as ct,e as dt}from"./collectionPage.styles-CoEdrsfq.js";import{g as ht,h as ut,i as mt,j as xt,k as pt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as jt,p as Ct,q as kt,r as $t,s as St,t as Nt}from"./Assets.styles-BBWJCcMx.js";import{L as ie}from"./LoadMore-jSNRJiwZ.js";import{u as ae}from"./useInfiniteGrid-BjEQAabI.js";import{E as B}from"./ErrorNotice-OUNK486K.js";import{G as ne}from"./grid.styles-hOZTJ80g.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BDmKiALz.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return s?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:ge,media:Pt}=he,Ft=i.article`
|
|
2
2
|
height: 300px;
|
|
3
3
|
background: ${w.bg};
|
|
4
4
|
border-radius: ${ge.card};
|
|
@@ -135,7 +135,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
135
135
|
&:active {
|
|
136
136
|
background: ${w.accentActive};
|
|
137
137
|
}
|
|
138
|
-
`;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,j=s==null||a==null,{data:n}=Oe(c,j),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(Rt,{title:d,children:d}),e.jsxs(Bt,{children:[e.jsxs(Tt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(_t,{address:b,linkToProfile:!0}):e.jsx(zt,{children:" "}),e.jsx(Wt,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(pe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(Dt,{"data-view":!0,"data-testid":"coll-card-view",onClick:m=>{m.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Kt({address:r,className:s=""}){const a=Ke(),l=te(d=>d.followed.includes(r.toLowerCase())),c=te(d=>d.toggle);return!a||!r?null:e.jsx(
|
|
138
|
+
`;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,j=s==null||a==null,{data:n}=Oe(c,j),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(Rt,{title:d,children:d}),e.jsxs(Bt,{children:[e.jsxs(Tt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(_t,{address:b,linkToProfile:!0}):e.jsx(zt,{children:" "}),e.jsx(Wt,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(pe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(Dt,{"data-view":!0,"data-testid":"coll-card-view",onClick:m=>{m.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Kt({address:r,className:s=""}){const a=Ke(),l=te(d=>d.followed.includes(r.toLowerCase())),c=te(d=>d.toggle);return!a||!r?null:e.jsx(Ge,{type:"button",size:"sm",variant:l?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":l,title:l?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>c(r),children:l?o("creator.following"):o("creator.follow")})}const{colors:v,radius:fe,media:y}=he,be=ue`
|
|
139
139
|
display: inline-flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: center;
|
|
@@ -149,7 +149,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
149
149
|
text-transform: uppercase;
|
|
150
150
|
letter-spacing: 0.046em;
|
|
151
151
|
text-decoration: none;
|
|
152
|
-
`,
|
|
152
|
+
`,Gt=i.section`
|
|
153
153
|
position: relative;
|
|
154
154
|
border-radius: ${fe.card};
|
|
155
155
|
overflow: hidden;
|
|
@@ -169,7 +169,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
169
169
|
${y.maxWidth("mobile")} {
|
|
170
170
|
min-height: 260px;
|
|
171
171
|
}
|
|
172
|
-
`,
|
|
172
|
+
`,Ut=i.div`
|
|
173
173
|
position: absolute;
|
|
174
174
|
inset: 0;
|
|
175
175
|
z-index: 0;
|
|
@@ -302,4 +302,4 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
302
302
|
&:hover {
|
|
303
303
|
background: ${v.blackBtn};
|
|
304
304
|
}
|
|
305
|
-
`,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,C;const{data:s}=me(r),{data:a}=
|
|
305
|
+
`,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,C;const{data:s}=me(r),{data:a}=Ue(r),l=He(x=>{var $;return($=x.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(s==null?void 0:s.name)||xe(r),b=(C=(m=s==null?void 0:s.avatar)==null?void 0:m.snapshots)==null?void 0:C.face256,j=(a==null?void 0:a.cover)||rt,n=a==null?void 0:a.description,g=`${Qe.profileUrl}/${r}`,f=qe.filter(x=>a==null?void 0:a.links[x]),h=Ve(Je({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Gt,{"aria-label":`${d} storefront`,children:[e.jsxs(Ut,{children:[e.jsx(Ht,{src:j,alt:"",loading:"eager"}),e.jsx(qt,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Vt,{children:[f.map(x=>e.jsx(Jt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[x])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${x}`),"aria-label":o(`creator.link.${x}`),children:e.jsx(oe,{name:oo[x]})},x)),c&&e.jsx(Qt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(oe,{name:"pen"})})]}),e.jsxs(Yt,{children:[b?e.jsx(le,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Zt,{children:d}),n?e.jsx(Xt,{children:n}):null]}),e.jsxs(eo,{children:[e.jsx(to,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Kt,{address:r,className:"creator-hero__follow"})]})]})]})}const so=["all","on_sale","not_for_sale"],ce=48;function jo(){var Q,Y;const{address:r}=Me(),s=de(),[a]=Ae(),l=a.has("collections"),{data:c}=me(r),d=(c==null?void 0:c.name)||(r?xe(r):o("creator.fallbackName"));Ye({title:d,description:o("seo.creator.description",{name:d}),image:(Y=(Q=c==null?void 0:c.avatar)==null?void 0:Q.snapshots)==null?void 0:Y.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[j,n]=Ie(b),{category:g,subCategory:f,rarities:h,priceMin:m,priceMax:C,smart:x,sort:$}=j,S=so.includes(j.status)?j.status:"all",T=t=>n({status:t});Re(`${l}:${g}:${f??""}`);const[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Fe=>{Fe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=p}},[E]);const _=m&&!Number.isNaN(Number(m))?Number(m):void 0,z=C&&!Number.isNaN(Number(C))?Number(C):void 0,ve=f?_e[f]:void 0,ye=(Z.find(t=>t.key===$)??Z[0]).server,W={creator:r,category:g,rarities:h.length?h:void 0,wearableCategories:ve,minPriceCredits:_,maxPriceCredits:z,isWearableSmart:x||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ye},{items:A,total:je,isLoading:Ce,isPlaceholderData:ke,error:D,hasNextPage:$e,isFetchingNextPage:O,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",W],t=>se({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=Ze({queryKey:["creator-item-count",r],queryFn:()=>se({creator:r,first:1}).then(t=>t.total),enabled:!!r}),u=ae(["creator-collections",r],t=>ot(r,{first:ce,skip:t}).then(p=>({items:p.collections,total:p.total})),{enabled:!!r&&l});function K(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ee(){const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}`:""},{replace:!0})}function Pe(){if(l){Ee();return}const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}&collections`:"?collections"},{replace:!0})}function G(t){n({rarities:h.includes(t)?h.filter(p=>p!==t):[...h,t]})}function U(){n(b)}const k=[];(g==="wearable"||g==="emote")&&k.push({key:"category",label:o(g==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>K("all")}),(_!=null||z!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Be)h.includes(t)&&k.push({key:`rarity-${t}`,label:Xe(t),onRemove:()=>G(t)});x&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>T("all")});const F=Et({gridLoading:Ce||ke,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=et(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:tt(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(st,{children:[e.jsxs(it,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(at,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(nt,{children:d})]}),r?e.jsx(ro,{address:r}):null,!l&&!I&&J.length>0?e.jsx(lt,{items:J,source:"creator"}):null,e.jsxs(ht,{children:[E?e.jsx(ut,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(xt,{children:[e.jsx(pt,{children:o("assets.filters")}),e.jsx(gt,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(bt,{category:g,subCategory:f,onCategory:K,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:C,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:G,status:S,onStatus:T,smart:x,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Pe})}),e.jsx(wt,{children:e.jsx(vt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(yt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(ct,{children:e.jsx(dt,{"data-testid":"creator-collections-count","aria-busy":u.isLoading||void 0,children:u.isLoading?e.jsx(pe,{className:"skeleton",width:72,"data-testid":"creator-collections-count-skeleton","aria-hidden":!0}):o("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(B,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:u.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),u.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,isError:u.isFetchNextPageError,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{sort:$,onSort:t=>n({sort:t}),total:je,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:U}),D?e.jsx(B,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(re,{item:t},t.id):e.jsx(re,{item:t,mode:"view"},t.id)),O?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:$e,isFetching:O,isError:Se,onLoadMore:()=>void Ne()}),R==="error"?e.jsx(B,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(Ct,{children:[e.jsx(kt,{children:o("creator.emptyFilters.title")}),e.jsx($t,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(St,{children:e.jsx(Nt,{type:"button",onClick:U,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{jo as Creator,jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-
|
|
1
|
+
import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-CKUuopSw.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BQyeyr-U.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-C7hpB9s1.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-
|
|
1
|
+
import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-CKUuopSw.js";const m=a.section`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 36px;
|