@dcl/shop 0.1.0-29942650568.commit-3cdb6da → 0.1.0-29944279663.commit-001b5a7
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/{AnimatedBackground-CysLhvvU.js → AnimatedBackground-CPcXx1BG.js} +1 -1
- package/assets/{Assets-DsvJ5f0v.js → Assets-AjWSopj2.js} +1 -1
- package/assets/{Assets.styles-CA7lhkqC.js → Assets.styles-BldKbSnl.js} +1 -1
- package/assets/{Authorizations-vnz0r2Ax.js → Authorizations-DN5rReSr.js} +3 -3
- package/assets/Cart-BOomZzFA.js +3 -0
- package/assets/{Cart-Ep_4Wxpy.css → Cart-BqMUti_3.css} +1 -1
- package/assets/{CircularProgress-BoWkcKSM.js → CircularProgress-B7vK7bWC.js} +3 -3
- package/assets/{Collection-DFg8H4cI.js → Collection-Op3SrGcQ.js} +1 -1
- package/assets/CollectionCarousel-C2R0_DIx.js +1 -0
- package/assets/{Creator-DpJL7xsg.js → Creator-BXkmnq6l.js} +1 -1
- package/assets/{CssVarsProvider-CVkDPUQi.js → CssVarsProvider-CbqPuVyv.js} +1 -1
- package/assets/{ExchangeController-XYLG0Onl.js → ExchangeController-CkwXcZrE.js} +1 -1
- package/assets/GetCredits-DyYrVUsB.js +1 -0
- package/assets/{HelpersUtil-CXmyL-9f.js → HelpersUtil-Cd6Cz7k6.js} +1 -1
- package/assets/{ImportListings-DL4qvnkm.js → ImportListings-BqaE2RRj.js} +1 -1
- package/assets/ItemDetail-CXntx0dm.js +78 -0
- package/assets/{LoadMore-DwH_uJJ9.js → LoadMore-wolzH5ER.js} +1 -1
- package/assets/MarketCheckout-D_f5rC4e.js +3 -0
- package/assets/{MyAssets-ChdfSyve.js → MyAssets-CBQJfW0w.js} +1 -1
- package/assets/{MyFavorites-BAgv7K26.js → MyFavorites-DtHDd-wr.js} +1 -1
- package/assets/{MyPurchases-DlfJ7xtX.js → MyPurchases-BBRP2pOD.js} +4 -4
- package/assets/{NotFound-uK-Ostnl.js → NotFound-CJzX5KFi.js} +1 -1
- package/assets/{PrimaryListModal-Bm7Lx1a1.js → PrimaryListModal-Bfe2jEqA.js} +1 -1
- package/assets/{StoreSettings-jeamoHJO.js → StoreSettings-CCjyP-1z.js} +2 -2
- package/assets/Success-DgDiikPg.js +4 -0
- package/assets/{SwapController-B81AJRRn.js → SwapController-CtlOMvk3.js} +1 -1
- package/assets/{Tooltip-CYItdKnL.js → Tooltip-BtGlCRjR.js} +1 -1
- package/assets/{TradeService-BxBTy4_C.js → TradeService-OKrfHBNk.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-WHc1zToo.js → W3MFrameProviderSingleton-BFTt2bWv.js} +3 -3
- package/assets/{WebCryptoP256-BQQeByzz.js → WebCryptoP256-CNNq2h94.js} +1 -1
- package/assets/{authorizations-C600xDT9.js → authorizations-ChRb35xG.js} +1 -1
- package/assets/{basic-CaSER4PW.js → basic-O1kzoE_h.js} +1 -1
- package/assets/{biconomy-nsDuvr1X.js → biconomy-NJyzVP4P.js} +1 -1
- package/assets/{buy-C5J6mAtx.js → buy-CNc4Y8CN.js} +1 -1
- package/assets/{buy-gasless-Sy6Gurph.js → buy-gasless-wrR0AjfW.js} +1 -1
- package/assets/{cart-checkout-BwJruvi6.js → cart-checkout-BAUaf92R.js} +1 -1
- package/assets/{categories-CQMvcQ_A.js → categories-BKqMpg3a.js} +1 -1
- package/assets/{ccip-CVFd9-T6.js → ccip-DzP3mwwB.js} +1 -1
- package/assets/{ccip-C_DKTuDg.js → ccip-S_59ofbi.js} +1 -1
- package/assets/{collection-BButATLz.js → collection-4y6zy3OY.js} +1 -1
- package/assets/{controller-C4IlqRFi.js → controller-CyymDuZ1.js} +2 -2
- package/assets/{core-Bsb1vtZ6.js → core-DpgBxh1f.js} +4 -4
- package/assets/{custom-B2_bVLxh.js → custom-CUYXqRFz.js} +1 -1
- package/assets/{data-capture-CeCg7Ckv.js → data-capture-DEtSxXU7.js} +1 -1
- package/assets/{email-DGWqulOs.js → email-CZBKdtTz.js} +1 -1
- package/assets/{embedded-wallet-BDA__pmu.js → embedded-wallet-DI5q9f92.js} +1 -1
- package/assets/emotion-styled.browser.esm-DSDqSITi.js +1 -0
- package/assets/{engine-COT4y3N6.js → engine-H6XTP7Hg.js} +1 -1
- package/assets/{errors-B2rT3Gvo.js → errors-gKUnErEU.js} +1 -1
- package/assets/{estimate-l1-fee-DSG403IA.js → estimate-l1-fee-CRLseeHD.js} +1 -1
- package/assets/{execute-zpOqUNic.js → execute-DnoTKwUA.js} +2 -2
- package/assets/{features-CMZ-QMXf.js → features-DsCWYm7t.js} +1 -1
- package/assets/{fetchTokenMetadata-CZyR6DMv.js → fetchTokenMetadata-D8xF6Tp2.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-Cll7wRD7.js → get-ecosystem-wallet-info-eeuY73_c.js} +1 -1
- package/assets/{getBalance-BlSTzNnh.js → getBalance-D4FtfBuc.js} +1 -1
- package/assets/{getNFT-bAbPTgKN.js → getNFT-CCUV8jjB.js} +1 -1
- package/assets/{getNFT-yZahXefO.js → getNFT-DsBG7sol.js} +1 -1
- package/assets/{getOverlayAlpha-CH1E19pc.js → getOverlayAlpha-DD0MBenH.js} +1 -1
- package/assets/{hashTypedData-CoI7qham.js → hashTypedData-D4XcfX8m.js} +1 -1
- package/assets/{hashTypedData-BjKHZJt2.js → hashTypedData-DY9RW77q.js} +1 -1
- package/assets/{import-B-7LIWfg.js → import-C4A0dOmT.js} +1 -1
- package/assets/{in-app-DuAkMaop.js → in-app-miryaTIx.js} +1 -1
- package/assets/{in-app-wallet-calls-VVaW7dWC.js → in-app-wallet-calls-BNAeRkM1.js} +1 -1
- package/assets/{index-D4mGcEtB.js → index-5BCUAQ7G.js} +1 -1
- package/assets/{index-CBhum_yI.js → index-B-lOuLL_.js} +1 -1
- package/assets/{index-DuM3vKAV.js → index-B0f3YMv0.js} +1 -1
- package/assets/{index-VrPb_Zz5.js → index-B2KZdX5l.js} +1 -1
- package/assets/{index-Dp2XIou0.js → index-B7Aw3qxP.js} +1 -1
- package/assets/{index-ChF-gCVV.js → index-BHgNE80I.js} +1 -1
- package/assets/{index-D2i7N7FD.js → index-BMxVktKR.js} +1 -1
- package/assets/{index-CyMsSal1.js → index-BPTCeB75.js} +1 -1
- package/assets/{index-Cj8JMZ6F.js → index-BR9EQbWB.js} +1 -1
- package/assets/{index-2LZVA_H9.js → index-BVDwZ7ux.js} +1 -1
- package/assets/{index-uk-CfnlL.js → index-BaEQqKh7.js} +1 -1
- package/assets/{index-C4vAJ3fL.js → index-Bd6HRkkM.js} +1 -1
- package/assets/{index-BCa080Jk.js → index-BeDPwdIU.js} +1 -1
- package/assets/{index-B14E9dDt.js → index-BeF4PcAs.js} +1 -1
- package/assets/{index-ZjDtH0Hr.js → index-Bnxb7s2U.js} +1 -1
- package/assets/index-Bw9Y53F1.css +1 -0
- package/assets/{index-Q9d0V8TZ.js → index-C1yBaAe9.js} +10 -10
- package/assets/{index-DvbuNJKq.js → index-CAtCo41a.js} +1 -1
- package/assets/{index-C2JrnQDe.js → index-CJ72HArz.js} +1 -1
- package/assets/{index-Cok_sFK3.js → index-CKain9CR.js} +1 -1
- package/assets/{index-DIusB22U.js → index-CNUSWwhT.js} +2 -2
- package/assets/{index-BEL4KhCu.js → index-CS_YGkJS.js} +1 -1
- package/assets/{index-CUV4Rf3F.js → index-CUapata6.js} +1 -1
- package/assets/{index-Dfv7PJQh.js → index-CW4WLUXF.js} +1 -1
- package/assets/{index-CiH0W5Hj.js → index-CaKtCSoO.js} +1 -1
- package/assets/{index-CjnhvTx0.js → index-CchI9mHk.js} +1 -1
- package/assets/{index-CRZSv11U.js → index-Cd8SstNC.js} +1 -1
- package/assets/{index-BSSPgvD1.js → index-Cglxr6xq.js} +1 -1
- package/assets/{index-Bzlo07t4.js → index-CitxiVaF.js} +1 -1
- package/assets/{index-DeO2Srep.js → index-CpUzfl0K.js} +2 -2
- package/assets/{index-DIZEbKwM.js → index-CryDMiQl.js} +1 -1
- package/assets/{index-BlnhiyW1.js → index-CvSuJFRB.js} +1 -1
- package/assets/{index-B5bMVqc5.js → index-D-u-hSI3.js} +1 -1
- package/assets/{index-zvLgVYhW.js → index-D15jEYwr.js} +1 -1
- package/assets/{index-DcAG03_T.js → index-D4MR9O_F.js} +1 -1
- package/assets/{index-Bwtbao7B.js → index-DBt6hDgv.js} +1 -1
- package/assets/{index-DJCp8uIp.js → index-DNxKrdux.js} +1 -1
- package/assets/{index-gcnUvFrd.js → index-DSw2AqET.js} +1 -1
- package/assets/{index-BsY45tr2.js → index-DWxI9Hlb.js} +1 -1
- package/assets/{index-DsttSp14.js → index-DXtL9zpK.js} +3 -3
- package/assets/{index-D7J0TuHz.js → index-DbySRbMy.js} +2 -2
- package/assets/{index-BaDAgjcA.js → index-DpDqOxel.js} +1 -1
- package/assets/{index-C0_U8Amn.js → index-DsrJfyy3.js} +1 -1
- package/assets/{index-DmSOW0PY.js → index-G8bd0RHd.js} +1 -1
- package/assets/{index-tAmGgcla.js → index-KOeN6JEM.js} +1 -1
- package/assets/{index-BC--wvbP.js → index-U4GunfhO.js} +1 -1
- package/assets/{index-CzOo8tvO.js → index-ZiBxg6FP.js} +2 -2
- package/assets/{index-CkTptFnK.js → index-dBhDm5QH.js} +2 -2
- package/assets/{index-BmwayVyG.js → index-iruECcYS.js} +3 -3
- package/assets/{index-DxHb67V2.js → index-k4CkTGxw.js} +1 -1
- package/assets/{index-C0utXQ6l.js → index-rbNc96Al.js} +1 -1
- package/assets/{index-CJs5gUNJ.js → index-sXacIDUz.js} +3 -3
- package/assets/{index-ClDUuLhd.js → index-wJEgDopC.js} +1 -1
- package/assets/{index.es-DAd9yxMt.js → index.es-BxcQA2dU.js} +1 -1
- package/assets/{index.es-BzMx-nup.js → index.es-Cl_XwBUi.js} +4 -4
- package/assets/{index.es-fI5nPWfV.js → index.es-DIuzDiOd.js} +1 -1
- package/assets/{localBatchGatewayRequest-BIFDJTSD.js → localBatchGatewayRequest-DInd0cLm.js} +1 -1
- package/assets/{mana-rate-CC-yyhWK.js → mana-rate-CQNKlfL0.js} +1 -1
- package/assets/{networks-DkdE2sZd.js → networks-Cov5QiMG.js} +1 -1
- package/assets/{onramp-C_i59kJR.js → onramp-hb5ff0As.js} +1 -1
- package/assets/{openzeppelin-BMNh5qua.js → openzeppelin-Bjn2nu6_.js} +1 -1
- package/assets/{parseNft-CW-hWGBI.js → parseNft-D9LBoQtO.js} +2 -2
- package/assets/{parseSignature-NZopg6IG.js → parseSignature-L1A1P3GM.js} +1 -1
- package/assets/{parseSignature-C3GhRBL-.js → parseSignature-ePtMgMiu.js} +3 -3
- package/assets/{passkeys-DuQQbJhZ.js → passkeys-DmsGOzkI.js} +1 -1
- package/assets/{pay-with-exchange-DH6Kt6OD.js → pay-with-exchange-AEyKwlqz.js} +1 -1
- package/assets/{qr-overlay-u2BzHEzf.js → qr-overlay-DyUlpaIC.js} +1 -1
- package/assets/{receive-D2V6X2tA.js → receive-DXQR7h-2.js} +1 -1
- package/assets/{resolveImplementation-BsuIKFkz.js → resolveImplementation-BXX46XHe.js} +1 -1
- package/assets/{rpc-BIhelmqB.js → rpc-DpwEotT8.js} +1 -1
- package/assets/{secp256k1-BHmvTUzO.js → secp256k1-CAtCZ-Xr.js} +1 -1
- package/assets/{secp256k1-BtgeD6jy.js → secp256k1-DXm6hl-z.js} +1 -1
- package/assets/{secp256k1-hNsXkUex.js → secp256k1-IsXW7STM.js} +1 -1
- package/assets/{send-DkPpjCf1.js → send-CbWz9hcp.js} +1 -1
- package/assets/{send-batch-transaction-Bt9-Q0FO.js → send-batch-transaction-9mR-y7h4.js} +1 -1
- package/assets/{send-eip712-transaction-CJ8Dr-eb.js → send-eip712-transaction-CM2oNuUv.js} +2 -2
- package/assets/{send-gasless-transaction-D5eQ85CY.js → send-gasless-transaction-Dt3TrVjF.js} +2 -2
- package/assets/{send-transaction-BK1KmPMR.js → send-transaction-BZ4LJjTi.js} +2 -2
- package/assets/{sendRawTransaction-Ddh_tSjE.js → sendRawTransaction--x3C4a4M.js} +3 -3
- package/assets/{serializeTransaction-f04zsBlb.js → serializeTransaction-DkNQBPpa.js} +1 -1
- package/assets/{session-proposal-r1mPrmCX.js → session-proposal-C_7oJg4v.js} +1 -1
- package/assets/{session-request-Cfr7jp2h.js → session-request-BswrUDyz.js} +2 -2
- package/assets/{signing-C-mKTJFW.js → signing-Ci_N7XnZ.js} +3 -3
- package/assets/{socials-pmAt6WyL.js → socials-Cy0uuEjD.js} +1 -1
- package/assets/{swaps-XKJYQXAz.js → swaps-CJefGDGP.js} +1 -1
- package/assets/{thirdweb-B_kKfwse.js → thirdweb-_jeY-8oo.js} +3 -3
- package/assets/{to-serializable-transaction-rhTmQPEU.js → to-serializable-transaction-z3rODop-.js} +2 -2
- package/assets/{trade-encoding-CaZYjVNs.js → trade-encoding-DQ3zNCj8.js} +1 -1
- package/assets/{transactionReceipt-BcU054L-.js → transactionReceipt-CmnDZJIN.js} +1 -1
- package/assets/{transactions-lrp4i700.js → transactions-C19bGnmB.js} +1 -1
- package/assets/useCreditPacks-Caur-2iX.js +1 -0
- package/assets/{useInfiniteGrid-8c-8xSTi.js → useInfiniteGrid-CRDFn4if.js} +1 -1
- package/assets/{useStore-Ccbed9Z-.js → useStore-DjC0Mzyl.js} +1 -1
- package/assets/useTheme-4G-3zKnL.js +1 -0
- package/assets/useTheme-YjNnj0AZ.js +1 -0
- package/assets/{verifyHash-z4q1c5J1.js → verifyHash-C_4O6fWL.js} +1 -1
- package/assets/{w3m-modal-2GWsHPDh.js → w3m-modal-C8bpYQNG.js} +1 -1
- package/assets/{w3m-modal-DUSXSzQv.js → w3m-modal-Ckpscz46.js} +1 -1
- package/assets/{wait-for-tx-receipt-CAc2Bmoi.js → wait-for-tx-receipt-FMU2_8T4.js} +1 -1
- package/assets/{wallets-BD_QGCV9.js → wallets-DdObuep1.js} +5 -5
- package/assets/{web-connector-Da5xZh52.js → web-connector-CnDHaN6b.js} +3 -3
- package/assets/{writeContract-zNHMPW7R.js → writeContract-C9X9RN9V.js} +1 -1
- package/assets/{zoraTestnet-Csb8JMNL.js → zoraTestnet-d3v06Qdp.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-CTQAeaCb.js +0 -3
- package/assets/CollectionCarousel-BgmGp9gP.js +0 -1
- package/assets/GetCredits-C41Akzju.js +0 -1
- package/assets/ItemDetail-8kxMVjol.js +0 -78
- package/assets/MarketCheckout-0NCiBi_9.js +0 -3
- package/assets/Success-IAIc5xBC.js +0 -4
- package/assets/emotion-styled.browser.esm-Of0yAmXP.js +0 -1
- package/assets/index-DYDor-ZM.css +0 -1
- package/assets/useCreditPacks-Be9cG5vr.js +0 -1
- package/assets/useTheme-7-Mr4FFJ.js +0 -1
- package/assets/useTheme-C3YHg0O0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BrLDncxD.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BrLDncxD.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/DCL_LogoPattern-BryBPc3d.png",b=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ke,r as p,j as e,b as Qe}from"./react-BrLDncxD.js";import{c as F,w as Ze,q as Je,L as Xe,s,F as t,d as Te,n as Ye,o as ze,j as Ie,e as et,t as o,I as z,
|
|
1
|
+
import{a as Ke,r as p,j as e,b as Qe}from"./react-BrLDncxD.js";import{c as F,w as Ze,q as Je,L as Xe,s,F as t,d as Te,n as Ye,o as ze,j as Ie,e as et,t as o,I as z,g as B,v as pe,x as D,y as tt,z as nt,u as Ne,G as st,A as K,au as ot,av as it}from"./index-C1yBaAe9.js";import{r as rt,a as at,m as _e}from"./mana-rate-CQNKlfL0.js";import{u as Ae,M as lt}from"./MarketCheckout-D_f5rC4e.js";import{g as ct,h as dt,i as ft,j as pt,k as ut,C as xt,l as ht,o as mt,m as gt,n as bt,M as yt}from"./Assets.styles-BldKbSnl.js";import{d as ue,R as wt,F as vt,S as xe,b as jt}from"./categories-BKqMpg3a.js";import{L as $t}from"./LoadMore-wolzH5ER.js";import{u as Ct}from"./useInfiniteGrid-CRDFn4if.js";import{E as kt}from"./ErrorNotice-BDH9xoG4.js";import{d as St}from"./dcl-schemas-BICTSpB5.js";import{u as Rt,G as Et,w as Tt,S as zt}from"./buy-gasless-wrR0AjfW.js";import{s as It}from"./buy-CNc4Y8CN.js";import{h as Nt}from"./trade-encoding-DQ3zNCj8.js";import{f as _t}from"./errors-gKUnErEU.js";import{J as At,C as Pt,B as ne}from"./ethers-CLB2z3On.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-DYZXk5O5.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-BtGlCRjR.js";import"./authorizations-ChRb35xG.js";function Q(n){const i=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${i}:${f}`}const W="100000000000000000000",Pe=2,V=15,Bt=/^[a-zA-Z0-9]+$/;function he(n){const i=n.trim();return i.length===0?{ok:!1,reason:"empty"}:Bt.test(i)?i.length<Pe?{ok:!1,reason:"too-short"}:i.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Ft(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Wt=["function available(string _subdomain) view returns (bool)"],me={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ht(){return F.chainId===St.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new At(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Gt(n){return at(W,n)}async function qt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:Nt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:W}}async function Vt(n,i={}){const f=Ot,u=i.intervalMs??1e4,l=i.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),m=(a.status??"pending").toLowerCase(),w=a.fillTx??a.fillTxnRef??null,y=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:y};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:y}}}catch{}x<l-1&&await new Promise(d=>setTimeout(d,u))}return c}async function Kt(n){const{name:i,identity:f,signer:u}=n,l=n.chainId??F.chainId,c=n.provider??"across",x=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:c});try{const m=await rt(l),w=Gt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await qt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const v=await Ze(f,w);if(d=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),ne.from(v.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(v.credit,y);let h;try{h=await Rt({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Et))throw b;h=await It(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await Tt(h),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:h}),c==="across"){const b=await Vt(h,n.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:h};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:h,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:h}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:i,buyer:x,originConfirmed:a}),m instanceof zt)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Je(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(_t(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Qt=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-
|
|
1
|
+
import{r as y,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-BKqMpg3a.js";import{T as se}from"./Tooltip-BtGlCRjR.js";import{F as e,s as o,I as m,t as s,G as re,C as v}from"./index-C1yBaAe9.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as
|
|
1
|
+
import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as q,F as e,M as B,u as D,t as i,d as N,e as F,I as x,g as G,m as A,o as H,c as M,J as y,E as Q,H as z}from"./index-C1yBaAe9.js";import{g as K,a as W,s as J,b as O}from"./authorizations-ChRb35xG.js";import{f as P}from"./errors-gKUnErEU.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=B`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,U=a.section`
|
|
4
4
|
width: 100%;
|
|
@@ -158,6 +158,6 @@ import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as N,F as
|
|
|
158
158
|
font-size: 22px;
|
|
159
159
|
font-weight: 700;
|
|
160
160
|
margin: 6px 0 0;
|
|
161
|
-
`,ct=a(
|
|
161
|
+
`,ct=a(q)`
|
|
162
162
|
margin-top: 12px;
|
|
163
|
-
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){
|
|
163
|
+
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){Q(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){D({title:i("authorizations.title"),noindex:!0});const{session:o}=N(),n=M.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=K(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as e,r as y,a as qe,u as Ie,L as se}from"./react-BrLDncxD.js";import{t as a,g as R,j as J,u as Te,ae as v,a as ue,d as Fe,m as Re,n as Ae,o as Be,I as F,h as Le,e as Ue,x as D,ag as he,ah as We,E as U,s as ze,B as $e,C as Ke,w as Qe,q as me,ai as Oe,z as _e,y as Ge,aj as De}from"./index-C1yBaAe9.js";import{a as ye}from"./buy-CNc4Y8CN.js";import{g as He,a as Je,w as Ve,S as Ye,G as Xe}from"./buy-gasless-wrR0AjfW.js";import{R as H,r as Ze}from"./cart-checkout-BAUaf92R.js";import{u as es,M as ss,c as as}from"./useCreditPacks-Caur-2iX.js";import{W as ts,C as rs,a as cs}from"./CollectionCarousel-C2R0_DIx.js";import{l as ns}from"./loader-logo-BzY9EKdC.js";import{i as is,a as ls}from"./errors-gKUnErEU.js";import{E as os}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-ChRb35xG.js";import"./index-HN6Rk25C.js";import"./trade-encoding-DQ3zNCj8.js";import"./address-DrURAr9O.js";const ds="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/buy-error-22UunaPC.png";function us(r){const{phase:n,balanceCredits:u,onClose:h}=r,C=n==="processing",w=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),S=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:h,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${S?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:w}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:h,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(R,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:J(u)})]})]}),n==="processing"&&e.jsx(hs,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(ms,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:h}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:ds,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:h,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??h,children:a("cartCheckout.tryAgain")})]})]})]})]})}function hs({stage:r,step:n,total:u,isSelfCustody:h}){const C=r==="reserving",w=u>0?Math.min(100,Math.round(n/u*100)):0,S=r==="awaiting-signature"?h?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ns,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),C?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ms({lines:r,shortfallCredits:n,packs:u,selectedPack:h,onSelectPack:C,onBuyPacks:w,onCancel:S}){const N=u.find(t=>t.id===h),V=r.reduce((t,m)=>t+(m.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(ts,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",a("buyModal.warningToPurchase",{count:V})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const m=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),m>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:m})}):null]}),t.item.creator?e.jsx(rs,{address:t.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(R,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:J(t.priceCredits*m)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(t=>{const m=t.id===h;return e.jsxs("button",{className:`buy-modal__pack${m?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(R,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:J(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(R,{className:"buy-modal__total-ico"}),e.jsx("span",{children:J((N==null?void 0:N.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((N==null?void 0:N.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:S,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}const _s=ze($e)`
|
|
2
|
+
margin-top: 12px;
|
|
3
|
+
`;function pe(r){if(is(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:Ke.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ys=12e4;function ps(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const be=r=>r.reduce((n,u)=>n+u.priceCredits*u.quantity,0),bs=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function As(){Te({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),u=v(s=>s.increment),h=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=ue(s=>s.items),V=ue(s=>s.toggle),{session:t}=Fe(),m=es().packs.slice(0,ss);y.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ge=r.some(s=>s.category!=="emote"),{data:Y}=Re({queryKey:["upsell-listings"],queryFn:()=>De({first:40}),staleTime:6e4}),{data:A}=Ae(t),W=Be(),z=qe(),{state:M}=Ie(),[ae,B]=y.useState(null),[fe,E]=y.useState(null),[te,$]=y.useState(null),[xe,P]=y.useState(!1),[f,L]=y.useState(null),re=y.useRef(0),[o,j]=y.useState(null),[X,ce]=y.useState(""),Z=y.useRef(null),je=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),ne=r.reduce((s,c)=>s+c.quantity,0),ke=f?f.liveTotalCredits:je,ve=new Set(r.map(s=>s.id)),ie=((Y==null?void 0:Y.items)??[]).filter(s=>!ve.has(s.id)).slice(0,12),Ce=new Map(f==null?void 0:f.buyable.map(s=>[s.item.id,s])),K=(A==null?void 0:A.credits)??0,Ne=We;function Q(s){s(),L(null),$(null),E(null)}function we(){j(null),P(!1)}function le(s){const c=be(s),i=Math.max(0,c-K),p=m.find(d=>d.credits>=i)??m[m.length-1];ce(p.id),D("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:K,shortfall:i}),j({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),P(!1)}async function Se(s){if(!t||s.length===0)return;const c=bs(s),i=c.map(l=>({...l.item,priceCredits:l.priceCredits})),p=s.map(l=>({...l.item,priceCredits:l.priceCredits,quantity:l.quantity})),d=[];let k="authorize",G=!1;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const l=[];for(let x=0;x<c.length;x++){const T=c[x];j({phase:"processing",stage:"reserving",step:x+1,total:c.length});try{const{credit:_,maxCreditedValue:ee}=await Qe(t.identity,T.usdCents,T.trade.id);d.push(_.id),l.push({trade:T.trade,credits:[_],maxCreditedValue:ee})}catch(_){if(ls(_)){if(d.length){try{await me(t.identity,d)}catch(ee){U(ee,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}le(s);return}throw _}}k="submit";const b=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(He())try{g=await Je({purchases:l,buyer:t.address,signer:t.signer,onSigned:b});const T=(await Promise.allSettled(g.map(_=>Ve(_)))).flatMap(_=>_.status==="rejected"?[_.reason]:[]);if(T.length&&!T.some(_=>_ instanceof Ye))throw T[0];G=!0}catch(x){if(!(x instanceof Xe))throw x;g=await ye({purchases:l,buyer:t.address,signer:t.signer,onSigned:b})}else g=await ye({purchases:l,buyer:t.address,signer:t.signer});s.forEach(x=>n(x.item.id)),L(null),D("Shop Completed Purchase",{...Oe(i),payment_type:"credits",no_crypto_step:G,transaction_hash:g[0]??null}),W.invalidateQueries({queryKey:["usd-balance"]});const I=Z.current;Z.current=null,j(null),P(!1);const Pe={items:p,txHash:g[0]??void 0,settled:!0,...I?{creditsAdded:I}:{}};z("/success",{state:Pe,replace:!0})}catch(l){if(_e(l)||U(l,{flow:"cart_checkout",step:k,cart_size:s.length}),D(_e(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:Ge(l),value_usd:he(i.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await me(t.identity,d)}catch(b){U(b,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}j({phase:"error",message:pe(l)})}}function oe(s){const c=be(s);if(A!=null&&A.credits<c){le(s);return}Se(s)}async function O(){if(!t){E(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;E(null),$(null),P(!0);const c=s.reduce((i,p)=>i+p.priceCredits*p.quantity,0);D("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:he(c),has_sufficient_credits:K>=c});try{B(a("cart.status.reviewing"));const i=await Ze(s,t.address,Ne),p=[...i.unavailable,...i.own];if(p.length&&(p.forEach(d=>n(d.id)),$(ps(i))),i.buyable.length===0){E(a("cart.error.noneAvailable")),L(null),B(null);return}if(i.orderChanged){L(i),re.current=Date.now(),B(null);return}B(null),oe(i.buyable)}catch(i){U(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),E(pe(i)),B(null)}finally{P(!1)}}async function Me(){if(f){if(!t){E(a("buyModal.signInToCheckout"));return}if(Date.now()-re.current>ys){L(null),$(null),await O();return}E(null),oe(f.buyable)}}async function Ee(){if(X){try{sessionStorage.setItem(H,JSON.stringify(v.getState().items))}catch{}P(!0);try{const s=await as(X,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(H)}catch{}U(s,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const de=y.useRef(!1);y.useEffect(()=>{if(!(M!=null&&M.resumeCheckout)||de.current)return;de.current=!0,Z.current=M.creditsAdded??null;try{const c=sessionStorage.getItem(H);if(c){sessionStorage.removeItem(H);const i=JSON.parse(c);Array.isArray(i)&&i.length&&w(i)}}catch{}W.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[M==null?void 0:M.resumeCheckout]);const q=xe||(o==null?void 0:o.phase)==="processing";return r.length===0&&!o?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(F,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(_s,{as:se,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(F,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(F,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ne})}),ge?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:q,children:[e.jsx(F,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=Ce.get(s.id),i=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,k=s.quantity,G=typeof s.available=="number"&&k>=s.available,l=i*k,b=!!N[s.id],g=s.tokenId??s.itemId,I=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[I?e.jsx(se,{className:"checkout__thumb-link",to:I,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[I?e.jsx(se,{className:"checkout__name",to:I,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Le,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:q||k<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:k}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>u(s.id)),disabled:q||G,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(R,{className:"checkout__price-ico"})," ",l,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*k}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${b?" is-on":""}`,onClick:()=>V(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(F,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:q,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(F,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:q,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ne})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(R,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(f?Me():O()),disabled:q,children:q?a("cart.working"):f?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),f?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,te?e.jsx("p",{className:"muted checkout__msg",children:te}):null,ae?e.jsx("p",{className:"muted checkout__msg",children:ae}):null,e.jsx(os,{message:fe,className:"checkout__msg"})]})]})]})]}),ie.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:ie})}):null,o?e.jsx(us,{phase:o.phase,balanceCredits:K,onClose:we,stage:o.phase==="processing"?o.stage:void 0,step:o.phase==="processing"?o.step:void 0,total:o.phase==="processing"?o.total:void 0,isSelfCustody:Ue(t==null?void 0:t.providerType),lines:o.phase==="nofunds"?o.lines:void 0,shortfallCredits:o.phase==="nofunds"?o.shortfall:void 0,packs:m,selectedPack:X,onSelectPack:ce,onBuyPacks:()=>void Ee(),message:o.phase==="error"?o.message:void 0,onRetry:()=>void O()}):null]})}export{As as Cart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
body.shop-cart-bg{background:var(--media)}.checkout{max-width:1510px;margin:0 auto}.checkout__top{position:relative}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 615px;gap:24px;align-items:start}.checkout__left{min-width:0;display:flex;flex-direction:column;gap:12px}.checkout__head-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-radius:16px;padding:12px 12px 12px 24px}.checkout__panel{min-width:0;background:#fff;border-radius:16px;padding:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:14px;font-weight:600;line-height:1.57;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:24px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137.5px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__actions{position:absolute;top:9px;right:7px;display:flex;align-items:flex-start;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;box-shadow:0 1px 3px #1615180f;border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:24px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:16px;font-weight:400;color:var(--muted)}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__total-ico{width:30px;height:30px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{position:relative;padding:40px 0 24px}.cart-upsell:before{content:"";position:absolute;top:0;bottom:-80px;left:50%;width:100vw;transform:translate(-50%);background:var(--bg);z-index:0}.cart-upsell>*{position:relative;z-index:1}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__qty-tag{margin-left:6px;font-size:12px;font-weight:600;color:var(--muted)}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
|
|
1
|
+
body.shop-cart-bg{background:var(--media)}.checkout{max-width:1510px;margin:0 auto}.checkout__top{position:relative}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 615px;gap:24px;align-items:start}.checkout__left{min-width:0;display:flex;flex-direction:column;gap:12px}.checkout__head-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-radius:16px;padding:12px 12px 12px 24px}.checkout__panel{min-width:0;background:#fff;border-radius:16px;padding:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:14px;font-weight:600;line-height:1.57;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:24px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137.5px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__actions{position:absolute;top:9px;right:7px;display:flex;align-items:flex-start;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;box-shadow:0 1px 3px #1615180f;border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:24px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:16px;font-weight:400;color:var(--muted)}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__total-ico{width:30px;height:30px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{position:relative;padding:47px 0 24px}.cart-upsell .collection-carousel{margin-top:0}.cart-upsell:before{content:"";position:absolute;top:0;bottom:-80px;left:50%;width:100vw;transform:translate(-50%);background:var(--bg);z-index:0}.cart-upsell>*{position:relative;z-index:1}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__qty-tag{margin-left:6px;font-size:12px;font-weight:600;color:var(--muted)}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N,O as U,P as w,Q as z,R as o,S as E,U as c,V as I,W as g,X as D,M}from"./index-C1yBaAe9.js";import{r as W,j as v}from"./react-BrLDncxD.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ import{O as N,P as U,Q as w,R as z,S as o,U as E,V as c,W as I,X as g,Y as D,N a
|
|
|
6
6
|
100% {
|
|
7
7
|
transform: rotate(360deg);
|
|
8
8
|
}
|
|
9
|
-
`)),B=
|
|
9
|
+
`)),B=M(S||(S=l`
|
|
10
10
|
0% {
|
|
11
11
|
stroke-dasharray: 1px, 200px;
|
|
12
12
|
stroke-dashoffset: 0;
|
|
@@ -25,4 +25,4 @@ import{O as N,P as U,Q as w,R as z,S as o,U as E,V as c,W as I,X as g,Y as D,N a
|
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
26
|
`),V)),O=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),B)),
|
|
28
|
+
`),B)),q=W.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,K),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(L,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(O,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(Q,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{q as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as v,
|
|
1
|
+
import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as v,ak as Z,I as J,t,c as V,E as W,m as X,u as ee,A as ae,ao as te,C as re,ap as se}from"./index-C1yBaAe9.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-4y6zy3OY.js";import{u as de}from"./useStore-DjC0Mzyl.js";import{s as E}from"./address-DrURAr9O.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-BKqMpg3a.js";import{L as xe}from"./LoadMore-wolzH5ER.js";import{u as he}from"./useInfiniteGrid-CRDFn4if.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as o}from"./react-BrLDncxD.js";import{ak as b,G as N,t as n,I as E,al as _,A as W}from"./index-C1yBaAe9.js";import{s as A}from"./address-DrURAr9O.js";function M({address:c,className:i}){const{data:l}=b(c),s=l!=null&&l.name?N(l.name):A(c);return e.jsx("div",{className:i,children:n("search.byCreator",{name:s})})}function P({className:c}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:c,children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"#691fa9",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v6",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"16.5",r:"1.1",fill:"#691fa9"})]})}function z({title:c,items:i,onViewAll:l}){const s=o.useRef(null),[d,v]=o.useState(1),[h,j]=o.useState(0),[g,k]=o.useState(!0),[p,C]=o.useState(!1),a=o.useCallback(()=>{const r=s.current;if(!r)return;const{scrollLeft:t,scrollWidth:f,clientWidth:u}=r,x=Math.max(1,Math.ceil(f/u));v(x),j(Math.min(x-1,Math.round(t/u))),k(t<=1),C(t+u>=f-1)},[]);if(o.useEffect(()=>{a();const r=s.current;if(r)return r.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a),()=>{r.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,i.length]),i.length===0)return null;function m(r){const t=s.current;t&&t.scrollBy({left:r*t.clientWidth,behavior:"smooth"})}function w(r){const t=s.current;t&&t.scrollTo({left:r*t.clientWidth,behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:c}),l?e.jsxs("button",{className:"collection-carousel__viewall",onClick:l,children:[n("collectionCarousel.viewAll"),e.jsx(E,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>m(-1),"aria-label":n("collectionCarousel.scrollLeft"),disabled:g,children:e.jsx("img",{src:_,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:s,children:i.map(r=>e.jsx(W,{item:r},r.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>m(1),"aria-label":n("collectionCarousel.scrollRight"),disabled:p,children:e.jsx("img",{src:_,alt:"","aria-hidden":!0})})]}),d>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":n("collectionCarousel.pages"),children:Array.from({length:d}).map((r,t)=>e.jsx("button",{className:`collection-carousel__dot${t===h?" is-active":""}`,"aria-label":n("collectionCarousel.goToPage",{page:t+1}),"aria-current":t===h?"true":void 0,onClick:()=>w(t)},t))}):null]})}export{M as C,P as W,z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K,j as e,L as re,d as se,b as te,r as
|
|
1
|
+
import{a as K,j as e,L as re,d as se,b as te,r as N}from"./react-BrLDncxD.js";import{aq as oe,ar as ce,h as le,t as a,as as E,B as ne,ak as D,d as ie,I,c as de,u as me,A as ue,aj as he,at as ge,C as xe}from"./index-C1yBaAe9.js";import{d as _e,g as pe,a as je,A as Ne}from"./collection-4y6zy3OY.js";import{u as be,L as fe}from"./useStore-DjC0Mzyl.js";import{s as O}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-BKqMpg3a.js";import{L as B}from"./LoadMore-wolzH5ER.js";import{u as R}from"./useInfiniteGrid-CRDFn4if.js";import{E as T}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,j=r==null||o==null,{data:i}=oe(m,j),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function Se({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const ye={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,j=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(je({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:j,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:ye[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(Se,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,j]=N.useState("wearable"),[i,p]=N.useState(null),[h,_]=N.useState([]),[d,b]=N.useState(""),[l,f]=N.useState(""),[P,z]=N.useState("newest"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:S,maxPriceCredits:y,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:q,isFetchingNextPage:F,fetchNextPage:W}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function Z(s){j(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){j("wearable"),p(null),_([]),b(""),f("")}const k=!!(S||y),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(Ne,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:Z,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:q,isFetching:F,onLoadMore:()=>void W()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b7 as U,b8 as Ue,
|
|
1
|
+
import{b7 as U,b8 as Ue,R as C,b9 as qe,ba as Ye,$ as Qe,bb as Je,aW as Xe,Q as R,a$ as K,a_ as Te,bc as a,bd as Ze,be as Le,T as et,b5 as tt}from"./index-C1yBaAe9.js";import{R as rt,g as ot}from"./getOverlayAlpha-DD0MBenH.js";import{j as T,r as y}from"./react-BrLDncxD.js";import{u as nt,a as Be}from"./useTheme-YjNnj0AZ.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${s}') || '${o}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -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-BFTt2bWv.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-iruECcYS.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $,b as q,r as i,j as e}from"./react-BrLDncxD.js";import{u as H,t as s,d as Q,o as V,x as g,C as d,E as P,y as I,g as W,r as z}from"./index-C1yBaAe9.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-BAUaf92R.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-Caur-2iX.js";import{C as te}from"./CircularProgress-B7vK7bWC.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";const j="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/credit-coin-CmcTCd5i.webp",ae="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",x=se()?"mock":"stripe",ce={pack_5:j,pack_10:j,pack_25:j,pack_50:j},ne="https://docs.decentraland.org";function M(l){const r=l;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const l=$(),{session:r,signIn:m}=Q(),n=V(),[N,w]=q(),{packs:F,isLoading:T}=Z(),[p,o]=i.useState("select"),[c,E]=i.useState(null),[R,L]=i.useState(null),[U,h]=i.useState(null),[K,f]=i.useState(!1),b=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=b.current)==null?void 0:t.abort()},[]);const A=i.useCallback(()=>{w(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[w]),y=i.useCallback(async t=>{o("processing");const a=new AbortController;b.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const _=u.creditsGranted??(c==null?void 0:c.credits)??0;L(_>0?_:null),o("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:_>0?_:null,provider:x}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){const k={resumeCheckout:!0,..._>0?{creditsAdded:_}:{}};l("/cart",{state:k});return}}catch{}try{const k=sessionStorage.getItem(G);if(k){sessionStorage.removeItem(G);const C=JSON.parse(k),B=C.tokenId??C.itemId;if(C.contractAddress&&B){l(`/item/${C.contractAddress}/${B}`,{state:{item:C,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),o("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),o("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),h(M(u)),o("error")}},[c,r,n,l]),O=i.useCallback(async t=>{if(!r){m();return}h(null),f(!1),E(t),o(x==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:x});try{const a=await ee(t.id,{address:r.address,identity:r.identity});if(a.mock)y(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:x}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),h(M(a)),o("error")}},[r,m,y]),v=i.useRef(!1);i.useEffect(()=>{if(v.current)return;const t=N.get("order");if(N.get("canceled")!=null){v.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:x}),A(),f(!0),o("select");return}t&&(o("processing"),r&&(v.current=!0,A(),y(t)))},[N,r]);function S(){var t;(t=b.current)==null||t.abort(),o("select"),E(null),L(null),h(null),f(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),R!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:R,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:S,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:S,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:l,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:l.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??j,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CryDMiQl.js";import{d as g,r as v}from"./index-iruECcYS.js";import{C as c}from"./ConstantsUtil-DO6FyoSW.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BFTt2bWv.js";import{au as y}from"./NetworkUtil-BGlQiKvg.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as K,r as u,j as e,L as B}from"./react-BrLDncxD.js";import{e as $,t as s,C as w,B as k,
|
|
1
|
+
import{a as K,r as u,j as e,L as B}from"./react-BrLDncxD.js";import{e as $,t as s,C as w,B as k,g as L,x as P,E as A,u as U,d as W,o as O,m as z,s as Q,J}from"./index-C1yBaAe9.js";import{i as Y,R as D,f as G}from"./import-C4A0dOmT.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./buy-CNc4Y8CN.js";import"./authorizations-ChRb35xG.js";import"./index-HN6Rk25C.js";import"./trade-encoding-DQ3zNCj8.js";import"./mana-rate-CQNKlfL0.js";function H({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=$(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,E]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await Y(n[r].item,n[r].priceCredits,T),P("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof D)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||E("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
|
|
2
2
|
margin-top: 10px;
|
|
3
3
|
`,V=Q(k)`
|
|
4
4
|
padding: 13px 24px;
|