@dcl/shop 0.5.1-30941423866.commit-16bb43e → 0.5.1-30942080363.commit-5a008a2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-D6HGEkBY.js → Activity-CfohBp0y.js} +6 -6
- package/_assets/{AnimatedBackground-Bz6-eXM-.js → AnimatedBackground-gpCse7EH.js} +2 -2
- package/_assets/{Assets-91-VU1Yf.js → Assets-IY2PmVDp.js} +7 -7
- package/_assets/{Assets.styles-nkCcUHhi.js → Assets.styles-DU_WP2lv.js} +1 -1
- package/_assets/{Authorizations-CEIgVod3.js → Authorizations-DgmmTCT_.js} +3 -3
- package/_assets/{Cart-bL5VUwar.js → Cart-gTkEGP_-.js} +22 -22
- package/_assets/{CircularProgress-t5C2xMSa.js → CircularProgress-1fPr054_.js} +3 -3
- package/_assets/Collection-BRcUPhzB.js +119 -0
- package/_assets/{CollectionCarousel-BofN3PUd.js → CollectionCarousel-CMmb6-ne.js} +17 -17
- package/_assets/{Creator-BvEpySRn.js → Creator-CFYVnbbD.js} +9 -9
- package/_assets/{ErrorNotice-SoCdrSmZ.js → ErrorNotice-D6PKmOXM.js} +1 -1
- package/_assets/{ExchangeController-CfUvjqK_.js → ExchangeController-DrcHwQX8.js} +1 -1
- package/_assets/{GetCredits-DoaG2_0N.js → GetCredits-X1fDrfGZ.js} +12 -12
- package/_assets/{HelpersUtil-BMGSbn7T.js → HelpersUtil-JE28M1o7.js} +1 -1
- package/_assets/{ItemDetail-DgqMo17C.js → ItemDetail-DeXvVWPr.js} +3 -3
- package/_assets/{LoadMore-QZxbtyl3.js → LoadMore-B2K4UDfe.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CfeNfvcw.js → ManaPricingBanner.styles-eLx-8UKH.js} +3 -3
- package/_assets/{MenuList-3Ove0Kax.js → MenuList-CnBRd37k.js} +1 -1
- package/_assets/{MyAssets-Dfi9GJY7.js → MyAssets-DdRWkVS3.js} +1 -1
- package/_assets/{MyFavorites-4NZPS72p.js → MyFavorites-BlGmxMaR.js} +1 -1
- package/_assets/NotFound-Bz-rDcjH.js +13 -0
- package/_assets/{NotificationsBell-C3ZVZms3.js → NotificationsBell-BrZbQAvI.js} +1 -1
- package/_assets/{OutfitDetail-BnpYR8Sn.js → OutfitDetail-B249K3hQ.js} +4 -4
- package/_assets/{OutfitPreview-Ds73Fyio.js → OutfitPreview-Cdl7SceL.js} +2 -2
- package/_assets/{OutfitStudio-BcZDs5Sw.js → OutfitStudio-YxiNgnnh.js} +13 -13
- package/_assets/{StoreSettings-DgkB-s8z.js → StoreSettings-DopfDTeB.js} +43 -43
- package/_assets/{Success-CFrayKii.js → Success-C5omXUBX.js} +6 -6
- package/_assets/{SwapController-B0I2SBMi.js → SwapController-Bjmuyz_j.js} +1 -1
- package/_assets/{Tooltip-DrwaXxlg.js → Tooltip-D3wp0OFx.js} +1 -1
- package/_assets/{TradeService-wTgWWF_f.js → TradeService-1mcj7EiB.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-DmUcIZ1-.js → W3MFrameProviderSingleton-DHrNy8cB.js} +3 -3
- package/_assets/{WebCryptoP256-Bh90kMb3.js → WebCryptoP256-D9oW_qyA.js} +1 -1
- package/_assets/{authorizations-LULzuipv.js → authorizations-Bx-uumVM.js} +1 -1
- package/_assets/{basic-BJTMzaq4.js → basic-B39QAUZJ.js} +1 -1
- package/_assets/{biconomy-DwCfSXz5.js → biconomy-Bx6Ho69d.js} +1 -1
- package/_assets/browseLayout.styles-DXLz-YlY.js +91 -0
- package/_assets/{builder-CsWf7X7a.js → builder-Czq1-krd.js} +1 -1
- package/_assets/{buy-Cs1e8dwt.js → buy-BDTufK8m.js} +1 -1
- package/_assets/{buy-gasless-nMph8utE.js → buy-gasless-CXKZGuta.js} +1 -1
- package/_assets/{categories-Al7TFiZ3.js → categories-3pKh51AH.js} +1 -1
- package/_assets/{ccip-BwXOtHnt.js → ccip-BDfDn3iK.js} +1 -1
- package/_assets/{ccip-D1z2vDZ1.js → ccip-Co2XroO9.js} +1 -1
- package/_assets/{clsx-CF2rJgou.js → clsx-FFNUV-WB.js} +2 -2
- package/_assets/{controller-Dd98YdMj.js → controller-Bpa17ZZP.js} +2 -2
- package/_assets/{core-D1SojbPa.js → core-BAfyWlVX.js} +4 -4
- package/_assets/{createSvgIcon-BD9EM61r.js → createSvgIcon-B10djVRg.js} +3 -3
- package/_assets/{custom-COzYkjQL.js → custom-B06rMK4w.js} +1 -1
- package/_assets/{data-capture-BjEF_GLG.js → data-capture-BkYxbz02.js} +1 -1
- package/_assets/{email-ps4Ivz5i.js → email-Bknt0jHD.js} +1 -1
- package/_assets/{embedded-wallet-CVLG0kXZ.js → embedded-wallet-o7x5DbDu.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CDuZD50Q.js → emotion-styled.browser.esm-Dpa1iAyn.js} +1 -1
- package/_assets/{engine-pr6_tb_z.js → engine-BNOXJug7.js} +1 -1
- package/_assets/{errors-5vlAB2Zg.js → errors-Cg4Fnsf8.js} +1 -1
- package/_assets/{estimate-l1-fee-B3g-FnFs.js → estimate-l1-fee-DXNJIfzL.js} +1 -1
- package/_assets/{execute-Cel7d92K.js → execute-BFeK7M_Y.js} +2 -2
- package/_assets/{features-D5rLpDoE.js → features-DCfBaiy_.js} +1 -1
- package/_assets/{fetchTokenMetadata-DryrCOLG.js → fetchTokenMetadata-aKrX_QaT.js} +2 -2
- package/_assets/{field.styles-C90By0S4.js → field.styles-tnDxAMEw.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DS2uBDFK.js → get-ecosystem-wallet-info-CCTUHx5Y.js} +1 -1
- package/_assets/{getBalance-DzSIaYv8.js → getBalance-CxkeTHxS.js} +1 -1
- package/_assets/{getNFT-B_38vu3d.js → getNFT-CYunBlyN.js} +1 -1
- package/_assets/{getNFT-BYs-Lc0M.js → getNFT-Dy6NXKIb.js} +1 -1
- package/_assets/{getThemeProps-CMN_iN9O.js → getThemeProps-Bz6-UTTf.js} +1 -1
- package/_assets/{grid.styles-_dq0Z7zy.js → grid.styles-BjSrL-3s.js} +1 -1
- package/_assets/{hashTypedData-U2WpRL9J.js → hashTypedData-Ckb55FUP.js} +1 -1
- package/_assets/{hashTypedData-nZ5SahOR.js → hashTypedData-jiOsNHGE.js} +1 -1
- package/_assets/{in-app-CrkxD8Cc.js → in-app-CBFCQ5yP.js} +1 -1
- package/_assets/{in-app-wallet-calls-Li6zp_GH.js → in-app-wallet-calls-Buf5QRM_.js} +1 -1
- package/_assets/{index-uA72jFdu.js → index-9iEI2jn0.js} +1 -1
- package/_assets/{index-Crfc7kEB.js → index-B0lN-Mk6.js} +2 -2
- package/_assets/{index-BfJ9y_zu.js → index-B14yGzKq.js} +1 -1
- package/_assets/{index-CycLf6t0.js → index-B4h2Nw0d.js} +1 -1
- package/_assets/{index-DNQcT8i8.js → index-BUTTEIUm.js} +3 -3
- package/_assets/{index-EbRcCO2e.js → index-BUelAUn3.js} +1 -1
- package/_assets/{index-AnVlYA8W.js → index-BWaeHJs2.js} +1 -1
- package/_assets/{index-1geQS8z5.js → index-BYy-feq3.js} +1 -1
- package/_assets/{index-CVaetlkF.js → index-Bc5IBzFc.js} +1 -1
- package/_assets/{index-onFl5MgF.js → index-BoBgM1AD.js} +3 -3
- package/_assets/{index-CroRq_48.js → index-BzOyUlEA.js} +1 -1
- package/_assets/{index-Dl3xGhv0.js → index-C3IX0bEG.js} +1 -1
- package/_assets/{index-Cnjifnkg.js → index-C4PvJvch.js} +1 -1
- package/_assets/{index-DhVlJ1ll.js → index-CAP79hiU.js} +1 -1
- package/_assets/{index-BzjKhN7Z.js → index-CMaqcpip.js} +1 -1
- package/_assets/{index-BjGq2FUA.js → index-CWKNVQns.js} +1 -1
- package/_assets/{index-B-cFSgSm.js → index-CWsWvJQR.js} +1 -1
- package/_assets/{index-BRUTO6r3.js → index-CXO-pG6w.js} +1 -1
- package/_assets/{index-C23YPWAe.js → index-Cab_9Z0c.js} +1 -1
- package/_assets/{index-B7jpRyRq.js → index-CcfifGLA.js} +1 -1
- package/_assets/{index-DptqVcuN.js → index-CfiJexEY.js} +2 -2
- package/_assets/{index-BzJy8rqx.js → index-ChdOnCl5.js} +1 -1
- package/_assets/{index-BB2cIvLa.js → index-CpshLABR.js} +1 -1
- package/_assets/{index-BZWjyqNw.js → index-CtMN6sQa.js} +1 -1
- package/_assets/{index-CbbOEMBd.js → index-D2bvSzer.js} +1 -1
- package/_assets/{index-Cl61ltQF.js → index-D7Ov3BOT.js} +1 -1
- package/_assets/{index-DfH6m-Ar.js → index-DG0maXsi.js} +1 -1
- package/_assets/{index-ChlDHmTZ.js → index-DHfu_49i.js} +1 -1
- package/_assets/{index-CkDVG_a0.js → index-DI8pHoj5.js} +1 -1
- package/_assets/{index-DI5MJwtI.js → index-DUecvlpK.js} +1 -1
- package/_assets/{index-CtSdDkYg.js → index-DZq6_deL.js} +2 -2
- package/_assets/{index-Dy8SH7iw.js → index-DcGjcsc6.js} +1 -1
- package/_assets/{index-B5d3bUu8.js → index-DinK4F_L.js} +3 -3
- package/_assets/{index-T4DelPen.js → index-Dl80d6_E.js} +1 -1
- package/_assets/{index-CIJrlsx5.js → index-DmwDbAPX.js} +1 -1
- package/_assets/{index-DxPgc0KP.js → index-Dokx6uQZ.js} +1 -1
- package/_assets/{index-C9YePsjK.js → index-Dt_NBFaG.js} +1 -1
- package/_assets/{index-CZ-oyr8d.js → index-DvFfsS8l.js} +1 -1
- package/_assets/{index-Bie49yv7.js → index-DxEYKwRl.js} +2 -2
- package/_assets/{index-CPEW56oC.js → index-DzJCqD2K.js} +1 -1
- package/_assets/{index-3p-1HM0o.js → index-RDFBoQxi.js} +1 -1
- package/_assets/{index-BXLMe2R7.js → index-RQ6uZEar.js} +1 -1
- package/_assets/{index-DqDSn6aV.js → index-SERS6_dB.js} +1 -1
- package/_assets/{index-18uEK4oZ.js → index-STO6kbYe.js} +1 -1
- package/_assets/index-UGlpWu7U.js +3306 -0
- package/_assets/{index-BpktVBiY.js → index-_RCROc0P.js} +1 -1
- package/_assets/{index-voVSpMmf.js → index-he_m0Fl-.js} +1 -1
- package/_assets/{index-3swvxeAv.js → index-nI7p19n6.js} +1 -1
- package/_assets/{index-YQoU1Oij.js → index-nuT17Odj.js} +1 -1
- package/_assets/{index-Ccc-pGrt.js → index-qGfC-M8O.js} +1 -1
- package/_assets/{index-Z5BMZOu5.js → index-sItL3uzy.js} +16 -16
- package/_assets/{index-C6vWyFJn.js → index-wxVvLfDd.js} +2 -2
- package/_assets/{index.es-CToxxyBw.js → index.es-DThH2vFQ.js} +1 -1
- package/_assets/{index.es-DRByKX1-.js → index.es-MdcUrD81.js} +4 -4
- package/_assets/{index.es-CvbAgxyC.js → index.es-v1HXELTh.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DTJgI3xj.js → localBatchGatewayRequest-CgJUOzba.js} +1 -1
- package/_assets/{mana-convert-BvzeO7sG.js → mana-convert-C0Bze7yJ.js} +1 -1
- package/_assets/{networks-CFK3bJYy.js → networks-D-bNskAV.js} +1 -1
- package/_assets/{onramp-okVUuWV0.js → onramp-B_PP9t-6.js} +1 -1
- package/_assets/{openzeppelin-De_HqqIc.js → openzeppelin-CP5bQyOk.js} +1 -1
- package/_assets/{parseNft-q8FmdH8G.js → parseNft-Dj-N28Ic.js} +2 -2
- package/_assets/{parseSignature-CqPrGTDR.js → parseSignature-DlXx8lne.js} +3 -3
- package/_assets/{parseSignature-B5R6ASNp.js → parseSignature-Dp9TGASb.js} +1 -1
- package/_assets/{passkeys-DSnfSnMU.js → passkeys-D4vOQZOp.js} +1 -1
- package/_assets/{pay-with-exchange-W6o_xhiT.js → pay-with-exchange-BlkoZTrJ.js} +1 -1
- package/_assets/{qr-overlay-yLQ0IoEW.js → qr-overlay-B77wg9uX.js} +1 -1
- package/_assets/{receive-B1if_96A.js → receive-fChjzOcU.js} +1 -1
- package/_assets/{resolveImplementation-DO2_Regw.js → resolveImplementation-DB1To9fC.js} +1 -1
- package/_assets/{rpc-Byx0dACz.js → rpc-Dtph7Sn-.js} +1 -1
- package/_assets/{secp256k1-qgQXh0MJ.js → secp256k1-7hf5kymY.js} +1 -1
- package/_assets/{secp256k1-DZugY34I.js → secp256k1-B54M-EJX.js} +1 -1
- package/_assets/{secp256k1-DdXA0G93.js → secp256k1-RKrSZRhb.js} +1 -1
- package/_assets/{send-batch-transaction-_L7mjvMY.js → send-batch-transaction-Dsnq3698.js} +1 -1
- package/_assets/{send-eip712-transaction-DurwgWTK.js → send-eip712-transaction-Bk870_4c.js} +2 -2
- package/_assets/{send-DtosPy0k.js → send-ekbhdMTX.js} +1 -1
- package/_assets/{send-gasless-transaction-B3bmXUxJ.js → send-gasless-transaction-mhZcHIOy.js} +2 -2
- package/_assets/{send-transaction-CZKkuF5l.js → send-transaction-DLfuM_nJ.js} +2 -2
- package/_assets/{sendMetaTransaction-4my7kZiF.js → sendMetaTransaction-CbxpNfVY.js} +1 -1
- package/_assets/{sendRawTransaction-BwVANbYg.js → sendRawTransaction-Dq6iLNOF.js} +3 -3
- package/_assets/{serializeTransaction-cVp_FJox.js → serializeTransaction-D0Ct49e0.js} +1 -1
- package/_assets/{session-proposal-CYvptxU7.js → session-proposal-C_FAURhx.js} +1 -1
- package/_assets/{session-request-Bn37Dem4.js → session-request-Bdn2jF6v.js} +2 -2
- package/_assets/{signing-DEItZ-F3.js → signing-BKBKIDWR.js} +3 -3
- package/_assets/{socials-CdpDKKrQ.js → socials-DDmkzfIp.js} +1 -1
- package/_assets/{swaps-DnenFD5w.js → swaps-BZjTE4Lo.js} +1 -1
- package/_assets/{thirdweb-Bp130Dcj.js → thirdweb-BRgX__sH.js} +3 -3
- package/_assets/{to-serializable-transaction-CcF0iJ96.js → to-serializable-transaction-D0EMGY08.js} +2 -2
- package/_assets/{trade-encoding-BRe43PSw.js → trade-encoding-Dw1x271X.js} +1 -1
- package/_assets/{transactionReceipt-lMu7BRwr.js → transactionReceipt-MJ3mbhdi.js} +1 -1
- package/_assets/{transactions-B14lINkM.js → transactions-DaDqXmUP.js} +1 -1
- package/_assets/{useCreditPacks-C5VR3CBS.js → useCreditPacks-CPOVN7Gq.js} +1 -1
- package/_assets/{useImportable-B5bQ22LQ.js → useImportable-BElQRFOW.js} +1 -1
- package/_assets/{useInfiniteGrid-eJ_aRWUt.js → useInfiniteGrid-7hiVU_K4.js} +1 -1
- package/_assets/useManaRate-bDKCffp4.js +1 -0
- package/_assets/{useTheme--KekSHIk.js → useTheme-C7dqsuDI.js} +1 -1
- package/_assets/{verifyHash-Bt7jFOSN.js → verifyHash-DcTMzSLu.js} +1 -1
- package/_assets/{w3m-modal-Dn7of9MZ.js → w3m-modal-Qporq01P.js} +1 -1
- package/_assets/{w3m-modal-CDIk6daa.js → w3m-modal-gRdkhlg8.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BUw9UtP4.js → wait-for-tx-receipt-Zm4DabEW.js} +1 -1
- package/_assets/{wallets-A7pRwPiu.js → wallets-vgey4Pk4.js} +5 -5
- package/_assets/{web-connector-P4z47D9H.js → web-connector-DkrfZGZ4.js} +3 -3
- package/_assets/{writeContract-Bx4xVEvO.js → writeContract-CYVoU1GT.js} +1 -1
- package/_assets/{zoraTestnet-CuzBONzv.js → zoraTestnet-B5TlluZS.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-B3QlNwPP.js +0 -119
- package/_assets/NotFound-BJON5Kwq.js +0 -13
- package/_assets/browseLayout.styles-Cb1bSjYL.js +0 -91
- package/_assets/index-CqLzAYYu.js +0 -3482
- package/_assets/useManaRate-CEsFS4D7.js +0 -1
- package/_assets/useStore-BZhz06Vz.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-sItL3uzy.js","_assets/react-DehiWSvs.js","_assets/index-UGlpWu7U.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-BElQRFOW.js","_assets/buy-BDTufK8m.js","_assets/mana-convert-C0Bze7yJ.js","_assets/authorizations-Bx-uumVM.js","_assets/sendMetaTransaction-CbxpNfVY.js","_assets/trade-encoding-Dw1x271X.js","_assets/ManaPricingBanner.styles-eLx-8UKH.js","_assets/field.styles-tnDxAMEw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bv as bt,s as h,t as s,m as yt,B as vt,l as wt,n as jt,b as d,u as $,I as j,bw as Z,bx as J,by as kt,_ as It,q as P,bz as At,b7 as z,aq as $t,bA as Pt,bB as H}from"./index-UGlpWu7U.js";import{r as y,e as Lt,j as e,L as et,a as Tt}from"./react-DehiWSvs.js";import{m as Nt}from"./mana-convert-C0Bze7yJ.js";import{u as Et}from"./useManaRate-bDKCffp4.js";import{u as Ct}from"./useImportable-BElQRFOW.js";import{L as St}from"./LoadMore-B2K4UDfe.js";import{u as I}from"./useInfiniteGrid-7hiVU_K4.js";import{m as it}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-BDTufK8m.js";import"./authorizations-Bx-uumVM.js";import"./sendMetaTransaction-CbxpNfVY.js";import"./trade-encoding-Dw1x271X.js";const Ft=15e3;function Mt(t,a){return t.txHash&&a.txHash?t.txHash===a.txHash:t.txHash||a.txHash?!1:t.status===a.status&&Math.abs(t.createdAt-a.createdAt)<=Ft}function Dt(t){const a=[...t].sort((i,c)=>c.createdAt-i.createdAt),n=[];for(const i of a){const c=n[n.length-1];c&&Mt(c[c.length-1],i)?c.push(i):n.push([i])}return n.map(i=>{var c;return{id:((c=i.find(r=>r.txHash))==null?void 0:c.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function zt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function Ht(t){const a=[],n=new Map;for(const i of t){const c=zt(i);if(!c){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(c);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:c,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(c,u),a.push(u)}return a}function qt(t,a){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:a?Nt(t.manaWei,a):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Ot(t){const n=Dt(t.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=t.sales.map(o=>{const p=qt(o,t.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),c=(t.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),r=new Set(t.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(t.manaPurchases??[]).filter(o=>!r.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...c,...u].sort((o,p)=>p.createdAt-o.createdAt||(o.id<p.id?-1:1))}function Wt(t,a){return a==="all"?t:a==="sales"?t.filter(n=>n.kind==="sale"):t.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const at=t=>t.trim().toLowerCase();function Rt(t){const a=new Map;for(const n of t??[]){const i=at(n.txHash??"");if(!i)continue;const c=a.get(i);c?c.push(n):a.set(i,[n])}return a}function _t(t,a,n=Date.now()){const i=a.txHash?t.get(at(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const c=i.length===1?Bt(i[0].netCents):null,r=i.filter(o=>!o.available&&o.availableAt>n);if(r.length===0)return{kind:"credited",credits:c};const u=r.reduce((o,p)=>Math.max(o,p.availableAt),0);return{kind:"pending",credits:c,availableAt:u}}function Bt(t){return bt(t)}const Gt="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/credits-product-vs4Q6u6l.svg",q=yt`
|
|
3
3
|
0% { background-position: 200% 0; }
|
|
4
4
|
100% { background-position: -200% 0; }
|
|
5
5
|
`,Ut=h.section`
|
|
@@ -286,7 +286,7 @@ import{bn as bt,s as h,t as s,o as yt,B as vt,n as wt,q as jt,b as d,u as $,I as
|
|
|
286
286
|
border-radius: 10px;
|
|
287
287
|
background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
|
|
288
288
|
background-size: 200% 100%;
|
|
289
|
-
animation: ${
|
|
289
|
+
animation: ${q} 1.3s infinite linear;
|
|
290
290
|
|
|
291
291
|
@media (prefers-reduced-motion: reduce) {
|
|
292
292
|
animation: none;
|
|
@@ -309,7 +309,7 @@ import{bn as bt,s as h,t as s,o as yt,B as vt,n as wt,q as jt,b as d,u as $,I as
|
|
|
309
309
|
border-radius: 6px;
|
|
310
310
|
background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
|
|
311
311
|
background-size: 200% 100%;
|
|
312
|
-
animation: ${
|
|
312
|
+
animation: ${q} 1.3s infinite linear;
|
|
313
313
|
|
|
314
314
|
@media (prefers-reduced-motion: reduce) {
|
|
315
315
|
animation: none;
|
|
@@ -335,7 +335,7 @@ import{bn as bt,s as h,t as s,o as yt,B as vt,n as wt,q as jt,b as d,u as $,I as
|
|
|
335
335
|
border: 1px solid transparent;
|
|
336
336
|
background: linear-gradient(100deg, ${s.colors.media} 30%, ${s.colors.panel} 50%, ${s.colors.media} 70%);
|
|
337
337
|
background-size: 200% 100%;
|
|
338
|
-
animation: ${
|
|
338
|
+
animation: ${q} 1.3s infinite linear;
|
|
339
339
|
|
|
340
340
|
@media (prefers-reduced-motion: reduce) {
|
|
341
341
|
animation: none;
|
|
@@ -354,4 +354,4 @@ import{bn as bt,s as h,t as s,o as yt,B as vt,n as wt,q as jt,b as d,u as $,I as
|
|
|
354
354
|
margin: 6px 0 0;
|
|
355
355
|
`,ae=h(vt)`
|
|
356
356
|
margin-top: 12px;
|
|
357
|
-
`,K=M.withComponent(et),se=y.lazy(()=>It(()=>import("./index-
|
|
357
|
+
`,K=M.withComponent(et),se=y.lazy(()=>It(()=>import("./index-sItL3uzy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.ImportListings}))),A=24,ne=["all","purchases","sales"],D="migrate";function w(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ct(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function dt(t){const a=Number(t)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function lt({children:t}){const a=y.useRef(null),[n,i]=y.useState(null),c=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return e.jsxs(te,{ref:a,tabIndex:0,onMouseEnter:c,onMouseLeave:()=>i(null),onFocus:c,onBlur:()=>i(null),children:[t,n?Tt.createPortal(e.jsx(ee,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function re({item:t}){const a=!!t.contractAddress&&!!t.itemId,n=!!t.tradeId||a,{data:i,isLoading:c}=$({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?Pt(t.tradeId):H(t.contractAddress,{itemId:t.itemId}),enabled:n,staleTime:5*6e4}),r=n&&c,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",p=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=e.jsxs(e.Fragment,{children:[r?e.jsx(R,{}):e.jsx(W,{children:o?e.jsx("img",{src:o,alt:u}):e.jsx(j,{name:"cart",size:20})}),e.jsxs(_,{children:[r?e.jsx(G,{}):e.jsx(B,{title:u,children:u}),t.quantity>1?e.jsx(U,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(ie,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]});return p?e.jsx(K,{to:p,"data-link":"true",children:x}):e.jsx(M,{children:x})}function oe({order:t}){const a=Ht(t.lines),n=a.reduce((i,c)=>i+c.quantity,0);return e.jsxs(L,{"data-testid":"purchase-order",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(v,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(O,{children:a.map(i=>e.jsx(re,{item:i},i.key))})]})}function ce({sale:t}){const{data:a,isLoading:n}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??d("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",r=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,u=e.jsxs(e.Fragment,{children:[n?e.jsx(R,{}):e.jsx(W,{children:c?e.jsx("img",{src:c,alt:i}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[n?e.jsx(G,{}):e.jsx(B,{title:i,children:i}),e.jsx(U,{children:d("activity.boughtFrom",{account:ct(t.seller)})})]})]});return e.jsxs(L,{"data-testid":"activity-mana-purchase",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.paidWithMana")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(v,{children:[dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]})]})]}),e.jsx(O,{children:r?e.jsx(K,{to:r,"data-link":"true",children:u}):e.jsx(M,{children:u})})]})}function de({sale:t,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),c=(n==null?void 0:n.name)??d("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,o=e.jsxs(e.Fragment,{children:[i?e.jsx(R,{}):e.jsx(W,{children:r?e.jsx("img",{src:r,alt:c}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[i?e.jsx(G,{}):e.jsx(B,{title:c,children:c}),e.jsxs(U,{children:[d("activity.soldTo",{account:ct(t.counterparty)}),a.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return e.jsxs(L,{"data-testid":"activity-sale",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.saleLabel")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),a.kind==="direct"?e.jsxs(v,{"data-kind":"income",children:["+",dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]}):a.credits!==null?e.jsxs(v,{"data-kind":"income",children:[e.jsx(P,{className:"ccy-mark"})," +",$t(a.credits)]}):e.jsx(v,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(O,{children:u?e.jsx(K,{to:u,"data-link":"true",children:o}):e.jsx(M,{children:o})})]})}function le({order:t}){const a=`$${(t.usdCents/100).toFixed(2)}`,n=At(t.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(L,{"data-testid":"credit-order",children:e.jsxs(T,{children:[e.jsx(Yt,{children:e.jsx("img",{src:Gt,alt:"","aria-hidden":!0})}),e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:a})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":n,children:i}),e.jsxs(v,{"data-kind":"income",children:["+",e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]})]})})}function he({filter:t}){const a={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[t];return e.jsxs(rt,{children:[e.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),e.jsx(ot,{children:a.title}),e.jsx("p",{className:"muted",children:a.body}),t!=="sales"?e.jsx(ae,{as:et,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function Le(){const{session:t}=wt(),[a,n]=y.useState("all"),[i,c]=Lt(),r=i.get("view")===D;jt({title:r?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=Ct(),o=u!==void 0&&(u>0||r),p=!!t&&!r&&a!=="sales",x=!!t&&!r&&a!=="purchases",m=I(["purchases",t==null?void 0:t.address],l=>kt(t.address,t.identity,{first:A,skip:l}),{enabled:p}),g=I(["sales",t==null?void 0:t.address],l=>Z(t.address,{role:"seller",first:A,skip:l}),{enabled:x}),f=I(["credit-orders",t==null?void 0:t.address],l=>J(t.address,t.identity,{first:A,skip:l}),{enabled:p}),b=I(["mana-purchases",t==null?void 0:t.address],l=>Z(t.address,{role:"buyer",first:A,skip:l}),{enabled:p}),{data:V}=$({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>J(t.address,t.identity,{first:200}).then(l=>l.payouts),enabled:x,staleTime:6e4}),ht=y.useMemo(()=>Rt(V),[V]),{data:ut}=Et(x);if(!t)return e.jsxs(rt,{children:[e.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),e.jsx(ot,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const Q=Wt(Ot({purchases:p?m.items:[],sales:x?g.items:[],creditOrders:p?f.items:[],manaPurchases:p?b.items:[],rate:ut}),a),pt=p&&(m.isLoading||f.isLoading||b.isLoading)||x&&g.isLoading,X=p&&(m.isFetchingNextPage||f.isFetchingNextPage||b.isFetchingNextPage)||x&&g.isFetchingNextPage,xt=p&&(m.hasNextPage||f.hasNextPage||b.hasNextPage)||x&&g.hasNextPage;function mt(){p&&m.hasNextPage&&m.fetchNextPage(),p&&f.hasNextPage&&f.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),x&&g.hasNextPage&&g.fetchNextPage()}function gt(l){if(n(l),!r)return;const k=new URLSearchParams(i);k.delete("view"),c(k,{replace:!0})}function ft(){const l=new URLSearchParams(i);l.set("view",D),c(l,{replace:!0})}return e.jsxs(Ut,{"data-view":r?D:"feed",children:[e.jsx(Kt,{children:e.jsx(Vt,{children:d("nav.activity")})}),e.jsxs(Qt,{role:"tablist","aria-label":d("nav.activity"),children:[ne.map(l=>e.jsx(st,{type:"button",role:"tab","aria-selected":!r&&a===l,"data-active":!r&&a===l,"data-testid":`activity-filter-${l}`,onClick:()=>gt(l),children:d(`activity.filter.${l}`)},l)),o?e.jsxs(Xt,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:ft,children:[d("activity.migrate.chip"),u?e.jsx(Zt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?e.jsx(y.Suspense,{fallback:e.jsx(Jt,{"aria-busy":"true"}),children:e.jsx(se,{})}):pt?e.jsx(Y,{children:Array.from({length:5}).map((l,k)=>e.jsx(tt,{},k))}):Q.length===0?e.jsx(he,{filter:a}):e.jsxs(e.Fragment,{children:[e.jsxs(Y,{children:[Q.map(l=>l.kind==="purchase"?e.jsx(oe,{order:l.order},l.id):l.kind==="credit"?e.jsx(le,{order:l.order},l.id):l.kind==="mana-purchase"?e.jsx(ce,{sale:l.sale},l.id):e.jsx(de,{sale:l.sale,payout:_t(ht,l.sale)},l.id)),X?e.jsx(tt,{}):null]}),e.jsx(St,{hasNextPage:xt,isFetching:X,onLoadMore:mt})]})]})}export{Le as Activity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-
|
|
1
|
+
import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-UGlpWu7U.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -94,4 +94,4 @@ void main() {
|
|
|
94
94
|
inset: 0;
|
|
95
95
|
width: 100%;
|
|
96
96
|
height: 100%;
|
|
97
|
-
`;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,
|
|
97
|
+
`;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,b,()=>d),w=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${S})`}}),v.jsx(I,{ref:t})]})}export{G as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as We,r as m,j as e,e as
|
|
1
|
+
import{d as We,r as m,j as e,e as Je}from"./react-DehiWSvs.js";import{c as F,bc as Xe,bd as Ye,a as et,s,t,l as Be,b3 as tt,v as nt,aq as ge,b as n,o as st,I as S,q as M,bE as ne,b2 as it,Q as Y,bg as ot,bf as rt,n as Fe,ac as at,ae as Te,af as q,as as lt,bF as ct}from"./index-UGlpWu7U.js";import{r as dt,s as pt,u as ht}from"./buy-BDTufK8m.js";import{a as xt,m as Le}from"./mana-convert-C0Bze7yJ.js";import{u as Ue}from"./useManaRate-bDKCffp4.js";import{g as ft,h as mt,i as ut,j as gt,k as bt,C as yt,l as wt,o as jt,m as vt,n as $t,M as Ct,p as kt,E as St,q as Et,r as Rt,s as Tt,t as _t,u as zt,v as It}from"./Assets.styles-DU_WP2lv.js";import{S as _e,R as At,F as Nt,e as Mt}from"./categories-3pKh51AH.js";import{L as Pt}from"./LoadMore-B2K4UDfe.js";import{u as Wt}from"./useInfiniteGrid-7hiVU_K4.js";import{E as Bt}from"./ErrorNotice-D6PKmOXM.js";import{d as Ft}from"./dcl-schemas-Dr9BTjb7.js";import{s as Lt,G as Ut,w as Ht,S as Ot}from"./buy-gasless-CXKZGuta.js";import{j as Gt}from"./trade-encoding-Dw1x271X.js";import{f as Dt}from"./errors-Cg4Fnsf8.js";import{J as qt,C as Vt,B as be}from"./ethers-CtNGBird.js";import{n as Zt}from"./Tooltip-D3wp0OFx.js";import{G as Kt}from"./grid.styles-BjSrL-3s.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-Bx-uumVM.js";import"./sendMetaTransaction-CbxpNfVY.js";function V(i){const o=i.source??"item",a=i.tradeId||`${i.contractAddress}-${i.tokenId??i.itemId??""}`;return`${o}:${a}`}const L="100000000000000000000",He=2,ee=15,Qt=/^[a-zA-Z0-9]+$/;function ze(i){const o=i.trim();return o.length===0?{ok:!1,reason:"empty"}:Qt.test(o)?o.length<He?{ok:!1,reason:"too-short"}:o.length>ee?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Jt(i){return i.replace(/[^a-zA-Z0-9]/g,"").slice(0,ee)}const Xt=["function available(string _subdomain) view returns (bool)"],Ie={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return F.chainId===Number(Ft.ChainId.MATIC_MAINNET)?Ie.mainnet:Ie.sepolia}async function en(i,o={}){var p;const{rpc:a,address:h}=Yt(),l=new qt(a),d=new Vt(h,Xt,l);console.info(`[names] availability check → DCLRegistrar(${h}).available("${i}") on ${a}`);const x=await d.available(i);if((p=o.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${i}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class ye extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(i){return xt(L,i)}async function sn(i,o,a={}){var p;const h=a.chainId??F.chainId,l=a.provider??"across",d=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${h}&provider=${l}`,x=await et(d,{method:"GET",identity:i,metadata:{}});if(!x.ok){let r;try{r=(p=await x.json())==null?void 0:p.code}catch{}throw r==="ROUTE_COST_TOO_HIGH"?new ye:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(i,o){const a=be.from(i.availableAmount),l=be.from(L).sub(a);return{credits:[{value:i.amount,expiresAt:Number(i.expiresAt),salt:Gt(i.id)}],creditsSignatures:[i.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:L}}async function rn(i,o={}){const a=tn,h=o.intervalMs??1e4,l=o.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const p=await fetch(`${a}/deposit/status?originChainId=137&depositTxHash=${i}`);if(p.ok){const r=await p.json(),u=(r.status??"pending").toLowerCase(),g=r.fillTx??r.fillTxnRef??null,w=r.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:w}}}catch{}x<l-1&&await new Promise(p=>setTimeout(p,h))}return d}async function an(i){const{name:o,identity:a,signer:h}=i,l=i.chainId??F.chainId,d=i.provider??"across",x=(i.beneficiary??await h.getAddress()).toLowerCase();let p=null,r=!1;console.info("[names] register start",{name:o,buyer:x,chainId:l,provider:d});try{const u=await dt(l),g=nn(u);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:u});const w=await sn(a,o,{chainId:l,provider:d});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(a,g);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),be.from(j.maxCreditedValue).lt(L))throw new Error("Credit under-sized for the name price");const k=on(j.credit,w);let f;try{f=await Lt({chainId:l,buyer:x,signer:h,args:k})}catch(b){if(!(b instanceof Ut))throw b;f=await pt(l,k,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ht(f),r=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await rn(f,i.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:o,buyer:x,originConfirmed:r}),u instanceof Ot)return{status:"pending",originTxHash:u.txHash};if(p&&!r&&await Ye(a,[p]).catch(()=>{}),u instanceof ye)throw u;const g=new Error(Dt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=u,g}}const ln=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -379,7 +379,7 @@ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b8
|
|
|
379
379
|
color: ${t.colors.accent};
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
`;function En({name:i,priceCredits:o,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=m.useState("confirm"),[g,w]=m.useState(""),[j,k]=m.useState(null),f=m.useRef(!1),b=g.trim().toLowerCase()===i.toLowerCase(),v=r==="completing",E=o!=null?ge(o):"—",C=o==null,
|
|
382
|
+
`;function En({name:i,priceCredits:o,onClose:a}){const{session:h}=Be(),{data:l,isError:d}=tt(h),x=nt(),p=We(),[r,u]=m.useState("confirm"),[g,w]=m.useState(""),[j,k]=m.useState(null),f=m.useRef(!1),b=g.trim().toLowerCase()===i.toLowerCase(),v=r==="completing",E=o!=null?ge(o):"—",C=o==null,_=l==null?void 0:l.credits,R=o!=null&&_!=null?o-_:0,$=R>0,z=C?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:ge(R)}):null;m.useEffect(()=>{const y=H=>{H.key==="Escape"&&!v&&a()};document.addEventListener("keydown",y);const U=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=U}},[v,a]);async function I(){if(!(!h||!b||C||$||f.current)){f.current=!0,u("completing"),k(null);try{const y=await an({name:i,identity:h.identity,signer:h.signer});Y("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,settlement:y.status}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),u(y.status==="registered"?"success":"pending")}catch(y){Y(rt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ot(y),purchase_type:"name"}),k(y instanceof ye?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),u("error")}finally{f.current=!1}}}const A=r!=="success"&&r!=="pending",te=st(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:v?void 0:a,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(ie,{children:r==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(oe,{onClick:a,disabled:v,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{})]}),(r==="confirm"||r==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),r==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ae,{onClick:()=>u("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Rn(i)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(fn,{"aria-hidden":!0,children:"@"}),e.jsx(mn,{value:g,onChange:y=>w(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),z?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsx("span",{children:z})]}):null,e.jsx(Ae,{onClick:()=>void I(),disabled:!b||!h||C||$,children:n("names.buyCta")})]})]}),r==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:it,alt:"",width:56,height:56}),e.jsx(yn,{children:te?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),r==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(ie,{children:n("names.pendingHeaderTitle")}),e.jsx(oe,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(S,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsx(Ne,{children:e.jsx(Me,{onClick:()=>{a(),p("/my-items")},children:n("names.myItems")})})]}),r==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(ie,{children:n("names.successHeaderTitle")}),e.jsx(oe,{onClick:a,"aria-label":n("buyModal.close"),children:e.jsx(S,{name:"close"})})]}),e.jsxs(re,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",ne(l,d)]}),e.jsx(ae,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(S,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(le,{style:{marginTop:20},children:[e.jsx(ce,{"aria-hidden":!0,children:"@"}),e.jsxs(de,{children:[e.jsxs(pe,{children:[i,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(he,{children:n("names.subtitle")})]}),e.jsxs(xe,{children:[e.jsx(M,{}),E]})]}),e.jsxs(Ne,{children:[e.jsx(Me,{onClick:()=>{a(),p("/my-items")},children:n("names.myItems")}),e.jsx(Sn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Rn(i){return i.replace(/[&<>"']/g,o=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[o])}const Tn="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/identity-B4DXDuJP.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.5.1-30942080363.commit-5a008a2/_assets/governance-DnazlIjy.webp",An=s.div`
|
|
383
383
|
width: 100%;
|
|
384
384
|
min-width: 0;
|
|
385
385
|
`,Nn=s.nav`
|
|
@@ -563,7 +563,7 @@ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b8
|
|
|
563
563
|
${t.media.maxWidth("mobile")} {
|
|
564
564
|
font-size: 20px;
|
|
565
565
|
}
|
|
566
|
-
`,
|
|
566
|
+
`,Qn=s.input`
|
|
567
567
|
flex: 0 1 auto;
|
|
568
568
|
min-width: 0;
|
|
569
569
|
max-width: 100%;
|
|
@@ -585,7 +585,7 @@ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b8
|
|
|
585
585
|
${t.media.maxWidth("mobile")} {
|
|
586
586
|
font-size: 16px;
|
|
587
587
|
}
|
|
588
|
-
`,
|
|
588
|
+
`,Jn=s.span`
|
|
589
589
|
flex: none;
|
|
590
590
|
margin-left: 2px;
|
|
591
591
|
font-family: ${t.font.sans};
|
|
@@ -742,13 +742,13 @@ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b8
|
|
|
742
742
|
width: 100%;
|
|
743
743
|
aspect-ratio: 388 / 235;
|
|
744
744
|
object-fit: cover;
|
|
745
|
-
`,
|
|
745
|
+
`,Q=s.div`
|
|
746
746
|
flex: 1;
|
|
747
747
|
display: flex;
|
|
748
748
|
flex-direction: column;
|
|
749
749
|
gap: 6px;
|
|
750
750
|
padding: 12px 16px;
|
|
751
|
-
`,
|
|
751
|
+
`,J=s.h3`
|
|
752
752
|
margin: 0;
|
|
753
753
|
font-family: ${t.font.sans};
|
|
754
754
|
font-weight: 700;
|
|
@@ -797,4 +797,4 @@ import{d as We,r as m,j as e,e as Qe}from"./react-DehiWSvs.js";import{c as F,b8
|
|
|
797
797
|
clip: rect(0, 0, 0, 0);
|
|
798
798
|
white-space: nowrap;
|
|
799
799
|
border: 0;
|
|
800
|
-
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(i){const o=typeof window<"u"?window.location.hostname:"";return`${o.endsWith("decentraland.org")?"https://decentraland.org":o.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(i)}`}function ps({onBack:i}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:o,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=m.useState(""),[p,r]=m.useState("idle"),[u,g]=m.useState(!1),w=m.useRef(null),[j,k]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const T=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:T.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),T.abort()}},[d]);const f=ze(d),b=f.ok&&(p==="available"||p==="error");function v(){if(b){if(!o){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:i,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>x(Qt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(me,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(me,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(me,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(is,{children:n("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(J,{children:[e.jsx(Q,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="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",ue=48;function Ns(){const[i]=Qe(),o=We(),a=(i.get("q")??"").trim().toLowerCase(),h=(i.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=m.useState("wearable"),[x,p]=m.useState(null),[r,u]=m.useState([]),[g,w]=m.useState(""),[j,k]=m.useState(""),[f,b]=m.useState("on_sale"),[v,E]=m.useState(!1),[C,T]=m.useState("newest"),[R,$]=m.useState(!1);m.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=_}},[R]);const z=f==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=ht(),y=x?Mt[x]:void 0,U=(Te.find(c=>c.key===C)??Te[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Wt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=m.useRef(null);m.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=m.useRef("__init__");m.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:f,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:f,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,f,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(_=>_.includes(c)?_.filter(W=>W!==c):[..._,c])}function Je(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of At)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),f!=="on_sale"&&B.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ft,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(mt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(ut,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(gt,{children:[e.jsx(bt,{children:n("assets.filters")}),e.jsx(yt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(wt,{children:e.jsx(jt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:f,onStatus:b,smart:v,onSmart:E})}),e.jsx(vt,{children:e.jsx($t,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(Ct,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{sort:C,onSort:T,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Je}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx(kt,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Bt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(St,{"data-testid":"browse-empty",children:[e.jsx(Et,{src:hs,alt:""}),e.jsxs(Rt,{children:[e.jsx(_t,{children:n("assets.empty.title")}),e.jsx(Tt,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(zt,{children:e.jsx(It,{type:"button",onClick:()=>o("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(_e,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const _=c;if(_.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(_);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{..._,priceCredits:W}},V(c))}),$e?e.jsx(_e,{count:6}):null]})}),e.jsx(Pt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ns as Assets};
|
|
800
|
+
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(i){const o=typeof window<"u"?window.location.hostname:"";return`${o.endsWith("decentraland.org")?"https://decentraland.org":o.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(i)}`}function ps({onBack:i}){Fe({title:n("seo.names.title"),description:n("seo.names.description")});const{session:o,signIn:a}=Be(),{data:h}=Ue(),l=h?Le(L,h):null,[d,x]=m.useState(""),[p,r]=m.useState("idle"),[u,g]=m.useState(!1),w=m.useRef(null),[j,k]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&k(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ze(d).ok){r(d.length===0?"idle":"invalid");return}r("checking");const _=new AbortController,R=setTimeout(()=>{(async()=>{try{const $=await en(d,{signal:_.signal});r($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;r("error")}})()},400);return()=>{clearTimeout(R),_.abort()}},[d]);const f=ze(d),b=f.ok&&(p==="available"||p==="error");function v(){if(b){if(!o){a();return}g(!0)}}const E=e.jsxs(e.Fragment,{children:[n("names.claim"),l!=null?e.jsxs(es,{children:[e.jsx(M,{}),ge(l)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Nn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:i,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:p==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Qn,{value:d,onChange:C=>x(Jt(C.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:ee,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Dn,{ref:w,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Jn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",ee]}):null,e.jsx(Oe,{onClick:v,disabled:!b,"data-testid":"names-claim",children:E})]}),p==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(S,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(S,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:v,disabled:!b,children:E}),p==="checking"?e.jsx(me,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):p==="error"?e.jsx(me,{tone:"muted",role:"status",children:n("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(me,{tone:"muted",role:"status",children:n("names.tooShort",{min:He})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:p==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(is,{children:n("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(Z,{children:[e.jsx(K,{src:Tn,alt:""}),e.jsxs(Q,{children:[e.jsx(J,{children:n("names.why1Title")}),e.jsx(X,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:_n,alt:""}),e.jsxs(Q,{children:[e.jsx(J,{children:n("names.why2Title")}),e.jsxs(X,{children:[n("names.why2")," ",e.jsx(rs,{children:n("names.why2Address")})]}),e.jsxs(Pe,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:zn,alt:""}),e.jsxs(Q,{children:[e.jsx(J,{children:n("names.why3Title")}),e.jsx(X,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(K,{src:In,alt:""}),e.jsxs(Q,{children:[e.jsx(J,{children:n("names.why4Title")}),e.jsx(X,{children:n("names.why4")}),e.jsxs(Pe,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(S,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(En,{name:d,priceCredits:l,onClose:()=>g(!1)}):null]})}const hs="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",ue=48;function Ns(){const[i]=Je(),o=We(),a=(i.get("q")??"").trim().toLowerCase(),h=(i.get("q")??"").trim();Fe({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,d]=m.useState("wearable"),[x,p]=m.useState(null),[r,u]=m.useState([]),[g,w]=m.useState(""),[j,k]=m.useState(""),[f,b]=m.useState("on_sale"),[v,E]=m.useState(!1),[C,_]=m.useState("newest"),[R,$]=m.useState(!1);m.useEffect(()=>{if(!R)return;const c=W=>{W.key==="Escape"&&$(!1)};document.addEventListener("keydown",c);const T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=T}},[R]);const z=f==="on_sale",I=g&&!Number.isNaN(Number(g))?Number(g):void 0,A=j&&!Number.isNaN(Number(j))?Number(j):void 0,te=ht(),y=x?Mt[x]:void 0,U=(_e.find(c=>c.key===C)??_e[0]).server,H={category:l,rarities:r.length?r:void 0,wearableCategories:y,minPriceCredits:I,maxPriceCredits:A,search:a||void 0,sortBy:U,isSmart:v||void 0,onSale:!0,listingType:te?void 0:"primary"},we={category:l,rarities:r.length?r:void 0,wearableCategories:y,search:a||void 0,sortBy:U,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:O,total:je,isLoading:N,isPlaceholderData:P,error:ve,hasNextPage:Ge,isFetchingNextPage:$e,isFetchNextPageError:De,fetchNextPage:qe}=Wt(z?["shop-items",H]:["catalog-items",we],c=>z?lt({...H,first:ue,skip:c}):ct({...we,first:ue,skip:c}),{enabled:l!=="names"}),G=je,Ce=N||P,Ve=N?15:Math.min(Math.max(O.length,1),ue),{data:ke,isError:Ze}=Ue(),Ke=c=>ke&&c.manaWei?Le(c.manaWei,ke):null,Se=m.useRef(null);m.useEffect(()=>{N||P||!a||Se.current===a||(Se.current=a,Y("Shop Searched",{query:a,result_count:G}))},[a,N,P,G]);const D=m.useRef("__init__");m.useEffect(()=>{if(N||P)return;const c=JSON.stringify({category:l,subCategory:x,rarities:r,min:I,max:A,sort:C,status:f,smart:v});if(D.current==="__init__"||D.current===c){D.current=c;return}D.current=c,Y("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:r,min_price_credits:I??null,max_price_credits:A??null,status:f,smart:v,sort:C},result_count:G})},[l,x,r,I,A,C,f,v,N,P,G]);function Ee(c){d(c),p(null)}function Re(c){u(T=>T.includes(c)?T.filter(W=>W!==c):[...T,c])}function Qe(){d("wearable"),p(null),u([]),w(""),k(""),b("on_sale"),E(!1)}const B=[];(I!=null||A!=null)&&B.push({key:"price",label:n("filter.price"),onRemove:()=>{w(""),k("")}});for(const c of At)r.includes(c)&&B.push({key:`rarity-${c}`,label:at(c),onRemove:()=>Re(c)});return v&&B.push({key:"smart",label:n("filter.smart"),onRemove:()=>E(!1)}),f!=="on_sale"&&B.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ft,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(mt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(ut,{"data-open":R||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(gt,{children:[e.jsx(bt,{children:n("assets.filters")}),e.jsx(yt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(wt,{children:e.jsx(jt,{category:l,subCategory:x,onCategory:Ee,onSub:p,priceMin:g,priceMax:j,onPriceMin:w,onPriceMax:k,rarities:r,onToggleRarity:Re,status:f,onStatus:b,smart:v,onSmart:E})}),e.jsx(vt,{children:e.jsx($t,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(Ct,{children:l==="names"?e.jsx(ps,{onBack:()=>Ee("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{sort:C,onSort:_,total:je,loading:N||P,query:a,onOpenFilters:()=>$(!0),chips:B,onClearChips:Qe}),Ze&&z&&O.some(c=>c.source==="legacy")?e.jsx(kt,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ve?e.jsx(Bt,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ce&&O.length===0&&!ve?e.jsxs(St,{"data-testid":"browse-empty",children:[e.jsx(Et,{src:hs,alt:""}),e.jsxs(Rt,{children:[e.jsx(Tt,{children:n("assets.empty.title")}),e.jsx(_t,{children:h?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:h}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(zt,{children:e.jsx(It,{type:"button",onClick:()=>o("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:Ce?e.jsx(Te,{count:Ve}):e.jsxs(e.Fragment,{children:[O.map(c=>{if(!z)return e.jsx(q,{item:c,mode:"view"},V(c));const T=c;if(T.source!=="legacy")return e.jsx(q,{item:c},V(c));const W=Ke(T);return W==null?e.jsx(q,{item:c,mode:"view"},V(c)):e.jsx(q,{item:{...T,priceCredits:W}},V(c))}),$e?e.jsx(Te,{count:6}):null]})}),e.jsx(Pt,{hasNextPage:Ge,isFetching:$e,isError:De,onLoadMore:()=>void qe()})]})]})})]})}export{Ns as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-
|
|
1
|
+
import{r as $,j as t}from"./react-DehiWSvs.js";import{R as C,C as oe,a as ie,b as ne}from"./categories-3pKh51AH.js";import{n as c,T as se}from"./Tooltip-D3wp0OFx.js";import{t as e,s as o,I as g,b as s,ac as ae,C as v}from"./index-UGlpWu7U.js";const re=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,
|
|
1
|
+
import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,m as R,n as F,b as e,l as G,o as O,I as z,q as B,u as w,v as K,c as Q,w as H,x as A,y as X,z as Z,A as T}from"./index-UGlpWu7U.js";import{c as J,d as U,b as V,e as Y,s as tt,a as it}from"./authorizations-Bx-uumVM.js";import{f as et}from"./builder-Czq1-krd.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-Cg4Fnsf8.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CbxpNfVY.js";const nt=R`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
|
-
`,st=
|
|
3
|
+
`,st=R`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
5
5
|
`,rt=n.section`
|
|
6
6
|
width: 100%;
|
|
@@ -183,4 +183,4 @@ import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as
|
|
|
183
183
|
margin: 6px 0 0;
|
|
184
184
|
`,M=n(W)`
|
|
185
185
|
margin-top: 12px;
|
|
186
|
-
`;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=P.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const
|
|
186
|
+
`;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=P.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const D=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:D}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,q=10,wt=f*q;async function N(t,s){const r=await T(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),q),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>T(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=H(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){F({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=G(),r=Q.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/items",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(E,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(E,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
|