@dcl/shop 0.1.0-30341552356.commit-1157de5 → 0.1.0-30346982084.commit-1556fc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Activity-Dj44bwKw.js → Activity-DmfuaSV_.js} +1 -1
- package/assets/{AnimatedBackground-CwKlLPU1.js → AnimatedBackground-CSIivh-7.js} +1 -1
- package/assets/{Assets-DWnYTXCo.js → Assets-9imsOw89.js} +5 -5
- package/assets/{Assets.styles-BhE61g54.js → Assets.styles-Bd9foaaO.js} +1 -1
- package/assets/{Authorizations-BwJDLOap.js → Authorizations-D9ohnYIV.js} +1 -1
- package/assets/{Button-B3EWO6NJ.js → Button-PRPgkFJi.js} +1 -1
- package/assets/Cart-BYUQ1r55.js +1 -0
- package/assets/{CircularProgress-Be2BeSsu.js → CircularProgress-Br4H-um1.js} +1 -1
- package/assets/{Collection-CZEi_EO2.js → Collection-CPemNR6A.js} +1 -1
- package/assets/CollectionCarousel-CZMR8GBR.js +292 -0
- package/assets/{Creator-DgBS8-4a.js → Creator-B-gVe0hd.js} +1 -1
- package/assets/{ExchangeController-BkfKxSM1.js → ExchangeController-U5LImOme.js} +1 -1
- package/assets/{GetCredits-D4_gPu7y.js → GetCredits-DEQvJ9mI.js} +57 -57
- package/assets/{HelpersUtil-nSm_BMK5.js → HelpersUtil-DbzkV19A.js} +1 -1
- package/assets/{ImportListings-0xT85_lg.js → ImportListings-BaQxr4PS.js} +1 -1
- package/assets/{ItemDetail-Dq6IJ40V.js → ItemDetail-DNm4APW3.js} +130 -130
- package/assets/{LoadMore-Cbr521EF.js → LoadMore-CaAwZKNE.js} +1 -1
- package/assets/{MarketCheckout-CEZ0wtt0.js → MarketCheckout-Cv0PPf1x.js} +1 -1
- package/assets/{MenuList-BYXPwoXC.js → MenuList-Ih5H1pCm.js} +1 -1
- package/assets/{MyAssets-Y32vTL95.js → MyAssets-DxduQTTM.js} +1 -1
- package/assets/{MyFavorites-DQ-5zeBc.js → MyFavorites-CizrdQTv.js} +1 -1
- package/assets/{NotFound-9u0kqnXS.js → NotFound-ThIMrJ4c.js} +1 -1
- package/assets/{NotificationsBell-Bh-SEbDn.js → NotificationsBell-BKuVYP1v.js} +1 -1
- package/assets/{StoreSettings-DnEI4N7v.js → StoreSettings-DusaT8_Y.js} +5 -5
- package/assets/{Success-jGqc-yIA.js → Success-DHzkksX7.js} +1 -1
- package/assets/{SwapController-DXwEV4tc.js → SwapController-Cnr2ltkx.js} +1 -1
- package/assets/{Tooltip-CkfT0XKM.js → Tooltip-ClXq4Pqb.js} +1 -1
- package/assets/{TradeService-BP9td6am.js → TradeService-DlTcNnE_.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-DOHwgNRJ.js → W3MFrameProviderSingleton-Fg03tN2o.js} +3 -3
- package/assets/{WebCryptoP256-xSGFEHUn.js → WebCryptoP256-Cc4T4ixV.js} +1 -1
- package/assets/{authorizations-DVHH9Rgu.js → authorizations-yFswdfzV.js} +1 -1
- package/assets/{basic-jN1vb_0X.js → basic-B_D7BnHm.js} +1 -1
- package/assets/{biconomy-CnJ3HxGY.js → biconomy-BJiYxiCM.js} +1 -1
- package/assets/{builder--u_mLwLg.js → builder-D8pn_epC.js} +1 -1
- package/assets/{buy-DsK3JvBE.js → buy-DUxGZAn9.js} +1 -1
- package/assets/{buy-gasless-B0tydfop.js → buy-gasless-thIWNIP4.js} +1 -1
- package/assets/{cart-checkout-B_ayyHRb.js → cart-checkout-D_tpC44p.js} +1 -1
- package/assets/{categories-CnryCWCq.js → categories-Uv70U5cD.js} +1 -1
- package/assets/{ccip-CpnrZcJR.js → ccip-DzXqpOYU.js} +1 -1
- package/assets/{ccip-DSWWT7QA.js → ccip-VKQ25R1N.js} +1 -1
- package/assets/{collection-DvprT8Ak.js → collection-zY_3UAhh.js} +1 -1
- package/assets/{controller-DcyNYMS1.js → controller-CkueccvF.js} +2 -2
- package/assets/{core-BjxuDLc2.js → core-BPn7TGlM.js} +4 -4
- package/assets/{custom-BXO5l2GN.js → custom-qzg0xRz2.js} +1 -1
- package/assets/{data-capture-CNmHScYc.js → data-capture-CaUbT2NS.js} +1 -1
- package/assets/{email-CeHIxnKR.js → email-uGUB_0kS.js} +1 -1
- package/assets/{embedded-wallet-DFRpG2QT.js → embedded-wallet-DObfuzM9.js} +1 -1
- package/assets/{emotion-styled.browser.esm-BAKrhA-T.js → emotion-styled.browser.esm-DcPUbBuT.js} +1 -1
- package/assets/{engine-QHP5dbJN.js → engine-DSL72zE-.js} +1 -1
- package/assets/{errors-CxK78Ezc.js → errors-D5qyrGIk.js} +1 -1
- package/assets/{estimate-l1-fee-DJZ2ykvP.js → estimate-l1-fee-S26WZ6Ak.js} +1 -1
- package/assets/{execute-BxL0u7cZ.js → execute-BQYQS73i.js} +2 -2
- package/assets/{features-D-1vXo09.js → features-Dq0i2CD5.js} +1 -1
- package/assets/{fetchTokenMetadata-Bmh-GAy2.js → fetchTokenMetadata-Dgy-_8Bg.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-gP16_3M9.js → get-ecosystem-wallet-info-ofi4oQQH.js} +1 -1
- package/assets/{getBalance-Cy11zY8o.js → getBalance-CXG7wyGb.js} +1 -1
- package/assets/{getNFT-D8_d_43-.js → getNFT-DaDzBV3Q.js} +1 -1
- package/assets/{getNFT-CLM4lOgZ.js → getNFT-bnhpKzUY.js} +1 -1
- package/assets/{getThemeProps-Db0LqBsH.js → getThemeProps-B21wezVE.js} +1 -1
- package/assets/{hashTypedData-CyLnrmuM.js → hashTypedData-BCdtc7qs.js} +1 -1
- package/assets/{hashTypedData-DlhCxtnU.js → hashTypedData-u3xXKVK8.js} +1 -1
- package/assets/{import-xj2dmpRb.js → import-DbFcVbNo.js} +1 -1
- package/assets/{in-app-Ca1mMARX.js → in-app-D74PdGPY.js} +1 -1
- package/assets/{in-app-wallet-calls-CW5YIAy_.js → in-app-wallet-calls-B6OYTQHi.js} +1 -1
- package/assets/{index-Dyl6gCDy.js → index-5n5g8y7I.js} +1 -1
- package/assets/{index-CXOudy9H.js → index-AnxCAOik.js} +1 -1
- package/assets/{index-B8QWKyIQ.js → index-B2xziJCn.js} +1 -1
- package/assets/{index-B-_1QhtU.js → index-B398Z6qc.js} +1 -1
- package/assets/{index-CwJPZDQg.js → index-B4oAmBun.js} +1 -1
- package/assets/{index-BZ-ADUaA.js → index-B57fwX4O.js} +1 -1
- package/assets/{index-BFMPeJUP.js → index-B8cKholU.js} +1 -1
- package/assets/{index-_B4jXVuv.js → index-BFKxtKk6.js} +1 -1
- package/assets/{index-CJ85TtZ8.js → index-BP7RAkXG.js} +1 -1
- package/assets/{index-CgEZpoUf.js → index-BQidvrNP.js} +1 -1
- package/assets/{index-CRQc7aFW.js → index-BSGtwjgw.js} +1 -1
- package/assets/{index-DaGxFfPe.js → index-Ba1RDwMB.js} +1 -1
- package/assets/{index-DMKg8lh3.js → index-BeP2kPio.js} +1 -1
- package/assets/{index-qJN3KuXC.js → index-BkMH6F8u.js} +1 -1
- package/assets/{index-Cog4X8JZ.js → index-BqBu_NQG.js} +1 -1
- package/assets/{index-D4GTMW1w.js → index-BrAphGcH.js} +1 -1
- package/assets/{index-DE80LSux.js → index-C1kOV0UG.js} +1 -1
- package/assets/{index-BAHZtt4N.js → index-C3HOIkVJ.js} +1 -1
- package/assets/{index-Ct3-9z3S.js → index-C5KPZuQK.js} +1 -1
- package/assets/{index-BS5Ceouq.js → index-C694a0Ow.js} +1 -1
- package/assets/{index-Ik8KJlRB.js → index-C9iefch6.js} +3 -3
- package/assets/{index-a3vLcVip.js → index-CDA4ZfV6.js} +1 -1
- package/assets/{index-CR6dp-n2.js → index-CGqBQlDi.js} +2 -2
- package/assets/{index-DcgPlZHV.js → index-CJ1S6FqL.js} +1 -1
- package/assets/{index-cdg92wTF.js → index-CNtUTU8a.js} +1 -1
- package/assets/{index-DMzXLpFX.js → index-COMZ0QYj.js} +2 -2
- package/assets/{index-BWqSG2Zp.js → index-COonIPaP.js} +1 -1
- package/assets/{index-hTjbV6vV.js → index-ChK7Zhgp.js} +1 -1
- package/assets/{index-DidAGC-b.js → index-CrK156Ip.js} +1 -1
- package/assets/{index-CYe6NA33.js → index-CsgSHO5z.js} +1 -1
- package/assets/{index-CUAbfX_G.js → index-Cw5lzg0W.js} +1 -1
- package/assets/{index-tNNieLvH.js → index-CzraiSNX.js} +1 -1
- package/assets/{index-BRqkHqJo.js → index-D037rArF.js} +1 -1
- package/assets/{index-DG5yd0Hy.js → index-D8Hubo7A.js} +1 -1
- package/assets/{index-ShBnagKs.js → index-DAZ0ysBb.js} +2 -2
- package/assets/{index-CEvsvVpf.js → index-DDwukGpN.js} +1 -1
- package/assets/{index-CB1uzRfI.js → index-DJOUK5YK.js} +1 -1
- package/assets/{index-BPlewML_.js → index-DJrwapx8.js} +1 -1
- package/assets/{index-C3ZPHWQF.js → index-DPT9OP9g.js} +1 -1
- package/assets/{index-DHAtTfUI.js → index-DQhXQPRB.js} +1 -1
- package/assets/{index-n8GCu-Rn.js → index-DhRiwLX6.js} +1 -1
- package/assets/{index-DPvzgx_y.js → index-Kah_5I7w.js} +1 -1
- package/assets/{index-DTUefcrq.js → index-MaWZu7Kc.js} +1 -1
- package/assets/{index-D3sOF6Ef.js → index-NHBZf6ex.js} +1 -1
- package/assets/{index-G557eOOZ.js → index-STt3JjAX.js} +3 -3
- package/assets/{index-CaZpvuaJ.js → index-UABzGmxG.js} +1 -1
- package/assets/{index-D3S3ylBv.js → index-YOQZ8CmL.js} +1 -1
- package/assets/{index-CBJiZL2c.js → index-ZDbcq5k2.js} +1 -1
- package/assets/{index-LI2Gp3bz.js → index-aDVbUgI3.js} +1 -1
- package/assets/{index-Boi8OWdb.js → index-j6t2niBa.js} +11 -11
- package/assets/{index-Bw8dL1iq.js → index-q0KpvQUB.js} +3 -3
- package/assets/{index.es-86Q_KSh8.js → index.es-Cv-8i9Np.js} +4 -4
- package/assets/{index.es-Pf3_VMB1.js → index.es-Dehk7NCx.js} +1 -1
- package/assets/{index.es-Do8tEs_c.js → index.es-lh8FvPbN.js} +1 -1
- package/assets/{localBatchGatewayRequest-Q9ISf7xV.js → localBatchGatewayRequest-CovSJ1_K.js} +1 -1
- package/assets/{mana-rate-Dr5e3Fsu.js → mana-rate-VtkIiKPn.js} +1 -1
- package/assets/{networks-DH11TI3P.js → networks-D9pPwkAE.js} +1 -1
- package/assets/{onramp-fUReVnH1.js → onramp-DvLJzB9T.js} +1 -1
- package/assets/{openzeppelin-BMoHmYeO.js → openzeppelin-C7C2YcF8.js} +1 -1
- package/assets/{parseNft-Bsnv7LY2.js → parseNft-KwvNwgpb.js} +2 -2
- package/assets/{parseSignature-WQa_Z13b.js → parseSignature-BC73WzsU.js} +3 -3
- package/assets/{parseSignature-vnzc0TWx.js → parseSignature-DFYYPie8.js} +1 -1
- package/assets/{passkeys-DcSb_2bY.js → passkeys-6AiQ1D9l.js} +1 -1
- package/assets/{pay-with-exchange-BSvTA-vL.js → pay-with-exchange-wP8MZ_ta.js} +1 -1
- package/assets/{qr-overlay-Cxia7TxD.js → qr-overlay-DjFSVbtJ.js} +1 -1
- package/assets/{receive-C7U2pw1b.js → receive-BTrZJWRX.js} +1 -1
- package/assets/{resolveImplementation-B0oFFgdO.js → resolveImplementation-Dsd-Oed1.js} +1 -1
- package/assets/{rpc-CPkDSng_.js → rpc-CEN3fcFs.js} +1 -1
- package/assets/{secp256k1-B8iTaWun.js → secp256k1-DLaPjQs0.js} +1 -1
- package/assets/{secp256k1-9B-GuXCR.js → secp256k1-L1naJI_X.js} +1 -1
- package/assets/{secp256k1-BG_xdWRK.js → secp256k1-fUcmJoDX.js} +1 -1
- package/assets/{send-HIK1lDa_.js → send-D4DmG50x.js} +1 -1
- package/assets/{send-batch-transaction-DlA-mriP.js → send-batch-transaction-h-Jt765v.js} +1 -1
- package/assets/{send-eip712-transaction-BKSgmtge.js → send-eip712-transaction-D98RhdSg.js} +2 -2
- package/assets/{send-gasless-transaction-CaZ9Bdzc.js → send-gasless-transaction-C-8GOpkL.js} +2 -2
- package/assets/{send-transaction-IH4G-3ve.js → send-transaction-DL8-nvnG.js} +2 -2
- package/assets/{sendMetaTransaction-CoMlUn3U.js → sendMetaTransaction-B9JFGTtU.js} +1 -1
- package/assets/{sendRawTransaction-Bl9YcsnP.js → sendRawTransaction-CC3AYMqI.js} +3 -3
- package/assets/{serializeTransaction-lddISawN.js → serializeTransaction-1pdrtaaB.js} +1 -1
- package/assets/{session-proposal-DnwQ3Izq.js → session-proposal-Yeg-UO4z.js} +1 -1
- package/assets/{session-request-BlxbeFMn.js → session-request-COAI913l.js} +2 -2
- package/assets/{signing-CMF-guhc.js → signing-DSe4t946.js} +3 -3
- package/assets/{socials-oKTNFCc_.js → socials-CiYNvPX9.js} +1 -1
- package/assets/{swaps-DKTQ0Qks.js → swaps-msltbZvz.js} +1 -1
- package/assets/{thirdweb-CleLzSpa.js → thirdweb-BStKfYrG.js} +3 -3
- package/assets/{to-serializable-transaction-Dmnj9hOd.js → to-serializable-transaction-CbT-ln_e.js} +2 -2
- package/assets/{trade-encoding-CJ445Q0f.js → trade-encoding-DCm246c_.js} +1 -1
- package/assets/{transactionReceipt-wJvnMFcL.js → transactionReceipt-B0J6fK3s.js} +1 -1
- package/assets/{transactions-CwbwJTBm.js → transactions-BvSKhMwK.js} +1 -1
- package/assets/useCreditPacks-0-2Fvcmi.js +1 -0
- package/assets/{useInfiniteGrid-BsvaZzST.js → useInfiniteGrid-Eaq5Vw9-.js} +1 -1
- package/assets/useManaRate-B-VLyqcA.js +1 -0
- package/assets/{useStore-D4BwFx3W.js → useStore-BYd8E7j4.js} +1 -1
- package/assets/{useTheme-C3x6r6Lw.js → useTheme-D-T7h_1z.js} +1 -1
- package/assets/{verifyHash-Cw5VgEE4.js → verifyHash-CzJndLTS.js} +1 -1
- package/assets/{w3m-modal-C3TYSgnM.js → w3m-modal-Bpc7s3z4.js} +1 -1
- package/assets/{w3m-modal-Btpx7WOs.js → w3m-modal-DQxDXMlD.js} +1 -1
- package/assets/{wait-for-tx-receipt-PVsjRORl.js → wait-for-tx-receipt-OIvPxpDE.js} +1 -1
- package/assets/{wallets-CawAcOqK.js → wallets-BidvFh0P.js} +5 -5
- package/assets/{web-connector-g3y9yAdS.js → web-connector-DH50FkIX.js} +3 -3
- package/assets/{writeContract-CkNfH9sB.js → writeContract-CBx3ReDH.js} +1 -1
- package/assets/{zoraTestnet-D5vdVlTL.js → zoraTestnet-DW1cpNA6.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-C048yxEZ.js +0 -1
- package/assets/CollectionCarousel-B4KoClM7.js +0 -292
- package/assets/useCreditPacks-DslICYvP.js +0 -1
- package/assets/useManaRate-BrpK_vbN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,j as e,L as _,e as dt}from"./react-B36MyIP_.js";import{n as l,K as o,R as lt,B as ht,h as ut,t as d,e as xt,u as b,I as g,aG as G,aH as B,aI as pt,k as v,an as E,S as X,m as mt,aJ as gt,aK as Q}from"./index-
|
|
1
|
+
import{r as j,j as e,L as _,e as dt}from"./react-B36MyIP_.js";import{n as l,K as o,R as lt,B as ht,h as ut,t as d,e as xt,u as b,I as g,aG as G,aH as B,aI as pt,k as v,an as E,S as X,m as mt,aJ as gt,aK as Q}from"./index-j6t2niBa.js";import{m as ft}from"./mana-rate-VtkIiKPn.js";import{u as yt}from"./useManaRate-B-VLyqcA.js";import{L as jt}from"./LoadMore-CaAwZKNE.js";import{u as f}from"./useInfiniteGrid-Eaq5Vw9-.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";const bt=15e3;function vt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=bt}function kt(t){const i=[...t].sort((n,a)=>a.createdAt-n.createdAt),r=[];for(const n of i){const a=r[r.length-1];a&&vt(a[a.length-1],n)?a.push(n):r.push([n])}return r.map(n=>{var a;return{id:((a=n.find(c=>c.txHash))==null?void 0:a.txHash)??n[n.length-1].id,createdAt:Math.max(...n.map(c=>c.createdAt)),status:n.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:n.reduce((c,u)=>c+u.credits,0),lines:n}})}function wt(t){const i=[],r=new Map;for(const n of t)if(n.tradeId){const a=r.get(n.tradeId);if(a){a.quantity+=1,a.credits+=n.credits;continue}const c={key:n.tradeId,tradeId:n.tradeId,quantity:1,credits:n.credits};r.set(n.tradeId,c),i.push(c)}else i.push({key:n.id,tradeId:null,quantity:1,credits:n.credits});return i}function It(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?ft(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function $t(t){const r=kt(t.purchases.filter(s=>s.status!=="EXPIRED")).map(s=>({kind:"purchase",id:`purchase:${s.id}`,createdAt:s.createdAt,order:s})),n=t.sales.map(s=>{const x=It(s,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),a=(t.creditOrders??[]).filter(s=>s.status!=="EXPIRED").map(s=>({kind:"credit",id:`credit:${s.id}`,createdAt:s.createdAt,order:s})),c=new Set(t.purchases.filter(s=>s.txHash).map(s=>s.txHash.toLowerCase())),u=(t.manaPurchases??[]).filter(s=>!c.has(s.txHash.toLowerCase())).map(s=>({kind:"mana-purchase",id:`mana-purchase:${s.id}`,createdAt:s.createdAt,sale:s}));return[...r,...n,...a,...u].sort((s,x)=>x.createdAt-s.createdAt||(s.id<x.id?-1:1))}function At(t,i){return i==="all"?t:i==="sales"?t.filter(r=>r.kind==="sale"):t.filter(r=>r.kind==="purchase"||r.kind==="credit"||r.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Pt(t){const i=new Map;for(const r of t??[]){const n=J(r.txHash??"");if(!n)continue;const a=i.get(n);a?a.push(r):i.set(n,[r])}return i}function Nt(t,i,r=Date.now()){const n=i.txHash?t.get(J(i.txHash)):void 0;if(!n||n.length===0)return{kind:"direct"};const a=n.length===1?Lt(n[0].netCents):null,c=n.filter(s=>!s.available&&s.availableAt>r);if(c.length===0)return{kind:"credited",credits:a};const u=c.reduce((s,x)=>Math.max(s,x.availableAt),0);return{kind:"pending",credits:a,availableAt:u}}function Lt(t){return Math.floor(t/10)}const Et="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/credits-product-vs4Q6u6l.svg",T=lt`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,Tt=l.section`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-B36MyIP_.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-B36MyIP_.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as Le,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D as nt,y as st,s as ot,n as s,K as t,e as ie,w as rt,x as Fe,m as Be,j as it,t as o,I as T,k as B,A as ye,E as J,F as at,G as lt,h as We,L as ct,M as te,aL as dt,aM as pt}from"./index-j6t2niBa.js";import{u as ft,M as ht}from"./MarketCheckout-Cv0PPf1x.js";import{r as xt,a as ut,m as He}from"./mana-rate-VtkIiKPn.js";import{u as Ue}from"./useManaRate-B-VLyqcA.js";import{g as mt,h as gt,i as bt,j as yt,k as wt,C as jt,l as vt,o as Ct,m as $t,n as kt,M as St,E as Et,p as Tt,q as It,r as _t,s as Rt,t as zt,u as At}from"./Assets.styles-Bd9foaaO.js";import{d as we,R as Nt,F as Mt,S as je,b as Pt}from"./categories-Uv70U5cD.js";import{L as Lt}from"./LoadMore-CaAwZKNE.js";import{u as Ft}from"./useInfiniteGrid-Eaq5Vw9-.js";import{E as Bt}from"./ErrorNotice-D_Z5OVFI.js";import{d as Wt}from"./dcl-schemas-BICTSpB5.js";import{u as Ht,G as Ut,w as Ot,S as Dt}from"./buy-gasless-thIWNIP4.js";import{s as Gt}from"./buy-DUxGZAn9.js";import{i as qt}from"./trade-encoding-DCm246c_.js";import{f as Vt}from"./errors-D5qyrGIk.js";import{J as Kt,C as Zt,B as re}from"./ethers-BteKixT0.js";import{l as Qt}from"./loader-logo-BzY9EKdC.js";import{n as Jt}from"./emotion-CSxEP8yM.js";import"./sentry-gZJVwIqQ.js";import"./intl-CBcMB1D2.js";import"./authorizations-yFswdfzV.js";import"./sendMetaTransaction-B9JFGTtU.js";import"./Tooltip-ClXq4Pqb.js";function ne(n){const r=n.source??"item",l=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${r}:${l}`}const H="100000000000000000000",Oe=2,X=15,Xt=/^[a-zA-Z0-9]+$/;function ve(n){const r=n.trim();return r.length===0?{ok:!1,reason:"empty"}:Xt.test(r)?r.length<Oe?{ok:!1,reason:"too-short"}:r.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Yt(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const en=["function available(string _subdomain) view returns (bool)"],Ce={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function tn(){return W.chainId===Wt.ChainId.MATIC_MAINNET?Ce.mainnet:Ce.sepolia}async function nn(n,r={}){var a;const{rpc:l,address:h}=tn(),u=new Kt(l),c=new Zt(h,en,u);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${l}`);const x=await c.available(n);if((a=r.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const sn="https://app.across.to/api";class De extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function on(n){return ut(H,n)}async function rn(n,r,l={}){var a;const h=l.chainId??W.chainId,u=l.provider??"across",c=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(r)}&chainId=${h}&provider=${u}`,x=await ot(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let d;try{d=(a=await x.json())==null?void 0:a.code}catch{}throw d==="ROUTE_COST_TOO_HIGH"?new De:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function an(n,r){const l=re.from(n.availableAmount),u=re.from(H).sub(l);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:qt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:r.externalCall.target,selector:r.externalCall.selector,data:r.externalCall.data,expiresAt:r.externalCall.expiresAt,salt:r.externalCall.salt},customExternalCallSignature:r.customExternalCallSignature,maxUncreditedValue:u.isNegative()?"0":u.toString(),maxCreditedValue:H}}async function ln(n,r={}){const l=sn,h=r.intervalMs??1e4,u=r.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<u;x++){try{const a=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${n}`);if(a.ok){const d=await a.json(),p=(d.status??"pending").toLowerCase(),w=d.fillTx??d.fillTxnRef??null,m=d.actionsSucceeded!==!1;if(p==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:m};if(p==="refunded"||p==="expired")return{status:p,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:m}}}catch{}x<u-1&&await new Promise(a=>setTimeout(a,h))}return c}async function cn(n){const{name:r,identity:l,signer:h}=n,u=n.chainId??W.chainId,c=n.provider??"across",x=(n.beneficiary??await h.getAddress()).toLowerCase();let a=null,d=!1;console.info("[names] register start",{name:r,buyer:x,chainId:u,provider:c});try{const p=await xt(u),w=on(p);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:p});const m=await rn(l,r,{chainId:u,provider:c});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await nt(l,w);if(a=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),re.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const $=an(C.credit,m);let b;try{b=await Ht({chainId:u,buyer:x,signer:h,args:$})}catch(y){if(!(y instanceof Ut))throw y;b=await Gt(u,$,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:b}),await Ot(b),d=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:b}),c==="across"){const y=await ln(b,n.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:b};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:b,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:b}}catch(p){if(console.error("[names] register failed — raw error:",p,{name:r,buyer:x,originConfirmed:d}),p instanceof Dt)return{status:"pending",originTxHash:p.txHash};throw a&&!d&&await st(l,[a]).catch(()=>{}),p instanceof De?p:new Error(Vt(p,"Couldn't register the name. Please try again.",{sale:!0}))}}const dn=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -366,7 +366,7 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
366
366
|
flex: none;
|
|
367
367
|
color: ${t.colors.dclRed};
|
|
368
368
|
}
|
|
369
|
-
`;function zn({name:n,priceCredits:r,onClose:l}){const{session:h}=ie(),{data:u,isError:c}=rt(h),x=
|
|
369
|
+
`;function zn({name:n,priceCredits:r,onClose:l}){const{session:h}=ie(),{data:u,isError:c}=rt(h),x=Fe(),a=Le(),[d,p]=f.useState("confirm"),[w,m]=f.useState(""),[C,$]=f.useState(null),b=f.useRef(!1),y=w.trim().toLowerCase()===n.toLowerCase(),S=d==="completing",j=r!=null?Be(r):"—";f.useEffect(()=>{const g=R=>{R.key==="Escape"&&!S&&l()};document.addEventListener("keydown",g);const Y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=Y}},[S,l]);async function E(){if(!(!h||!y||b.current)){b.current=!0,p("completing"),$(null);try{await cn({name:n,identity:h.identity,signer:h.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:r??null}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),p("success")}catch(g){J(lt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:at(g),purchase_type:"name"}),$((g==null?void 0:g.message)||o("names.errorGeneric")),p("error")}finally{b.current=!1}}}const k=d!=="success",I=it(h==null?void 0:h.providerType);return e.jsx(dn,{onClick:S?void 0:l,role:"presentation",children:e.jsxs(pn,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[k&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:d==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(Se,{onClick:l,disabled:S,"aria-label":o("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",ye(u,c)]}),e.jsx(Te,{})]}),(d==="confirm"||d==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(Ie,{children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(B,{}),j]})]}),d==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Rn,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>p("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(fn,{children:[e.jsx(hn,{children:o("names.confirmTitle")}),e.jsx(xn,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${An(n)}</b>`})}}),e.jsxs(un,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(gn,{value:w,onChange:g=>m(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(bn,{children:".dcl.eth"})]})]}),e.jsx(Me,{onClick:()=>void E(),disabled:!y||!h,children:o("names.buyCta")})]})]}),d==="completing"&&e.jsxs(yn,{children:[e.jsx(wn,{src:Qt,alt:"",width:56,height:56}),e.jsx(jn,{children:I?o("names.confirming"):o("names.completing")}),e.jsxs(vn,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx($n,{children:"1/1"})]})]}),d==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:o("names.successHeaderTitle")}),e.jsx(Se,{onClick:l,"aria-label":o("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",ye(u,c)]}),e.jsx(Te,{}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(En,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(Ie,{style:{marginTop:20},children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(B,{}),j]})]}),e.jsxs(Tn,{children:[e.jsx(In,{onClick:()=>{l(),a("/my-assets")},children:o("names.myItems")}),e.jsx(_n,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function An(n){return n.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/identity-B4DXDuJP.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/world-B-9aPlxu.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/invite-BfwIhP2C.webp",Ln="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/governance-DnazlIjy.webp",Fn=s.div`
|
|
370
370
|
width: 100%;
|
|
371
371
|
min-width: 0;
|
|
372
372
|
`,Bn=s.nav`
|
|
@@ -396,7 +396,7 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
396
396
|
`,Hn=s.span`
|
|
397
397
|
font-weight: 700;
|
|
398
398
|
color: ${t.colors.muted};
|
|
399
|
-
`,
|
|
399
|
+
`,Un=s.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
gap: 48px;
|
|
@@ -409,7 +409,7 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
409
409
|
gap: 32px;
|
|
410
410
|
padding-bottom: 32px;
|
|
411
411
|
}
|
|
412
|
-
`,
|
|
412
|
+
`,On=s.div`
|
|
413
413
|
position: relative;
|
|
414
414
|
border-radius: ${t.radius.banner};
|
|
415
415
|
overflow: hidden;
|
|
@@ -784,4 +784,4 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
784
784
|
clip: rect(0, 0, 0, 0);
|
|
785
785
|
white-space: nowrap;
|
|
786
786
|
border: 0;
|
|
787
|
-
`,hs="https://docs.decentraland.org/creator/worlds/about/",xs="https://governance.decentraland.org";function us(n){const r=typeof window<"u"?window.location.hostname:"";return`${r.endsWith("decentraland.org")?"https://decentraland.org":r.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ms({onBack:n}){We({title:o("seo.names.title"),description:o("seo.names.description")});const{session:r,signIn:l}=ie(),{data:h}=Oe(),u=h?He(H,h):null,[c,x]=f.useState(""),[a,d]=f.useState("idle"),[p,w]=f.useState(!1),m=f.useRef(null),[C,$]=f.useState(void 0);f.useLayoutEffect(()=>{m.current&&$(m.current.offsetWidth)},[c]),f.useEffect(()=>{if(!ve(c).ok){d(c.length===0?"idle":"invalid");return}d("checking");const k=new AbortController,I=setTimeout(()=>{(async()=>{try{const g=await nn(c,{signal:k.signal});d(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;d("error")}})()},400);return()=>{clearTimeout(I),k.abort()}},[c]);const b=ve(c),y=b.ok&&(a==="available"||a==="error");function S(){if(y){if(!r){l();return}w(!0)}}const j=e.jsxs(e.Fragment,{children:[o("names.claim"),u!=null?e.jsxs(rs,{children:[e.jsx(B,{}),Be(u)]}):null]});return e.jsxs(Ln,{"data-testid":"names-page",children:[e.jsxs(Bn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(Wn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Hn,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(On,{children:[e.jsxs(Un,{children:[e.jsxs(Dn,{children:[e.jsx(Gn,{children:o("names.heroTitle")}),e.jsx(qn,{children:o("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:a==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:c,onChange:E=>x(Yt(E.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Qn,{ref:m,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(ns,{children:o("names.suffix")})]}),c.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Ge,{onClick:S,disabled:!y,"data-testid":"names-claim",children:j})]}),a==="taken"?e.jsxs(Jn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(Xn,{href:us(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(os,{onClick:S,disabled:!y,children:j}),a==="checking"?e.jsx(se,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):a==="error"?e.jsx(se,{tone:"muted",role:"status",children:o("names.checkError")}):a==="invalid"&&!b.ok&&b.reason==="too-short"?e.jsx(se,{tone:"muted",role:"status",children:o("names.tooShort",{min:Ue})}):null,e.jsx(fs,{role:"status","aria-live":"polite",children:a==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:o("names.whyTitle")}),e.jsx(cs,{children:o("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(q,{children:[e.jsx(V,{src:Nn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why1Title")}),e.jsx(Q,{children:o("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Mn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why2Title")}),e.jsxs(Q,{children:[o("names.why2")," ",e.jsx(ps,{children:o("names.why2Address")})]}),e.jsxs(Pe,{href:hs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Pn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why3Title")}),e.jsx(Q,{children:o("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Fn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why4Title")}),e.jsx(Q,{children:o("names.why4")}),e.jsxs(Pe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),p?e.jsx(zn,{name:c,priceCredits:u,onClose:()=>w(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",oe=48;function bs(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Os(){const[n]=tt(),r=Fe(),l=(n.get("q")??"").trim().toLowerCase(),h=Le(),{session:u,signIn:c}=ie(),x=(n.get("q")??"").trim();We({title:x?o("seo.collectibles.searchTitle",{query:x}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[a,d]=f.useState("wearable"),[p,w]=f.useState(null),[m,C]=f.useState([]),[$,b]=f.useState(""),[y,S]=f.useState(""),[j,E]=f.useState("on_sale"),[k,I]=f.useState(!1),[g,Y]=f.useState("newest"),[R,A]=f.useState(!1),[ae,ee]=f.useState(null);f.useEffect(()=>{if(!R)return;const i=L=>{L.key==="Escape"&&A(!1)};document.addEventListener("keydown",i);const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=v}},[R]);const O=j==="on_sale",N=$&&!Number.isNaN(Number($))?Number($):void 0,M=y&&!Number.isNaN(Number(y))?Number(y):void 0,qe=ft(),le=p?Pt[p]:void 0,ce=(we.find(i=>i.key===g)??we[0]).server,de={category:a,rarities:m.length?m:void 0,wearableCategories:le,minPriceCredits:N,maxPriceCredits:M,search:l||void 0,sortBy:ce,isSmart:k||void 0,onSale:!0,listingType:qe?void 0:"primary"},pe={category:a,rarities:m.length?m:void 0,wearableCategories:le,search:l||void 0,sortBy:ce,isWearableSmart:k||void 0,isOnSale:j==="not_for_sale"?!1:void 0},{items:P,total:fe,isLoading:_,isPlaceholderData:z,error:he,hasNextPage:Ve,isFetchingNextPage:xe,fetchNextPage:Ke}=Lt(O?["shop-items",de]:["catalog-items",pe],i=>O?dt({...de,first:oe,skip:i}):pt({...pe,first:oe,skip:i}),{enabled:a!=="names"}),U=fe,ue=_||z,Ze=_?15:Math.min(Math.max(P.length,1),oe),{data:D,isError:Qe}=Oe(),Je=i=>D&&i.manaWei?He(i.manaWei,D):null,me=f.useRef(null);f.useEffect(()=>{_||z||!l||me.current===l||(me.current=l,J("Shop Searched",{query:l,result_count:U}))},[l,_,z,U]);const G=f.useRef("__init__");f.useEffect(()=>{if(_||z)return;const i=JSON.stringify({category:a,subCategory:p,rarities:m,min:N,max:M,sort:g,status:j,smart:k});if(G.current==="__init__"||G.current===i){G.current=i;return}G.current=i,J("Shop Applied Filter",{filters:{category:a,sub_category:p,rarities:m,min_price_credits:N??null,max_price_credits:M??null,status:j,smart:k,sort:g},result_count:U})},[a,p,m,N,M,g,j,k,_,z,U]);function ge(i){d(i),w(null)}function be(i){C(v=>v.includes(i)?v.filter(L=>L!==i):[...v,i])}function Xe(){d("wearable"),w(null),C([]),b(""),S(""),E("on_sale"),I(!1)}function Ye(i){const v=P.find(L=>L.id===i.id);if(!(!v||v.source!=="legacy"||!v.manaWei)){if(!u){c();return}ee(bs(v))}}function et(){h.invalidateQueries({queryKey:["shop-items"]})}const F=[];(N!=null||M!=null)&&F.push({key:"price",label:o("filter.price"),onRemove:()=>{b(""),S("")}});for(const i of Nt)m.includes(i)&&F.push({key:`rarity-${i}`,label:ct(i),onRemove:()=>be(i)});return k&&F.push({key:"smart",label:o("filter.smart"),onRemove:()=>I(!1)}),j!=="on_sale"&&F.push({key:"status",label:j==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(mt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(gt,{onClick:()=>A(!1),"aria-hidden":!0}):null,e.jsxs(bt,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(yt,{children:[e.jsx(wt,{children:o("assets.filters")}),e.jsx(jt,{onClick:()=>A(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx(Ct,{category:a,subCategory:p,onCategory:ge,onSub:w,priceMin:$,priceMax:y,onPriceMin:b,onPriceMax:S,rarities:m,onToggleRarity:be,status:j,onStatus:E,smart:k,onSmart:I})}),e.jsx($t,{children:e.jsx(kt,{type:"button",onClick:()=>A(!1),children:o("assets.showItems")})})]})]}),e.jsx(St,{children:a==="names"?e.jsx(ms,{onBack:()=>ge("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{sort:g,onSort:Y,total:fe,loading:_||z,query:l,onOpenFilters:()=>A(!0),chips:F,onClearChips:Xe}),Qe&&O&&P.some(i=>i.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,he?e.jsx(Bt,{message:o("assets.loadError"),testId:"browse-error"}):null,!ue&&P.length===0&&!he?e.jsxs(Et,{"data-testid":"browse-empty",children:[e.jsx(Tt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(_t,{children:o("assets.empty.title")}),e.jsx(Rt,{children:x?e.jsxs(e.Fragment,{children:[o("assets.empty.searchBefore"),e.jsx("b",{children:x}),o("assets.empty.searchAfter")]}):o("assets.empty.filters")})]}),e.jsx(zt,{children:e.jsx(At,{type:"button",onClick:()=>r("/overview"),children:o("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid","data-testid":"grid",children:ue?e.jsx(je,{count:Ze}):e.jsxs(e.Fragment,{children:[P.map(i=>{if(!O)return e.jsx(te,{item:i,mode:"view"},ne(i));const v=i;return v.source==="legacy"?e.jsx(te,{item:v,mode:"market",marketPriceCredits:Je(v),onBuyNow:Ye},ne(i)):e.jsx(te,{item:i},ne(i))}),xe?e.jsx(je,{count:6}):null]})}),e.jsx(Ft,{hasNextPage:Ve,isFetching:xe,onLoadMore:()=>void Ke()})]})]})}),ae&&D?e.jsx(ht,{listing:ae,rate:D,onClose:()=>ee(null),onSold:()=>{ee(null),et()}}):null]})}export{Os as Assets};
|
|
787
|
+
`,hs="https://docs.decentraland.org/creator/worlds/about/",xs="https://governance.decentraland.org";function us(n){const r=typeof window<"u"?window.location.hostname:"";return`${r.endsWith("decentraland.org")?"https://decentraland.org":r.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ms({onBack:n}){We({title:o("seo.names.title"),description:o("seo.names.description")});const{session:r,signIn:l}=ie(),{data:h}=Ue(),u=h?He(H,h):null,[c,x]=f.useState(""),[a,d]=f.useState("idle"),[p,w]=f.useState(!1),m=f.useRef(null),[C,$]=f.useState(void 0);f.useLayoutEffect(()=>{m.current&&$(m.current.offsetWidth)},[c]),f.useEffect(()=>{if(!ve(c).ok){d(c.length===0?"idle":"invalid");return}d("checking");const k=new AbortController,I=setTimeout(()=>{(async()=>{try{const g=await nn(c,{signal:k.signal});d(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;d("error")}})()},400);return()=>{clearTimeout(I),k.abort()}},[c]);const b=ve(c),y=b.ok&&(a==="available"||a==="error");function S(){if(y){if(!r){l();return}w(!0)}}const j=e.jsxs(e.Fragment,{children:[o("names.claim"),u!=null?e.jsxs(rs,{children:[e.jsx(B,{}),Be(u)]}):null]});return e.jsxs(Fn,{"data-testid":"names-page",children:[e.jsxs(Bn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(Wn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Hn,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Un,{children:[e.jsxs(On,{children:[e.jsxs(Dn,{children:[e.jsx(Gn,{children:o("names.heroTitle")}),e.jsx(qn,{children:o("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:a==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:c,onChange:E=>x(Yt(E.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Qn,{ref:m,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(ns,{children:o("names.suffix")})]}),c.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Ge,{onClick:S,disabled:!y,"data-testid":"names-claim",children:j})]}),a==="taken"?e.jsxs(Jn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(Xn,{href:us(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(os,{onClick:S,disabled:!y,children:j}),a==="checking"?e.jsx(se,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):a==="error"?e.jsx(se,{tone:"muted",role:"status",children:o("names.checkError")}):a==="invalid"&&!b.ok&&b.reason==="too-short"?e.jsx(se,{tone:"muted",role:"status",children:o("names.tooShort",{min:Oe})}):null,e.jsx(fs,{role:"status","aria-live":"polite",children:a==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:o("names.whyTitle")}),e.jsx(cs,{children:o("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(q,{children:[e.jsx(V,{src:Nn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why1Title")}),e.jsx(Q,{children:o("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Mn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why2Title")}),e.jsxs(Q,{children:[o("names.why2")," ",e.jsx(ps,{children:o("names.why2Address")})]}),e.jsxs(Pe,{href:hs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Pn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why3Title")}),e.jsx(Q,{children:o("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Ln,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why4Title")}),e.jsx(Q,{children:o("names.why4")}),e.jsxs(Pe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),p?e.jsx(zn,{name:c,priceCredits:u,onClose:()=>w(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",oe=48;function bs(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Us(){const[n]=tt(),r=Le(),l=(n.get("q")??"").trim().toLowerCase(),h=Fe(),{session:u,signIn:c}=ie(),x=(n.get("q")??"").trim();We({title:x?o("seo.collectibles.searchTitle",{query:x}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[a,d]=f.useState("wearable"),[p,w]=f.useState(null),[m,C]=f.useState([]),[$,b]=f.useState(""),[y,S]=f.useState(""),[j,E]=f.useState("on_sale"),[k,I]=f.useState(!1),[g,Y]=f.useState("newest"),[R,A]=f.useState(!1),[ae,ee]=f.useState(null);f.useEffect(()=>{if(!R)return;const i=F=>{F.key==="Escape"&&A(!1)};document.addEventListener("keydown",i);const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=v}},[R]);const U=j==="on_sale",N=$&&!Number.isNaN(Number($))?Number($):void 0,M=y&&!Number.isNaN(Number(y))?Number(y):void 0,qe=ft(),le=p?Pt[p]:void 0,ce=(we.find(i=>i.key===g)??we[0]).server,de={category:a,rarities:m.length?m:void 0,wearableCategories:le,minPriceCredits:N,maxPriceCredits:M,search:l||void 0,sortBy:ce,isSmart:k||void 0,onSale:!0,listingType:qe?void 0:"primary"},pe={category:a,rarities:m.length?m:void 0,wearableCategories:le,search:l||void 0,sortBy:ce,isWearableSmart:k||void 0,isOnSale:j==="not_for_sale"?!1:void 0},{items:P,total:fe,isLoading:_,isPlaceholderData:z,error:he,hasNextPage:Ve,isFetchingNextPage:xe,fetchNextPage:Ke}=Ft(U?["shop-items",de]:["catalog-items",pe],i=>U?dt({...de,first:oe,skip:i}):pt({...pe,first:oe,skip:i}),{enabled:a!=="names"}),O=fe,ue=_||z,Ze=_?15:Math.min(Math.max(P.length,1),oe),{data:D,isError:Qe}=Ue(),Je=i=>D&&i.manaWei?He(i.manaWei,D):null,me=f.useRef(null);f.useEffect(()=>{_||z||!l||me.current===l||(me.current=l,J("Shop Searched",{query:l,result_count:O}))},[l,_,z,O]);const G=f.useRef("__init__");f.useEffect(()=>{if(_||z)return;const i=JSON.stringify({category:a,subCategory:p,rarities:m,min:N,max:M,sort:g,status:j,smart:k});if(G.current==="__init__"||G.current===i){G.current=i;return}G.current=i,J("Shop Applied Filter",{filters:{category:a,sub_category:p,rarities:m,min_price_credits:N??null,max_price_credits:M??null,status:j,smart:k,sort:g},result_count:O})},[a,p,m,N,M,g,j,k,_,z,O]);function ge(i){d(i),w(null)}function be(i){C(v=>v.includes(i)?v.filter(F=>F!==i):[...v,i])}function Xe(){d("wearable"),w(null),C([]),b(""),S(""),E("on_sale"),I(!1)}function Ye(i){const v=P.find(F=>F.id===i.id);if(!(!v||v.source!=="legacy"||!v.manaWei)){if(!u){c();return}ee(bs(v))}}function et(){h.invalidateQueries({queryKey:["shop-items"]})}const L=[];(N!=null||M!=null)&&L.push({key:"price",label:o("filter.price"),onRemove:()=>{b(""),S("")}});for(const i of Nt)m.includes(i)&&L.push({key:`rarity-${i}`,label:ct(i),onRemove:()=>be(i)});return k&&L.push({key:"smart",label:o("filter.smart"),onRemove:()=>I(!1)}),j!=="on_sale"&&L.push({key:"status",label:j==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(mt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(gt,{onClick:()=>A(!1),"aria-hidden":!0}):null,e.jsxs(bt,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(yt,{children:[e.jsx(wt,{children:o("assets.filters")}),e.jsx(jt,{onClick:()=>A(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx(Ct,{category:a,subCategory:p,onCategory:ge,onSub:w,priceMin:$,priceMax:y,onPriceMin:b,onPriceMax:S,rarities:m,onToggleRarity:be,status:j,onStatus:E,smart:k,onSmart:I})}),e.jsx($t,{children:e.jsx(kt,{type:"button",onClick:()=>A(!1),children:o("assets.showItems")})})]})]}),e.jsx(St,{children:a==="names"?e.jsx(ms,{onBack:()=>ge("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{sort:g,onSort:Y,total:fe,loading:_||z,query:l,onOpenFilters:()=>A(!0),chips:L,onClearChips:Xe}),Qe&&U&&P.some(i=>i.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,he?e.jsx(Bt,{message:o("assets.loadError"),testId:"browse-error"}):null,!ue&&P.length===0&&!he?e.jsxs(Et,{"data-testid":"browse-empty",children:[e.jsx(Tt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(_t,{children:o("assets.empty.title")}),e.jsx(Rt,{children:x?e.jsxs(e.Fragment,{children:[o("assets.empty.searchBefore"),e.jsx("b",{children:x}),o("assets.empty.searchAfter")]}):o("assets.empty.filters")})]}),e.jsx(zt,{children:e.jsx(At,{type:"button",onClick:()=>r("/overview"),children:o("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid","data-testid":"grid",children:ue?e.jsx(je,{count:Ze}):e.jsxs(e.Fragment,{children:[P.map(i=>{if(!U)return e.jsx(te,{item:i,mode:"view"},ne(i));const v=i;return v.source==="legacy"?e.jsx(te,{item:v,mode:"market",marketPriceCredits:Je(v),onBuyNow:Ye},ne(i)):e.jsx(te,{item:i},ne(i))}),xe?e.jsx(je,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:xe,onLoadMore:()=>void Ke()})]})]})}),ae&&D?e.jsx(ht,{listing:ae,rate:D,onClose:()=>ee(null),onSold:()=>{ee(null),et()}}):null]})}export{Us as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-B36MyIP_.js";import{R as C,a as oe,C as ie,c as ne}from"./categories-
|
|
1
|
+
import{r as $,j as t}from"./react-B36MyIP_.js";import{R as C,a as oe,C as ie,c as ne}from"./categories-Uv70U5cD.js";import{T as se}from"./Tooltip-ClXq4Pqb.js";import{K as e,n as o,I as m,t as s,L as re,b as v}from"./index-j6t2niBa.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 q,r as D}from"./react-B36MyIP_.js";import{n as a,B as M,K as o,R as I,h as B,t as e,e as F,j as K,I as f,k as G,S as P,u as w,x as Q,c as H,U as k,J as O,N as $}from"./index-
|
|
1
|
+
import{j as t,L as q,r as D}from"./react-B36MyIP_.js";import{n as a,B as M,K as o,R as I,h as B,t as e,e as F,j as K,I as f,k as G,S as P,u as w,x as Q,c as H,U as k,J as O,N as $}from"./index-j6t2niBa.js";import{b as W,c as _,d as J,f as U,s as X,h as V}from"./authorizations-yFswdfzV.js";import{a as Y}from"./builder-D8pn_epC.js";import{f as Z}from"./errors-D5qyrGIk.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B9JFGTtU.js";const tt=I`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,it=I`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bb as Xe,bc as Ye,q as Ge,bd as qe,Y as G,Z as b,$ as z,W as ee,X as se,be as Ze,a2 as H,R as le,V as Ce,bf as be,bg as we,bh as w,a1 as Re,bi as Je,T as Qe,aT as eo,r as oo,a0 as B,bj as to,bk as J}from"./index-
|
|
1
|
+
import{bb as Xe,bc as Ye,q as Ge,bd as qe,Y as G,Z as b,$ as z,W as ee,X as se,be as Ze,a2 as H,R as le,V as Ce,bf as be,bg as we,bh as w,a1 as Re,bi as Je,T as Qe,aT as eo,r as oo,a0 as B,bj as to,bk as J}from"./index-j6t2niBa.js";import{r as l,j as T,R as Y}from"./react-B36MyIP_.js";function Me(e){var o,t,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(o=0;o<n;o++)e[o]&&(t=Me(e[o]))&&(i&&(i+=" "),i+=t)}else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function no(){for(var e,o,t=0,i="",n=arguments.length;t<n;t++)(e=arguments[t])&&(o=Me(e))&&(i&&(i+=" "),i+=o);return i}const io=["className","component"];function ao(e={}){const{themeId:o,defaultTheme:t,defaultClassName:i="MuiBox-root",generateClassName:n}=e,a=Xe("div",{shouldForwardProp:u=>u!=="theme"&&u!=="sx"&&u!=="as"})(Ye);return l.forwardRef(function(c,p){const f=Ge(t),g=qe(c),{className:m,component:v="div"}=g,h=G(g,io);return T.jsx(a,b({as:v,ref:p,className:no(m,n?n(i):i),theme:o&&f[o]||f},h))})}function ae(e,o){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ae(e,o)}function ro(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,ae(e,o)}const ge=Y.createContext(null);function so(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e,o){var t=function(a){return o&&l.isValidElement(a)?o(a):a},i=Object.create(null);return e&&l.Children.map(e,function(n){return n}).forEach(function(n){i[n.key]=t(n)}),i}function lo(e,o){e=e||{},o=o||{};function t(f){return f in o?o[f]:e[f]}var i=Object.create(null),n=[];for(var a in e)a in o?n.length&&(i[a]=n,n=[]):n.push(a);var r,u={};for(var c in o){if(i[c])for(r=0;r<i[c].length;r++){var p=i[c][r];u[i[c][r]]=t(p)}u[c]=t(c)}for(r=0;r<n.length;r++)u[n[r]]=t(n[r]);return u}function A(e,o,t){return t[o]!=null?t[o]:e.props[o]}function co(e,o){return ce(e.children,function(t){return l.cloneElement(t,{onExited:o.bind(null,t),in:!0,appear:A(t,"appear",e),enter:A(t,"enter",e),exit:A(t,"exit",e)})})}function uo(e,o,t){var i=ce(e.children),n=lo(o,i);return Object.keys(n).forEach(function(a){var r=n[a];if(l.isValidElement(r)){var u=a in o,c=a in i,p=o[a],f=l.isValidElement(p)&&!p.props.in;c&&(!u||f)?n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:!0,exit:A(r,"exit",e),enter:A(r,"enter",e)}):!c&&u&&!f?n[a]=l.cloneElement(r,{in:!1}):c&&u&&l.isValidElement(p)&&(n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:p.props.in,exit:A(r,"exit",e),enter:A(r,"enter",e)}))}}),n}var po=Object.values||function(e){return Object.keys(e).map(function(o){return e[o]})},fo={component:"div",childFactory:function(o){return o}},ue=(function(e){ro(o,e);function o(i,n){var a;a=e.call(this,i,n)||this;var r=a.handleExited.bind(so(a));return a.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},a}var t=o.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},o.getDerivedStateFromProps=function(n,a){var r=a.children,u=a.handleExited,c=a.firstRender;return{children:c?co(n,u):uo(n,r,u),firstRender:!1}},t.handleExited=function(n,a){var r=ce(this.props.children);n.key in r||(n.props.onExited&&n.props.onExited(a),this.mounted&&this.setState(function(u){var c=b({},u.children);return delete c[n.key],{children:c}}))},t.render=function(){var n=this.props,a=n.component,r=n.childFactory,u=G(n,["component","childFactory"]),c=this.state.contextValue,p=po(this.state.children).map(r);return delete u.appear,delete u.enter,delete u.exit,a===null?Y.createElement(ge.Provider,{value:c},p):Y.createElement(ge.Provider,{value:c},Y.createElement(a,u,p))},o})(Y.Component);ue.propTypes={};ue.defaultProps=fo;function ho(e){const{className:o,classes:t,pulsate:i=!1,rippleX:n,rippleY:a,rippleSize:r,in:u,onExited:c,timeout:p}=e,[f,g]=l.useState(!1),m=z(o,t.ripple,t.rippleVisible,i&&t.ripplePulsate),v={width:r,height:r,top:-(r/2)+a,left:-(r/2)+n},h=z(t.child,f&&t.childLeaving,i&&t.childPulsate);return!u&&!f&&g(!0),l.useEffect(()=>{if(!u&&c!=null){const C=setTimeout(c,p);return()=>{clearTimeout(C)}}},[c,u,p]),T.jsx("span",{className:m,style:v,children:T.jsx("span",{className:h})})}const E=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),bo=["center","classes","className"];let oe=e=>e,me,xe,ve,ye;const re=550,go=80,mo=le(me||(me=oe`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as j,a as pa,u as _a,L as te}from"./react-B36MyIP_.js";import{t,k as K,m as G,ak as ga,h as ba,ai as P,Q as Ue,e as fa,u as va,w as xa,x as Ca,al as ja,am as ka,I as A,an as Na,l as wa,j as Ma,ao as Oe,E as B,ap as $e,aq as Sa,J as O,b as qa,D as Ve,y as pe,ar as _e,G as se,F as De,g as ne,a as Pa,C as ge,c as Ge,as as Aa}from"./index-j6t2niBa.js";import{P as Ye,m as Xe,W as Ia,c as be,t as Ra,C as Fa,A as Ta,a as Ea,s as He,i as Wa,b as La,d as Ba,e as Ka}from"./CollectionCarousel-CZMR8GBR.js";import{u as Qa}from"./useManaRate-B-VLyqcA.js";import{u as Je,r as za}from"./mana-rate-VtkIiKPn.js";import{a as Ua,j as Oa,h as $a,n as Va,i as Da,A as Ga}from"./authorizations-yFswdfzV.js";import{a as fe}from"./buy-DUxGZAn9.js";import{a as Ha,w as Ja,S as Ya,G as Xa}from"./buy-gasless-thIWNIP4.js";import{R as re,r as Za}from"./cart-checkout-D_tpC44p.js";import{u as et,M as at,c as tt}from"./useCreditPacks-0-2Fvcmi.js";import{l as st}from"./loader-logo-BzY9EKdC.js";import{i as nt,a as rt}from"./errors-D5qyrGIk.js";import{E as ct}from"./ErrorNotice-D_Z5OVFI.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DCm246c_.js";import"./sendMetaTransaction-B9JFGTtU.js";const it="https://cdn.decentraland.org/@dcl/shop/0.1.0-30346982084.commit-1556fc4/assets/buy-error-22UunaPC.png";function ot(c){const{phase:o,balanceCredits:C,onClose:N}=c,I=o==="processing",T=o==="error"?t("cartCheckout.errorTitle"):o==="nofunds"?t("cartCheckout.titleNoFunds"):o==="choose"?t("buyModal.choosePayment"):t("cartCheckout.titleBuy"),E=o==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:I?void 0:N,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${E?" 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:T}),!I&&e.jsx("button",{className:"buy-modal__x",onClick:N,"aria-label":t("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:o==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(K,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:G(C)})]})]}),o==="choose"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"cart-checkout__choose-total",children:[e.jsx("span",{children:t("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(K,{className:"buy-modal__balance-ico"}),G(c.totalCredits??0)]})]}),e.jsx(Ye,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const M=Xe(c.totalCents??0,c.totalManaWei??0n);return M!=null?t("buyModal.manaRate",{mana:M.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),o==="processing"&&e.jsx(lt,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),o==="nofunds"&&e.jsx(dt,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:N}),o==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:it,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:t("cartCheckout.errorHeadline")})," ",t("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:N,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:c.onRetry??N,children:t("cartCheckout.tryAgain")})]})]})]})]})}function lt({stage:c,step:o,total:C,isSelfCustody:N}){const I=c==="reserving",T=C>0?Math.min(100,Math.round(o/C*100)):0,E=c==="awaiting-signature"?N?t("buyModal.confirmToContinue"):t("buyModal.completingTransaction"):c==="settling"?t("buyModal.completingTransaction"):t("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:st,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:E}),I?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:`${T}%`}})}),C>1?e.jsxs("span",{className:"cart-checkout__step",children:[o,"/",C]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function dt({lines:c,shortfallCredits:o,packs:C,selectedPack:N,onSelectPack:I,onBuyPacks:T,onCancel:E}){const M=C.find(n=>n.id===N),ie=c.reduce((n,q)=>n+(q.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(Ia,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,o)})})," ",t("buyModal.warningToPurchase",{count:ie})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:c.map(n=>{const q=n.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:n.item.thumbnail?e.jsx("img",{src:n.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:n.item.name,children:[n.item.name||t("buyModal.itemFallback"),q>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:t("cartCheckout.qty",{count:q})}):null]}),n.item.creator?e.jsx(ga,{address:n.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(K,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:G(n.priceCredits*q)})]})]})]},n.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:C.map(n=>{const q=n.id===N;return e.jsxs("button",{className:`buy-modal__pack${q?" buy-modal__pack--on":""}`,onClick:()=>I(n.id),children:[e.jsx(K,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:G(n.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(K,{className:"buy-modal__total-ico"}),e.jsx("span",{children:G((M==null?void 0:M.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((M==null?void 0:M.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:T,children:t("buyModal.buy")})]})]})}function ve(c){if(nt(c))return t("errors.rejected");const o=(c.message??"").toLowerCase();return o.includes("insufficient")?t("cart.error.insufficient",{currency:qa.name}):o.includes("no active listing")||o.includes("your own listing")?t("cart.error.listingChanged"):t("marketCheckout.error.generic")}const ut=12e4;function ht(c){const o=[];return c.unavailable.length&&o.push(t("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&o.push(t("cart.drop.own",{count:c.own.length})),t("cart.drop.removed",{items:o.join(` ${t("cart.drop.and")} `)})}const xe=c=>c.reduce((o,C)=>o+C.priceCredits*C.quantity,0),ce=c=>c.flatMap(o=>Array.from({length:o.quantity},()=>({...o,quantity:1})));function It(){ba({title:t("nav.cart"),noindex:!0});const c=P(a=>a.items),o=P(a=>a.remove),C=P(a=>a.increment),N=P(a=>a.decrement),I=P(a=>a.clear),T=P(a=>a.restore),E=P(a=>a.setFittingOpen),M=Ue(a=>a.items),ie=Ue(a=>a.toggle),{session:n,signIn:q}=fa(),H=et().packs.slice(0,at);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Ze=c.some(a=>a.category!=="emote"),{data:oe}=va({queryKey:["upsell-listings"],queryFn:()=>Aa({first:40}),staleTime:6e4}),{data:f}=xa(n),y=Ca(),Q=pa(),{state:W}=_a(),[ea,$]=j.useState(null),[Ce,J]=j.useState(null),[aa,S]=j.useState(!1),[w,L]=j.useState(null),je=j.useRef(0),[u,g]=j.useState(null),{data:V}=ja(n),{data:le}=Qa(!0),[de,ke]=j.useState(""),D=j.useRef(null),Ne=ka(c),we=a=>Oe(Ne[a.id]),ue=c.filter(we),he=c.length>0&&ue.length===0,ta=ue.reduce((a,s)=>a+s.priceCredits*s.quantity,0),sa=c.reduce((a,s)=>a+s.quantity,0),na=ue.reduce((a,s)=>a+s.quantity,0),Me=w?w.liveTotalCredits:ta,ra=new Set(c.map(a=>a.id)),Se=((oe==null?void 0:oe.items)??[]).filter(a=>!ra.has(a.id)).slice(0,12),ca=new Map(w==null?void 0:w.buyable.map(a=>[a.item.id,a])),Y=(f==null?void 0:f.credits)??0,X=Me*10,qe=le?Je(X,le):0n,Z=be({priceCents:X,priceManaWei:qe,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n}),Pe=Xe(X,qe),Ae=Pe!=null?t("buyModal.manaRate",{mana:Pe.toLocaleString("en",{maximumFractionDigits:2})}):null,ia=Sa;function ee(a){a(),L(null),J(null),$(null)}function oa(){g(null),S(!1)}function Ie(a){const s=xe(a),i=Math.max(0,s-Y),r=H.find(l=>l.credits>=i)??H[H.length-1];ke(r.id),B("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:Y,shortfall:i}),g({phase:"nofunds",lines:a.map(l=>({item:l.item,priceCredits:l.priceCredits,quantity:l.quantity})),shortfall:i}),S(!1)}async function me(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(m=>({...m.item,priceCredits:m.priceCredits})),r=a.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),l=[];let d="authorize",p=!1;g({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[];for(let x=0;x<s.length;x++){const b=s[x];g({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const{credit:v,maxCreditedValue:U}=await Ve(n.identity,b.usdCents,b.trade.id);l.push(v.id),m.push({trade:b.trade,credits:[v],maxCreditedValue:U})}catch(v){if(rt(v)){if(l.length){try{await pe(n.identity,l)}catch(U){O(U,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}Ie(a);return}throw v}}d="submit";const k=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let _=[];if(Ua())try{_=await Ha({purchases:m,buyer:n.address,signer:n.signer,onSigned:k});const b=(await Promise.allSettled(_.map(v=>Ja(v)))).flatMap(v=>v.status==="rejected"?[v.reason]:[]);if(b.length&&!b.some(v=>v instanceof Ya))throw b[0];p=!0}catch(x){if(!(x instanceof Xa))throw x;_=await fe({purchases:m,buyer:n.address,signer:n.signer,onSigned:k})}else _=await fe({purchases:m,buyer:n.address,signer:n.signer});a.forEach(x=>o(x.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"credits",no_crypto_step:p,transaction_hash:_[0]??null}),Wa(y);const h=D.current;D.current=null,g(null),S(!1);const F={items:r,txHash:_[0]??void 0,settled:!0,...h?{creditsAdded:h}:{}};Q("/success",{state:F,replace:!0})}catch(m){if(se(m)||O(m,{flow:"cart_checkout",step:d,cart_size:a.length}),B(se(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:De(m),value_usd:$e(i.reduce((k,_)=>k+_.priceCredits,0)),cart_size:s.length}),l.length){try{await pe(n.identity,l)}catch(k){O(k,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}g({phase:"error",message:ve(m)})}}function Re(a,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const i=D.current;D.current=null,g(null),S(!1);const r={items:a,txHash:s[0]??void 0,settled:!0,...i?{creditsAdded:i}:{}};Q("/success",{state:r,replace:!0})}function Fe(a,s){se(a)||O(a,{flow:s,step:"submit"}),B(se(a)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:De(a)}),g({phase:"error",message:ve(a)}),S(!1)}async function la(a,s){const i=ne(ge.MANAToken,s),r=ne(ge.CreditsManager,s);await Da({auth:{kind:Ga.Allowance,contractAddress:i.address,spenderAddress:r.address,chainId:s},signer:a})}async function da(a){const s=ce(a).reduce((d,p)=>d+p.usdCents,0),i=(V??0n)>0n;let r=le;if(!r&&i)try{r=await y.fetchQuery({queryKey:["mana-rate",Ge.chainId],queryFn:()=>za(Ge.chainId),staleTime:6e4})}catch{r=void 0}const l=r?Je(s,r):0n;return{totalCents:s,manaWei:l}}async function Te(a,s){const i=xe(a),{totalCents:r,manaWei:l}=await da(a),d=be({priceCents:r,priceManaWei:l,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n});if(s&&d.options.some(p=>p.method===s)){if(s==="credits"){me(a);return}const{spender:p,chainId:m}=Ee(s,a);await We(p,m,()=>s==="mana"?void Le(a):void Be(a,r,l));return}if(d.options.some(p=>p.method==="mana"||p.method==="combined")){g({phase:"choose",lines:a,totalCents:r,manaWei:l}),S(!1);return}if(f!=null&&f.credits<i){Ie(a);return}me(a)}function ua(a){return be({priceCents:a.totalCents,priceManaWei:a.manaWei,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n})}const[ye,ae]=j.useState(null);function Ee(a,s){const i=s[0].trade;return{spender:a==="mana"?ne(Pa(i.contract),i.chainId).address:ne(ge.CreditsManager,i.chainId).address,chainId:i.chainId}}async function We(a,s,i){const r=Oa(s,a),l=n?await $a(r,n.address).catch(()=>!0):!0;if(Va(n==null?void 0:n.providerType,l)){S(!1),ae({auth:r,run:i});return}i()}function ha(a){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:i,manaWei:r}=u;if(a==="credits"){me(s);return}const{spender:l,chainId:d}=Ee(a,s);We(l,d,()=>a==="mana"?void Le(s):void Be(s,i,r))}async function Le(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(d=>({...d.item,priceCredits:d.priceCredits})),r=a.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),l=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const d=await La({trades:s.map(p=>p.trade),buyer:n.address,signer:n.signer,onSigned:l});a.forEach(p=>o(p.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"mana",transaction_hash:d[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(r,d)}catch(d){Fe(d,"buy_cart_mana")}}async function Be(a,s,i){if(!n||a.length===0)return;const r=ce(a),l=r.map(h=>({...h.item,priceCredits:h.priceCredits})),d=a.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),p=Ba(r.map(h=>h.usdCents),(f==null?void 0:f.balanceCents)??0),m=p.reduce((h,F)=>h+F,0),k=Ka(Math.max(0,s-m),s,i),_=[];g({phase:"processing",stage:"reserving",step:1,total:r.length});try{const h=[];for(let b=0;b<r.length;b++){const v=p[b];if(v<=0)continue;g({phase:"processing",stage:"reserving",step:b+1,total:r.length});const{credit:U,maxCreditedValue:ya}=await Ve(n.identity,v,r[b].trade.id);_.push(U.id),h.push({trade:r[b].trade,credits:[U],maxCreditedValue:ya})}r.forEach((b,v)=>{p[v]<=0&&h.push({trade:b.trade,credits:[],maxCreditedValue:"0"})}),h[0]={...h[0],maxCreditedValue:(BigInt(h[0].maxCreditedValue)+k).toString()},await la(n.signer,r[0].trade.chainId);const F=()=>g({phase:"processing",stage:"settling",step:r.length,total:r.length});g({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const x=await fe({purchases:h,buyer:n.address,signer:n.signer,onSigned:F});a.forEach(b=>o(b.item.id)),L(null),B("Shop Completed Purchase",{..._e(l),payment_type:"credits_and_mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(d,x)}catch(h){_.length&&(pe(n.identity,_).catch(()=>{}),y.invalidateQueries({queryKey:["usd-balance"]})),Fe(h,"buy_cart_combined")}}async function z(a){if(!n){He({type:"cart-checkout"}),q();return}const s=P.getState().items.filter(we);if(s.length===0)return;$(null),J(null),S(!0);const i=s.reduce((r,l)=>r+l.priceCredits*l.quantity,0);B("Shop Started Checkout",{cart_size:s.length,cart_value_credits:i,cart_value_usd:$e(i),has_sufficient_credits:Y>=i});try{const r=await Za(s,n.address,ia),l=[...r.unavailable,...r.own];if(l.length&&(l.forEach(d=>o(d.id)),J(ht(r))),r.buyable.length===0){$(t("cart.error.noneAvailable")),L(null);return}if(r.orderChanged){L(r),je.current=Date.now();return}await Te(r.buyable,a)}catch(r){O(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),$(ve(r))}finally{S(!1)}}async function Ke(){if(w){if(!n){He({type:"cart-checkout"}),q();return}if(Date.now()-je.current>ut){L(null),J(null),await z();return}$(null),Te(w.buyable)}}async function ma(){if(de){try{sessionStorage.setItem(re,JSON.stringify(P.getState().items))}catch{}S(!0);try{const a=await tt(de,n?{address:n.address,identity:n.identity}:void 0);if(a.url){window.location.href=a.url;return}Q("/credits")}catch(a){try{sessionStorage.removeItem(re)}catch{}O(a,{flow:"cart_buy_credits"}),g({phase:"error",message:t("buyModal.error.creditsCheckout")})}finally{S(!1)}}}const Qe=j.useRef(!1);j.useEffect(()=>{if(!n||Qe.current||!Ra("cart-checkout"))return;Qe.current=!0;const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[n]);const ze=j.useRef(!1);j.useEffect(()=>{if(!(W!=null&&W.resumeCheckout)||ze.current)return;ze.current=!0,D.current=W.creditsAdded??null;try{const s=sessionStorage.getItem(re);if(s){sessionStorage.removeItem(re);const i=JSON.parse(s);Array.isArray(i)&&i.length&&T(i)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[W==null?void 0:W.resumeCheckout]);const R=aa||(u==null?void 0:u.phase)==="processing";return c.length===0&&!u?e.jsx("div",{className:"checkout checkout--empty",children:e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("section",{className:"checkout__panel cart-empty","data-testid":"cart-empty",children:[e.jsx(A,{name:"cart-plus",size:110,className:"cart-empty__icon"}),e.jsxs("div",{className:"cart-empty__text",children:[e.jsx("p",{className:"cart-empty__title",children:t("cart.empty.title")}),e.jsx("p",{className:"cart-empty__body",children:t("cart.empty.body")})]}),e.jsx(te,{className:"cart-empty__cta",to:"/assets",children:t("cart.empty.cta")})]})]})}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("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:()=>Q(-1),type:"button","aria-label":t("cart.goBack"),children:e.jsx(A,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:t("cart.panelTitle",{count:sa})}),Ze?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:R,children:[e.jsx(A,{name:"fitting-room"}),t("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:c.map(a=>{const s=ca.get(a.id),i=s?s.priceCredits:a.priceCredits,r=!!s&&s.priceCredits!==a.priceCredits,l=!a.tokenId,d=a.quantity,p=typeof a.available=="number"&&d>=a.available,m=i*d,k=!!M[a.id],_=Na(a),h=Ne[a.id],F=!Oe(h),x=h==="sold-out"?t("cart.availability.soldOut"):t("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${F?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(te,{className:"checkout__thumb-link",to:_,state:{item:a,tradeId:a.tradeId},"aria-label":a.name,children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null}):a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.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:[_?e.jsx(te,{className:"checkout__name",to:_,state:{item:a,tradeId:a.tradeId},title:a.name,children:a.name}):e.jsx("div",{className:"checkout__name",title:a.name,children:a.name}),a.creator?e.jsx(wa,{address:a.creator,className:"checkout__creator",linkToProfile:!0}):null,l?e.jsxs("span",{className:"checkout__creator-tag","data-testid":"cart-creator-tag",children:[e.jsx(A,{name:"buy-from-creator",className:"checkout__creator-tag-ico","aria-hidden":!0}),t("cart.creatorTag")]}):null]}),e.jsx("div",{className:"checkout__foot",children:F?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"checkout__unavailable",children:[e.jsx(A,{name:"warning-fill",size:24,className:"checkout__warn","aria-hidden":!0}),x]}),_?e.jsx(te,{className:"checkout__resales",to:_,state:{item:a,tradeId:a.tradeId},children:t("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>N(a.id)),disabled:R||d<=1,"aria-label":t("cart.decreaseQuantity",{name:a.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:d}),e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>C(a.id)),disabled:R||p,"aria-label":t("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(K,{className:"checkout__price-ico"})," ",m,r?e.jsx("span",{className:"checkout__price-was",children:a.priceCredits*d}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${k?" is-on":""}`,onClick:()=>ie(a),"aria-label":k?t("cart.removeFromFavorites",{name:a.name}):t("cart.addToFavorites",{name:a.name}),title:k?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(A,{name:k?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>ee(()=>o(a.id)),disabled:R,"aria-label":t("cart.remove",{name:a.name}),title:t("cart.removeTitle"),children:e.jsx(A,{name:"trash",size:24})})]})]},a.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>ee(I),disabled:R,children:t("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:t("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:t("cart.totalItems",{count:na})}),e.jsxs("span",{className:"checkout__total-side",children:[e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(K,{className:"checkout__total-ico"})," ",Me]}),Ae&&(V??0n)>0n?e.jsx("span",{className:"checkout__total-rate","data-testid":"cart-mana-rate",children:Ae}):null]})]}),Z.options.length>0||Z.manaShortfall?e.jsx(Ye,{options:Z.options,totalCents:X,shortfall:Z.manaShortfall,creditsLabel:w?t("marketCheckout.confirmPurchase"):t("cart.buyWithCredits"),busy:R||he,onPay:a=>void(w?Ke():z(a))}):e.jsx("button",{className:"checkout__cta",onClick:()=>void(w?Ke():z()),disabled:R||he,children:R?t("cart.working"):w?t("marketCheckout.confirmPurchase"):t("assetCard.buyNow")}),he?e.jsx("p",{className:"muted checkout__msg",children:t("cart.allUnavailable")}):null,n?null:e.jsx("p",{className:"muted checkout__msg",children:t("cart.signInHint")}),w?e.jsx("p",{className:"muted checkout__msg",children:t("cart.priceChanged")}):null,Ce?e.jsx("p",{className:"muted checkout__msg",children:Ce}):null,e.jsx(ct,{message:ea,className:"checkout__msg"})]})]})]})]}),Se.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Fa,{title:t("cart.youMightAlsoLike"),items:Se})}):null,ye&&n?e.jsx(Ta,{auth:ye.auth,signer:n.signer,title:t("authorizeStep.manaTitle"),name:t("authorizeStep.manaName"),reason:t("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ea,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:a}=ye;ae(null),a()},onCancel:()=>ae(null),onClose:()=>ae(null)}):null,u?e.jsx(ot,{phase:u.phase,balanceCredits:Y,onClose:oa,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ma(n==null?void 0:n.providerType),options:u.phase==="choose"?ua(u).options:void 0,onPay:ha,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?xe(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:H,selectedPack:de,onSelectPack:ke,onBuyPacks:()=>void ma(),message:u.phase==="error"?u.message:void 0,onRetry:()=>void z()}):null]})}export{It as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-
|
|
1
|
+
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-j6t2niBa.js";import{r as W,j as v}from"./react-B36MyIP_.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=R(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as O,a as Q}from"./react-B36MyIP_.js";import{K as N,n as v,ay as Y,az as E,I as Z,t,c as V,J as W,u as X,h as ee,M as ae,aA as te,b as re,aB as se}from"./index-
|
|
1
|
+
import{j as e,r as p,d as O,a as Q}from"./react-B36MyIP_.js";import{K as N,n as v,ay as Y,az as E,I as Z,t,c as V,J as W,u as X,h as ee,M as ae,aA as te,b as re,aB as se}from"./index-j6t2niBa.js";import{E as oe}from"./ErrorNotice-D_Z5OVFI.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-zY_3UAhh.js";import{u as de}from"./useStore-BYd8E7j4.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-Uv70U5cD.js";import{L as xe}from"./LoadMore-CaAwZKNE.js";import{u as he}from"./useInfiniteGrid-Eaq5Vw9-.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.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;
|