@dcl/shop 0.1.0-30098548645.commit-d41f1c2 → 0.1.0-30124433292.commit-3681582
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-BqXTjVty.js → Activity-BK4KMnMS.js} +1 -1
- package/assets/{AnimatedBackground-B1wSbdZF.js → AnimatedBackground-DHyYRjGJ.js} +1 -1
- package/assets/{Assets-uNZ9-jka.js → Assets-DHSZ3Pma.js} +1 -1
- package/assets/{Assets.styles-C-xsD5dl.js → Assets.styles-ZcMNqA4L.js} +1 -1
- package/assets/{Authorizations-W1UUdrPD.js → Authorizations-B1N9MIgm.js} +1 -1
- package/assets/{Cart-Blw7vVhV.js → Cart-C4-D4ZHb.js} +1 -1
- package/assets/{CircularProgress-BFfCy1Hd.js → CircularProgress-xCRBPMNy.js} +1 -1
- package/assets/{Collection-DQPRvrkF.js → Collection-CF3fcBSY.js} +1 -1
- package/assets/{CollectionCarousel-D2Bi7Sgm.js → CollectionCarousel-DthPMnK1.js} +1 -1
- package/assets/{Creator-DPwgF8OQ.js → Creator-Dmo0SJOI.js} +1 -1
- package/assets/{CssVarsProvider-Cp4XcbYa.js → CssVarsProvider-Dpy58zet.js} +1 -1
- package/assets/{ExchangeController-DdMMOoWf.js → ExchangeController-B1_76-TU.js} +1 -1
- package/assets/{GetCredits-BbXMUpEL.js → GetCredits-CYn7AQqe.js} +1 -1
- package/assets/{HelpersUtil-CQPNVThh.js → HelpersUtil-XNHJPIP0.js} +1 -1
- package/assets/{ImportListings-DvBSRPqC.js → ImportListings-DDXI7JNI.js} +1 -1
- package/assets/{ItemDetail-CVK9Pwv2.js → ItemDetail-BHfN4ZbY.js} +3 -3
- package/assets/{LoadMore-Co82ACWq.js → LoadMore-BDrBHvfL.js} +1 -1
- package/assets/{MarketCheckout-CXF5RWuK.js → MarketCheckout-BpU-AwKt.js} +1 -1
- package/assets/{MyAssets-BPoXrFd-.js → MyAssets-BMY2c3n3.js} +1 -1
- package/assets/{MyFavorites-BLOtKEJq.js → MyFavorites-CKBsIu3I.js} +1 -1
- package/assets/{NotFound-B-Y9Dm45.js → NotFound-aVJwRiRB.js} +1 -1
- package/assets/{PrimaryListModal-cAIZGy2D.js → PrimaryListModal-DyCfH9JF.js} +1 -1
- package/assets/{StoreSettings-Bos_AZlO.js → StoreSettings-BvggmHJN.js} +5 -5
- package/assets/{Success-DNHF9FcH.js → Success-BKxe9orQ.js} +1 -1
- package/assets/{SwapController-Bk4YDtlv.js → SwapController-Cxz_R-cp.js} +1 -1
- package/assets/{Tooltip-CMiyDsYT.js → Tooltip-CQVkHZL8.js} +1 -1
- package/assets/{TradeService-B-E0tJaw.js → TradeService-DzeeSa-6.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-B4WegxTX.js → W3MFrameProviderSingleton-nlgW21N5.js} +3 -3
- package/assets/{WebCryptoP256-CIN8LP5I.js → WebCryptoP256-DlMsvJ_V.js} +1 -1
- package/assets/{authorizations-xecfPSH8.js → authorizations-Bu5ynTut.js} +1 -1
- package/assets/{basic-DrYgU33R.js → basic-BpONuYnG.js} +1 -1
- package/assets/{biconomy-BkGZoSRG.js → biconomy-D17Pt1Vm.js} +1 -1
- package/assets/{builder-CdMpbqLu.js → builder-WRm0Yifb.js} +1 -1
- package/assets/{buy-DnDBBIJp.js → buy-Bg6ayEVg.js} +1 -1
- package/assets/buy-gasless-DHSR8j9W.js +1 -0
- package/assets/{cart-checkout-DldS-zcM.js → cart-checkout-srmBjqa3.js} +1 -1
- package/assets/{categories-q4cmLb4w.js → categories-CPkgFcrW.js} +1 -1
- package/assets/{ccip-Iagv6b6U.js → ccip-DHhCpQzR.js} +1 -1
- package/assets/{ccip-6xULYkiQ.js → ccip-em6DABSU.js} +1 -1
- package/assets/{collection-9XqBYepL.js → collection-CnhLIVpI.js} +1 -1
- package/assets/{controller-CGXADiD7.js → controller-Cie4Aw3d.js} +2 -2
- package/assets/{core-ClJQ0SHg.js → core-Bt2V3toO.js} +4 -4
- package/assets/{custom-CRZtbdh1.js → custom-cOOMqA6K.js} +1 -1
- package/assets/{data-capture-Brtecicz.js → data-capture-BZ7A5Z5k.js} +1 -1
- package/assets/{email-Dc521KI9.js → email-DXloZ8qA.js} +1 -1
- package/assets/{embedded-wallet-qO37cv4b.js → embedded-wallet-CgkpmBAb.js} +1 -1
- package/assets/{emotion-styled.browser.esm-CdNioFJM.js → emotion-styled.browser.esm-DfoKy-pj.js} +1 -1
- package/assets/{engine-C38d94-_.js → engine-CzYvnB17.js} +1 -1
- package/assets/{errors-BHedmHUe.js → errors-BImf8DDM.js} +1 -1
- package/assets/{estimate-l1-fee-BIFy_-EC.js → estimate-l1-fee-gOwRw5z4.js} +1 -1
- package/assets/{execute-CxvgrSL8.js → execute-ud83RGqS.js} +2 -2
- package/assets/{features-CLCrkR7s.js → features-DxPH-haZ.js} +1 -1
- package/assets/{fetchTokenMetadata-ChVieTUE.js → fetchTokenMetadata-DChqEGuz.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-zShJZuFf.js → get-ecosystem-wallet-info-xUSXAeJm.js} +1 -1
- package/assets/{getBalance-D426yGLP.js → getBalance-D8OfNiEw.js} +1 -1
- package/assets/{getNFT-DbYpgeGV.js → getNFT-DkedtIa4.js} +1 -1
- package/assets/{getNFT-DDdhWmh5.js → getNFT-EuseX6lY.js} +1 -1
- package/assets/{getOverlayAlpha-DF26uj8z.js → getOverlayAlpha-zAle2GuY.js} +1 -1
- package/assets/{hashTypedData-DBErsqac.js → hashTypedData-Dqmk47xN.js} +1 -1
- package/assets/{hashTypedData-ZQ4gFkel.js → hashTypedData-abS_7cer.js} +1 -1
- package/assets/{import-ZCCl3Kgl.js → import-CuPZVchc.js} +1 -1
- package/assets/{in-app-CpdkUQeY.js → in-app-Cd-d2j0h.js} +1 -1
- package/assets/{in-app-wallet-calls-dlczJBmg.js → in-app-wallet-calls-BqANuQ3r.js} +1 -1
- package/assets/{index-Dum_hwGS.js → index-0NSEGJZv.js} +1 -1
- package/assets/{index-BqBeehVu.js → index-5GF4A0S-.js} +1 -1
- package/assets/{index-BUxPYCpI.js → index-AqK7feCi.js} +1 -1
- package/assets/{index-BPE4c8Hm.js → index-B-mtLlzK.js} +1 -1
- package/assets/{index-BmClkpNO.js → index-B0r7CJWG.js} +1 -1
- package/assets/{index-C_96F6p3.js → index-B9yNV6c0.js} +1 -1
- package/assets/{index-CwuYCSTt.js → index-BTqEklxp.js} +1 -1
- package/assets/{index-DjNqY58Q.js → index-BdxV9LV_.js} +1 -1
- package/assets/{index-Be_wjnpZ.js → index-BlhIwuOI.js} +1 -1
- package/assets/{index-dOPjS08E.js → index-BqxxuGEO.js} +3 -3
- package/assets/{index-BTEpBP4F.js → index-BrXKLFgO.js} +1 -1
- package/assets/{index-DTSWcrXA.js → index-BsIDqh4z.js} +1 -1
- package/assets/{index-DHqnjZXk.js → index-Bu0ceOeP.js} +1 -1
- package/assets/{index-ej1HeaVq.js → index-C1M0bOpf.js} +1 -1
- package/assets/{index-N282EqWL.js → index-C3X5jLeD.js} +9 -9
- package/assets/{index-DsmEu83d.js → index-CAjhZgPW.js} +2 -2
- package/assets/{index-DUHukso9.js → index-CDlAE_WC.js} +1 -1
- package/assets/{index-CmFvRPK_.js → index-CGFMFn1H.js} +1 -1
- package/assets/{index-Cf3Ptwp7.js → index-CSLEY4ca.js} +1 -1
- package/assets/{index-oDGz3alu.js → index-CYPATMbH.js} +1 -1
- package/assets/{index-DkV39niV.js → index-CcInJPMR.js} +1 -1
- package/assets/{index-SeXxQE7d.js → index-Cd1kOVjp.js} +1 -1
- package/assets/{index-uRCNAkhD.js → index-CecaRjyr.js} +1 -1
- package/assets/{index-DZWZ4ZjC.js → index-Cr_ncTLI.js} +1 -1
- package/assets/{index-CtyVceSL.js → index-Cvc29q-I.js} +3 -3
- package/assets/{index-BYL4Amcw.js → index-D2LsYIdq.js} +1 -1
- package/assets/{index-GYAvpxvp.js → index-D39xHY3d.js} +1 -1
- package/assets/{index-PtVfNA02.js → index-D73PUnuv.js} +1 -1
- package/assets/{index-BwP2pQ92.js → index-DCkcZnW5.js} +1 -1
- package/assets/{index-BoQpPvsJ.js → index-DFIVRio9.js} +3 -3
- package/assets/{index-Dz6EILW5.js → index-DGn6VaO-.js} +1 -1
- package/assets/{index-Dw9WIdKs.js → index-DIlSeQzV.js} +1 -1
- package/assets/{index-BCFHpbdv.js → index-DLy3F1PO.js} +1 -1
- package/assets/{index-Dkdo-C-7.js → index-DM6W5d9P.js} +2 -2
- package/assets/{index-dc-VQ6_u.js → index-DMknz5cu.js} +1 -1
- package/assets/{index-CnNzrERF.js → index-DVlSY8mP.js} +1 -1
- package/assets/{index-CO8EAj61.js → index-DY_9EV49.js} +2 -2
- package/assets/{index-hSbfPxTM.js → index-DZ6ajsXs.js} +1 -1
- package/assets/{index-DWo6WByw.js → index-DebzClIH.js} +1 -1
- package/assets/{index-xEDt5tK0.js → index-DgKLBFdD.js} +1 -1
- package/assets/{index-D9WRMnJQ.js → index-Djb9RTtv.js} +1 -1
- package/assets/{index-CIVsEPCC.js → index-DmoKb6B-.js} +1 -1
- package/assets/{index-Ix0aAVOz.js → index-DpPkDpzv.js} +1 -1
- package/assets/{index-DCT6sOxM.js → index-M8HIp82S.js} +1 -1
- package/assets/{index-DXsS9lM4.js → index-NN1ViCJc.js} +1 -1
- package/assets/{index-BpsxTpFt.js → index-Z8Wo_kwk.js} +1 -1
- package/assets/{index-C8X5uQxK.js → index-Za0RNTve.js} +1 -1
- package/assets/{index-LwWUxbJ1.js → index-ixz0SMZY.js} +1 -1
- package/assets/{index-GctTWB_u.js → index-kMsmgOxf.js} +1 -1
- package/assets/{index-DTFks6GD.js → index-q0JQZ3dR.js} +1 -1
- package/assets/{index-BfgxxLyc.js → index-v11xmkay.js} +1 -1
- package/assets/{index-C8gW1uS_.js → index-wyA7ZE7I.js} +1 -1
- package/assets/{index.es-BAkCd3hx.js → index.es-C181Dk-6.js} +4 -4
- package/assets/{index.es-mQdmYoWw.js → index.es-DKJYmPMf.js} +1 -1
- package/assets/{index.es-8l4m8O48.js → index.es-nYWt2I6x.js} +1 -1
- package/assets/{localBatchGatewayRequest-C-QF008k.js → localBatchGatewayRequest-kTkh-9Y1.js} +1 -1
- package/assets/{mana-rate-B5qogWAy.js → mana-rate-BRTVWI6W.js} +1 -1
- package/assets/{networks-DTf6JA_i.js → networks-Bum5JTBr.js} +1 -1
- package/assets/{onramp-C6_Jmv_4.js → onramp-CFmv1zZR.js} +1 -1
- package/assets/{openzeppelin-BI3jzvYe.js → openzeppelin-zgph3CRe.js} +1 -1
- package/assets/{parseNft-BJiElQOd.js → parseNft-CZwNnq-K.js} +2 -2
- package/assets/{parseSignature-YsYfChHW.js → parseSignature-BEnVvaTZ.js} +3 -3
- package/assets/{parseSignature-BTArmdp-.js → parseSignature-CmSsHC25.js} +1 -1
- package/assets/{passkeys-ClpAr2XQ.js → passkeys-BLHHj7-d.js} +1 -1
- package/assets/{pay-with-exchange-BrMLcJvy.js → pay-with-exchange-BV1nqwHf.js} +1 -1
- package/assets/{qr-overlay-DFoBAvax.js → qr-overlay-DNUGuQ9g.js} +1 -1
- package/assets/{receive-2v3kqZfq.js → receive-DX5PX0qv.js} +1 -1
- package/assets/{resolveImplementation-Cz7jydx-.js → resolveImplementation-DtRRnBJY.js} +1 -1
- package/assets/{rpc-DcYX9vLT.js → rpc-N5gKnuFD.js} +1 -1
- package/assets/{secp256k1-Du_5cnvk.js → secp256k1-B3NLODsT.js} +1 -1
- package/assets/{secp256k1-CRO1xSNd.js → secp256k1-CbGQ7AnW.js} +1 -1
- package/assets/{secp256k1-D0kj9oiG.js → secp256k1-Cs17P-H6.js} +1 -1
- package/assets/{send-EHrmCt5p.js → send-DuAfQv20.js} +1 -1
- package/assets/{send-batch-transaction-DrLYa7mf.js → send-batch-transaction-CK1FAK6a.js} +1 -1
- package/assets/{send-eip712-transaction-DWQC0CYI.js → send-eip712-transaction-CCANsdcR.js} +2 -2
- package/assets/{send-gasless-transaction-DraXgpfw.js → send-gasless-transaction-DMAXE9_o.js} +2 -2
- package/assets/{send-transaction-Di96Go1T.js → send-transaction-CGlKSvcE.js} +2 -2
- package/assets/{sendRawTransaction-CzOwT9zB.js → sendRawTransaction-BGxuVTrM.js} +3 -3
- package/assets/{serializeTransaction-BVfMAhW_.js → serializeTransaction-CCiQEbVK.js} +1 -1
- package/assets/{session-proposal-DQbScMFK.js → session-proposal-B5yk7mT0.js} +1 -1
- package/assets/{session-request-BSJWiNx1.js → session-request-C2C-LgcL.js} +2 -2
- package/assets/{signing-BTj_vr30.js → signing-peFpZpgT.js} +3 -3
- package/assets/{socials-Ca0m8Bc6.js → socials-Cjx6YfeD.js} +1 -1
- package/assets/{swaps-Bxufbu_7.js → swaps-DHGkT6CC.js} +1 -1
- package/assets/{thirdweb-BSXHM0bk.js → thirdweb-p9nuhkCz.js} +3 -3
- package/assets/{to-serializable-transaction-BiEB81zL.js → to-serializable-transaction-CnZ3cWe2.js} +2 -2
- package/assets/{trade-encoding-6_dO5FYh.js → trade-encoding-Dp_icjFZ.js} +1 -1
- package/assets/{transactionReceipt-WUy2-DIs.js → transactionReceipt-BGOacWj7.js} +1 -1
- package/assets/{transactions-Ddu0qS1y.js → transactions-BBxZRzis.js} +1 -1
- package/assets/{useCreditPacks-BXDDD38Z.js → useCreditPacks-CTza1Tus.js} +1 -1
- package/assets/{useInfiniteGrid-BokrX5YA.js → useInfiniteGrid-Mx1HAG8J.js} +1 -1
- package/assets/useManaRate-BP0fvx6U.js +1 -0
- package/assets/{useStore-DL2tZW7o.js → useStore-45Le9Qaw.js} +1 -1
- package/assets/useTheme-CgBOLs_h.js +1 -0
- package/assets/{useTheme-Tgfl6yPv.js → useTheme-XtIUuPdU.js} +1 -1
- package/assets/{verifyHash-DEKVRRCg.js → verifyHash-zHFDxXH3.js} +1 -1
- package/assets/{w3m-modal-BOayHahj.js → w3m-modal-CTLy-nbk.js} +1 -1
- package/assets/{w3m-modal-DGk65SCN.js → w3m-modal-DFuYjjkX.js} +1 -1
- package/assets/{wait-for-tx-receipt-C-yyIlse.js → wait-for-tx-receipt-kY7a907-.js} +1 -1
- package/assets/{wallets-CKstZZYA.js → wallets-B-yYAVWE.js} +5 -5
- package/assets/{web-connector-Df1Nw4jg.js → web-connector-DXFq0InF.js} +3 -3
- package/assets/{writeContract-EXXVPkwI.js → writeContract-8JrxZEN1.js} +1 -1
- package/assets/{zoraTestnet-Dj9qFBkp.js → zoraTestnet-5571NyS8.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/buy-gasless-DITQks7J.js +0 -1
- package/assets/useManaRate-CtZMBb6a.js +0 -1
- package/assets/useTheme-B-xHZMoE.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as V,j as e,L as $}from"./react-BXazHbBy.js";import{s as o,G as a,N as X,B as Z,m as J,t as c,u as Y,I as x,ai as tt,aj as et,C as h,o as I,ak as w,al as it,am as st}from"./index-
|
|
1
|
+
import{r as V,j as e,L as $}from"./react-BXazHbBy.js";import{s as o,G as a,N as X,B as Z,m as J,t as c,u as Y,I as x,ai as tt,aj as et,C as h,o as I,ak as w,al as it,am as st}from"./index-C3X5jLeD.js";import{a as nt}from"./mana-rate-BRTVWI6W.js";import{u as at}from"./useManaRate-BP0fvx6U.js";import{L as rt}from"./LoadMore-BDrBHvfL.js";import{u as b}from"./useInfiniteGrid-Mx1HAG8J.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const ot=15e3;function ct(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)<=ot}function dt(t){const i=[...t].sort((s,n)=>n.createdAt-s.createdAt),d=[];for(const s of i){const n=d[d.length-1];n&&ct(n[n.length-1],s)?n.push(s):d.push([s])}return d.map(s=>{var n;return{id:((n=s.find(r=>r.txHash))==null?void 0:n.txHash)??s[s.length-1].id,createdAt:Math.max(...s.map(r=>r.createdAt)),status:s.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:s.reduce((r,u)=>r+u.credits,0),lines:s}})}function lt(t){const i=[],d=new Map;for(const s of t)if(s.tradeId){const n=d.get(s.tradeId);if(n){n.quantity+=1,n.credits+=s.credits;continue}const r={key:s.tradeId,tradeId:s.tradeId,quantity:1,credits:s.credits};d.set(s.tradeId,r),i.push(r)}else i.push({key:s.id,tradeId:null,quantity:1,credits:s.credits});return i}function ut(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?nt(t.manaWei,i):null,createdAt:t.createdAt}}function pt(t){const d=dt(t.purchases.filter(n=>n.status!=="EXPIRED")).map(n=>({kind:"purchase",id:`purchase:${n.id}`,createdAt:n.createdAt,order:n})),s=t.sales.map(n=>{const r=ut(n,t.rate);return{kind:"sale",id:`sale:${r.id}`,createdAt:r.createdAt,sale:r}});return[...d,...s].sort((n,r)=>r.createdAt-n.createdAt||(n.id<r.id?-1:1))}function xt(t,i){if(i==="all")return t;const d=i==="purchases"?"purchase":"sale";return t.filter(s=>s.kind===d)}const m=X`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,ht=o.section`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BXazHbBy.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BXazHbBy.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-30124433292.commit-3681582/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30124433292.commit-3681582/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{u as Ze,r as p,j as e,b as Je}from"./react-BXazHbBy.js";import{p as H,h as Xe,c as Ye,r as et,s,G as t,u as oe,a as tt,b as Ne,y as _e,w as nt,t as o,I as N,C as F,d as he,j as D,k as st,l as ot,m as Ae,H as rt,A as Q,aD as it,aE as at}from"./index-
|
|
1
|
+
import{u as Ze,r as p,j as e,b as Je}from"./react-BXazHbBy.js";import{p as H,h as Xe,c as Ye,r as et,s,G as t,u as oe,a as tt,b as Ne,y as _e,w as nt,t as o,I as N,C as F,d as he,j as D,k as st,l as ot,m as Ae,H as rt,A as Q,aD as it,aE as at}from"./index-C3X5jLeD.js";import{r as lt,m as ct,a as Pe}from"./mana-rate-BRTVWI6W.js";import{u as Me}from"./useManaRate-BP0fvx6U.js";import{g as dt,h as ft,i as pt,j as ut,k as xt,C as ht,l as mt,o as gt,m as bt,n as yt,M as wt}from"./Assets.styles-ZcMNqA4L.js";import{d as me,R as vt,F as jt,S as ge,b as $t}from"./categories-CPkgFcrW.js";import{L as Ct}from"./LoadMore-BDrBHvfL.js";import{M as kt}from"./MarketCheckout-BpU-AwKt.js";import{u as St}from"./useInfiniteGrid-Mx1HAG8J.js";import{E as Rt}from"./ErrorNotice-Cmr8aXJs.js";import{d as Et}from"./dcl-schemas-BICTSpB5.js";import{u as It,G as Tt,w as zt,S as Nt}from"./buy-gasless-DHSR8j9W.js";import{s as _t}from"./buy-Bg6ayEVg.js";import{h as At}from"./trade-encoding-Dp_icjFZ.js";import{f as Pt}from"./errors-BImf8DDM.js";import{J as Mt,C as Lt,B as se}from"./ethers-BJDbBwOP.js";import{l as Bt}from"./loader-logo-BzY9EKdC.js";import{n as Ft}from"./emotion-CSxEP8yM.js";import"./sentry-CLqlZ0dX.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-CQVkHZL8.js";import"./authorizations-Bu5ynTut.js";import"./sendMetaTransaction-CiO3jI6F.js";function Z(n){const r=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${r}:${f}`}const W="100000000000000000000",Le=2,V=15,Ht=/^[a-zA-Z0-9]+$/;function be(n){const r=n.trim();return r.length===0?{ok:!1,reason:"empty"}:Ht.test(r)?r.length<Le?{ok:!1,reason:"too-short"}:r.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Wt(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Ot=["function available(string _subdomain) view returns (bool)"],ye={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ut(){return H.chainId===Et.ChainId.MATIC_MAINNET?ye.mainnet:ye.sepolia}async function Gt(n,r={}){var d;const{rpc:f,address:u}=Ut(),h=new Mt(f),l=new Lt(u,Ot,h);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const c=await l.available(n);if((d=r.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${c}`),c?"available":"taken"}const qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Dt(n){return ct(W,n)}async function Vt(n,r,f={}){var d;const u=f.chainId??H.chainId,h=f.provider??"across",l=`${H.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(r)}&chainId=${u}&provider=${h}`,c=await et(l,{method:"GET",identity:n,metadata:{}});if(!c.ok){let a;try{a=(d=await c.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${c.status}`)}return c.json()}function Kt(n,r){const f=se.from(n.availableAmount),h=se.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:At(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:h.isNegative()?"0":h.toString(),maxCreditedValue:W}}async function Qt(n,r={}){const f=qt,u=r.intervalMs??1e4,h=r.maxAttempts??60;let l={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let c=0;c<h;c++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),x=(a.status??"pending").toLowerCase(),m=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:m,actionsSucceeded:w};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};l={status:"pending",destinationTxHash:m,actionsSucceeded:w}}}catch{}c<h-1&&await new Promise(d=>setTimeout(d,u))}return l}async function Zt(n){const{name:r,identity:f,signer:u}=n,h=n.chainId??H.chainId,l=n.provider??"across",c=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:r,buyer:c,chainId:h,provider:l});try{const x=await lt(h),m=Dt(x);console.info("[names] step 1/6 sized reservation",{usdCents:m,manaRate:x});const w=await Vt(f,r,{chainId:h,provider:l});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Xe(f,m);if(d=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),se.from(j.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const k=Kt(j.credit,w);let g;try{g=await It({chainId:h,buyer:c,signer:u,args:k})}catch(y){if(!(y instanceof Tt))throw y;g=await _t(h,k,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await zt(g),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),l==="across"){const y=await Qt(g,n.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:g};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:g,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:r,buyer:c,originConfirmed:a}),x instanceof Nt)return{status:"pending",originTxHash:x.txHash};throw d&&!a&&await Ye(f,[d]).catch(()=>{}),x instanceof Be?x:new Error(Pt(x,"Couldn't register the name. Please try again.",{sale:!0}))}}const Jt=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-BXazHbBy.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-BXazHbBy.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-CPkgFcrW.js";import{T as se}from"./Tooltip-CQVkHZL8.js";import{G as e,s as o,I as m,t as s,H as re,e as v}from"./index-C3X5jLeD.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 D,r as F}from"./react-BXazHbBy.js";import{s as a,B as N,G as o,N as S,m as B,t as e,u as G,w as K,I as g,C as M,o as w,b as P,p as Q,K as k,F as H,J as $}from"./index-
|
|
1
|
+
import{j as t,L as D,r as F}from"./react-BXazHbBy.js";import{s as a,B as N,G as o,N as S,m as B,t as e,u as G,w as K,I as g,C as M,o as w,b as P,p as Q,K as k,F as H,J as $}from"./index-C3X5jLeD.js";import{b as W,c as _,d as J,s as O,f as X}from"./authorizations-Bu5ynTut.js";import{a as U}from"./builder-WRm0Yifb.js";import{f as V}from"./errors-BImf8DDM.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const Y=S`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,Z=S`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,r as m,u as Ae,a as Ue,L as re}from"./react-BXazHbBy.js";import{t as a,C as R,y as Y,an as We,m as ze,ad as N,n as pe,u as Oe,o as $e,a as Ge,b as He,ao as De,I as F,ak as Je,x as Ve,w as Ye,ap as ve,j as J,aq as ge,ar as Xe,F as U,s as Ze,B as es,e as ss,h as as,c as fe,as as ts,l as xe,k as rs,at as cs}from"./index-
|
|
1
|
+
import{j as e,r as m,u as Ae,a as Ue,L as re}from"./react-BXazHbBy.js";import{t as a,C as R,y as Y,an as We,m as ze,ad as N,n as pe,u as Oe,o as $e,a as Ge,b as He,ao as De,I as F,ak as Je,x as Ve,w as Ye,ap as ve,j as J,aq as ge,ar as Xe,F as U,s as Ze,B as es,e as ss,h as as,c as fe,as as ts,l as xe,k as rs,at as cs}from"./index-C3X5jLeD.js";import{W as ns,t as is,C as ls,s as ke}from"./CollectionCarousel-DthPMnK1.js";import{a as je}from"./buy-Bg6ayEVg.js";import{a as os,w as ds,S as us,G as hs}from"./buy-gasless-DHSR8j9W.js";import{R as V,r as ms}from"./cart-checkout-srmBjqa3.js";import{g as _s}from"./authorizations-Bu5ynTut.js";import{u as ys,M as bs,c as ps}from"./useCreditPacks-CTza1Tus.js";import{l as vs}from"./loader-logo-BzY9EKdC.js";import{i as gs,a as fs}from"./errors-BImf8DDM.js";import{E as xs}from"./ErrorNotice-Cmr8aXJs.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Dp_icjFZ.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";const ks="https://cdn.decentraland.org/@dcl/shop/0.1.0-30124433292.commit-3681582/assets/buy-error-22UunaPC.png";function js(r){const{phase:n,balanceCredits:h,onClose:y}=r,C=n==="processing",S=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),q=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:y,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${q?" 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:S}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:y,"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:Y(h)})]})]}),n==="processing"&&e.jsx(Ns,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(Cs,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:y}),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:ks,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:y,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??y,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Ns({stage:r,step:n,total:h,isSelfCustody:y}){const C=r==="reserving",S=h>0?Math.min(100,Math.round(n/h*100)):0,q=r==="awaiting-signature"?y?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:vs,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:q}),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:`${S}%`}})}),h>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",h]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function Cs({lines:r,shortfallCredits:n,packs:h,selectedPack:y,onSelectPack:C,onBuyPacks:S,onCancel:q}){const w=h.find(t=>t.id===y),X=r.reduce((t,f)=>t+(f.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(ns,{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:X})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const f=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"),f>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:f})}):null]}),t.item.creator?e.jsx(We,{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:Y(t.priceCredits*f)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:h.map(t=>{const f=t.id===y;return e.jsxs("button",{className:`buy-modal__pack${f?" 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:Y(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:Y((w==null?void 0:w.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((w==null?void 0:w.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:q,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:S,children:a("buyModal.buy")})]})]})}const ws=Ze(es)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`;function Ne(r){if(gs(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:ss.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const Ss=12e4;function qs(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 Ce=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),Ms=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Ds(){ze({title:a("nav.cart"),noindex:!0});const r=N(s=>s.items),n=N(s=>s.remove),h=N(s=>s.increment),y=N(s=>s.decrement),C=N(s=>s.clear),S=N(s=>s.restore),q=N(s=>s.setFittingOpen),w=pe(s=>s.items),X=pe(s=>s.toggle),{session:t,signIn:f}=Oe(),W=ys().packs.slice(0,bs);m.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const we=r.some(s=>s.category!=="emote"),{data:Z}=$e({queryKey:["upsell-listings"],queryFn:()=>cs({first:40}),staleTime:6e4}),{data:T}=Ge(t),d=He(),z=Ae(),{state:M}=Ue(),[ce,B]=m.useState(null),[Se,L]=m.useState(null),[ne,O]=m.useState(null),[qe,E]=m.useState(!1),[x,K]=m.useState(null),ie=m.useRef(0),[o,k]=m.useState(null),[ee,le]=m.useState(""),se=m.useRef(null),oe=De(r),de=s=>ve(oe[s.id]),ae=r.filter(de),ue=r.length>0&&ae.length===0,Me=ae.reduce((s,c)=>s+c.priceCredits*c.quantity,0),Ee=r.reduce((s,c)=>s+c.quantity,0),Pe=ae.reduce((s,c)=>s+c.quantity,0),Ie=x?x.liveTotalCredits:Me,Fe=new Set(r.map(s=>s.id)),he=((Z==null?void 0:Z.items)??[]).filter(s=>!Fe.has(s.id)).slice(0,12),Re=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),$=(T==null?void 0:T.credits)??0,Te=Xe;function G(s){s(),K(null),O(null),L(null)}function Be(){k(null),E(!1)}function me(s){const c=Ce(s),i=Math.max(0,c-$),v=W.find(u=>u.credits>=i)??W[W.length-1];le(v.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:i}),E(!1)}async function Le(s){if(!t||s.length===0)return;const c=Ms(s),i=c.map(l=>({...l.item,priceCredits:l.priceCredits})),v=s.map(l=>({...l.item,priceCredits:l.priceCredits,quantity:l.quantity})),u=[];let j="authorize",H=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const l=[];for(let b=0;b<c.length;b++){const I=c[b];k({phase:"processing",stage:"reserving",step:b+1,total:c.length});try{const{credit:p,maxCreditedValue:te}=await as(t.identity,I.usdCents,I.trade.id);u.push(p.id),l.push({trade:I.trade,credits:[p],maxCreditedValue:te})}catch(p){if(fs(p)){if(u.length){try{await fe(t.identity,u)}catch(te){U(te,{flow:"cart_checkout",step:"release"})}d.invalidateQueries({queryKey:["usd-balance"]})}me(s);return}throw p}}j="submit";const g=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let _=[];if(_s())try{_=await os({purchases:l,buyer:t.address,signer:t.signer,onSigned:g});const I=(await Promise.allSettled(_.map(p=>ds(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(I.length&&!I.some(p=>p instanceof us))throw I[0];H=!0}catch(b){if(!(b instanceof hs))throw b;_=await je({purchases:l,buyer:t.address,signer:t.signer,onSigned:g})}else _=await je({purchases:l,buyer:t.address,signer:t.signer});s.forEach(b=>n(b.item.id)),K(null),J("Shop Completed Purchase",{...ts(i),payment_type:"credits",no_crypto_step:H,transaction_hash:_[0]??null}),d.invalidateQueries({queryKey:["usd-balance"]}),d.invalidateQueries({queryKey:["detail-trade"]}),d.invalidateQueries({queryKey:["shop-item"]}),d.invalidateQueries({queryKey:["owned-token"]}),d.invalidateQueries({queryKey:["public-token"]}),d.invalidateQueries({queryKey:["item-resales"]}),d.invalidateQueries({queryKey:["shop-items"]}),d.invalidateQueries({queryKey:["catalog-items"]}),d.invalidateQueries({queryKey:["my-assets"]}),d.invalidateQueries({queryKey:["purchases"]}),d.invalidateQueries({queryKey:["owned-item-count"]}),d.invalidateQueries({queryKey:["overview-listings"]}),d.invalidateQueries({queryKey:["upsell-listings"]});const A=se.current;se.current=null,k(null),E(!1);const D={items:v,txHash:_[0]??void 0,settled:!0,...A?{creditsAdded:A}:{}};z("/success",{state:D,replace:!0})}catch(l){if(xe(l)||U(l,{flow:"cart_checkout",step:j,cart_size:s.length}),J(xe(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:rs(l),value_usd:ge(i.reduce((g,_)=>g+_.priceCredits,0)),cart_size:c.length}),u.length){try{await fe(t.identity,u)}catch(g){U(g,{flow:"cart_checkout",step:"release"})}d.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:Ne(l)})}}function _e(s){const c=Ce(s);if(T!=null&&T.credits<c){me(s);return}Le(s)}async function Q(){if(!t){ke({type:"cart-checkout"}),f();return}const s=N.getState().items.filter(de);if(s.length===0)return;L(null),O(null),E(!0);const c=s.reduce((i,v)=>i+v.priceCredits*v.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:ge(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await ms(s,t.address,Te),v=[...i.unavailable,...i.own];if(v.length&&(v.forEach(u=>n(u.id)),O(qs(i))),i.buyable.length===0){L(a("cart.error.noneAvailable")),K(null),B(null);return}if(i.orderChanged){K(i),ie.current=Date.now(),B(null);return}B(null),_e(i.buyable)}catch(i){U(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),L(Ne(i)),B(null)}finally{E(!1)}}async function Ke(){if(x){if(!t){ke({type:"cart-checkout"}),f();return}if(Date.now()-ie.current>Ss){K(null),O(null),await Q();return}L(null),_e(x.buyable)}}async function Qe(){if(ee){try{sessionStorage.setItem(V,JSON.stringify(N.getState().items))}catch{}E(!0);try{const s=await ps(ee,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(V)}catch{}U(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const ye=m.useRef(!1);m.useEffect(()=>{if(!t||ye.current||!is("cart-checkout"))return;ye.current=!0;const s=setTimeout(()=>void Q(),0);return()=>clearTimeout(s)},[t]);const be=m.useRef(!1);m.useEffect(()=>{if(!(M!=null&&M.resumeCheckout)||be.current)return;be.current=!0,se.current=M.creditsAdded??null;try{const c=sessionStorage.getItem(V);if(c){sessionStorage.removeItem(V);const i=JSON.parse(c);Array.isArray(i)&&i.length&&S(i)}}catch{}d.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void Q(),0);return()=>clearTimeout(s)},[M==null?void 0:M.resumeCheckout]);const P=qe||(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(ws,{as:re,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:Ee})}),we?e.jsxs("button",{className:"checkout__fitting",onClick:()=>q(!0),disabled:P,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=Re.get(s.id),i=c?c.priceCredits:s.priceCredits,v=!!c&&c.priceCredits!==s.priceCredits,u=!s.tokenId,j=s.quantity,H=typeof s.available=="number"&&j>=s.available,l=i*j,g=!!w[s.id],_=Je(s),A=oe[s.id],D=!ve(A),b=A==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${D?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(re,{className:"checkout__thumb-link",to:_,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:[_?e.jsx(re,{className:"checkout__name",to:_,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(Ve,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsx("div",{className:"checkout__foot",children:D?e.jsx("span",{className:"checkout__unavailable",children:b}):e.jsxs(e.Fragment,{children:[u?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>y(s.id)),disabled:P||j<=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:j}),e.jsx("button",{className:"checkout__step",onClick:()=>G(()=>h(s.id)),disabled:P||H,"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,v?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${g?" is-on":""}`,onClick:()=>X(s),"aria-label":g?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:g?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(F,{name:g?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>G(()=>n(s.id)),disabled:P,"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:()=>G(C),disabled:P,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:Pe})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(R,{className:"checkout__total-ico"})," ",Ie]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(x?Ke():Q()),disabled:P||ue,children:P?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),ue?e.jsx("p",{className:"muted checkout__msg",children:a("cart.allUnavailable")}):null,t?null:e.jsx("p",{className:"muted checkout__msg",children:a("cart.signInHint")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,ne?e.jsx("p",{className:"muted checkout__msg",children:ne}):null,ce?e.jsx("p",{className:"muted checkout__msg",children:ce}):null,e.jsx(xs,{message:Se,className:"checkout__msg"})]})]})]})]}),he.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ls,{title:a("cart.youMightAlsoLike"),items:he})}):null,o?e.jsx(js,{phase:o.phase,balanceCredits:$,onClose:Be,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:Ye(t==null?void 0:t.providerType),lines:o.phase==="nofunds"?o.lines:void 0,shortfallCredits:o.phase==="nofunds"?o.shortfall:void 0,packs:W,selectedPack:ee,onSelectPack:le,onBuyPacks:()=>void Qe(),message:o.phase==="error"?o.message:void 0,onRetry:()=>void Q()}):null]})}export{Ds as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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 as R}from"./index-
|
|
1
|
+
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 as R}from"./index-C3X5jLeD.js";import{r as W,j as v}from"./react-BXazHbBy.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 Q,u as Y}from"./react-BXazHbBy.js";import{G as N,s as v,af as Z,ag as F,I as J,t,p as V,F as W,o as X,m as ee,A as ae,ax as te,e as re,ay as se}from"./index-
|
|
1
|
+
import{j as e,r as p,d as Q,u as Y}from"./react-BXazHbBy.js";import{G as N,s as v,af as Z,ag as F,I as J,t,p as V,F as W,o as X,m as ee,A as ae,ax as te,e as re,ay as se}from"./index-C3X5jLeD.js";import{E as oe}from"./ErrorNotice-Cmr8aXJs.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-CnhLIVpI.js";import{u as de}from"./useStore-45Le9Qaw.js";import{d as E,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-CPkgFcrW.js";import{L as xe}from"./LoadMore-BDrBHvfL.js";import{u as he}from"./useInfiniteGrid-Mx1HAG8J.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as o}from"./react-BXazHbBy.js";import{t as i,I as C,au as g,A as E}from"./index-
|
|
1
|
+
import{j as e,r as o}from"./react-BXazHbBy.js";import{t as i,I as C,au as g,A as E}from"./index-C3X5jLeD.js";const d="shop:resume_after_signin",N=900*1e3;function I(l){try{sessionStorage.setItem(d,JSON.stringify({...l,at:Date.now()}))}catch{}}function M(l){let c;try{c=sessionStorage.getItem(d)}catch{return null}if(!c)return null;try{sessionStorage.removeItem(d)}catch{}let s;try{s=JSON.parse(c)}catch{return null}return!s||s.type!==l||typeof s.at!="number"||Date.now()-s.at>N?null:s.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:s.path}}function W({className:l}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:l,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 L({title:l,items:c,onViewAll:s}){const a=o.useRef(null),[h,p]=o.useState(1),[f,v]=o.useState(0),[j,k]=o.useState(!0),[w,y]=o.useState(!1),n=o.useCallback(()=>{const r=a.current;if(!r)return;const{scrollLeft:t,scrollWidth:_,clientWidth:u}=r,x=Math.max(1,Math.ceil(_/u));p(x),v(Math.min(x-1,Math.round(t/u))),k(t<=1),y(t+u>=_-1)},[]);if(o.useEffect(()=>{n();const r=a.current;if(r)return r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[n,c.length]),c.length===0)return null;function m(r){const t=a.current;t&&t.scrollBy({left:r*t.clientWidth,behavior:"smooth"})}function b(r){const t=a.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:l}),s?e.jsxs("button",{className:"collection-carousel__viewall",onClick:s,children:[i("collectionCarousel.viewAll"),e.jsx(C,{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":i("collectionCarousel.scrollLeft"),disabled:j,children:e.jsx("img",{src:g,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:a,children:c.map(r=>e.jsx(E,{item:r},r.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>m(1),"aria-label":i("collectionCarousel.scrollRight"),disabled:w,children:e.jsx("img",{src:g,alt:"","aria-hidden":!0})})]}),h>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":i("collectionCarousel.pages"),children:Array.from({length:h}).map((r,t)=>e.jsx("button",{className:`collection-carousel__dot${t===f?" is-active":""}`,"aria-label":i("collectionCarousel.goToPage",{page:t+1}),"aria-current":t===f?"true":void 0,onClick:()=>b(t)},t))}):null]})}export{L as C,W,I as s,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-BXazHbBy.js";import{az as oe,aA as ce,x as le,t as a,aB as B,B as ne,af as z,u as ie,ag as D,I as E,p as de,m as me,A as ue,at as he,aC as ge,e as xe}from"./index-
|
|
1
|
+
import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-BXazHbBy.js";import{az as oe,aA as ce,x as le,t as a,aB as B,B as ne,af as z,u as ie,ag as D,I as E,p as de,m as me,A as ue,at as he,aC as ge,e as xe}from"./index-C3X5jLeD.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-CnhLIVpI.js";import{u as be,L as fe}from"./useStore-45Le9Qaw.js";import{d as I,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-CPkgFcrW.js";import{L as $}from"./LoadMore-BDrBHvfL.js";import{u as R}from"./useInfiniteGrid-Mx1HAG8J.js";import{E as T}from"./ErrorNotice-Cmr8aXJs.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.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,N=r==null||o==null,{data:i}=oe(m,N),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=B(m=>m.followed.includes(t.toLowerCase())),n=B(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}=z(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)||D(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(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(Ne({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:N,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(E,{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(E,{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 Oe(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=z(t),g=(m==null?void 0:m.name)||(t?D(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,O]=j.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=(I.find(s=>s.key===P)??I[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:W,isFetchingNextPage:F,fetchNextPage:Z}=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 q(s){N(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(){N("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(je,{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:q,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($,{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:O,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($,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Oe as Creator,Oe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aV as U,aW as Ue,S as C,aX as qe,aY as Ye,a0 as Qe,aZ as Xe,aI as Ze,R,aN as K,aM as Te,a_ as a,a$ as Je,b0 as Le,T as et,aT as tt}from"./index-
|
|
1
|
+
import{aV as U,aW as Ue,S as C,aX as qe,aY as Ye,a0 as Qe,aZ as Xe,aI as Ze,R,aN as K,aM as Te,a_ as a,a$ as Je,b0 as Le,T as et,aT as tt}from"./index-C3X5jLeD.js";import{R as rt,g as ot}from"./getOverlayAlpha-zAle2GuY.js";import{j as T,r as y}from"./react-BXazHbBy.js";import{u as nt,a as Be}from"./useTheme-XtIUuPdU.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(Xe,{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-nlgW21N5.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DFIVRio9.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as q,b as H,r as n,j as e}from"./react-BXazHbBy.js";import{m as Q,t as s,u as V,b as W,j as g,ak as z,e as d,F as A,k as F,C as D,f as $}from"./index-
|
|
1
|
+
import{u as q,b as H,r as n,j as e}from"./react-BXazHbBy.js";import{m as Q,t as s,u as V,b as W,j as g,ak as z,e as d,F as A,k as F,C as D,f as $}from"./index-C3X5jLeD.js";import{R as I}from"./resume-buy-Bf0zIH7y.js";import{R as J}from"./cart-checkout-srmBjqa3.js";import{l as Z}from"./loader-logo-BzY9EKdC.js";import{u as X,p as ee,c as se,i as te}from"./useCreditPacks-CTza1Tus.js";import{C as re}from"./CircularProgress-xCRBPMNy.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-30124433292.commit-3681582/assets/pack-chips--HnOpf5U.webp",ae="https://cdn.decentraland.org/@dcl/shop/0.1.0-30124433292.commit-3681582/assets/credit-coin-CmcTCd5i.webp",ce="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",C=te()?"mock":"stripe",ie={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function G(o){const r=o;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 ke(){Q({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=q(),{session:r,signIn:m}=V(),i=W(),[k,S]=H(),{packs:M,isLoading:T}=X(),[p,l]=n.useState("select"),[c,w]=n.useState(null),[E,R]=n.useState(null),[U,h]=n.useState(null),[K,N]=n.useState(!1),f=n.useRef(null);n.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=n.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=n.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await ee(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;R(_>0?_:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:_>0?_:null,provider:C}),i.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(J)){const j={resumeCheckout:!0,..._>0?{creditsAdded:_}:{}};o("/cart",{state:j});return}}catch{}try{const j=sessionStorage.getItem(I);if(j){sessionStorage.removeItem(I);const P=JSON.parse(j),B=z(P);if(B){o(B,{state:{item:P,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),i.invalidateQueries({queryKey:["usd-balance"]}),l("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})),l("error"))}catch(u){A(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:F(u),pack_usd:(c==null?void 0:c.usd)??null}),h(G(u)),l("error")}},[c,r,i,o]),O=n.useCallback(async t=>{if(!r){m();return}h(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await se(t.id,{address:r.address,identity:r.identity});if(a.mock)b(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){A(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:F(a),pack_usd:t.usd}),h(G(a)),l("error")}},[r,m,b]),y=n.useRef(!1);n.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),h(null),N(!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(de,{packs:M,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(re,{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:Z,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:ce,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})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ae,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(D,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,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:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/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:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,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:v,children:s("getCredits.tryAgain")})})]})]})}function de({packs:o,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(i=>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"})]})},i))}):e.jsx("div",{className:"packs",children:o.map(i=>e.jsxs("button",{type:"button",className:`pack${i.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(i),"aria-label":s("getCredits.packAria",{amount:$(i.credits),usd:i.usd}),children:[i.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:i.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ie[i.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",i.usd.toFixed(2)]})})]})]},i.id))})}export{ke as GetCredits,ke 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-kMsmgOxf.js";import{d as g,r as v}from"./index-DFIVRio9.js";import{C as c}from"./ConstantsUtil-DamObtDN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-nlgW21N5.js";import{au as y}from"./NetworkUtil-xdrSr8Td.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as R,r as h,j as e,L as B}from"./react-BXazHbBy.js";import{w as $,t as s,e as S,B as k,C as L,j as P,F as Q,m as U,u as W,b as O,o as z,s as K,K as Y}from"./index-
|
|
1
|
+
import{u as R,r as h,j as e,L as B}from"./react-BXazHbBy.js";import{w as $,t as s,e as S,B as k,C as L,j as P,F as Q,m as U,u as W,b as O,o as z,s as K,K as Y}from"./index-C3X5jLeD.js";import{i as D,R as G,f as H}from"./import-CuPZVchc.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-CLqlZ0dX.js";import"./ethers-BJDbBwOP.js";import"./intl-CBcMB1D2.js";import"./buy-Bg6ayEVg.js";import"./authorizations-Bu5ynTut.js";import"./index-HN6Rk25C.js";import"./sendMetaTransaction-CiO3jI6F.js";import"./trade-encoding-Dp_icjFZ.js";import"./mana-rate-BRTVWI6W.js";function J({queue:n,session:w,onClose:j,onDone:o}){const N=R(),d=$(w.providerType),[m,f]=h.useState(()=>n.map(()=>"pending")),[I,M]=h.useState("running"),T=h.useRef(!1);h.useEffect(()=>{if(T.current)return;T.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(u=>u.map((g,p)=>p===r?"active":g));try{await D(n[r].item,n[r].priceCredits,w),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(u=>u.map((g,p)=>p===r?"done":g))}catch(u){if(u instanceof G)Q(u,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((p,b)=>b===r?"unlisted":p));else{const g=u,p=g.code===4001||/reject|denied|cancel/i.test(g.message??"");p||Q(u,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?p?"skipped":"failed":a))}}}t||M("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(){o(),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:S.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:()=>{o(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{o(),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=K(k)`
|
|
2
2
|
margin-top: 10px;
|
|
3
3
|
`,V=K(k)`
|
|
4
4
|
padding: 13px 24px;
|