@dcl/shop 0.7.0 → 0.7.1
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-Bfm7kRfv.js → Activity-Cnn-lMD9.js} +3 -3
- package/_assets/{AnimatedBackground-C-bhqVsp.js → AnimatedBackground-D9QjeeBa.js} +1 -1
- package/_assets/{Assets-B55dtQQJ.js → Assets-CRJDmBDB.js} +12 -12
- package/_assets/{Assets.styles-NQkvfYq_.js → Assets.styles-BjdmDuEG.js} +1 -1
- package/_assets/{Authorizations-CiQtw5K-.js → Authorizations-C-EUi_Ea.js} +1 -1
- package/_assets/{Cart-D7wbUiTa.js → Cart-B8YOGJmI.js} +9 -9
- package/_assets/{CircularProgress-ZsDKUKD2.js → CircularProgress-Db8orehr.js} +3 -3
- package/_assets/{Collection-DwFpgZbC.js → Collection-C2FumsGf.js} +6 -6
- package/_assets/{CollectionCarousel-DENDQYmz.js → CollectionCarousel-DL857EZk.js} +6 -6
- package/_assets/Creator-WSL6qgqX.js +306 -0
- package/_assets/{ErrorNotice-BEc3g8r8.js → ErrorNotice-MWF7JXST.js} +1 -1
- package/_assets/{ExchangeController-BCP2fWjj.js → ExchangeController-D0BUEGgM.js} +1 -1
- package/_assets/{GetCredits-Vnk46xfQ.js → GetCredits-VgVSObKH.js} +56 -40
- package/_assets/{Grow-DuBI26R-.js → Grow-DaJKbNKH.js} +1 -1
- package/_assets/{HelpersUtil-ClfhYE3l.js → HelpersUtil-Des1BKsb.js} +1 -1
- package/_assets/ItemDetail-DpbhFiHl.js +3497 -0
- package/_assets/LazyEmoteControls-COW8eJUD.js +2 -0
- package/_assets/{LoadMore-CC_UzQ34.js → LoadMore-CIWThu0V.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-BokPI2D_.js → ManaPricingBanner.styles-D7yh-OMv.js} +3 -3
- package/_assets/{MyAssets-Bo37jIwn.js → MyAssets-MBEHe0qY.js} +1 -1
- package/_assets/{MyFavorites-B2TJaZUB.js → MyFavorites-Cer-5MAy.js} +1 -1
- package/_assets/{NotFound-DLx8jzvN.js → NotFound-CuiJHtW_.js} +1 -1
- package/_assets/{NotificationsBell-BtCXxoM8.js → NotificationsBell-BneUIyzO.js} +1 -1
- package/_assets/OutfitDetail-B1WI3yDq.js +334 -0
- package/_assets/{OutfitPreview-D5_qH5Ln.js → OutfitPreview-C2-ueSaA.js} +2 -2
- package/_assets/{OutfitStudio-qONuf5K7.js → OutfitStudio-DYdoL9fR.js} +7 -7
- package/_assets/{StoreSettings-vN3UO986.js → StoreSettings-DuuOxmdV.js} +9 -9
- package/_assets/{Success-f5eJlnKx.js → Success-CEH1MUQt.js} +1 -1
- package/_assets/{SwapController-B9sRrkAK.js → SwapController-CIXsGZBK.js} +1 -1
- package/_assets/{Tooltip-D1ZBIqYA.js → Tooltip-jfo7edQn.js} +1 -1
- package/_assets/{TradeService-DvFVQpxx.js → TradeService-DiOUxFwj.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-mcKRqTfP.js → W3MFrameProviderSingleton-D_hwynnp.js} +3 -3
- package/_assets/{WebCryptoP256-B7MhXWuH.js → WebCryptoP256-DFE3V2WS.js} +1 -1
- package/_assets/{authorizations-D_1liO7d.js → authorizations-CboNrOcr.js} +1 -1
- package/_assets/{basic-CqEh5duU.js → basic-DvU1J3w8.js} +1 -1
- package/_assets/{biconomy-D_Y6_R5H.js → biconomy-DTTg16ds.js} +1 -1
- package/_assets/builder-C3uRVotE.js +1 -0
- package/_assets/{buy-D5A2EHRt.js → buy-BYu3r4d1.js} +1 -1
- package/_assets/{buy-gasless-DOjyxrOK.js → buy-gasless-BpGXC11T.js} +1 -1
- package/_assets/{categories-2VrlGaC_.js → categories-B-ttqFdP.js} +1 -1
- package/_assets/{ccip-BOQWcrsE.js → ccip-B5qgpEOa.js} +1 -1
- package/_assets/{ccip-Bmb04-XK.js → ccip-Chjvzuo3.js} +1 -1
- package/_assets/{collectionPage.styles-DaKP3DX-.js → collectionPage.styles-Cqc0qEsV.js} +4 -4
- package/_assets/{controller-BQ-e2rGO.js → controller-D65h4JHM.js} +2 -2
- package/_assets/{core-CTr2fRUy.js → core-DQrWR_KU.js} +4 -4
- package/_assets/{createSvgIcon-BhCc-35g.js → createSvgIcon-CIAc53Uf.js} +3 -3
- package/_assets/{custom-DG1qkiJE.js → custom-CXFEHrtn.js} +1 -1
- package/_assets/{data-capture-Ba2U2y5O.js → data-capture-CyNw1tR6.js} +1 -1
- package/_assets/disposePreview-8oEf57G7.js +1 -0
- package/_assets/{email-Wxqgx6Lj.js → email-BSFpn-mK.js} +1 -1
- package/_assets/{embedded-wallet-DR6Si6kV.js → embedded-wallet-DUt0q64F.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-Ce_kaTO_.js → emotion-styled.browser.esm-MB_ZnWA0.js} +1 -1
- package/_assets/{engine-CT5J10tT.js → engine-CWoVWkrK.js} +1 -1
- package/_assets/{errors-BQ78iy4c.js → errors-CspB8iK7.js} +1 -1
- package/_assets/{estimate-l1-fee-BWX6n2wW.js → estimate-l1-fee-CctWCWaJ.js} +1 -1
- package/_assets/{execute-C6tBpvgs.js → execute-CqdEBDWF.js} +2 -2
- package/_assets/{features-BmPELMhg.js → features-1-FLWkh7.js} +1 -1
- package/_assets/{fetchTokenMetadata-Mg3wjHG6.js → fetchTokenMetadata-BaQpNTHG.js} +2 -2
- package/_assets/{field.styles-5z9eWAwV.js → field.styles-O-FhYRsZ.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-Blc_71v0.js → get-ecosystem-wallet-info-efBvwCgh.js} +1 -1
- package/_assets/{getBalance-mM7D97ev.js → getBalance-B6jNJqou.js} +1 -1
- package/_assets/{getNFT-zt_0lqjp.js → getNFT-BLha6TEN.js} +1 -1
- package/_assets/{getNFT-CbZgRluJ.js → getNFT-CEFWuq38.js} +1 -1
- package/_assets/{grid.styles-B1gNJ9t8.js → grid.styles-9axjWKOh.js} +1 -1
- package/_assets/{hashTypedData-BmTdbBr7.js → hashTypedData-DRoLgz93.js} +1 -1
- package/_assets/{hashTypedData-xC0RrFzF.js → hashTypedData-DU5frjBz.js} +1 -1
- package/_assets/{in-app-D6xPBmdK.js → in-app-B7r-w8-I.js} +1 -1
- package/_assets/{in-app-wallet-calls-DRD1x_CO.js → in-app-wallet-calls-DikRiAsm.js} +1 -1
- package/_assets/{index-B9ZWePj8.js → index--d9L6VlZ.js} +3 -3
- package/_assets/{index-p6LU--BY.js → index-B7llCCrg.js} +3 -3
- package/_assets/{index-Dtczzkr-.js → index-BLcuFifQ.js} +1 -1
- package/_assets/{index-Cu7cZeif.js → index-BMoopm2-.js} +1 -1
- package/_assets/{index-C1UOaaoO.js → index-BReAWJ34.js} +1 -1
- package/_assets/{index-D-lT6ZHp.js → index-BTadlrEf.js} +1 -1
- package/_assets/{index-GiJ7q8m3.js → index-BVyKLj9g.js} +1 -1
- package/_assets/{index-8jpO9R0L.js → index-BWwETmQE.js} +1 -1
- package/_assets/{index-BnRijaO7.js → index-Bfbnmm19.js} +2 -2
- package/_assets/{index-dwg60Gnv.js → index-BgabQb2i.js} +1 -1
- package/_assets/{index-pNEW50qZ.js → index-Bggu5dcK.js} +1 -1
- package/_assets/{index-CFCPlMvn.js → index-BkzAB4dC.js} +1 -1
- package/_assets/{index-CrA-gT12.js → index-BlFmY0PY.js} +2 -2
- package/_assets/{index-Cx2Xs8TS.js → index-BvC5hvQr.js} +1 -1
- package/_assets/{index-CVRID3Zs.js → index-Bw8RegM3.js} +1 -1
- package/_assets/{index-DmJ1WEe8.js → index-ByXn6qsZ.js} +1 -1
- package/_assets/{index-BQt-UtVW.js → index-C2dqHPFe.js} +1 -1
- package/_assets/{index-Cqx_iE06.js → index-C2gCqG5-.js} +1 -1
- package/_assets/{index-CakvWn8X.js → index-C5Q9tbiE.js} +2 -2
- package/_assets/{index-BG_zxl6p.js → index-C7mQXKdO.js} +1 -1
- package/_assets/{index-Ds0nhWl1.js → index-CIuQobaT.js} +1 -1
- package/_assets/{index-DzF05fXw.js → index-CKY-zq6_.js} +1 -1
- package/_assets/{index-AUd3llLa.js → index-CMFFdWaD.js} +3 -3
- package/_assets/{index-B47z7qMq.js → index-COXs6Mhj.js} +1 -1
- package/_assets/{index-Qgfkcf-Z.js → index-CSMohmqH.js} +1 -1
- package/_assets/{index-D6orrgpK.js → index-CaO4BbgL.js} +1 -1
- package/_assets/{index-CxFaiS6B.js → index-Cgl5oOLN.js} +1 -1
- package/_assets/{index-CYAsq_LJ.js → index-D4Z2JmNT.js} +1 -1
- package/_assets/{index-HfSTYCId.js → index-DDKTVZmj.js} +1 -1
- package/_assets/{index-Cpx6YfS5.js → index-DLLktYWt.js} +1 -1
- package/_assets/{index-Db5yIiwQ.js → index-DPQIOv9u.js} +1 -1
- package/_assets/{index-By7h7Ees.js → index-DR68c_Xf.js} +1 -1
- package/_assets/{index-DUxAD7Ds.js → index-DZlNnXl_.js} +2 -2
- package/_assets/{index-B3IuheKM.js → index-D_FVnuvd.js} +1 -1
- package/_assets/{index-CXdifgIh.js → index-Dcv3uBNj.js} +1 -1
- package/_assets/{index-SH2zEbyV.js → index-DkxuiR0U.js} +1 -1
- package/_assets/{index-CdIpnfG_.js → index-DrK9O1Pz.js} +1 -1
- package/_assets/index-DvGpQtXK.js +3378 -0
- package/_assets/{index-D56APiYW.js → index-Iv9CW07E.js} +1 -1
- package/_assets/{index-4odeU1-q.js → index-KGamvf3R.js} +8 -8
- package/_assets/{index-C2GswxH6.js → index-KzbPGO4w.js} +1 -1
- package/_assets/{index-DqLl5DCg.js → index-LuVJpw9c.js} +1 -1
- package/_assets/{index-CRwuFsYT.js → index-XPa69X9v.js} +1 -1
- package/_assets/{index-GeaRFVYH.js → index-Y3M9UhW1.js} +3 -3
- package/_assets/{index-xhul-9iX.js → index-Zvh0r5Lt.js} +1 -1
- package/_assets/{index-nBe_oU0G.js → index-cPbHgYyr.js} +1 -1
- package/_assets/{index-CgAxepZC.js → index-fUWjTMSy.js} +1 -1
- package/_assets/{index--2hu34yL.js → index-kngovSRn.js} +1 -1
- package/_assets/{index-Dmg93p28.js → index-rSQnRqcs.js} +1 -1
- package/_assets/{index-Bmjy2mpL.js → index-uRRgUqn2.js} +1 -1
- package/_assets/{index-MmMSnATW.js → index-xqlURRt6.js} +1 -1
- package/_assets/{index-eU7Hyz9Z.js → index-z_VEn6An.js} +1 -1
- package/_assets/{index.es-DHidcgy5.js → index.es-ClGX6azd.js} +1 -1
- package/_assets/{index.es-Cn1zNa1z.js → index.es-DEd0yiWT.js} +4 -4
- package/_assets/{index.es-GVwle0q7.js → index.es-DUY_zrrQ.js} +1 -1
- package/_assets/{localBatchGatewayRequest-VWgW7Rrx.js → localBatchGatewayRequest-DN2xsMJ_.js} +1 -1
- package/_assets/{networks-CDvdXnK2.js → networks-CDFMzeLC.js} +1 -1
- package/_assets/{onramp-DLXpeqxV.js → onramp-BW3vCZnx.js} +1 -1
- package/_assets/{openzeppelin-F7uG1PQF.js → openzeppelin-CUcdj_sx.js} +1 -1
- package/_assets/{parseNft-D-HVZytL.js → parseNft-G6_xBphx.js} +2 -2
- package/_assets/{parseSignature-Ck0-hAYX.js → parseSignature-CIXTBJVX.js} +1 -1
- package/_assets/{parseSignature-Bajk-MJ2.js → parseSignature-DRZnwzny.js} +3 -3
- package/_assets/{passkeys-DTp9eXzY.js → passkeys-Kq30ZnPW.js} +1 -1
- package/_assets/{pay-with-exchange-B7T027Na.js → pay-with-exchange-wv1lVt88.js} +1 -1
- package/_assets/{qr-overlay-D24Rmf2y.js → qr-overlay-BNvjvuvd.js} +1 -1
- package/_assets/{receive-Dpi-pR18.js → receive-BU-20CjU.js} +1 -1
- package/_assets/{resolveImplementation-zRiJR6hj.js → resolveImplementation-C-p0Txrw.js} +1 -1
- package/_assets/{rpc-DBs1enVe.js → rpc-D0gBTa6Z.js} +1 -1
- package/_assets/{secp256k1-DlBFD_9l.js → secp256k1-B3k0VS5Y.js} +1 -1
- package/_assets/{secp256k1-CFlVBTcQ.js → secp256k1-C_-lAZcz.js} +1 -1
- package/_assets/{secp256k1-D988VQxR.js → secp256k1-YCpzKzUb.js} +1 -1
- package/_assets/{send-C--S0H3a.js → send-BRaIAbAO.js} +1 -1
- package/_assets/{send-batch-transaction-BsTouWWn.js → send-batch-transaction-Bab8Fd2d.js} +1 -1
- package/_assets/{send-eip712-transaction-CVPyso6U.js → send-eip712-transaction-CKAs5XET.js} +2 -2
- package/_assets/{send-gasless-transaction-B_ncM11b.js → send-gasless-transaction-CiFZmQQQ.js} +2 -2
- package/_assets/{send-transaction-CQNEiR4D.js → send-transaction-DOvrVTQH.js} +2 -2
- package/_assets/{sendMetaTransaction-BkMNQLKq.js → sendMetaTransaction-D69U0yOu.js} +1 -1
- package/_assets/{sendRawTransaction-eF-4-IOR.js → sendRawTransaction-Cnl8KhyZ.js} +3 -3
- package/_assets/{serializeTransaction-E8IX_hjf.js → serializeTransaction--73AW1zM.js} +1 -1
- package/_assets/{session-proposal-B5Vbxh9X.js → session-proposal-DYdwdKre.js} +1 -1
- package/_assets/{session-request-YtoGiiaC.js → session-request-Dme0ul41.js} +2 -2
- package/_assets/{signing-ChPpUSja.js → signing-Bd3rbnSj.js} +3 -3
- package/_assets/{socials-OPF-4Wmw.js → socials-VohiP86p.js} +1 -1
- package/_assets/{styled-CI0T6-yj.js → styled-CvsbVgfF.js} +2 -2
- package/_assets/{swaps-D9XgTxrT.js → swaps-DKu-ROps.js} +1 -1
- package/_assets/{thirdweb-CJavbJGB.js → thirdweb-BMXspv9l.js} +3 -3
- package/_assets/{to-serializable-transaction-Capw1hGa.js → to-serializable-transaction-CX8P98IC.js} +2 -2
- package/_assets/{trade-encoding-CS-l5HWK.js → trade-encoding-BD8tpz7m.js} +1 -1
- package/_assets/{transactionReceipt-DoRy-YCC.js → transactionReceipt-C3xmpECX.js} +1 -1
- package/_assets/{transactions-DlPEEm5e.js → transactions-8lwN2rpf.js} +1 -1
- package/_assets/{useCreditPacks-_PiP2Q_K.js → useCreditPacks-B-QtC7sA.js} +1 -1
- package/_assets/{useImportable-Dur9WNgJ.js → useImportable-zF3kPKFU.js} +1 -1
- package/_assets/{useInfiniteGrid-OWa5mJdJ.js → useInfiniteGrid-Drc6luef.js} +1 -1
- package/_assets/{useTheme-DpoJyopi.js → useTheme-BXrN5D9V.js} +1 -1
- package/_assets/{verifyHash-BZZQrCdK.js → verifyHash-B5Ov596i.js} +1 -1
- package/_assets/{w3m-modal-BurrNe_2.js → w3m-modal-BfUiYkFq.js} +1 -1
- package/_assets/{w3m-modal-DVcmDyvT.js → w3m-modal-BiPLqXgA.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DABDEQLt.js → wait-for-tx-receipt-DZxMxn7p.js} +1 -1
- package/_assets/{wallets-DsQIZNUu.js → wallets-ZPwMzIt3.js} +5 -5
- package/_assets/{web-connector-CBr7K2EN.js → web-connector-Dsb7R1Dr.js} +3 -3
- package/_assets/{writeContract-Clw7zVob.js → writeContract-BLACgB36.js} +1 -1
- package/_assets/{zoraTestnet-Dofh77OY.js → zoraTestnet-BCAU7V7m.js} +1 -1
- package/index.html +22 -12
- package/package.json +2 -2
- package/sitemap.xml +7 -6
- package/_assets/Creator-CVJd5TOb.js +0 -306
- package/_assets/ItemDetail-CacEb2nn.js +0 -3392
- package/_assets/LazyEmoteControls-DOn7IxHq.js +0 -2
- package/_assets/OutfitDetail-CSx4d1E1.js +0 -334
- package/_assets/builder-dRN2Kgse.js +0 -1
- package/_assets/disposePreview-DIA1G1eQ.js +0 -1
- package/_assets/index-CpUnpBQ7.js +0 -3378
|
@@ -0,0 +1,3497 @@
|
|
|
1
|
+
var fl=Object.defineProperty;var hl=(n,a,t)=>a in n?fl(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var H=(n,a,t)=>hl(n,typeof a!="symbol"?a+"":a,t);import{r as v,a as ml,j as s,d as Ft,l as Cs,R as M,h as gl,u as xl,b as yl,L as bl}from"./react-DehiWSvs.js";import{s as m,t as d,d as g,I as V,a3 as vl,w as Pe,az as Qe,e as wt,bH as Kr,k as Nt,b6 as Ss,b7 as wl,x as Yt,be as kl,av as Ms,aw as lr,bg as ha,S as ue,bk as Xe,bj as rt,ct as Dl,A as Te,bi as Qr,bh as _s,b5 as Cl,r as Sl,c as tn,g as ma,a as Ml,C as Ps,v as _l,n as ge,F as Pl,W as Sr,ag as Mr,y as Ma,b4 as Jt,p as Is,z as On,bq as js,cu as Il,B as Rn,af as ln,au as Vr,K as Es,bP as go,bQ as jl,i as Ts,cv as El,o as Tl,Q as En,cw as $l,cx as Nl,cy as Ol,aa as Rl,cz as Al,cA as Ll,ai as $s,cB as Ns,cC as Fl,cD as Yl,b as Os,cE as Wl,cF as Bl,cG as Hl,cH as zl,ay as ql,cI as Kl,ah as Ql,l as Vl,m as Ul,cJ as Xl,cK as Gl,cL as Jl,a4 as Zl,a5 as ed,as as td,q as nd,a6 as rd,a7 as ad,a8 as od,cM as xo,bp as id,cN as sd,cO as cd,cP as ld,cQ as dd,cR as ud,cS as pd,cT as fd,cU as hd}from"./index-DvGpQtXK.js";import{d as Re}from"./dcl-schemas-Dr9BTjb7.js";import{$ as Ur,m as md,K as gd,V as xd,Q as Rs,R as yd,M as bd,S as vd,C as wd,H as kd,a as Dd,T as Cd,X as Sd,b as Md,B as _d,c as Pd,d as Id,e as jd,f as Kt,j as Vn,k as Qt,W as Ed,p as Td,q as $d,P as Nd,x as Od,y as Rd,z as Ad,D as Ld,E as Fd,F as Yd,G as Wd,I as Bd,J as Hd,L as zd,l as qd,n as Kd,o as Qd,a0 as Vd,a1 as Ud,A as Xd,r as Gd,s as Jd,t as Zd,u as eu,v as tu,w as nu,a2 as ru,a3 as au,a4 as ou,N as iu,O as yo,U as su}from"./CollectionCarousel-DL857EZk.js";import{a as dr,t as cu,c as lu}from"./buy-BYu3r4d1.js";import{b as du,a as uu}from"./builder-C3uRVotE.js";import{u as pu,M as fu,l as hu,c as mu}from"./useCreditPacks-B-QtC7sA.js";import{m as bo}from"./mana-matic-C4e1sNO3.js";import{j as As,a as Ls,n as gu,k as xu,b as vo,g as Fs,M as yu,e as bu,r as vu,m as wu,c as ku}from"./authorizations-CboNrOcr.js";import{a as Ys,w as Ws,S as Bs,G as Hs}from"./buy-gasless-BpGXC11T.js";import{R as wo}from"./resume-buy-Bf0zIH7y.js";import{a as Du,f as bt,i as nn}from"./errors-CspB8iK7.js";import{E as dt}from"./ErrorNotice-MWF7JXST.js";import{C as Cu}from"./CircularProgress-Db8orehr.js";import{f as Su,h as Mu,i as _u,e as Pu,d as Iu,a as ju}from"./trade-encoding-BD8tpz7m.js";import{M as Eu,E as Tu,s as $u}from"./sendMetaTransaction-D69U0yOu.js";import{C as Nu,I as Ou}from"./ethers-CtNGBird.js";import{E as Ru}from"./LazyEmoteControls-COW8eJUD.js";import{u as Au,d as Lu}from"./disposePreview-8oEf57G7.js";import{T as ko}from"./Tooltip-jfo7edQn.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./clsx-WwvpwSg0.js";import"./styled-CvsbVgfF.js";const rn=Math.min,jt=Math.max,ur=Math.round,Un=Math.floor,ot=n=>({x:n,y:n}),Fu={left:"right",right:"left",bottom:"top",top:"bottom"};function Yu(n,a,t){return jt(n,rn(a,t))}function _r(n,a){return typeof n=="function"?n(a):n}function an(n){return n.split("-")[0]}function An(n){return n.split("-")[1]}function Wu(n){return n==="x"?"y":"x"}function _a(n){return n==="y"?"height":"width"}function Pt(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Pa(n){return Wu(Pt(n))}function Bu(n,a,t){t===void 0&&(t=!1);const e=An(n),r=Pa(n),o=_a(r);let i=r==="x"?e===(t?"end":"start")?"right":"left":e==="start"?"bottom":"top";return a.reference[o]>a.floating[o]&&(i=pr(i)),[i,pr(i)]}function Hu(n){const a=pr(n);return[ga(n),a,ga(a)]}function ga(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Do=["left","right"],Co=["right","left"],zu=["top","bottom"],qu=["bottom","top"];function Ku(n,a,t){switch(n){case"top":case"bottom":return t?a?Co:Do:a?Do:Co;case"left":case"right":return a?zu:qu;default:return[]}}function Qu(n,a,t,e){const r=An(n);let o=Ku(an(n),t==="start",e);return r&&(o=o.map(i=>i+"-"+r),a&&(o=o.concat(o.map(ga)))),o}function pr(n){const a=an(n);return Fu[a]+n.slice(a.length)}function Vu(n){var a,t,e,r;return{top:(a=n.top)!=null?a:0,right:(t=n.right)!=null?t:0,bottom:(e=n.bottom)!=null?e:0,left:(r=n.left)!=null?r:0}}function zs(n){return typeof n!="number"?Vu(n):{top:n,right:n,bottom:n,left:n}}function fr(n){const{x:a,y:t,width:e,height:r}=n;return{width:e,height:r,top:t,left:a,right:a+e,bottom:t+r,x:a,y:t}}function So(n,a,t){let{reference:e,floating:r}=n;const o=Pt(a),i=Pa(a),c=_a(i),l=an(a),p=o==="y",u=e.x+e.width/2-r.width/2,h=e.y+e.height/2-r.height/2,x=e[c]/2-r[c]/2;let b;switch(l){case"top":b={x:u,y:e.y-r.height};break;case"bottom":b={x:u,y:e.y+e.height};break;case"right":b={x:e.x+e.width,y:h};break;case"left":b={x:e.x-r.width,y:h};break;default:b={x:e.x,y:e.y}}const y=An(a);return y&&(b[i]+=x*(y==="end"?1:-1)*(t&&p?-1:1)),b}async function Uu(n,a){var t;a===void 0&&(a={});const{x:e,y:r,platform:o,rects:i,elements:c,strategy:l}=n,{boundary:p="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:x=!1,padding:b=0}=_r(a,n),y=zs(b),k=c[x?h==="floating"?"reference":"floating":h],f=fr(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(k)))==null||t?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:p,rootBoundary:u,strategy:l})),C=h==="floating"?{x:e,y:r,width:i.floating.width,height:i.floating.height}:i.reference,$=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),E=await(o.isElement==null?void 0:o.isElement($))&&await(o.getScale==null?void 0:o.getScale($))||{x:1,y:1},A=fr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:$,strategy:l}):C);return{top:(f.top-A.top+y.top)/E.y,bottom:(A.bottom-f.bottom+y.bottom)/E.y,left:(f.left-A.left+y.left)/E.x,right:(A.right-f.right+y.right)/E.x}}const Xu=50,Gu=async(n,a,t)=>{const{placement:e="bottom",strategy:r="absolute",middleware:o=[],platform:i}=t,c=i.detectOverflow?i:{...i,detectOverflow:Uu},l=await(i.isRTL==null?void 0:i.isRTL(a));let p=await i.getElementRects({reference:n,floating:a,strategy:r}),{x:u,y:h}=So(p,e,l),x=e,b=0;const y={};for(let w=0;w<o.length;w++){const k=o[w];if(!k)continue;const{name:f,fn:C}=k,{x:$,y:E,data:A,reset:N}=await C({x:u,y:h,initialPlacement:e,placement:x,strategy:r,middlewareData:y,rects:p,platform:c,elements:{reference:n,floating:a}});u=$??u,h=E??h,y[f]={...y[f],...A},N&&b<Xu&&(b++,typeof N=="object"&&(N.placement&&(x=N.placement),N.rects&&(p=N.rects===!0?await i.getElementRects({reference:n,floating:a,strategy:r}):N.rects),{x:u,y:h}=So(p,x,l)),w=-1)}return{x:u,y:h,placement:x,strategy:r,middlewareData:y}},Ju=n=>({name:"arrow",options:n,async fn(a){const{x:t,y:e,placement:r,rects:o,platform:i,elements:c,middlewareData:l}=a,{element:p,padding:u=0}=_r(n,a)||{};if(p==null)return{};const h=zs(u),x={x:t,y:e},b=Pa(r),y=_a(b),w=await i.getDimensions(p),k=b==="y",f=k?"top":"left",C=k?"bottom":"right",$=k?"clientHeight":"clientWidth",E=o.reference[y]+o.reference[b]-x[b]-o.floating[y],A=x[b]-o.reference[b],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(p));let S=N?N[$]:0;(!S||!await(i.isElement==null?void 0:i.isElement(N)))&&(S=c.floating[$]||o.floating[y]);const D=E/2-A/2,P=S/2-w[y]/2-1,I=rn(h[f],P),O=rn(h[C],P),T=S-w[y]-O,W=S/2-w[y]/2+D,z=Yu(I,W,T),U=!l.arrow&&An(r)!=null&&W!==z&&o.reference[y]/2-(W<I?I:O)-w[y]/2<0,Y=U?W<I?W-I:W-T:0;return{[b]:x[b]+Y,data:{[b]:z,centerOffset:W-z-Y,...U&&{alignmentOffset:Y}},reset:U}}}),Zu=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var t,e;const{placement:r,middlewareData:o,rects:i,initialPlacement:c,platform:l,elements:p}=a,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...k}=_r(n,a);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const f=an(r),C=Pt(c),$=an(c)===c,E=await(l.isRTL==null?void 0:l.isRTL(p.floating)),A=x||($||!w?[pr(c)]:Hu(c)),N=y!=="none";!x&&N&&A.push(...Qu(c,w,y,E));const S=[c,...A],D=await l.detectOverflow(a,k),P=[];let I=((e=o.flip)==null?void 0:e.overflows)||[];if(u&&P.push(D[f]),h){const z=Bu(r,i,E);P.push(D[z[0]],D[z[1]])}if(I=[...I,{placement:r,overflows:P}],!P.every(z=>z<=0)){var O,T;const z=(((O=o.flip)==null?void 0:O.index)||0)+1,U=S[z];if(U&&(!(h==="alignment"?C!==Pt(U):!1)||I.every(_=>Pt(_.placement)===C?_.overflows[0]>0:!0)))return{data:{index:z,overflows:I},reset:{placement:U}};let Y=(T=I.filter(q=>q.overflows[0]<=0).sort((q,_)=>q.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!Y)switch(b){case"bestFit":{var W;const q=(W=I.filter(_=>{if(N){const J=Pt(_.placement);return J===C||J==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(J=>J>0).reduce((J,me)=>J+me,0)]).sort((_,J)=>_[1]-J[1])[0])==null?void 0:W[0];q&&(Y=q);break}case"initialPlacement":Y=c;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}},ep=new Set(["left","top"]);async function tp(n,a){const{placement:t,platform:e,elements:r}=n,o=await(e.isRTL==null?void 0:e.isRTL(r.floating)),i=an(t),c=An(t),l=Pt(t)==="y",p=ep.has(i)?-1:1,u=o&&l?-1:1,h=_r(a,n);let{mainAxis:x,crossAxis:b,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof y=="number"&&(b=c==="end"?y*-1:y),l?{x:b*u,y:x*p}:{x:x*p,y:b*u}}const np=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var t,e;const{x:r,y:o,placement:i,middlewareData:c}=a,l=await tp(a,n);return i===((t=c.offset)==null?void 0:t.placement)&&(e=c.arrow)!=null&&e.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:i}}}}};function Pr(){return typeof window<"u"}function dn(n){return qs(n)?(n.nodeName||"").toLowerCase():"#document"}function Ie(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function ft(n){var a;return(a=(qs(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function qs(n){return Pr()?n instanceof Node||n instanceof Ie(n).Node:!1}function _e(n){return Pr()?n instanceof Element||n instanceof Ie(n).Element:!1}function Ct(n){return Pr()?n instanceof HTMLElement||n instanceof Ie(n).HTMLElement:!1}function Mo(n){return!Pr()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ie(n).ShadowRoot}function Ir(n){const{overflow:a,overflowX:t,overflowY:e,display:r}=Le(n);return/auto|scroll|overlay|hidden|clip/.test(a+e+t)&&r!=="inline"&&r!=="contents"}function rp(n){return/^(table|td|th)$/.test(dn(n))}function jr(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const ap=/transform|translate|scale|rotate|perspective|filter/,op=/paint|layout|strict|content/,Mt=n=>!!n&&n!=="none";let Xr;function Ia(n){const a=_e(n)?Le(n):n;return Mt(a.transform)||Mt(a.translate)||Mt(a.scale)||Mt(a.rotate)||Mt(a.perspective)||!ja()&&(Mt(a.backdropFilter)||Mt(a.filter))||ap.test(a.willChange||"")||op.test(a.contain||"")}function ip(n){let a=Ot(n);for(;Ct(a)&&!Tn(a);){if(Ia(a))return a;if(jr(a))return null;a=Ot(a)}return null}function ja(){return Xr==null&&(Xr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xr}function Tn(n){return/^(html|body|#document)$/.test(dn(n))}function Le(n){return Ie(n).getComputedStyle(n)}function Er(n){return _e(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ot(n){if(dn(n)==="html")return n;const a=n.assignedSlot||n.parentNode||Mo(n)&&n.host||ft(n);return Mo(a)?a.host:a}function Ks(n){const a=Ot(n);return Tn(a)?(n.ownerDocument||n).body:Ct(a)&&Ir(a)?a:Ks(a)}function $n(n,a,t){var e;a===void 0&&(a=[]),t===void 0&&(t=!0);const r=Ks(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=Ie(r);if(o){const c=xa(i);return a.concat(i,i.visualViewport||[],Ir(r)?r:[],c&&t?$n(c):[])}else return a.concat(r,$n(r,[],t))}function xa(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Qs(n){const a=Le(n);let t=parseFloat(a.width)||0,e=parseFloat(a.height)||0;const r=Ct(n),o=r?n.offsetWidth:t,i=r?n.offsetHeight:e,c=ur(t)!==o||ur(e)!==i;return c&&(t=o,e=i),{width:t,height:e,$:c}}function Ea(n){return _e(n)?n:n.contextElement}function Zt(n){const a=Ea(n);if(!Ct(a))return ot(1);const t=a.getBoundingClientRect(),{width:e,height:r,$:o}=Qs(a);let i=(o?ur(t.width):t.width)/e,c=(o?ur(t.height):t.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const sp=ot(0);function Vs(n){const a=Ie(n);return!ja()||!a.visualViewport?sp:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function cp(n,a,t){return a===void 0&&(a=!1),!!t&&a&&t===Ie(n)}function Rt(n,a,t,e){a===void 0&&(a=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=Ea(n);let i=ot(1);a&&(e?_e(e)&&(i=Zt(e)):i=Zt(n));const c=cp(o,t,e)?Vs(o):ot(0);let l=(r.left+c.x)/i.x,p=(r.top+c.y)/i.y,u=r.width/i.x,h=r.height/i.y;if(o&&e){const x=Ie(o),b=_e(e)?Ie(e):e;let y=x,w=xa(y);for(;w&&b!==y;){const k=Zt(w),f=w.getBoundingClientRect(),C=Le(w),$=f.left+(w.clientLeft+parseFloat(C.paddingLeft))*k.x,E=f.top+(w.clientTop+parseFloat(C.paddingTop))*k.y;l*=k.x,p*=k.y,u*=k.x,h*=k.y,l+=$,p+=E,y=Ie(w),w=xa(y)}}return fr({width:u,height:h,x:l,y:p})}function Tr(n,a){const t=Er(n).scrollLeft;return a?a.left+t:Rt(ft(n)).left+t}function Us(n,a){const t=n.getBoundingClientRect(),e=t.left+a.scrollLeft-Tr(n,t),r=t.top+a.scrollTop;return{x:e,y:r}}function lp(n){let{elements:a,rect:t,offsetParent:e,strategy:r}=n;const o=r==="fixed",i=ft(e),c=a?jr(a.floating):!1;if(e===i||c&&o)return t;let l={scrollLeft:0,scrollTop:0},p=ot(1);const u=ot(0),h=Ct(e);if((h||!o)&&((dn(e)!=="body"||Ir(i))&&(l=Er(e)),h)){const b=Rt(e);p=Zt(e),u.x=b.x+e.clientLeft,u.y=b.y+e.clientTop}const x=i&&!h&&!o?Us(i,l):ot(0);return{width:t.width*p.x,height:t.height*p.y,x:t.x*p.x-l.scrollLeft*p.x+u.x+x.x,y:t.y*p.y-l.scrollTop*p.y+u.y+x.y}}function dp(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function up(n){const a=Er(n),t=n.ownerDocument.body,e=jt(n.scrollWidth,n.clientWidth,t.scrollWidth,t.clientWidth),r=jt(n.scrollHeight,n.clientHeight,t.scrollHeight,t.clientHeight);let o=-a.scrollLeft+Tr(n);const i=-a.scrollTop;return Le(t).direction==="rtl"&&(o+=jt(n.clientWidth,t.clientWidth)-e),{width:e,height:r,x:o,y:i}}const pp=25;function fp(n,a,t){t===void 0&&(t="viewport");const e=t==="layoutViewport",r=Ie(n),o=ft(n),i=r.visualViewport;let c=o.clientWidth,l=o.clientHeight,p=0,u=0;if(i){const x=!ja()||a==="fixed";e?x||(p=-i.offsetLeft,u=-i.offsetTop):(c=i.width,l=i.height,x&&(p=i.offsetLeft,u=i.offsetTop))}if(Tr(o)<=0){const x=o.ownerDocument,b=x.body,y=getComputedStyle(b),w=x.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(o.clientWidth-b.clientWidth-w),f=getComputedStyle(o).scrollbarGutter==="stable both-edges"?k/2:k;f<=pp&&(c-=f)}return{width:c,height:l,x:p,y:u}}function hp(n,a){const t=Rt(n,!0,a==="fixed"),e=t.top+n.clientTop,r=t.left+n.clientLeft,o=Zt(n),i=n.clientWidth*o.x,c=n.clientHeight*o.y,l=r*o.x,p=e*o.y;return{width:i,height:c,x:l,y:p}}function _o(n,a,t){let e;if(a==="viewport"||a==="layoutViewport")e=fp(n,t,a);else if(a==="document")e=up(ft(n));else if(_e(a))e=hp(a,t);else{const r=Vs(n);e={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}return fr(e)}function mp(n,a){const t=a.get(n);if(t)return t;let e=$n(n,[],!1).filter(c=>_e(c)&&dn(c)!=="body"),r=null;const o=Le(n).position==="fixed";let i=o?Ot(n):n;for(;_e(i)&&!Tn(i);){const c=Le(i),l=Ia(i),p=r?r.position:o?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&c.position==="static")?e=e.filter(h=>h!==i):r=c,i=Ot(i)}return a.set(n,e),e}function gp(n){let{element:a,boundary:t,rootBoundary:e,strategy:r}=n;const i=[...t==="clippingAncestors"?jr(a)?[]:mp(a,this._c):[].concat(t),e],c=_o(a,i[0],r);let l=c.top,p=c.right,u=c.bottom,h=c.left;for(let x=1;x<i.length;x++){const b=_o(a,i[x],r);l=jt(b.top,l),p=rn(b.right,p),u=rn(b.bottom,u),h=jt(b.left,h)}return{width:p-h,height:u-l,x:h,y:l}}function xp(n){const{width:a,height:t}=Qs(n);return{width:a,height:t}}function yp(n,a,t){const e=Ct(a),r=ft(a),o=t==="fixed",i=Rt(n,!0,o,a);let c={scrollLeft:0,scrollTop:0};const l=ot(0);if((e||!o)&&((dn(a)!=="body"||Ir(r))&&(c=Er(a)),e)){const x=Rt(a,!0,o,a);l.x=x.x+a.clientLeft,l.y=x.y+a.clientTop}!e&&r&&(l.x=Tr(r));const p=r&&!e&&!o?Us(r,c):ot(0),u=i.left+c.scrollLeft-l.x-p.x,h=i.top+c.scrollTop-l.y-p.y;return{x:u,y:h,width:i.width,height:i.height}}function Gr(n){return Le(n).position==="static"}function Po(n,a){if(!Ct(n)||Le(n).position==="fixed")return null;if(a)return a(n);let t=n.offsetParent;return ft(n)===t&&(t=t.ownerDocument.body),t}function Xs(n,a){const t=Ie(n);if(jr(n))return t;if(!Ct(n)){let r=Ot(n);for(;r&&!Tn(r);){if(_e(r)&&!Gr(r))return r;r=Ot(r)}return t}let e=Po(n,a);for(;e&&rp(e)&&Gr(e);)e=Po(e,a);return e&&Tn(e)&&Gr(e)&&!Ia(e)?t:e||ip(n)||t}const bp=async function(n){const a=this.getOffsetParent||Xs,t=this.getDimensions,e=await t(n.floating);return{reference:yp(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:e.width,height:e.height}}};function vp(n){return Le(n).direction==="rtl"}const wp={convertOffsetParentRelativeRectToViewportRelativeRect:lp,getDocumentElement:ft,getClippingRect:gp,getOffsetParent:Xs,getElementRects:bp,getClientRects:dp,getDimensions:xp,getScale:Zt,isElement:_e,isRTL:vp};function Gs(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function kp(n,a,t){let e=null,r;const o=ft(n);function i(){var u;clearTimeout(r),(u=e)==null||u.disconnect(),e=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),i();const x=n.getBoundingClientRect(),{left:b,top:y,width:w,height:k}=x;if(u||a(),!w||!k)return;const f=Un(y),C=Un(o.clientWidth-(b+w)),$=Un(o.clientHeight-(y+k)),E=Un(b),N={rootMargin:-f+"px "+-C+"px "+-$+"px "+-E+"px",threshold:jt(0,rn(1,h))||1};let S=!0;function D(P){const I=P[0].intersectionRatio;if(!Gs(x,n.getBoundingClientRect()))return c();if(I!==h){if(!S)return c();I?c(!1,I):r=setTimeout(()=>{c(!1,1e-7)},1e3)}S=!1}try{e=new IntersectionObserver(D,{...N,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,N)}e.observe(n)}const l=Ie(n),p=()=>c(t);return l.addEventListener("resize",p),c(!0),()=>{l.removeEventListener("resize",p),i()}}function Dp(n,a,t,e){e===void 0&&(e={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=e,p=Ea(n),u=r||o?[...p?$n(p):[],...a?$n(a):[]]:[];u.forEach(f=>{r&&f.addEventListener("scroll",t),o&&f.addEventListener("resize",t)});const h=p&&c?kp(p,t,o):null;let x=-1,b=null;i&&(b=new ResizeObserver(f=>{let[C]=f;C&&C.target===p&&b&&a&&(b.unobserve(a),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var $;($=b)==null||$.observe(a)})),t()}),p&&!l&&b.observe(p),a&&b.observe(a));let y,w=l?Rt(n):null;l&&k();function k(){const f=Rt(n);w&&!Gs(w,f)&&t(),w=f,y=requestAnimationFrame(k)}return t(),()=>{var f;u.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h==null||h(),(f=b)==null||f.disconnect(),b=null,l&&cancelAnimationFrame(y)}}const Cp=np,Sp=Zu,Io=Ju,Mp=(n,a,t)=>{const e=new Map,r=t??{},o={...wp,...r.platform,_c:e};return Gu(n,a,{...r,platform:o})};var _p=typeof document<"u",Pp=function(){},rr=_p?v.useLayoutEffect:Pp;function hr(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let t,e,r;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==a.length)return!1;for(e=t;e--!==0;)if(!hr(n[e],a[e]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(a).length)return!1;for(e=t;e--!==0;)if(!{}.hasOwnProperty.call(a,r[e]))return!1;for(e=t;e--!==0;){const o=r[e];if(!(o==="_owner"&&n.$$typeof)&&!hr(n[o],a[o]))return!1}return!0}return n!==n&&a!==a}function Js(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function jo(n,a){const t=Js(n);return Math.round(a*t)/t}function Jr(n){const a=v.useRef(n);return rr(()=>{a.current=n}),a}function Ip(n){n===void 0&&(n={});const{placement:a="bottom",strategy:t="absolute",middleware:e=[],platform:r,elements:{reference:o,floating:i}={},transform:c=!0,whileElementsMounted:l,open:p}=n,[u,h]=v.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:!1}),[x,b]=v.useState(e);hr(x,e)||b(e);const[y,w]=v.useState(null),[k,f]=v.useState(null),C=v.useCallback(_=>{_!==N.current&&(N.current=_,w(_))},[]),$=v.useCallback(_=>{_!==S.current&&(S.current=_,f(_))},[]),E=o||y,A=i||k,N=v.useRef(null),S=v.useRef(null),D=v.useRef(u),P=l!=null,I=Jr(l),O=Jr(r),T=Jr(p),W=v.useCallback(()=>{if(!N.current||!S.current)return;const _={placement:a,strategy:t,middleware:x};O.current&&(_.platform=O.current),Mp(N.current,S.current,_).then(J=>{const me={...J,isPositioned:T.current!==!1};z.current&&!hr(D.current,me)&&(D.current=me,ml.flushSync(()=>{h(me)}))})},[x,a,t,O,T]);rr(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[p]);const z=v.useRef(!1);rr(()=>(z.current=!0,()=>{z.current=!1}),[]),rr(()=>{if(E&&(N.current=E),A&&(S.current=A),E&&A){if(I.current)return I.current(E,A,W);W()}},[E,A,W,I,P]);const U=v.useMemo(()=>({reference:N,floating:S,setReference:C,setFloating:$}),[C,$]),Y=v.useMemo(()=>({reference:E,floating:A}),[E,A]),q=v.useMemo(()=>{const _={position:t,left:0,top:0};if(!Y.floating)return _;const J=jo(Y.floating,u.x),me=jo(Y.floating,u.y);return c?{..._,transform:"translate("+J+"px, "+me+"px)",...Js(Y.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:J,top:me}},[t,c,Y.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:W,refs:U,elements:Y,floatingStyles:q}),[u,W,U,Y,q])}const jp=n=>{function a(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:e,padding:r}=typeof n=="function"?n(t):n;return e&&a(e)?e.current!=null?Io({element:e.current,padding:r}).fn(t):{}:e?Io({element:e,padding:r}).fn(t):{}}}},Ep=(n,a)=>{const t=Cp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Tp=(n,a)=>{const t=Sp(n);return{name:t.name,fn:t.fn,options:[n,a]}},$p=(n,a)=>{const t=jp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Zs=216n,Np=(1n<<Zs)-1n;function Op(n){const a=typeof n=="bigint"?n:BigInt(n.trim());if(a<0n)throw new Error(`Invalid tokenId: ${String(n)}`);return{itemId:(a>>Zs).toString(),issuedId:(a&Np).toString()}}function Rp(n){if(!n)return null;try{return Op(n).itemId}catch{return null}}const ec=["cancelled-listings"];function Ap(n,a){a&&n.setQueryData(ec,t=>t!=null&&t.includes(a)?t:[...t??[],a])}function Eo(n,a){var t;if(a)return(t=n.getQueryData(ec))!=null&&t.includes(a)?void 0:a}function To(n,a){return a.kind==="listed"?{...n,isOnSale:!0,listingPrice:a.priceCredits,tradeId:a.tradeId??n.tradeId}:{...n,isOnSale:!1,listingPrice:void 0,tradeId:void 0}}function Zr(n,a,t){const{address:e,contractAddress:r,tokenId:o}=a;if(!r||!o)return;const i=`${r}-${o}`;n.cancelQueries({queryKey:["owned-token",r,o]}),n.cancelQueries({queryKey:["secondary-sale-state"]}),e&&n.cancelQueries({queryKey:["my-assets",e]});const c=t.kind==="gone";n.setQueriesData({queryKey:["owned-token",r,o]},p=>p&&(c?null:To(p,t)));const l=e?["my-assets",e]:["my-assets"];n.setQueriesData({queryKey:l},p=>p!=null&&p.pages?{...p,pages:p.pages.map(u=>{if(c){const h=u.items.filter(x=>!(x.contractAddress===r&&x.tokenId===o));return{...u,items:h,total:Math.max(0,u.total-(u.items.length-h.length))}}return{...u,items:u.items.map(h=>h.contractAddress===r&&h.tokenId===o?To(h,t):h)}})}:p),n.setQueriesData({queryKey:["secondary-sale-state"]},p=>{var h;if(!p)return p;const u={...p};return t.kind==="removed"||t.kind==="gone"?delete u[i]:u[i]={priceCredits:t.priceCredits,tradeId:t.tradeId??((h=u[i])==null?void 0:h.tradeId)??""},u})}function Lp(n){return!(n.isMarket||n.forSale&&n.priceKnown||n.manage||n.soldOutWithResale||!n.stillResolving&&!n.resolvingTrade&&(n.isTokenRoute?!n.ownedAssetLoading:!n.deepLinkLoading))}const Fp="data:image/webp;base64,UklGRqgOAABXRUJQVlA4IJwOAACwOwCdASqEAIsAPj0YikMiIaEWuib4IAPEtQBl0QC/bukK7J6X8cPZP5F69/Nvhj8oPlD3odY/QB8RXPv/C+3n59+izzA/0l/3/9064PmD/bH9Zvey/33r8/2PqC/zH/fdaX6EX7O+nP+3Xwlfub+33tOf/+7N8wTMuJT/znss7V9qD/DcDplr/deudN0/Rcajjp49/Q//7vLR70+4X+tP/R9az//+3r9z/Yk/ZVVfCa+jj+kU2kxc+zPDZIZQYWF19BTevkFTZdPnQBT3YukdDX/AtCNcmvBrFJ96eYkUWaCCtnOpfB+/IETSsPYuwsabIrqSWHYoPBskXi/DUubCFDAf/6+0pCLU1kmMIueWH8HebltZsATbIO+vXwG1gHAXjGECElz7j/+GXHZJM9ORAFgOa/b/pGdMUEE9PfuMHx1G3GpnRw8WEP5FknNoUNOyb6iY5VX/W5w6pnS5r1srs4CXTuHzUJLdvXVpyiQNuBwCyLYlukPjvLuqqHRrv5/jHTa1L+iumi2wLA8NzahM3euE6fvC7shIbIWajyLkVYhWOOdMRjOWdhSN1wi7JvE4t+bFXSVHOX+4DnQxVhhUKacLKMYPHhQKLZSdyYzM66dZ22undenNBcAjNHjBW+9t0W2glcAA/v44VaU8mJJP1Vz1l456kKu23B2wH7M9h1OtAwoGAGj8t///XA7H+OEVSxGjYfFAlM1Upvv/NmvKOBdxK8JXyQLqAqwy0bgja/QQTJKOEDkKXVg8HRGbA4YhU/9KZ5ulhbrnm7S6a3XhSmzHNxDfaPRezgQ0/P9ZW+KbLltsoK42ORYMdpD+ZNjvwybgVPBD9EHv+g73MeRCpYGemyJk33SfCLWO6KdUBlYRNr8Mo+qAoyC9JkWFe7IXV7Z97jmAJIiqXCgQLxyeB+hbtaa+FYbgl1eFTp7G94pdaY/8UctUnxSI5D+T1JSv+XjPm9esp935RnwxdbS6hotafVZHEYXhNE4yJuAqxUJUaOkBZ4Q5Np6wPjASRuycYuHZCHt2R3u3m2lnPOuVzRIM8oEZ+8HzouhdC8oAvg58NyHo8Vf/7w6NRKTABd/OXH580LMQQTdyszsubdMC9/V6zXxPvXQB4tlSIcLFtIZFgSmZyjuhvazQPJXERNOoR7CaZw2muWotmc1HOhl5YIiupxst1r61HraNl8+SaP5hh5c7eE4Z6mR6kPSQtsPTv801VocMwO0llrMRk3g20bZASEJCSF4Xx+DAKcXCpAzekMGHeOQQlMSqol0oZ2ysJ28N7WILeisnEJpp8bXhs8i8xP/JPeJ2mWM/qBOuL4jtzJRTFsHCrSkF/+pIoYxOUwFvqJ2lIDhsQ+Dz/qLXkaF2dV0Db/02Uizaa1nU3ROJmPBQ6h+88RI0hr61bueh7niiMRqzuJoERGL1qHWPKkBT/sDemsRnxsjKFqcFLTTAMZxAHbmHPs5H+gAJu4EWTOsRVgo4wVNO7iEWnl8abB2NKiM08EauUs8uWo5Z315p9I4R8yNXBrdAFfvjjpJnweJotSWdraKLe8Nl/IYJ30/Dch5FFjZQDeUJyDjNQ7UncafuesORQsS8gbMBhIjaMpkz6lFhQXTEwXffXf7Igim1f2TvIBMbUucINFHNBalbwuR9n4nktwHAAfhJinTX1ZSIcI1ivEBZqhr0PihAYnQEI4t+UIeMlIexMcD9pex7ffiC7xTypCNQZ4els7i0w1dRQPGkGSiqBhVpmYU/fa5AEsstEza3yJiyo46A8tdBZR7k+QjkjZi4R3JTDru7uAH8uAs99WmAWo7EtCfnIVcFLpMMVm4ysLp+H8w7tsa7oiAMOicQjpI206qt9gXJK0SRDCqXnpQPO5Za/sa0F9pFtQdk0IWV1bUZl50bsz1jRSgkgGLnG7codLl+O70us5JrrEAGElgaaXnHmCBhRme/TrpssMp3xOmZk0SYGH4jXStL3ojRg1WS450m9OdBzDKSErTczJlZu3nVH0YlqU/vLXp8ZUrVMqDnxO/EDMcahK1NulV8mcj+VKn2kPGku5QKF7iJJ93wd472rPI/Ty+MgECIrxo3TeA9OD96pLAgpF+t5iFercE6smtM9t5wruffSJ5YsS5pfMVNDdsPVS/vqwqHZRqUOSVWSD7wcqsWWt/WN3HUKS6iMJZmWe1iI77VOQ3eXgNA3zI7C5meewdOYjeaBg8EZ4cvdhJKn/67zSZITA8+fLTxDPm67nxcLbn0wDujGAF6ej27TC1GqzrpfQw+lBiRxSz4jn8x6VpAlKugU0gBAuZ2+zgZzWdAbq7juw3/PLVwGoU2eek5v1hW8Yi+T4pFEd7BdDbQRpv5l060TsIDWyr9/Pu6Tx8Sw/pTLwo9gG5L/9I96u2gJNoTogVbEpdYwfpMHBIK4E6gJ5WN2U5wK1nBhrHIFmBXZAyRjaCkurXxFowaB+aWWdVEz+6qj68/QnbWxjpU4xFg9mlaF5HokpyipN1BP+k6+3NQScKOSoApBIXm21svSUNNsYAQ+zgmQ6ZkAuSAynxgKswcfJiuA/e2Nuv6ODDw2h2Ceq5hldyZOZeMHbiAYuM60m33jsww0Uz8+4/Bry8tjZgXaLV/rlL5uP5pLf69IGbOFb1crxcN24yoKmIUAdtPf/co1SMQaxe913fYm8SZSj915c3LIj6HJguanjJB6xbKrwwZw9vmhrhshZpL2fNE3anpscm25z86/pFd9p//RYhaUgA56qx4HTvcD8lvvGAIW22PuYEMmYiZSbeHxpCKrG9iOKsxe7LXBfbQYCY12ed09vd/sLTpEmjuW1E/TSy9EhvRhF69d0KSSUeK1/2fqD9GZPe2s80Jdih9w6NwLxO/AC8AeZjS8gZIOafjhXVpzaKvhix8s1cO27cpUc/x13ywHu7WNVApWpCMNak9/QsanffreW5zk5UGrb/XFcJBpw/fp7Y3P/TiVlv9tm+xxsH4iw1MojhGsNJqBf9G0EGCyYh/OIjLOgv/KiVKn4KT9JKP/Uc0gvWfojQoL2cbQ/YHropMzIdwcarcB8fu08LL6cIHAPb9B2z/Rf4UJL/Ubdmy6jlxdkE01o3uWTeD2rD+IAvKf/22mdXvFK7jqHe499e/ceQouvvdG6cBfIpIAkF5/R7eOANm/YyxLS/ZfMwsdOv+JfuzzugHhAo470jWPURUr0Xn4njgpqI+Qj94gnkGTC0ReIxqIPS1b+RbjDc4MZZ9MAklPArtww4KsqO2JaWOom1/1AxsyPutOFrKBiuTdjE382yfu5g+GJKuwQu3cq2dabFpJyy44S7v5bpURssVtr1D8mxEYVlQ8fly+KRc+ozMRv8u9dj5jffRCTLisRHP3X8ahsJ2oZhd4aftYRWOx0T+gZ97rtkDRPJzlhfgLyMqiSvJjpxVKpv3PStthRNe8R8F9H8DFoPHSzHLmhe/uDSPeh3WffAKbjMKv32PUBbzp6f4GfwfjQD/xKCCRvV98FxqiqzNKlGnRzdZ6TCwaGLcgYygtYmNZKzhf7rOF9XXcVsNe/FloRRkBYeol7dma2BOGazDoZhxAkI5TWDGkO8Rd23eAUtpTOtgLoJdxik+XTsCLBz3xztmixjiZMgk33zVBoTsxJCpowT8UgJm56EBgWIJ8zDHdKSIvYtAuQo90BfPpwlqLFvQ62szIXGObwVCJBdaPQ6AOlSDrg/4M1Xptssca7lnD2z+0dh3f4AYJrPrGcXP9SGBq30IEgvBsrZOjfe7U2ZVguXost19mo1m/Hb/FwWSc3O9fFFBQJhZEYd9T8i0MIYbgdWdTEH41gDraRIKZizyjK4jVPPgi35lSRpQkyGFqloeLs0ULHVnqozYp97FxyjGuHBsWiA1dhcOzxWfb+9L2kk8EkzMe++yJQ9GqbD1xtOvYtb2UOexwpbDJAFJlPRYBxrMkATgGwSW4A2LWZy+pBo0GmiM1YGavhsPEBxglF83gZ9QIggiukPYB85BDmmb8ru99wD+DQvP4hu2YCz6A5kp/sJD3qOI7HIsJxRDkaO3sf/bYfZuqa3LdVmIT853KYb79N6neXufSxFSQnyi30mJHYwVcLOmAbDRvHYwF83Y4b3NN8NOUSH4LXUFaZBoYelYzeiQg8IgkLa+g/RwRCUThxaOaTGfQNDGN2fFLJrDqh88e6T9bmWy9AzEoG29fv9hO+1zA0iEWnoTtNr1dBlC2eHYfWgoiWCBVcaC6cO6fIpEIncf2VapcojDaS3FujWm+w8IoiKoq9+Zzm1wng7TIKJKpp1mkbm3M2In/0vTqkGRtDVzLmUu/MzvzlpfyE7VFsAdsreB5BqSs60/mfodU1+j2SN84H1YurnWx4Z0u73N5QCNLLIlXEzvcE48IcvnvHogKXfYviH/f2iBtI3vrK3GIiThSR8ykXmUtIrxTtqbHvy82xxbyqM/ya2sKPKRdTrD85uEPL0Z8dvPiUfiVRCut4V5CnXWKzMKwmyXh2zdT/Wx1klkw4ixJ8NP/3JGF0lDVYVde7ZwEYrPdHJhgCgfH5KfwXpHykSyj20QwjG+7rDeFrrmlBS2dEbI2bOB2rMTgueOmZlfczR+dUuIss1K61IE1X8XChw2KIfkpCOP4G5DW2FBnK7MOx72/39EtlmaGIvi2uPD/S5KJCGWSH/ADxGkdDXJbT7IjwL0GTIWO1pkQgtPfrQ4KW84E+PdkU9hIuQO3a3Vgp9tGVCmDEX5bfo3c8W46FFBoLX5w3HFzNNkhTPTtJV+IO6h3yF4X9d2YxLqM+HnAwS2XyEvNrrcQbJx60XMbhF2fZy8hFLKLl0VHYvud4N/vW3v2siUFHw/s3F2S/62Z0mef3ERpa+28r0gvweNyUduP3KKmphD4cnGwoSlKz/BeXUnlO/hw9Eftd/qtYsyl+fxCu6ydlFSjlf8r5gsxR3kPUVtX3Z+hYk0O6LvcRQsJSnlitd9TCW4zGE59EoMxN2N0izBRDgAAAAAAA==",Yp="data:image/webp;base64,UklGRgwMAABXRUJQVlA4IAAMAABQMwCdASqOAI4APjkYiUMiIaEZqk6cIAOEtQBlWQCsPxs/GflL+WHzA1P+zfhD+l/sr8cvBbpH0DOTP9j/evah/rPUf5gn6af7r+49dfzDfsz+yPvGf6f1W/4r/M+wB/P/9T/8+wi9BLyzP28+En9t/3N9pH/y+wB///UA///FKf5/td/0HnLBOfeD9h6++yHaw/yO+agA+p/ExpOMeXoT54Xq72Df1z9Mz2AfuT7OS8YmVmOsmf5jqgueuMtdVDf7/8IGxCrKJVChp/KFp2oKFsO3+XUmwngaj6/KEi7C1DSuCh+zzCla9qnnEkR/lN/ebybUtOwxC/p+mhLOJMySpLEWwLMbmUzXCqcNK16hnpbCN+9vw3+nXHO91JFWS3EIj7YQRHRQllV+lVSTFM7EpzAIoof/7r+m1Y4VEnW29BCxuD7ccWEUcsaJd2V30EeDTbQCaEKZWFPJDxNOW38bQtKqiq2JW1YTvNG580QG2R6n6RStIpR01qX2WRZI0IQp89aKwHBuygxv09yseoLGd7tytCoaI5ow7+H+adzdekfWYAD+/t14UP643nlJr6+fzCSALmONrhm1HM9r/VJjGO780J/4xzq4fmwzMh+yAP7ORoQMYPQFL8+iKum/1qkeJnhtmLx36EDUhiylPQ1f/qsUYuEhCbZyW2XdXCBD6slorbYJhPZwGmkvNnewiRvcjvWe/0lvRe9+QjeaSNVOY2ffJT8NEWYqjJz0kA+mY53/IW+QpHju9l0d6eT6y8FYqHsW468sTTOvbtnAoyEhXaKkNND6o8lteDtnWHy+Odw4k0hfK3nM0cM+kp2GLZ+CT8ioE50GyNbNgn8B8vCW4Eb1K4YoeNGuq1kvFzfgCWvcW2sZTTO3e5pXWr9cnX3FbDGqPTujc9duJ35YmVbpjyAcEoH1KCsTRrycxu43ZGHhfL+GmEAA8o+8wd8lAHeorj9Ryp7uuWZ38R9AQACcqcUXurMjB7gxTl/8xweLH63MF21d2KMg4fem8ZkD3SkUG7Q2rP54BMmdjxJ9JgaZUrMBrV9GFqpJczgl9UAaP3Q/7R7nbexZ2UeB3HiCy5MKPjugecflKlll5aFJ07nRCYyOLOH9fb16mNlL9mWM259E31qcK4wpda3WGYMHOBOaKNfOxovW/u1df+qNevMn1SC/4vGKJstZ9PqE5btrilfwv0nSAQj/Q8dWAb3WKIAty9DT33t9vLz+e4aQNXru1U9rK+wTBmpCqEX9pSfSBywG8++6tF9Dzvt2dp4Ly/5FJPaOcH8+nU1a4l+XoTwpqk+yKJ0iY57ceXfl4fU77cs/8L0P1s44NWEIIX86Dx3zJvZGkQIn7YASFbLuKUuL3yyRmjK3epZIzS8q6ehQeQqVqnUw5eIPN0EX1yynGeDQjR24rjnxVtUlIqynCfszNLYPYyMIwwON0q2nCWvku6CZCUlEuZx+rruZ0xqcBzHF3xWmXItXuids516hkBSbPMThKqgTUZMGMMZ62azX5N94SBL7v+uS3P1ZCIza02Pgn8T/7NTE78CT0LmzqBEC1cH4OXLHyTqY4j+Cv4FoAejB3EJwCMhQiMLdnkb5qW+J4vEOTFUB7Xtvd2QgBXt0k5szm1QueRBDJMGAt549zXUvC1ayeSEuaGWhwb/JWOZA0tRqXLQIHMmA82/fqojN7zFdCeuCpV6YJGfleJFx9hM3E7DqKfRPG4dnevUWEzc89PCbOwSauxRXX967+DJbLaRzaXYPAP/+OlZ3hsk3xp6FDz62cJz/7UaqZ+L8ljKHJDJWb9z+bmcBGTKwg/bFy7aMSTVyVg/9Enj7xbwkU2zfy1/pKg7+NgTQWum04uv1OJbN57ArGK7D490MId38WjC65l78Pzu7NrN+B5ijzNoWH04e9Pcl73tni1fiORqqFrog6q/CamsBAlZRZWBLHKtN6Yh//b8qVGprn8VPF/VK7nZW70N1XtzyT2leLRfwRBqo4SIhuvqxOdHKNJHg1LXTlB/coShBHuyLS6wu/+o/YEwXybvqf7Ojys881X2cXNmexU04k0vUcyy+rKGmM6FnI6THfe2Tix72WnhHh2AingEVPQUoIIJG/7B5WrgJ2xfS2lCjFca1D73Hm7ye+fLOZSi+2TchrOAv2hi5xEYo5KiLYwKu2IfS0p+QqzkMEFyCIOuC5NFapFAWKWQ4O86kaENGqe1+v1ZILPmw86ztmGYuIizbkFakccHhURH+Ve+h8AyTPfiC9+E5uxgWh8E6sT7nhJN09IOah7RxqqKRX6/DFYH2bNmBZyWTrbWW1s1eweEC3mN7vG3Xt9bpw4bRqMuHNPiNK85445nBEmityQdIjtjF3JrZ9HpOaGrIuaaeW3iH7C44ITfsHcVJY/vTdpC3tqmtf6/BZ93mlQFBY0MluEiRTe7oUB1E7LiUGz8rkQZKJJIZ8JMSfjqUHyhDrL+B56rUW+pbd3PqVOLYiTglN+0DPhK3WpSI6wpdyvXOsWHG4Ta5xPCXk5JZSlld8F/X2O2QLiHXW587NTGkyZLQ6JCTo39tmm7vd3es4poNsDPbjhYJyGpRAqxjHLWCeyeJlvbDOieNltR+r952RSdtbkG3oHdvfxW6Pjb2YAyxaThXMTTyT/zYYm1Io6wic5GHpk2XOYbuPpM7ZevMxHtXuBU8xAFZEdeyKTe9uH/UGK8BYHm+N3bjkSBBpccHo+7RNVIX0s99vCP2NiXc4nAAswcNqVIDGDGL6yw9mQLnqJf67m0nhpkYMDU727dp0HJr9Ha4iu2nYrY4WbHC36j2N6iLfMKcTWaiJt5jGxWzb8A4vlC0YiHxi5G6hurHxARx6MMSf0bJmtyeeiRQVN0qy7dj2EAbarH0fHm8s8R9FBsmP+MaJ0EUAPwv7ty5BsY6D6Hyr/0JE2SgiBzriUqckvhNPR/OwC+JD1Mm2bjOFSq3qsiw9Kiw1KRymrWkF4Qd4V3XEi19kg/72fWqSSD/uvXkbLvcUeuGxmWIlDoBdKEkl/ld8xhLrLwdg7FyqOP4DS3VTAlFdd9/5MRMl56GDvO+HKTHXbsW9X+r6GRr2IX31uEVBI3/pfOScwYkF4hYkTmzP22VY8UCUvDruM6mfYED5HA88Gd+rn0t/0+v1vs1ArAcyeSS+U1QWvfTziu2+evgTaZB/x2HIzCmH0LGpMC6803Upr2innO/UcDUHEYKg6Un3+HxdlU2lPbniy4HPzLfzrAE94TRlcuoeOqrcTI7eAgYRNKwXh7XIeFrCsmIRgrt8YMu2v4jM0icqwly+QPuy2Kw8J6cXH2BA7K2LAF85VIVNVoRlDLXxjwsBb4heeCxAzkU+gm7I1b5uvL3i2xq/xj+lhL8t6XTKJliRrlPGHQuVR3ZceU87KLxOQcICfVOCe7B88mxyvsB2FmiotOM3UOnG+VcZ3jL1W+JFDzYyR9Y3KsZNaeJAazd5ajmnZLTYIY7gJ4N4t99U2hY/CMgI0yMNLaq3cJB0CNBsd1hRKl7lZ1wMh16/EZx5jig5JWvlZNPTMuJFHvpW42fyFjIfKslwVHB/SJKWDRr3w9uFCRm/Z3ABn2ydMFGvXjMZEaTsZlqF17J76wjrLkgmgcbtrtL9N8T3dXsKhM4LPscSPo2kc9MfW3dmjuo98vCdxBR/RvMAgm0VzEuXulny1QdmDMzoBUfPseIFkTNYFg89+m4OKn/8Xc28jcPteGx8v0vwYyKNlOAZvi/yt7OImF7kADj+rzqjSoqwVTnCCjOKrF1Gt1i+6oeDggdd5wEh1ghvxdHELxvJeJE8x82cfHEVXhE9Nheu7Q1WycLXUTZA8oZHsdBaBFpk6vyYdYFT8YTShaCjPle1+2DJHzXzhRUQ6ZY/HcDs/vS2V8+jO+pjV23u5WL6yRWULzVi+0qUXIiJzd9qj65YnWPMxIubcSpm+5n8vMpysoMuGzoNwBmNszF+S+b8acZRgm2Gi0UT5OGuYwq4wZ5kmd8OqnDzhze2RxwMRtRm+17eKYWzLWtgVuOca/HWuBI58UC9FNZtBLv1l2htg7Iyehb/cr9uKvXkPXh0LFeyfEc49dOsGvppssGqOAAAAA=",Wp=m.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 24px;
|
|
5
|
+
padding: 12px 16px 16px;
|
|
6
|
+
min-height: 0;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
`,Bp=m.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
padding-bottom: 16px;
|
|
14
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
15
|
+
`,Hp=m.h2`
|
|
16
|
+
margin: 0;
|
|
17
|
+
font-family: ${d.font.sans};
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
font-size: 20px;
|
|
20
|
+
line-height: 1.6;
|
|
21
|
+
color: ${d.colors.text};
|
|
22
|
+
`,zp=m.button`
|
|
23
|
+
flex: none;
|
|
24
|
+
display: grid;
|
|
25
|
+
place-items: center;
|
|
26
|
+
width: 18.535px;
|
|
27
|
+
height: 18.535px;
|
|
28
|
+
border: 0;
|
|
29
|
+
background: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
color: ${d.colors.text};
|
|
32
|
+
|
|
33
|
+
&:disabled {
|
|
34
|
+
opacity: 0.4;
|
|
35
|
+
cursor: default;
|
|
36
|
+
}
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: 2px solid ${d.colors.accent};
|
|
39
|
+
outline-offset: 2px;
|
|
40
|
+
}
|
|
41
|
+
`,qp=m.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: 12px;
|
|
45
|
+
`,Kp=m.div`
|
|
46
|
+
flex: none;
|
|
47
|
+
display: grid;
|
|
48
|
+
place-items: center;
|
|
49
|
+
width: 180.465px;
|
|
50
|
+
height: 179.763px;
|
|
51
|
+
border-radius: 15.746px;
|
|
52
|
+
background: ${d.colors.media};
|
|
53
|
+
border: 0.176px solid ${d.colors.muted2};
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
|
|
56
|
+
img {
|
|
57
|
+
width: 149.568px;
|
|
58
|
+
height: 148.866px;
|
|
59
|
+
object-fit: contain;
|
|
60
|
+
filter: drop-shadow(0.736px 2.945px 3.682px rgba(0, 0, 0, 0.1));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
${d.media.maxWidth("mobile")} {
|
|
64
|
+
width: 120px;
|
|
65
|
+
height: 120px;
|
|
66
|
+
}
|
|
67
|
+
`,Qp=m.div`
|
|
68
|
+
flex: 1 1 0;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 32px;
|
|
73
|
+
padding: 8px;
|
|
74
|
+
`,Vp=m.p`
|
|
75
|
+
margin: 0;
|
|
76
|
+
font-family: ${d.font.sans};
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
font-size: 20px;
|
|
79
|
+
line-height: 1.57;
|
|
80
|
+
color: ${d.colors.text};
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
`,Up=m.div`
|
|
84
|
+
> div {
|
|
85
|
+
font-family: ${d.font.sans};
|
|
86
|
+
font-size: 10px;
|
|
87
|
+
line-height: 1.43;
|
|
88
|
+
color: ${d.colors.muted};
|
|
89
|
+
}
|
|
90
|
+
`,Xp=m.div`
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 4px;
|
|
94
|
+
|
|
95
|
+
/* A 24px slot holding a 19.855px glyph — keep both boxes rather than one flat size. */
|
|
96
|
+
.ico {
|
|
97
|
+
width: 24px;
|
|
98
|
+
height: 24px;
|
|
99
|
+
background: ${d.colors.text2};
|
|
100
|
+
-webkit-mask-size: 19.855px 19.855px;
|
|
101
|
+
mask-size: 19.855px 19.855px;
|
|
102
|
+
-webkit-mask-position: left center;
|
|
103
|
+
mask-position: left center;
|
|
104
|
+
}
|
|
105
|
+
span {
|
|
106
|
+
font-family: ${d.font.sans};
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
font-size: 24px;
|
|
109
|
+
color: ${d.colors.text2};
|
|
110
|
+
}
|
|
111
|
+
`,Gp=m.div`
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
gap: 12px;
|
|
115
|
+
`,$o=m.button`
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
width: 100%;
|
|
120
|
+
padding: 12px 12px 12px 0;
|
|
121
|
+
border-radius: 12px;
|
|
122
|
+
border: 0.5px solid ${d.colors.muted};
|
|
123
|
+
background: ${d.colors.white};
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
text-align: left;
|
|
126
|
+
font-family: ${d.font.sans};
|
|
127
|
+
|
|
128
|
+
&[data-selected='true'] {
|
|
129
|
+
/* Flare gradient border (melon → ruby) painted over the row fill via the border-box trick, so the
|
|
130
|
+
12px corners stay rounded (border-image can't clip them). Fill is gray-5 when selected. */
|
|
131
|
+
background:
|
|
132
|
+
linear-gradient(${d.colors.media}, ${d.colors.media}) padding-box,
|
|
133
|
+
${d.gradients.flare} border-box;
|
|
134
|
+
border: 3px solid transparent;
|
|
135
|
+
}
|
|
136
|
+
&[data-disabled='true'] {
|
|
137
|
+
cursor: not-allowed;
|
|
138
|
+
opacity: 0.55;
|
|
139
|
+
}
|
|
140
|
+
&:focus-visible {
|
|
141
|
+
outline: 2px solid ${d.colors.accent};
|
|
142
|
+
outline-offset: 2px;
|
|
143
|
+
}
|
|
144
|
+
`,No=m.div`
|
|
145
|
+
flex: none;
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
min-width: 36px;
|
|
150
|
+
/* 12px on the left (per review) so the control clears the row's rounded corner; 9px elsewhere. */
|
|
151
|
+
padding: 9px 9px 9px 12px;
|
|
152
|
+
`,Oo=m.span`
|
|
153
|
+
display: grid;
|
|
154
|
+
place-items: center;
|
|
155
|
+
width: 20px;
|
|
156
|
+
height: 20px;
|
|
157
|
+
border-radius: 4px;
|
|
158
|
+
border: 2px solid ${d.colors.muted2};
|
|
159
|
+
background: ${d.colors.white};
|
|
160
|
+
|
|
161
|
+
&[data-checked='true'] {
|
|
162
|
+
border-color: ${d.colors.text};
|
|
163
|
+
background: ${d.colors.text};
|
|
164
|
+
}
|
|
165
|
+
.ico {
|
|
166
|
+
width: 14px;
|
|
167
|
+
height: 14px;
|
|
168
|
+
background: ${d.colors.white};
|
|
169
|
+
}
|
|
170
|
+
`,Ro=m.div`
|
|
171
|
+
flex: 1 1 0;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: space-between;
|
|
176
|
+
gap: 8px;
|
|
177
|
+
`,Ao=m.div`
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 13px;
|
|
181
|
+
min-width: 0;
|
|
182
|
+
`,Lo=m.span`
|
|
183
|
+
flex: none;
|
|
184
|
+
display: grid;
|
|
185
|
+
place-items: center;
|
|
186
|
+
`,Fo=m.img`
|
|
187
|
+
flex: none;
|
|
188
|
+
display: block;
|
|
189
|
+
width: ${({w:n})=>n}px;
|
|
190
|
+
height: ${({h:n})=>n}px;
|
|
191
|
+
object-fit: contain;
|
|
192
|
+
`,Yo=m.div`
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
min-width: 0;
|
|
196
|
+
`,Wo=m.span`
|
|
197
|
+
text-transform: capitalize;
|
|
198
|
+
font-family: ${d.font.sans};
|
|
199
|
+
font-weight: 700;
|
|
200
|
+
font-size: 15px;
|
|
201
|
+
line-height: 26px;
|
|
202
|
+
letter-spacing: -0.2px;
|
|
203
|
+
color: ${d.colors.text2};
|
|
204
|
+
`,Bo=m.span`
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
gap: 4px;
|
|
208
|
+
font-family: ${d.font.sans};
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
line-height: 1;
|
|
211
|
+
color: ${d.colors.muted1};
|
|
212
|
+
|
|
213
|
+
/* A 13px slot holding a 10.4px glyph. */
|
|
214
|
+
.ico {
|
|
215
|
+
width: 13px;
|
|
216
|
+
height: 13px;
|
|
217
|
+
background: ${d.colors.text};
|
|
218
|
+
-webkit-mask-size: 10.4px 10.4px;
|
|
219
|
+
mask-size: 10.4px 10.4px;
|
|
220
|
+
-webkit-mask-position: left center;
|
|
221
|
+
mask-position: left center;
|
|
222
|
+
}
|
|
223
|
+
`,Ho=m.span`
|
|
224
|
+
font-size: 10.4px;
|
|
225
|
+
color: ${d.colors.text};
|
|
226
|
+
`;m.span`
|
|
227
|
+
font-family: ${d.font.sans};
|
|
228
|
+
font-size: 12px;
|
|
229
|
+
font-weight: 600;
|
|
230
|
+
color: ${d.colors.dclRed};
|
|
231
|
+
`;const zo=m.div`
|
|
232
|
+
flex: none;
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
gap: 6px;
|
|
236
|
+
|
|
237
|
+
.ico {
|
|
238
|
+
width: 24px;
|
|
239
|
+
height: 24px;
|
|
240
|
+
background: ${d.colors.text2};
|
|
241
|
+
-webkit-mask-size: 19.855px 19.855px;
|
|
242
|
+
mask-size: 19.855px 19.855px;
|
|
243
|
+
-webkit-mask-position: left center;
|
|
244
|
+
mask-position: left center;
|
|
245
|
+
}
|
|
246
|
+
span {
|
|
247
|
+
font-family: ${d.font.sans};
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
font-size: 20px;
|
|
250
|
+
color: ${d.colors.text2};
|
|
251
|
+
}
|
|
252
|
+
`,qo=m.div`
|
|
253
|
+
flex: none;
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
align-items: flex-end;
|
|
257
|
+
gap: 2px;
|
|
258
|
+
`,Jp=m.span`
|
|
259
|
+
font-family: ${d.font.sans};
|
|
260
|
+
font-weight: 400;
|
|
261
|
+
font-size: 12px;
|
|
262
|
+
line-height: 1;
|
|
263
|
+
color: ${d.colors.muted};
|
|
264
|
+
white-space: nowrap;
|
|
265
|
+
`,Zp=m.button`
|
|
266
|
+
width: 100%;
|
|
267
|
+
height: 46px;
|
|
268
|
+
border: 0;
|
|
269
|
+
border-radius: 12px;
|
|
270
|
+
cursor: pointer;
|
|
271
|
+
background: ${d.gradients.amethyst};
|
|
272
|
+
color: ${d.colors.softWhite};
|
|
273
|
+
font-family: ${d.font.sans};
|
|
274
|
+
font-weight: 600;
|
|
275
|
+
font-size: 15px;
|
|
276
|
+
line-height: 24px;
|
|
277
|
+
letter-spacing: 0.46px;
|
|
278
|
+
text-transform: uppercase;
|
|
279
|
+
|
|
280
|
+
&:hover:not(:disabled) {
|
|
281
|
+
filter: brightness(1.05);
|
|
282
|
+
}
|
|
283
|
+
&:focus-visible {
|
|
284
|
+
outline: 2px solid ${d.colors.accent};
|
|
285
|
+
outline-offset: 2px;
|
|
286
|
+
}
|
|
287
|
+
&:disabled {
|
|
288
|
+
opacity: 0.6;
|
|
289
|
+
cursor: default;
|
|
290
|
+
}
|
|
291
|
+
`,ef=m.img`
|
|
292
|
+
width: 13px;
|
|
293
|
+
height: 13px;
|
|
294
|
+
display: block;
|
|
295
|
+
`,tf=m.img`
|
|
296
|
+
width: 24px;
|
|
297
|
+
height: 24px;
|
|
298
|
+
display: block;
|
|
299
|
+
`;m.span`
|
|
300
|
+
flex: none;
|
|
301
|
+
width: 32px;
|
|
302
|
+
display: grid;
|
|
303
|
+
gap: 2px;
|
|
304
|
+
place-items: center;
|
|
305
|
+
|
|
306
|
+
.ico {
|
|
307
|
+
width: 15px;
|
|
308
|
+
height: 15px;
|
|
309
|
+
background: ${d.colors.text2};
|
|
310
|
+
}
|
|
311
|
+
img {
|
|
312
|
+
width: 15px;
|
|
313
|
+
height: 15px;
|
|
314
|
+
display: block;
|
|
315
|
+
}
|
|
316
|
+
`;m.div`
|
|
317
|
+
flex: none;
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
gap: 4px;
|
|
321
|
+
|
|
322
|
+
.ico {
|
|
323
|
+
width: 18px;
|
|
324
|
+
height: 18px;
|
|
325
|
+
background: ${d.colors.text2};
|
|
326
|
+
}
|
|
327
|
+
img {
|
|
328
|
+
width: 18px;
|
|
329
|
+
height: 18px;
|
|
330
|
+
display: block;
|
|
331
|
+
}
|
|
332
|
+
span {
|
|
333
|
+
font-family: ${d.font.sans};
|
|
334
|
+
font-weight: 600;
|
|
335
|
+
font-size: 17px;
|
|
336
|
+
color: ${d.colors.text2};
|
|
337
|
+
}
|
|
338
|
+
`;m.span`
|
|
339
|
+
font-family: ${d.font.sans};
|
|
340
|
+
font-weight: 600;
|
|
341
|
+
font-size: 15px;
|
|
342
|
+
color: ${d.colors.muted};
|
|
343
|
+
`;const nf=m.span`
|
|
344
|
+
font-family: ${d.font.sans};
|
|
345
|
+
font-size: 11px;
|
|
346
|
+
line-height: 1.35;
|
|
347
|
+
color: ${d.colors.muted};
|
|
348
|
+
`;function rf({item:n,priceCredits:a,priceCents:t,options:e,priceManaWei:r,balanceCredits:o,manaBalanceWei:i,onBuy:c,onClose:l,busy:p=!1,shortfall:u}){const h=e.find(I=>I.method==="credits")??null,x=e.find(I=>I.method==="mana")??null,b=e.find(I=>I.method==="combined")??null,[y,w]=v.useState(()=>h?new Set(["credits"]):b?new Set(["credits","mana"]):x?new Set(["mana"]):new Set),k=!!h||!!b,f=!!x||!!b;v.useEffect(()=>{w(I=>{const O=new Set(I);return O.has("credits")&&!k&&O.delete("credits"),O.has("mana")&&!f&&O.delete("mana"),O.size===I.size?I:O})},[k,f]);const C=y.has("credits"),$=y.has("mana"),E=C&&$?b?"combined":null:C?h?"credits":null:$&&x?"mana":null,A=md(t,r),N=A!=null?g("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null,S=E==="combined"&&b?b.creditsCents:(h==null?void 0:h.creditsCents)??t,D=E==="combined"&&b?b.manaWei:(x==null?void 0:x.manaWei)??r;function P(I){w(O=>{const T=new Set(O);return T.has(I)?T.delete(I):T.add(I),T})}return s.jsxs(Wp,{children:[s.jsxs(Bp,{children:[s.jsx(Hp,{children:g("buyModal.choosePayment")}),s.jsx(zp,{onClick:l,disabled:p,"aria-label":g("buyModal.close"),children:s.jsx(V,{name:"close",className:"ico"})})]}),s.jsxs(qp,{children:[s.jsx(Kp,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(Qp,{children:[s.jsxs("div",{children:[s.jsx(Vp,{title:n.name,children:n.name||g("buyModal.itemFallback")}),n.creator?s.jsx(Up,{children:s.jsx(vl,{address:n.creator})}):null]}),s.jsxs(Xp,{children:[s.jsx(Pe,{}),s.jsx("span",{children:Qe(a)})]})]})]}),s.jsxs(Gp,{children:[s.jsxs($o,{type:"button","data-testid":"pay-with-credits","data-selected":C,"data-disabled":!k,disabled:p||!k,"aria-pressed":C,onClick:()=>P("credits"),children:[s.jsx(No,{children:s.jsx(Oo,{"data-checked":C,children:s.jsx(V,{name:"check",className:"ico"})})}),s.jsxs(Ro,{children:[s.jsxs(Ao,{children:[s.jsx(Lo,{children:s.jsx(Fo,{src:Fp,w:32.582,h:34.401,alt:"","aria-hidden":!0})}),s.jsxs(Yo,{children:[s.jsx(Wo,{children:wt.name}),s.jsxs(Bo,{children:[g("buyModal.creditsBalanceLabel"),s.jsx(Pe,{}),s.jsx(Ho,{children:Qe(o)})]})]})]}),s.jsx(qo,{children:s.jsxs(zo,{children:[s.jsx(Pe,{}),s.jsx("span",{children:Qe(Ur(S))})]})})]})]}),s.jsxs($o,{type:"button","data-testid":"pay-with-mana","data-selected":$,"data-disabled":!f,disabled:p||!f,"aria-pressed":$,onClick:()=>P("mana"),children:[s.jsx(No,{children:s.jsx(Oo,{"data-checked":$,children:s.jsx(V,{name:"check",className:"ico"})})}),s.jsxs(Ro,{children:[s.jsxs(Ao,{children:[s.jsx(Lo,{children:s.jsx(Fo,{src:Yp,w:35.328,h:35.328,alt:"","aria-hidden":!0})}),s.jsxs(Yo,{children:[s.jsx(Wo,{children:g("buyModal.methodMana")}),s.jsxs(Bo,{children:[g("buyModal.manaBalanceLabel"),s.jsx(ef,{src:bo,alt:"","aria-hidden":!0}),s.jsx(Ho,{children:Kr(i)})]})]})]}),s.jsx(qo,{children:f?s.jsxs(s.Fragment,{children:[s.jsxs(zo,{children:[s.jsx(tf,{src:bo,alt:"","aria-hidden":!0}),s.jsx("span",{children:Kr(D)})]}),N?s.jsx(Jp,{"data-testid":"mana-rate-note",children:N}):null]}):s.jsx(nf,{"data-testid":"mana-shortfall-note",children:u?g("buyModal.manaWorth",{mana:Kr(u.manaWei),credits:Qe(Ur(u.manaCents)),price:Qe(Ur(u.priceCents)),currency:wt.name}):g("buyModal.notEnoughMana")})})]})]})]}),s.jsx(Zp,{type:"button","data-testid":"confirm-payment",disabled:p||E===null,onClick:()=>E&&c(E),children:g("buyModal.buy")})]})}function tc(){const n=new Map,a=new Set,t=new Set,e=new Set;return{submitStarted:r=>{e.add(r)},submitFinished:r=>{e.delete(r)},broadcast:(r,o)=>{const i=n.get(r);i?i.add(o):n.set(r,new Set([o]))},reverted:r=>{a.add(r)},unobservable:r=>{t.add(r)},isInFlight:r=>e.has(r),mayBeConsumed:r=>{if(t.has(r))return!0;const o=n.get(r);if(!o)return!1;for(const i of o)if(!a.has(i))return!0;return!1}}}function af({size:n=64,...a}){return s.jsxs("svg",{viewBox:"0 0 64 64",width:n,height:n,"aria-hidden":!0,...a,children:[s.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),s.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function of(n){return s.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,...n,children:s.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ya({item:n,onClose:a,resume:t=!1}){var Ht,gt;const{session:e}=Nt(),{data:r}=Ss(e),{data:o}=wl(e),i=Yt(),c=Ft();async function l(L){var Q;const K=(Q=L.received)==null?void 0:Q[0];if((K==null?void 0:K.assetType)!==Number(Re.TradeAssetType.USD_PEGGED_MANA))try{return await i.fetchQuery({queryKey:["mana-rate",tn.chainId],queryFn:()=>Sl(tn.chainId),staleTime:6e4})}catch{return}}const p=pu().packs.slice(0,fu),[u,h]=v.useState("loading"),[x,b]=v.useState(null),[y,w]=v.useState(""),[k,f]=v.useState(n.priceCredits),[C,$]=v.useState(null),[E,A]=v.useState(null),[N,S]=v.useState(0),[D,P]=v.useState(null),I=v.useRef(null),O=v.useRef(tc()),T=(D==null?void 0:D.credits)??k,W=(r==null?void 0:r.credits)??0;v.useEffect(()=>{let L=!1;if(!e){h("error"),b(g("buyModal.signInToCheckout"));return}const K=Q=>{const ne=Q-((r==null?void 0:r.credits)??0),Z=p.find(xe=>xe.credits>=ne)??p[p.length-1];w(Z.id),ue("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:Q,credits_balance:(r==null?void 0:r.credits)??0,shortfall:Math.max(0,ne)}),h("nofunds")};return(async()=>{try{const Q=await kl(n);if(!Q)throw new Error("not for sale");if(Ms(Q,e.address))throw new Error("You can't buy your own listing.");const ne=hu(Q,await l(Q));if(!Number.isFinite(ne)||ne<=0)throw new Error("price unavailable");const Z=lr(ne);if(L)return;if(f(Z),A(Q),S(ne),r!=null&&r.credits<Z){K(Z);return}try{const{credit:xe,maxCreditedValue:We,usdCents:fn}=await ha(e.identity,ne,Q.id);if(L){Y([xe.id]);return}I.current=xe.id;const hn=lr(fn);f(hn);const Wn={trade:Q,credit:xe,maxCreditedValue:We,usdCents:fn,credits:hn};P(Wn),t?U(Wn):h("ready")}catch(xe){if(L)return;if(Du(xe)){K(Z);return}throw xe}}catch(Q){if(L)return;ue(rt(Q)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Xe(Q)}),h("error"),b(bt(Q,g("buyModal.error.generic"),{sale:!0}))}})(),()=>{L=!0,I.current&&e&&(q([I.current]),I.current=null)}},[]),v.useEffect(()=>{const L=(D==null?void 0:D.trade)??E;if(!L||u!=="ready"&&u!=="nofunds"||o==null||o<=0n||C!==null)return;let K=!1;return Dl(L).then(Q=>{K||$(Q)}).catch(Q=>{}),()=>{K=!0}},[u,D,E,o,C]);const z=gd({priceCents:N,priceManaWei:C??0n,balanceCents:(r==null?void 0:r.balanceCents)??0,manaBalanceWei:o??0n});async function U(L=D){if(!e||!L)return;h("processing"),b(null);let K=!1,Q;try{const ne={trade:L.trade,buyer:e.address,signer:e.signer,credits:[L.credit],maxCreditedValue:L.maxCreditedValue,onBroadcast:({txHash:Z})=>O.current.broadcast(L.credit.id,Z),onReverted:({txHash:Z})=>{Z&&O.current.reverted(Z)}};if(O.current.submitStarted(L.credit.id),As())try{Q=await Ys(ne),O.current.broadcast(L.credit.id,Q),await Ws(Q),K=!0}catch(Z){if(Z instanceof Bs)K=!0;else if(Z instanceof Hs){if(Z.reason==="relayer-unreachable")throw O.current.unobservable(L.credit.id),Z;Q=await dr(ne)}else throw Q&&O.current.reverted(Q),Z}else Q=await dr(ne)}catch(ne){O.current.submitFinished(L.credit.id),rt(ne)||Te(ne,{flow:"buy",step:"submit",gasless:K}),Y([L.credit.id]),I.current=null,ue(rt(ne)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(ne)}),i.invalidateQueries({queryKey:["usd-balance"]}),b(bt(ne,g("buyModal.error.generic"),{sale:!0})),h("error");return}O.current.submitFinished(L.credit.id),I.current=null;try{xd(i,n),ue("Shop Completed Purchase",{...Qr([n]),payment_type:"credits",no_crypto_step:K,transaction_hash:Q??null})}catch(ne){Te(ne,{flow:"buy",step:"post_purchase"})}h("complete")}function Y(L){if(!e||L.length===0)return;const K=L.filter(Q=>!O.current.mayBeConsumed(Q));K.length!==0&&_s(e.identity,K).catch(()=>{})}function q(L){Y(L.filter(K=>!O.current.isInFlight(K)))}function _(){i.invalidateQueries({queryKey:["mana-balance"]}),i.invalidateQueries({queryKey:["usd-balance"]}),i.invalidateQueries({queryKey:["detail-trade"]}),i.invalidateQueries({queryKey:["shop-item"]}),i.invalidateQueries({queryKey:["owned-token",n.contractAddress,n.tokenId]}),i.invalidateQueries({queryKey:["public-token",n.contractAddress,n.tokenId]}),i.invalidateQueries({queryKey:["item-resales",n.contractAddress,n.itemId]}),i.invalidateQueries({queryKey:["shop-items"]}),i.invalidateQueries({queryKey:["catalog-items"]}),i.invalidateQueries({queryKey:["my-assets"]}),i.invalidateQueries({queryKey:["purchases"]}),i.invalidateQueries({queryKey:["owned-item-count"]}),i.invalidateQueries({queryKey:["overview-listings"]}),i.invalidateQueries({queryKey:["upsell-listings"]})}async function J(){const L=(D==null?void 0:D.trade)??E;if(!(!e||!L)){I.current&&(Y([I.current]),I.current=null),h("processing"),b(null);try{const K=await ru({trade:L,buyer:e.address,signer:e.signer});ue("Shop Completed Purchase",{...Qr([n]),payment_type:"mana",transaction_hash:K??null}),_(),h("complete")}catch(K){rt(K)||Te(K,{flow:"buy_mana",step:"submit"}),ue(rt(K)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(K)}),b(bt(K,g("buyModal.error.generic"),{sale:!0})),h("error")}}}async function me(){const L=(D==null?void 0:D.trade)??E,K=au(z,"combined");if(!e||!L||!K)return;h("processing"),b(null),I.current&&(Y([I.current]),I.current=null);let Q=null,ne;try{const{credit:Z}=await ha(e.identity,K.creditsCents,L.id);Q=Z.id,O.current.submitStarted(Z.id),ne=await ou({trade:L,buyer:e.address,signer:e.signer,credits:[Z],manaGapWei:K.manaWei,onBroadcast:({txHash:xe})=>O.current.broadcast(Z.id,xe),onReverted:({txHash:xe})=>{xe&&O.current.reverted(xe)}})}catch(Z){Q&&O.current.submitFinished(Q),Q&&Y([Q]),rt(Z)||Te(Z,{flow:"buy_credits_and_mana",step:"submit"}),ue(rt(Z)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(Z)}),i.invalidateQueries({queryKey:["usd-balance"]}),b(bt(Z,g("buyModal.error.generic"),{sale:!0})),h("error");return}Q&&O.current.submitFinished(Q);try{_(),ue("Shop Completed Purchase",{...Qr([n]),payment_type:"credits_and_mana",transaction_hash:ne??null})}catch(Z){Te(Z,{flow:"buy_credits_and_mana",step:"post_purchase"})}h("complete")}async function ye(){if(!(!y||!e)){try{sessionStorage.setItem(wo,JSON.stringify(n))}catch{}D&&Y([D.credit.id]),I.current=null,h("loading");try{const L=await mu(y,{address:e.address,identity:e.identity});if(L.url){window.location.href=L.url;return}c("/credits")}catch(L){Te(L,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(wo)}catch{}b(g("buyModal.error.creditsCheckout")),h("error")}}}const[Ye,Ce]=v.useState(null);function ve(L,K){const Q=L==="mana"?ma(Ml(K.contract),K.chainId).address:ma(Ps.CreditsManager,K.chainId).address;return xu(K.chainId,Q)}function ht(L){L==="mana"?J():L==="combined"?me():U()}async function mt(L){const K=(D==null?void 0:D.trade)??E;if(L==="credits"||!K||!e){ht(L);return}const Q=ve(L,K),ne=await Ls(Q,e.address).catch(()=>!0);if(gu(e.providerType,ne)){Ce({auth:Q,rail:L});return}ht(L)}const Bt=z.options.some(L=>L.method==="mana"||L.method==="combined"),Fr=u==="ready"&&(Bt||z.manaShortfall!=null)||u==="nofunds"&&Bt,pn=u==="processing",Yn=u==="complete"?g("buyModal.titleComplete"):u==="nofunds"?g("buyModal.titleNoFunds"):g("buyModal.titleBuy");return Ye&&e?s.jsx(Rs,{auth:Ye.auth,signer:e.signer,title:g(Ye.rail==="mana"?"authorizeStep.manaTitle":"authorizeStep.buyTitle"),name:g(Ye.rail==="mana"?"authorizeStep.manaName":"authorizeStep.buyName"),reason:g(Ye.rail==="mana"?"authorizeStep.manaReason":"authorizeStep.buyReason"),icon:s.jsx("img",{src:yd,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{rail:L}=Ye;Ce(null),ht(L)},onCancel:()=>Ce(null),onClose:()=>{Ce(null),a()}}):s.jsxs(bd,{role:"dialog","aria-modal":"true","aria-label":g("buyModal.dialogAria",{name:n.name}),"data-testid":"buy-modal",children:[s.jsx(vd,{onClick:pn?void 0:a,"aria-hidden":!0}),s.jsx(wd,{"data-tall":u==="processing"||u==="loading"||void 0,children:Fr?s.jsx(rf,{item:n,priceCredits:T,priceCents:N,options:z.options,priceManaWei:C??0n,balanceCredits:W,manaBalanceWei:o??0n,onBuy:L=>void mt(L),onClose:a,busy:pn,shortfall:z.manaShortfall}):s.jsxs(s.Fragment,{children:[s.jsxs(kd,{children:[s.jsxs(Dd,{children:[s.jsx(Cd,{children:Yn}),!pn&&s.jsx(Sd,{onClick:a,"aria-label":g("buyModal.close"),children:s.jsx(Md,{})})]}),s.jsxs(_d,{children:[s.jsx(Pd,{children:u==="nofunds"?g("buyModal.dclBalance"):g("buyModal.myCreditsBalance")}),s.jsx(Id,{}),s.jsx(jd,{children:Qe(W)})]})]}),u==="loading"&&s.jsx(Kt,{"data-processing":!0,children:s.jsx(Cu,{size:44})}),u==="error"&&s.jsxs(Kt,{children:[s.jsx(dt,{message:x}),s.jsx(Vn,{children:s.jsx(Qt,{"data-variant":"gradient",onClick:a,children:g("buyModal.close")})})]}),u==="nofunds"&&s.jsxs(Kt,{children:[s.jsxs(Ed,{children:[s.jsx(Td,{}),s.jsxs($d,{children:[s.jsx("b",{children:g("buyModal.insufficientFunds")})," ",g("buyModal.warningNeedToBuy")," ",s.jsx("b",{children:g("buyModal.warningCreditsAmount",{count:Math.max(0,T-W)})})," ",g("buyModal.warningToPurchase",{count:1})]})]}),s.jsx(Ko,{item:n,priceCredits:T}),z.manaShortfall?s.jsx(Nd,{options:[],totalCents:N,onPay:()=>{},shortfall:z.manaShortfall}):null,s.jsx(Od,{"data-testid":"credit-packs",children:p.map(L=>{const K=L.credits,Q=L.id===y;return s.jsxs(Rd,{"data-on":Q||void 0,onClick:()=>w(L.id),children:[s.jsx(Ad,{}),s.jsx(Ld,{children:Qe(K)}),s.jsxs(Fd,{children:["($",L.usd.toFixed(2),")"]})]},L.id)})}),s.jsxs(Yd,{children:[s.jsxs(Wd,{children:[s.jsx(Bd,{}),s.jsx("span",{children:Qe(((Ht=p.find(L=>L.id===y))==null?void 0:Ht.credits)??0)})]}),s.jsxs(Hd,{children:["$",(((gt=p.find(L=>L.id===y))==null?void 0:gt.usd)??0).toFixed(2)]})]}),s.jsxs(Vn,{children:[s.jsx(Qt,{"data-variant":"outline",onClick:a,children:g("buyModal.cancel")}),s.jsx(Qt,{"data-variant":"gradient",onClick:()=>void ye(),children:g("buyModal.buy")})]})]}),u==="ready"&&s.jsxs(Kt,{children:[s.jsx(Ko,{item:n,priceCredits:T}),s.jsx(Vn,{children:s.jsx(Qt,{"data-variant":"gradient","data-full":!0,onClick:()=>void U(),children:g("buyModal.buy")})})]}),u==="processing"&&s.jsxs(Kt,{"data-processing":!0,children:[s.jsx(zd,{src:Cl,alt:"",width:61,height:61}),s.jsx(qd,{children:t?g("buyModal.completingPurchase"):g("buyModal.completingTransaction")}),s.jsx(Kd,{"aria-hidden":!0,children:s.jsx(Qd,{})})]}),u==="complete"&&s.jsxs(Kt,{children:[s.jsxs(Vd,{children:[s.jsx(af,{}),s.jsxs(Ud,{children:[s.jsx("b",{children:g("getCredits.successTitle")})," ",g("buyModal.successBody")]})]}),s.jsxs(Vn,{children:[s.jsx(Qt,{"data-variant":"outline",onClick:()=>c("/items?tab=mine"),children:g("buyModal.myAssets")}),s.jsxs(Qt,{"data-variant":"ruby",onClick:a,children:[g("buyModal.tryInWorld"),s.jsx(of,{})]})]})]})]})})]})}function Ko({item:n,priceCredits:a}){return s.jsxs(Xd,{children:[s.jsx(Gd,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(Jd,{children:[s.jsxs("div",{children:[s.jsx(Zd,{title:n.name,children:n.name||g("buyModal.itemFallback")}),n.creator?s.jsx(eu,{address:n.creator}):null]}),s.jsxs(tu,{children:[s.jsx(nu,{}),s.jsx("span",{children:Qe(a)})]})]})]})}function nc(n){var a,t,e="";if(typeof n=="string"||typeof n=="number")e+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(a=0;a<r;a++)n[a]&&(t=nc(n[a]))&&(e&&(e+=" "),e+=t)}else for(t in n)n[t]&&(e&&(e+=" "),e+=t);return e}function ke(){for(var n,a,t=0,e="",r=arguments.length;t<r;t++)(n=arguments[t])&&(a=nc(n))&&(e&&(e+=" "),e+=a);return e}function B(n){const a=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&a==="[object Date]"?new n.constructor(+n):typeof n=="number"||a==="[object Number]"||typeof n=="string"||a==="[object String]"?new Date(n):new Date(NaN)}function oe(n,a){return n instanceof Date?new n.constructor(a):new Date(a)}function Ae(n,a){const t=B(n);return isNaN(a)?oe(n,NaN):(a&&t.setDate(t.getDate()+a),t)}function Fe(n,a){const t=B(n);if(isNaN(a))return oe(n,NaN);if(!a)return t;const e=t.getDate(),r=oe(n,t.getTime());r.setMonth(t.getMonth()+a+1,0);const o=r.getDate();return e>=o?r:(t.setFullYear(r.getFullYear(),r.getMonth(),e),t)}function Ta(n,a){const t=+B(n);return oe(n,t+a)}const rc=6048e5,sf=864e5,$r=6e4,Nr=36e5,cf=1e3;function lf(n,a){return Ta(n,a*Nr)}let df={};function Wt(){return df}function ut(n,a){var c,l,p,u;const t=Wt(),e=(a==null?void 0:a.weekStartsOn)??((l=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((u=(p=t.locale)==null?void 0:p.options)==null?void 0:u.weekStartsOn)??0,r=B(n),o=r.getDay(),i=(o<e?7:0)+o-e;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function on(n){return ut(n,{weekStartsOn:1})}function ac(n){const a=B(n),t=a.getFullYear(),e=oe(n,0);e.setFullYear(t+1,0,4),e.setHours(0,0,0,0);const r=on(e),o=oe(n,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const i=on(o);return a.getTime()>=r.getTime()?t+1:a.getTime()>=i.getTime()?t:t-1}function At(n){const a=B(n);return a.setHours(0,0,0,0),a}function mr(n){const a=B(n),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+n-+t}function sn(n,a){const t=At(n),e=At(a),r=+t-mr(t),o=+e-mr(e);return Math.round((r-o)/sf)}function uf(n){const a=ac(n),t=oe(n,0);return t.setFullYear(a,0,4),t.setHours(0,0,0,0),on(t)}function ba(n,a){return Ta(n,a*$r)}function $a(n,a){const t=a*3;return Fe(n,t)}function pf(n,a){return Ta(n,a*1e3)}function gr(n,a){const t=a*7;return Ae(n,t)}function it(n,a){return Fe(n,a*12)}function Qo(n){let a;return n.forEach(function(t){const e=B(t);(a===void 0||a<e||isNaN(Number(e)))&&(a=e)}),a||new Date(NaN)}function Vo(n){let a;return n.forEach(t=>{const e=B(t);(!a||a>e||isNaN(+e))&&(a=e)}),a||new Date(NaN)}function ff(n,a){const t=At(n),e=At(a);return+t==+e}function st(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function xr(n){if(!st(n)&&typeof n!="number")return!1;const a=B(n);return!isNaN(Number(a))}function yr(n,a){const t=B(n),e=B(a),r=t.getFullYear()-e.getFullYear(),o=t.getMonth()-e.getMonth();return r*12+o}function Et(n){const a=B(n);return Math.trunc(a.getMonth()/3)+1}function br(n,a){const t=B(n),e=B(a),r=t.getFullYear()-e.getFullYear(),o=Et(t)-Et(e);return r*4+o}function vr(n,a){const t=B(n),e=B(a);return t.getFullYear()-e.getFullYear()}function hf(n,a){const t=B(n),e=B(a),r=Uo(t,e),o=Math.abs(sn(t,e));t.setDate(t.getDate()-r*o);const i=+(Uo(t,e)===-r),c=r*(o-i);return c===0?0:c}function Uo(n,a){const t=n.getFullYear()-a.getFullYear()||n.getMonth()-a.getMonth()||n.getDate()-a.getDate()||n.getHours()-a.getHours()||n.getMinutes()-a.getMinutes()||n.getSeconds()-a.getSeconds()||n.getMilliseconds()-a.getMilliseconds();return t<0?-1:t>0?1:t}function oc(n){const a=B(n);return a.setHours(23,59,59,999),a}function ic(n){const a=B(n),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function va(n){const a=B(n),t=a.getMonth(),e=t-t%3;return a.setMonth(e,1),a.setHours(0,0,0,0),a}function sc(n){const a=B(n);return a.setDate(1),a.setHours(0,0,0,0),a}function cc(n){const a=B(n),t=a.getFullYear();return a.setFullYear(t+1,0,0),a.setHours(23,59,59,999),a}function Or(n){const a=B(n),t=oe(n,0);return t.setFullYear(a.getFullYear(),0,1),t.setHours(0,0,0,0),t}function mf(n,a){var c,l;const t=Wt(),e=t.weekStartsOn??((l=(c=t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??0,r=B(n),o=r.getDay(),i=(o<e?-7:0)+6-(o-e);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}const gf={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xf=(n,a,t)=>{let e;const r=gf[n];return typeof r=="string"?e=r:a===1?e=r.one:e=r.other.replace("{{count}}",a.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function ea(n){return(a={})=>{const t=a.width?String(a.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const yf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wf={date:ea({formats:yf,defaultWidth:"full"}),time:ea({formats:bf,defaultWidth:"full"}),dateTime:ea({formats:vf,defaultWidth:"full"})},kf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Df=(n,a,t,e)=>kf[n];function wn(n){return(a,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let r;if(e==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=t!=null&&t.width?String(t.width):i;r=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=t!=null&&t.width?String(t.width):n.defaultWidth;r=n.values[c]||n.values[i]}const o=n.argumentCallback?n.argumentCallback(a):a;return r[o]}}const Cf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Mf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_f={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Pf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},If={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jf=(n,a)=>{const t=Number(n),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Ef={ordinalNumber:jf,era:wn({values:Cf,defaultWidth:"wide"}),quarter:wn({values:Sf,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wn({values:Mf,defaultWidth:"wide"}),day:wn({values:_f,defaultWidth:"wide"}),dayPeriod:wn({values:Pf,defaultWidth:"wide",formattingValues:If,defaultFormattingWidth:"wide"})};function kn(n){return(a,t={})=>{const e=t.width,r=e&&n.matchPatterns[e]||n.matchPatterns[n.defaultMatchWidth],o=a.match(r);if(!o)return null;const i=o[0],c=e&&n.parsePatterns[e]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?$f(c,h=>h.test(i)):Tf(c,h=>h.test(i));let p;p=n.valueCallback?n.valueCallback(l):l,p=t.valueCallback?t.valueCallback(p):p;const u=a.slice(i.length);return{value:p,rest:u}}}function Tf(n,a){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&a(n[t]))return t}function $f(n,a){for(let t=0;t<n.length;t++)if(a(n[t]))return t}function Nf(n){return(a,t={})=>{const e=a.match(n.matchPattern);if(!e)return null;const r=e[0],o=a.match(n.parsePattern);if(!o)return null;let i=n.valueCallback?n.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;const c=a.slice(r.length);return{value:i,rest:c}}}const Of=/^(\d+)(th|st|nd|rd)?/i,Rf=/\d+/i,Af={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lf={any:[/^b/i,/^(a|c)/i]},Ff={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yf={any:[/1/i,/2/i,/3/i,/4/i]},Wf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bf={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Kf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Qf={ordinalNumber:Nf({matchPattern:Of,parsePattern:Rf,valueCallback:n=>parseInt(n,10)}),era:kn({matchPatterns:Af,defaultMatchWidth:"wide",parsePatterns:Lf,defaultParseWidth:"any"}),quarter:kn({matchPatterns:Ff,defaultMatchWidth:"wide",parsePatterns:Yf,defaultParseWidth:"any",valueCallback:n=>n+1}),month:kn({matchPatterns:Wf,defaultMatchWidth:"wide",parsePatterns:Bf,defaultParseWidth:"any"}),day:kn({matchPatterns:Hf,defaultMatchWidth:"wide",parsePatterns:zf,defaultParseWidth:"any"}),dayPeriod:kn({matchPatterns:qf,defaultMatchWidth:"any",parsePatterns:Kf,defaultParseWidth:"any"})},lc={code:"en-US",formatDistance:xf,formatLong:wf,formatRelative:Df,localize:Ef,match:Qf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Vf(n){const a=B(n);return sn(a,Or(a))+1}function Na(n){const a=B(n),t=+on(a)-+uf(a);return Math.round(t/rc)+1}function Oa(n,a){var u,h,x,b;const t=B(n),e=t.getFullYear(),r=Wt(),o=(a==null?void 0:a.firstWeekContainsDate)??((h=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((b=(x=r.locale)==null?void 0:x.options)==null?void 0:b.firstWeekContainsDate)??1,i=oe(n,0);i.setFullYear(e+1,0,o),i.setHours(0,0,0,0);const c=ut(i,a),l=oe(n,0);l.setFullYear(e,0,o),l.setHours(0,0,0,0);const p=ut(l,a);return t.getTime()>=c.getTime()?e+1:t.getTime()>=p.getTime()?e:e-1}function Uf(n,a){var c,l,p,u;const t=Wt(),e=(a==null?void 0:a.firstWeekContainsDate)??((l=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(p=t.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??1,r=Oa(n,a),o=oe(n,0);return o.setFullYear(r,0,e),o.setHours(0,0,0,0),ut(o,a)}function dc(n,a){const t=B(n),e=+ut(t,a)-+Uf(t,a);return Math.round(e/rc)+1}function ae(n,a){const t=n<0?"-":"",e=Math.abs(n).toString().padStart(a,"0");return t+e}const yt={y(n,a){const t=n.getFullYear(),e=t>0?t:1-t;return ae(a==="yy"?e%100:e,a.length)},M(n,a){const t=n.getMonth();return a==="M"?String(t+1):ae(t+1,2)},d(n,a){return ae(n.getDate(),a.length)},a(n,a){const t=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,a){return ae(n.getHours()%12||12,a.length)},H(n,a){return ae(n.getHours(),a.length)},m(n,a){return ae(n.getMinutes(),a.length)},s(n,a){return ae(n.getSeconds(),a.length)},S(n,a){const t=a.length,e=n.getMilliseconds(),r=Math.trunc(e*Math.pow(10,t-3));return ae(r,a.length)}},Vt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xo={G:function(n,a,t){const e=n.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(n,a,t){if(a==="yo"){const e=n.getFullYear(),r=e>0?e:1-e;return t.ordinalNumber(r,{unit:"year"})}return yt.y(n,a)},Y:function(n,a,t,e){const r=Oa(n,e),o=r>0?r:1-r;if(a==="YY"){const i=o%100;return ae(i,2)}return a==="Yo"?t.ordinalNumber(o,{unit:"year"}):ae(o,a.length)},R:function(n,a){const t=ac(n);return ae(t,a.length)},u:function(n,a){const t=n.getFullYear();return ae(t,a.length)},Q:function(n,a,t){const e=Math.ceil((n.getMonth()+1)/3);switch(a){case"Q":return String(e);case"QQ":return ae(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(n,a,t){const e=Math.ceil((n.getMonth()+1)/3);switch(a){case"q":return String(e);case"qq":return ae(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(n,a,t){const e=n.getMonth();switch(a){case"M":case"MM":return yt.M(n,a);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(n,a,t){const e=n.getMonth();switch(a){case"L":return String(e+1);case"LL":return ae(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(n,a,t,e){const r=dc(n,e);return a==="wo"?t.ordinalNumber(r,{unit:"week"}):ae(r,a.length)},I:function(n,a,t){const e=Na(n);return a==="Io"?t.ordinalNumber(e,{unit:"week"}):ae(e,a.length)},d:function(n,a,t){return a==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):yt.d(n,a)},D:function(n,a,t){const e=Vf(n);return a==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):ae(e,a.length)},E:function(n,a,t){const e=n.getDay();switch(a){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(n,a,t,e){const r=n.getDay(),o=(r-e.weekStartsOn+8)%7||7;switch(a){case"e":return String(o);case"ee":return ae(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(r,{width:"short",context:"formatting"});case"eeee":default:return t.day(r,{width:"wide",context:"formatting"})}},c:function(n,a,t,e){const r=n.getDay(),o=(r-e.weekStartsOn+8)%7||7;switch(a){case"c":return String(o);case"cc":return ae(o,a.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(r,{width:"narrow",context:"standalone"});case"cccccc":return t.day(r,{width:"short",context:"standalone"});case"cccc":default:return t.day(r,{width:"wide",context:"standalone"})}},i:function(n,a,t){const e=n.getDay(),r=e===0?7:e;switch(a){case"i":return String(r);case"ii":return ae(r,a.length);case"io":return t.ordinalNumber(r,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(n,a,t){const r=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,a,t){const e=n.getHours();let r;switch(e===12?r=Vt.noon:e===0?r=Vt.midnight:r=e/12>=1?"pm":"am",a){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,a,t){const e=n.getHours();let r;switch(e>=17?r=Vt.evening:e>=12?r=Vt.afternoon:e>=4?r=Vt.morning:r=Vt.night,a){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,a,t){if(a==="ho"){let e=n.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return yt.h(n,a)},H:function(n,a,t){return a==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):yt.H(n,a)},K:function(n,a,t){const e=n.getHours()%12;return a==="Ko"?t.ordinalNumber(e,{unit:"hour"}):ae(e,a.length)},k:function(n,a,t){let e=n.getHours();return e===0&&(e=24),a==="ko"?t.ordinalNumber(e,{unit:"hour"}):ae(e,a.length)},m:function(n,a,t){return a==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):yt.m(n,a)},s:function(n,a,t){return a==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):yt.s(n,a)},S:function(n,a){return yt.S(n,a)},X:function(n,a,t){const e=n.getTimezoneOffset();if(e===0)return"Z";switch(a){case"X":return Jo(e);case"XXXX":case"XX":return _t(e);case"XXXXX":case"XXX":default:return _t(e,":")}},x:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"x":return Jo(e);case"xxxx":case"xx":return _t(e);case"xxxxx":case"xxx":default:return _t(e,":")}},O:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+Go(e,":");case"OOOO":default:return"GMT"+_t(e,":")}},z:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+Go(e,":");case"zzzz":default:return"GMT"+_t(e,":")}},t:function(n,a,t){const e=Math.trunc(n.getTime()/1e3);return ae(e,a.length)},T:function(n,a,t){const e=n.getTime();return ae(e,a.length)}};function Go(n,a=""){const t=n>0?"-":"+",e=Math.abs(n),r=Math.trunc(e/60),o=e%60;return o===0?t+String(r):t+String(r)+a+ae(o,2)}function Jo(n,a){return n%60===0?(n>0?"-":"+")+ae(Math.abs(n)/60,2):_t(n,a)}function _t(n,a=""){const t=n>0?"-":"+",e=Math.abs(n),r=ae(Math.trunc(e/60),2),o=ae(e%60,2);return t+r+a+o}const Zo=(n,a)=>{switch(n){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},uc=(n,a)=>{switch(n){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},Xf=(n,a)=>{const t=n.match(/(P+)(p+)?/)||[],e=t[1],r=t[2];if(!r)return Zo(n,a);let o;switch(e){case"P":o=a.dateTime({width:"short"});break;case"PP":o=a.dateTime({width:"medium"});break;case"PPP":o=a.dateTime({width:"long"});break;case"PPPP":default:o=a.dateTime({width:"full"});break}return o.replace("{{date}}",Zo(e,a)).replace("{{time}}",uc(r,a))},wr={p:uc,P:Xf},Gf=/^D+$/,Jf=/^Y+$/,Zf=["D","DD","YY","YYYY"];function pc(n){return Gf.test(n)}function fc(n){return Jf.test(n)}function wa(n,a,t){const e=eh(n,a,t);if(console.warn(e),Zf.includes(n))throw new RangeError(e)}function eh(n,a,t){const e=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const th=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nh=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rh=/^'([^]*?)'?$/,ah=/''/g,oh=/[a-zA-Z]/;function ei(n,a,t){var u,h,x,b,y,w,k,f;const e=Wt(),r=(t==null?void 0:t.locale)??e.locale??lc,o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??e.firstWeekContainsDate??((b=(x=e.locale)==null?void 0:x.options)==null?void 0:b.firstWeekContainsDate)??1,i=(t==null?void 0:t.weekStartsOn)??((w=(y=t==null?void 0:t.locale)==null?void 0:y.options)==null?void 0:w.weekStartsOn)??e.weekStartsOn??((f=(k=e.locale)==null?void 0:k.options)==null?void 0:f.weekStartsOn)??0,c=B(n);if(!xr(c))throw new RangeError("Invalid time value");let l=a.match(nh).map(C=>{const $=C[0];if($==="p"||$==="P"){const E=wr[$];return E(C,r.formatLong)}return C}).join("").match(th).map(C=>{if(C==="''")return{isToken:!1,value:"'"};const $=C[0];if($==="'")return{isToken:!1,value:ih(C)};if(Xo[$])return{isToken:!0,value:C};if($.match(oh))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:C}});r.localize.preprocessor&&(l=r.localize.preprocessor(c,l));const p={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return l.map(C=>{if(!C.isToken)return C.value;const $=C.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&fc($)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&pc($))&&wa($,a,String(n));const E=Xo[$[0]];return E(c,$,r.localize,p)}).join("")}function ih(n){const a=n.match(rh);return a?a[1].replace(ah,"'"):n}function ti(n){return B(n).getDate()}function sh(n){return B(n).getDay()}function ch(n){const a=B(n),t=a.getFullYear(),e=a.getMonth(),r=oe(n,0);return r.setFullYear(t,e+1,0),r.setHours(0,0,0,0),r.getDate()}function lh(){return Object.assign({},Wt())}function Je(n){return B(n).getHours()}function dh(n){let t=B(n).getDay();return t===0&&(t=7),t}function Ze(n){return B(n).getMinutes()}function Me(n){return B(n).getMonth()}function ct(n){return B(n).getSeconds()}function ka(n){return B(n).getTime()}function G(n){return B(n).getFullYear()}function Dt(n,a){const t=B(n),e=B(a);return t.getTime()>e.getTime()}function Lt(n,a){const t=B(n),e=B(a);return+t<+e}function uh(n,a){const t=B(n),e=B(a);return+t==+e}function ph(n,a){const t=a instanceof Date?oe(a,0):new a(0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),t}const fh=10;class hc{constructor(){H(this,"subPriority",0)}validate(a,t){return!0}}class hh extends hc{constructor(a,t,e,r,o){super(),this.value=a,this.validateValue=t,this.setValue=e,this.priority=r,o&&(this.subPriority=o)}validate(a,t){return this.validateValue(a,this.value,t)}set(a,t,e){return this.setValue(a,t,this.value,e)}}class mh extends hc{constructor(){super(...arguments);H(this,"priority",fh);H(this,"subPriority",-1)}set(t,e){return e.timestampIsSet?t:oe(t,ph(t,Date))}}class re{run(a,t,e,r){const o=this.parse(a,t,e,r);return o?{setter:new hh(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(a,t,e){return!0}}class gh extends re{constructor(){super(...arguments);H(this,"priority",140);H(this,"incompatibleTokens",["R","u","t","T"])}parse(t,e,r){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});case"GGGG":default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,e,r){return e.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}}const fe={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ve={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function he(n,a){return n&&{value:a(n.value),rest:n.rest}}function le(n,a){const t=a.match(n);return t?{value:parseInt(t[0],10),rest:a.slice(t[0].length)}:null}function Ue(n,a){const t=a.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:a.slice(1)};const e=t[1]==="+"?1:-1,r=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,i=t[5]?parseInt(t[5],10):0;return{value:e*(r*Nr+o*$r+i*cf),rest:a.slice(t[0].length)}}function mc(n){return le(fe.anyDigitsSigned,n)}function pe(n,a){switch(n){case 1:return le(fe.singleDigit,a);case 2:return le(fe.twoDigits,a);case 3:return le(fe.threeDigits,a);case 4:return le(fe.fourDigits,a);default:return le(new RegExp("^\\d{1,"+n+"}"),a)}}function kr(n,a){switch(n){case 1:return le(fe.singleDigitSigned,a);case 2:return le(fe.twoDigitsSigned,a);case 3:return le(fe.threeDigitsSigned,a);case 4:return le(fe.fourDigitsSigned,a);default:return le(new RegExp("^-?\\d{1,"+n+"}"),a)}}function Ra(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function gc(n,a){const t=a>0,e=t?a:1-a;let r;if(e<=50)r=n||100;else{const o=e+50,i=Math.trunc(o/100)*100,c=n>=o%100;r=n+i-(c?100:0)}return t?r:1-r}function xc(n){return n%400===0||n%4===0&&n%100!==0}class xh extends re{constructor(){super(...arguments);H(this,"priority",130);H(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,e,r){const o=i=>({year:i,isTwoDigitYear:e==="yy"});switch(e){case"y":return he(pe(4,t),o);case"yo":return he(r.ordinalNumber(t,{unit:"year"}),o);default:return he(pe(e.length,t),o)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r){const o=t.getFullYear();if(r.isTwoDigitYear){const c=gc(r.year,o);return t.setFullYear(c,0,1),t.setHours(0,0,0,0),t}const i=!("era"in e)||e.era===1?r.year:1-r.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class yh extends re{constructor(){super(...arguments);H(this,"priority",130);H(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,e,r){const o=i=>({year:i,isTwoDigitYear:e==="YY"});switch(e){case"Y":return he(pe(4,t),o);case"Yo":return he(r.ordinalNumber(t,{unit:"year"}),o);default:return he(pe(e.length,t),o)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,r,o){const i=Oa(t,o);if(r.isTwoDigitYear){const l=gc(r.year,i);return t.setFullYear(l,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),ut(t,o)}const c=!("era"in e)||e.era===1?r.year:1-r.year;return t.setFullYear(c,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),ut(t,o)}}class bh extends re{constructor(){super(...arguments);H(this,"priority",130);H(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,e){return kr(e==="R"?4:e.length,t)}set(t,e,r){const o=oe(t,0);return o.setFullYear(r,0,4),o.setHours(0,0,0,0),on(o)}}class vh extends re{constructor(){super(...arguments);H(this,"priority",130);H(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,e){return kr(e==="u"?4:e.length,t)}set(t,e,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}}class wh extends re{constructor(){super(...arguments);H(this,"priority",120);H(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,r){switch(e){case"Q":case"QQ":return pe(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}}class kh extends re{constructor(){super(...arguments);H(this,"priority",120);H(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,r){switch(e){case"q":case"qq":return pe(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}}class Dh extends re{constructor(){super(...arguments);H(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);H(this,"priority",110)}parse(t,e,r){const o=i=>i-1;switch(e){case"M":return he(le(fe.month,t),o);case"MM":return he(pe(2,t),o);case"Mo":return he(r.ordinalNumber(t,{unit:"month"}),o);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}}class Ch extends re{constructor(){super(...arguments);H(this,"priority",110);H(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,e,r){const o=i=>i-1;switch(e){case"L":return he(le(fe.month,t),o);case"LL":return he(pe(2,t),o);case"Lo":return he(r.ordinalNumber(t,{unit:"month"}),o);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}}function Sh(n,a,t){const e=B(n),r=dc(e,t)-a;return e.setDate(e.getDate()-r*7),e}class Mh extends re{constructor(){super(...arguments);H(this,"priority",100);H(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,e,r){switch(e){case"w":return le(fe.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r,o){return ut(Sh(t,r,o),o)}}function _h(n,a){const t=B(n),e=Na(t)-a;return t.setDate(t.getDate()-e*7),t}class Ph extends re{constructor(){super(...arguments);H(this,"priority",100);H(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,e,r){switch(e){case"I":return le(fe.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,r){return on(_h(t,r))}}const Ih=[31,28,31,30,31,30,31,31,30,31,30,31],jh=[31,29,31,30,31,30,31,31,30,31,30,31];class Eh extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"subPriority",1);H(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,e,r){switch(e){case"d":return le(fe.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const r=t.getFullYear(),o=xc(r),i=t.getMonth();return o?e>=1&&e<=jh[i]:e>=1&&e<=Ih[i]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}}class Th extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"subpriority",1);H(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,e,r){switch(e){case"D":case"DD":return le(fe.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const r=t.getFullYear();return xc(r)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}}function Aa(n,a,t){var h,x,b,y;const e=Wt(),r=(t==null?void 0:t.weekStartsOn)??((x=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:x.weekStartsOn)??e.weekStartsOn??((y=(b=e.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??0,o=B(n),i=o.getDay(),l=(a%7+7)%7,p=7-r,u=a<0||a>6?a-(i+p)%7:(l+p)%7-(i+p)%7;return Ae(o,u)}class $h extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,e,r){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,o){return t=Aa(t,r,o),t.setHours(0,0,0,0),t}}class Nh extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,e,r,o){const i=c=>{const l=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return he(pe(e.length,t),i);case"eo":return he(r.ordinalNumber(t,{unit:"day"}),i);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,o){return t=Aa(t,r,o),t.setHours(0,0,0,0),t}}class Oh extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,e,r,o){const i=c=>{const l=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return he(pe(e.length,t),i);case"co":return he(r.ordinalNumber(t,{unit:"day"}),i);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,r,o){return t=Aa(t,r,o),t.setHours(0,0,0,0),t}}function Rh(n,a){const t=B(n),e=dh(t),r=a-e;return Ae(t,r)}class Ah extends re{constructor(){super(...arguments);H(this,"priority",90);H(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,e,r){const o=i=>i===0?7:i;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return he(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),o);case"iiiii":return he(r.day(t,{width:"narrow",context:"formatting"}),o);case"iiiiii":return he(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),o);case"iiii":default:return he(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),o)}}validate(t,e){return e>=1&&e<=7}set(t,e,r){return t=Rh(t,r),t.setHours(0,0,0,0),t}}class Lh extends re{constructor(){super(...arguments);H(this,"priority",80);H(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,e,r){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Ra(r),0,0,0),t}}class Fh extends re{constructor(){super(...arguments);H(this,"priority",80);H(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,e,r){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Ra(r),0,0,0),t}}class Yh extends re{constructor(){super(...arguments);H(this,"priority",80);H(this,"incompatibleTokens",["a","b","t","T"])}parse(t,e,r){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,r){return t.setHours(Ra(r),0,0,0),t}}class Wh extends re{constructor(){super(...arguments);H(this,"priority",70);H(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,e,r){switch(e){case"h":return le(fe.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,r){const o=t.getHours()>=12;return o&&r<12?t.setHours(r+12,0,0,0):!o&&r===12?t.setHours(0,0,0,0):t.setHours(r,0,0,0),t}}class Bh extends re{constructor(){super(...arguments);H(this,"priority",70);H(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,e,r){switch(e){case"H":return le(fe.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,r){return t.setHours(r,0,0,0),t}}class Hh extends re{constructor(){super(...arguments);H(this,"priority",70);H(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,e,r){switch(e){case"K":return le(fe.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}}class zh extends re{constructor(){super(...arguments);H(this,"priority",70);H(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,e,r){switch(e){case"k":return le(fe.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,r){const o=r<=24?r%24:r;return t.setHours(o,0,0,0),t}}class qh extends re{constructor(){super(...arguments);H(this,"priority",60);H(this,"incompatibleTokens",["t","T"])}parse(t,e,r){switch(e){case"m":return le(fe.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setMinutes(r,0,0),t}}class Kh extends re{constructor(){super(...arguments);H(this,"priority",50);H(this,"incompatibleTokens",["t","T"])}parse(t,e,r){switch(e){case"s":return le(fe.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,r){return t.setSeconds(r,0),t}}class Qh extends re{constructor(){super(...arguments);H(this,"priority",30);H(this,"incompatibleTokens",["t","T"])}parse(t,e){const r=o=>Math.trunc(o*Math.pow(10,-e.length+3));return he(pe(e.length,t),r)}set(t,e,r){return t.setMilliseconds(r),t}}class Vh extends re{constructor(){super(...arguments);H(this,"priority",10);H(this,"incompatibleTokens",["t","T","x"])}parse(t,e){switch(e){case"X":return Ue(Ve.basicOptionalMinutes,t);case"XX":return Ue(Ve.basic,t);case"XXXX":return Ue(Ve.basicOptionalSeconds,t);case"XXXXX":return Ue(Ve.extendedOptionalSeconds,t);case"XXX":default:return Ue(Ve.extended,t)}}set(t,e,r){return e.timestampIsSet?t:oe(t,t.getTime()-mr(t)-r)}}class Uh extends re{constructor(){super(...arguments);H(this,"priority",10);H(this,"incompatibleTokens",["t","T","X"])}parse(t,e){switch(e){case"x":return Ue(Ve.basicOptionalMinutes,t);case"xx":return Ue(Ve.basic,t);case"xxxx":return Ue(Ve.basicOptionalSeconds,t);case"xxxxx":return Ue(Ve.extendedOptionalSeconds,t);case"xxx":default:return Ue(Ve.extended,t)}}set(t,e,r){return e.timestampIsSet?t:oe(t,t.getTime()-mr(t)-r)}}class Xh extends re{constructor(){super(...arguments);H(this,"priority",40);H(this,"incompatibleTokens","*")}parse(t){return mc(t)}set(t,e,r){return[oe(t,r*1e3),{timestampIsSet:!0}]}}class Gh extends re{constructor(){super(...arguments);H(this,"priority",20);H(this,"incompatibleTokens","*")}parse(t){return mc(t)}set(t,e,r){return[oe(t,r),{timestampIsSet:!0}]}}const Jh={G:new gh,y:new xh,Y:new yh,R:new bh,u:new vh,Q:new wh,q:new kh,M:new Dh,L:new Ch,w:new Mh,I:new Ph,d:new Eh,D:new Th,E:new $h,e:new Nh,c:new Oh,i:new Ah,a:new Lh,b:new Fh,B:new Yh,h:new Wh,H:new Bh,K:new Hh,k:new zh,m:new qh,s:new Kh,S:new Qh,X:new Vh,x:new Uh,t:new Xh,T:new Gh},Zh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,em=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tm=/^'([^]*?)'?$/,nm=/''/g,rm=/\S/,am=/[a-zA-Z]/;function ta(n,a,t,e){var w,k,f,C,$,E,A,N;const r=lh(),o=(e==null?void 0:e.locale)??r.locale??lc,i=(e==null?void 0:e.firstWeekContainsDate)??((k=(w=e==null?void 0:e.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??r.firstWeekContainsDate??((C=(f=r.locale)==null?void 0:f.options)==null?void 0:C.firstWeekContainsDate)??1,c=(e==null?void 0:e.weekStartsOn)??((E=($=e==null?void 0:e.locale)==null?void 0:$.options)==null?void 0:E.weekStartsOn)??r.weekStartsOn??((N=(A=r.locale)==null?void 0:A.options)==null?void 0:N.weekStartsOn)??0;if(a==="")return n===""?B(t):oe(t,NaN);const l={firstWeekContainsDate:i,weekStartsOn:c,locale:o},p=[new mh],u=a.match(em).map(S=>{const D=S[0];if(D in wr){const P=wr[D];return P(S,o.formatLong)}return S}).join("").match(Zh),h=[];for(let S of u){!(e!=null&&e.useAdditionalWeekYearTokens)&&fc(S)&&wa(S,a,n),!(e!=null&&e.useAdditionalDayOfYearTokens)&&pc(S)&&wa(S,a,n);const D=S[0],P=Jh[D];if(P){const{incompatibleTokens:I}=P;if(Array.isArray(I)){const T=h.find(W=>I.includes(W.token)||W.token===D);if(T)throw new RangeError(`The format string mustn't contain \`${T.fullToken}\` and \`${S}\` at the same time`)}else if(P.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);h.push({token:D,fullToken:S});const O=P.run(n,S,o.match,l);if(!O)return oe(t,NaN);p.push(O.setter),n=O.rest}else{if(D.match(am))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");if(S==="''"?S="'":D==="'"&&(S=om(S)),n.indexOf(S)===0)n=n.slice(S.length);else return oe(t,NaN)}}if(n.length>0&&rm.test(n))return oe(t,NaN);const x=p.map(S=>S.priority).sort((S,D)=>D-S).filter((S,D,P)=>P.indexOf(S)===D).map(S=>p.filter(D=>D.priority===S).sort((D,P)=>P.subPriority-D.subPriority)).map(S=>S[0]);let b=B(t);if(isNaN(b.getTime()))return oe(t,NaN);const y={};for(const S of x){if(!S.validate(b,l))return oe(t,NaN);const D=S.set(b,y,l);Array.isArray(D)?(b=D[0],Object.assign(y,D[1])):b=D}return oe(t,b)}function om(n){return n.match(tm)[1].replace(nm,"'")}function im(n,a){const t=B(n),e=B(a);return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function sm(n,a){const t=va(n),e=va(a);return+t==+e}function cm(n,a){const t=B(n),e=B(a);return t.getFullYear()===e.getFullYear()}function Nn(n,a){const t=+B(n),[e,r]=[+B(a.start),+B(a.end)].sort((o,i)=>o-i);return t>=e&&t<=r}function lm(n,a){return Ae(n,-1)}function dm(n,a){const e=hm(n);let r;if(e.date){const l=mm(e.date,2);r=gm(l.restDateString,l.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const o=r.getTime();let i=0,c;if(e.time&&(i=xm(e.time),isNaN(i)))return new Date(NaN);if(e.timezone){if(c=ym(e.timezone),isNaN(c))return new Date(NaN)}else{const l=new Date(o+i),p=new Date(0);return p.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),p.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),p}return new Date(o+i+c)}const Xn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},um=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,pm=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function hm(n){const a={},t=n.split(Xn.dateTimeDelimiter);let e;if(t.length>2)return a;if(/:/.test(t[0])?e=t[0]:(a.date=t[0],e=t[1],Xn.timeZoneDelimiter.test(a.date)&&(a.date=n.split(Xn.timeZoneDelimiter)[0],e=n.substr(a.date.length,n.length))),e){const r=Xn.timezone.exec(e);r?(a.time=e.replace(r[1],""),a.timezone=r[1]):a.time=e}return a}function mm(n,a){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+a)+"})|(\\d{2}|[+-]\\d{"+(2+a)+"})$)"),e=n.match(t);if(!e)return{year:NaN,restDateString:""};const r=e[1]?parseInt(e[1]):null,o=e[2]?parseInt(e[2]):null;return{year:o===null?r:o*100,restDateString:n.slice((e[1]||e[2]).length)}}function gm(n,a){if(a===null)return new Date(NaN);const t=n.match(um);if(!t)return new Date(NaN);const e=!!t[4],r=Dn(t[1]),o=Dn(t[2])-1,i=Dn(t[3]),c=Dn(t[4]),l=Dn(t[5])-1;if(e)return Dm(a,c,l)?bm(a,c,l):new Date(NaN);{const p=new Date(0);return!wm(a,o,i)||!km(a,r)?new Date(NaN):(p.setUTCFullYear(a,o,Math.max(r,i)),p)}}function Dn(n){return n?parseInt(n):1}function xm(n){const a=n.match(pm);if(!a)return NaN;const t=na(a[1]),e=na(a[2]),r=na(a[3]);return Cm(t,e,r)?t*Nr+e*$r+r*1e3:NaN}function na(n){return n&&parseFloat(n.replace(",","."))||0}function ym(n){if(n==="Z")return 0;const a=n.match(fm);if(!a)return 0;const t=a[1]==="+"?-1:1,e=parseInt(a[2]),r=a[3]&&parseInt(a[3])||0;return Sm(e,r)?t*(e*Nr+r*$r):NaN}function bm(n,a,t){const e=new Date(0);e.setUTCFullYear(n,0,4);const r=e.getUTCDay()||7,o=(a-1)*7+t+1-r;return e.setUTCDate(e.getUTCDate()+o),e}const vm=[31,null,31,30,31,30,31,31,30,31,30,31];function yc(n){return n%400===0||n%4===0&&n%100!==0}function wm(n,a,t){return a>=0&&a<=11&&t>=1&&t<=(vm[a]||(yc(n)?29:28))}function km(n,a){return a>=1&&a<=(yc(n)?366:365)}function Dm(n,a,t){return a>=1&&a<=53&&t>=0&&t<=6}function Cm(n,a,t){return n===24?a===0&&t===0:t>=0&&t<60&&a>=0&&a<60&&n>=0&&n<25}function Sm(n,a){return a>=0&&a<=59}function Ee(n,a){const t=B(n),e=t.getFullYear(),r=t.getDate(),o=oe(n,0);o.setFullYear(e,a,15),o.setHours(0,0,0,0);const i=ch(o);return t.setMonth(a,Math.min(r,i)),t}function Mm(n,a){let t=B(n);return isNaN(+t)?oe(n,NaN):(a.year!=null&&t.setFullYear(a.year),a.month!=null&&(t=Ee(t,a.month)),a.date!=null&&t.setDate(a.date),a.hours!=null&&t.setHours(a.hours),a.minutes!=null&&t.setMinutes(a.minutes),a.seconds!=null&&t.setSeconds(a.seconds),a.milliseconds!=null&&t.setMilliseconds(a.milliseconds),t)}function ar(n,a){const t=B(n);return t.setHours(a),t}function or(n,a){const t=B(n);return t.setMinutes(a),t}function Gt(n,a){const t=B(n),e=Math.trunc(t.getMonth()/3)+1,r=a-e;return Ee(t,t.getMonth()+r*3)}function ir(n,a){const t=B(n);return t.setSeconds(a),t}function qe(n,a){const t=B(n);return isNaN(+t)?oe(n,NaN):(t.setFullYear(a),t)}function Tt(n,a){return Fe(n,-a)}function bc(n,a){return $a(n,-1)}function ni(n,a){return gr(n,-1)}function cn(n,a){return it(n,-a)}var _m=typeof document<"u",Pm=function(){},Dr=_m?v.useLayoutEffect:Pm;const Im={...Cs},jm=Im.useInsertionEffect,Em=jm||(n=>n());function Tm(n){const a=v.useRef(()=>{});return Em(()=>{a.current=n}),v.useCallback(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return a.current==null?void 0:a.current(...e)},[])}const $m={...Cs};let ri=!1,Nm=0;const ai=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Nm++;function Om(){const[n,a]=v.useState(()=>ri?ai():void 0);return Dr(()=>{n==null&&a(ai())},[]),v.useEffect(()=>{ri=!0},[]),n}const Rm=$m.useId,vc=Rm||Om,Am=v.forwardRef(function(a,t){const{context:{placement:e,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:c=14,height:l=7,tipRadius:p=0,strokeWidth:u=0,staticOffset:h,stroke:x,d:b,style:{transform:y,...w}={},...k}=a,f=vc(),[C,$]=v.useState(!1);if(Dr(()=>{if(!r)return;Le(r).direction==="rtl"&&$(!0)},[r]),!r)return null;const[E,A]=e.split("-"),N=E==="top"||E==="bottom";let S=h;(N&&i!=null&&i.x||!N&&i!=null&&i.y)&&(S=null);const D=u*2,P=D/2,I=c/2*(p/-8+1),O=l/2*p/4,T=!!b,W=S&&A==="end"?"bottom":"top";let z=S&&A==="end"?"right":"left";S&&C&&(z=A==="end"?"left":"right");const U=(o==null?void 0:o.x)!=null?S||o.x:"",Y=(o==null?void 0:o.y)!=null?S||o.y:"",q=b||"M0,0"+(" H"+c)+(" L"+(c-I)+","+(l-O))+(" Q"+c/2+","+l+" "+I+","+(l-O))+" Z",_={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[E];return s.jsxs("svg",{...k,"aria-hidden":!0,ref:t,width:T?c:c+D,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[z]:U,[W]:Y,[E]:N||T?"100%":"calc(100% - "+D/2+"px)",transform:[_,y].filter(J=>!!J).join(" "),...w},children:[D>0&&s.jsx("path",{clipPath:"url(#"+f+")",fill:"none",stroke:x,strokeWidth:D+(b?0:1),d:q}),s.jsx("path",{stroke:D&&!b?k.fill:"none",d:q}),s.jsx("clipPath",{id:f,children:s.jsx("rect",{x:-P,y:P*(T?-1:1),width:c+D,height:c})})]})});function Lm(){const n=new Map;return{emit(a,t){var e;(e=n.get(a))==null||e.forEach(r=>r(t))},on(a,t){n.has(a)||n.set(a,new Set),n.get(a).add(t)},off(a,t){var e;(e=n.get(a))==null||e.delete(t)}}}const Fm=v.createContext(null),Ym=v.createContext(null),Wm=()=>{var n;return((n=v.useContext(Fm))==null?void 0:n.id)||null},Bm=()=>v.useContext(Ym);function Hm(n){const{open:a=!1,onOpenChange:t,elements:e}=n,r=vc(),o=v.useRef({}),[i]=v.useState(()=>Lm()),c=Wm()!=null,[l,p]=v.useState(e.reference),u=Tm((b,y,w)=>{o.current.openEvent=b?y:void 0,i.emit("openchange",{open:b,event:y,reason:w,nested:c}),t==null||t(b,y,w)}),h=v.useMemo(()=>({setPositionReference:p}),[]),x=v.useMemo(()=>({reference:l||e.reference||null,floating:e.floating||null,domReference:e.reference}),[l,e.reference,e.floating]);return v.useMemo(()=>({dataRef:o,open:a,onOpenChange:u,elements:x,events:i,floatingId:r,refs:h}),[a,u,x,i,r,h])}function zm(n){var a,t;let{elements:e,...r}=n===void 0?{}:n;const{nodeId:o}=r,i=Hm({...r,elements:{reference:(a=e==null?void 0:e.reference)!=null?a:null,floating:(t=e==null?void 0:e.floating)!=null?t:null}}),c=r.rootContext||i,l=c.elements,[p,u]=v.useState(null),[h,x]=v.useState(null),y=(l==null?void 0:l.domReference)||p,w=v.useRef(null),k=Bm();Dr(()=>{y&&(w.current=y)},[y]);const f=Ip({...r,elements:{...l,...h&&{reference:h}}}),C=v.useCallback(S=>{const D=_e(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;x(D),f.refs.setReference(D)},[f.refs]),$=v.useCallback(S=>{(_e(S)||S===null)&&(w.current=S,u(S)),(_e(f.refs.reference.current)||f.refs.reference.current===null||S!==null&&!_e(S))&&f.refs.setReference(S)},[f.refs]),E=v.useMemo(()=>({...f.refs,setReference:$,setPositionReference:C,domReference:w}),[f.refs,$,C]),A=v.useMemo(()=>({...f.elements,domReference:y}),[f.elements,y]),N=v.useMemo(()=>({...f,...c,refs:E,elements:A,nodeId:o}),[f,E,A,o,c]);return Dr(()=>{c.dataRef.current.floatingContext=N;const S=k==null?void 0:k.nodesRef.current.find(D=>D.id===o);S&&(S.context=N)}),v.useMemo(()=>({...f,context:N,refs:E,elements:A}),[f,E,A,N])}/*!
|
|
349
|
+
react-datepicker v7.6.0
|
|
350
|
+
https://github.com/Hacker0x01/react-datepicker
|
|
351
|
+
Released under the MIT License.
|
|
352
|
+
*/var Da=function(a,t){return Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])},Da(a,t)};function be(n,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");Da(n,a);function t(){this.constructor=n}n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}var te=function(){return te=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},te.apply(this,arguments)};function Ge(n,a,t){if(t||arguments.length===2)for(var e=0,r=a.length,o;e<r;e++)(o||!(e in a))&&(o||(o=Array.prototype.slice.call(a,0,e)),o[e]=a[e]);return n.concat(o||Array.prototype.slice.call(a))}var qm=function(n){var a=n.showTimeSelectOnly,t=a===void 0?!1:a,e=n.showTime,r=e===void 0?!1:e,o=n.className,i=n.children,c=t?"Choose Time":"Choose Date".concat(r?" and Time":"");return M.createElement("div",{className:o,role:"dialog","aria-label":c,"aria-modal":"true"},i)},Km=function(n,a){var t=v.useRef(null),e=v.useRef(n);e.current=n;var r=v.useCallback(function(o){var i;t.current&&!t.current.contains(o.target)&&(a&&o.target instanceof HTMLElement&&o.target.classList.contains(a)||(i=e.current)===null||i===void 0||i.call(e,o))},[a]);return v.useEffect(function(){return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}},[r]),t},Rr=function(n){var a=n.children,t=n.onClickOutside,e=n.className,r=n.containerRef,o=n.style,i=n.ignoreClass,c=Km(t,i);return M.createElement("div",{className:e,style:o,ref:function(l){c.current=l,r&&(r.current=l)}},a)},F;(function(n){n.ArrowUp="ArrowUp",n.ArrowDown="ArrowDown",n.ArrowLeft="ArrowLeft",n.ArrowRight="ArrowRight",n.PageUp="PageUp",n.PageDown="PageDown",n.Home="Home",n.End="End",n.Enter="Enter",n.Space=" ",n.Tab="Tab",n.Escape="Escape",n.Backspace="Backspace",n.X="x"})(F||(F={}));function wc(){var n=typeof window<"u"?window:globalThis;return n}var Ln=12,Qm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;function ie(n){if(n==null)return new Date;var a=typeof n=="string"?dm(n):B(n);return at(a)?a:new Date}function ra(n,a,t,e,r){var o,i=null,c=$t(t)||$t(jn()),l=!0;if(Array.isArray(a))return a.forEach(function(u){var h=ta(n,u,new Date,{locale:c,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});e&&(l=at(h,r)&&n===se(h,u,t)),at(h,r)&&l&&(i=h)}),i;if(i=ta(n,a,new Date,{locale:c,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0}),e)l=at(i)&&n===se(i,a,t);else if(!at(i)){var p=((o=a.match(Qm))!==null&&o!==void 0?o:[]).map(function(u){var h=u[0];if(h==="p"||h==="P"){var x=wr[h];return c?x(u,c.formatLong):h}return u}).join("");n.length>0&&(i=ta(n,p.slice(0,n.length),new Date,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})),at(i)||(i=new Date(n))}return at(i)&&l?i:null}function at(n,a){return xr(n)&&!Lt(n,a??new Date("1/1/1800"))}function se(n,a,t){if(t==="en")return ei(n,a,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var e=t?$t(t):void 0;return t&&!e&&console.warn('A locale object was not found for the provided string ["'.concat(t,'"].')),!e&&jn()&&$t(jn())&&(e=$t(jn())),ei(n,a,{locale:e,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function $e(n,a){var t=a.dateFormat,e=a.locale,r=Array.isArray(t)&&t.length>0?t[0]:t;return n&&se(n,r,e)||""}function Vm(n,a,t){if(!n)return"";var e=$e(n,t),r=a?$e(a,t):"";return"".concat(e," - ").concat(r)}function Um(n,a){if(!(n!=null&&n.length))return"";var t=n[0]?$e(n[0],a):"";if(n.length===1)return t;if(n.length===2&&n[1]){var e=$e(n[1],a);return"".concat(t,", ").concat(e)}var r=n.length-1;return"".concat(t," (+").concat(r,")")}function aa(n,a){var t=a.hour,e=t===void 0?0:t,r=a.minute,o=r===void 0?0:r,i=a.second,c=i===void 0?0:i;return ar(or(ir(n,c),o),e)}function Xm(n){return Na(n)}function Gm(n,a){return se(n,"ddd",a)}function sr(n){return At(n)}function kt(n,a,t){var e=$t(a||jn());return ut(n,{locale:e,weekStartsOn:t})}function lt(n){return sc(n)}function _n(n){return Or(n)}function oi(n){return va(n)}function ii(){return At(ie())}function si(n){return oc(n)}function Jm(n){return mf(n)}function Zm(n){return ic(n)}function Ke(n,a){return n&&a?cm(n,a):!n&&!a}function Se(n,a){return n&&a?im(n,a):!n&&!a}function Cr(n,a){return n&&a?sm(n,a):!n&&!a}function ee(n,a){return n&&a?ff(n,a):!n&&!a}function It(n,a){return n&&a?uh(n,a):!n&&!a}function Pn(n,a,t){var e,r=At(a),o=oc(t);try{e=Nn(n,{start:r,end:o})}catch{e=!1}return e}function jn(){var n=wc();return n.__localeId__}function $t(n){if(typeof n=="string"){var a=wc();return a.__localeData__?a.__localeData__[n]:void 0}else return n}function eg(n,a,t){return a(se(n,"EEEE",t))}function tg(n,a){return se(n,"EEEEEE",a)}function ng(n,a){return se(n,"EEE",a)}function La(n,a){return se(Ee(ie(),n),"LLLL",a)}function kc(n,a){return se(Ee(ie(),n),"LLL",a)}function rg(n,a){return se(Gt(ie(),n),"QQQ",a)}function Ne(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.excludeDateIntervals,c=t.includeDates,l=t.includeDateIntervals,p=t.filterDate;return Fn(n,{minDate:e,maxDate:r})||o&&o.some(function(u){return u instanceof Date?ee(n,u):ee(n,u.date)})||i&&i.some(function(u){var h=u.start,x=u.end;return Nn(n,{start:h,end:x})})||c&&!c.some(function(u){return ee(n,u)})||l&&!l.some(function(u){var h=u.start,x=u.end;return Nn(n,{start:h,end:x})})||p&&!p(ie(n))||!1}function Fa(n,a){var t=a===void 0?{}:a,e=t.excludeDates,r=t.excludeDateIntervals;return r&&r.length>0?r.some(function(o){var i=o.start,c=o.end;return Nn(n,{start:i,end:c})}):e&&e.some(function(o){var i;return o instanceof Date?ee(n,o):ee(n,(i=o.date)!==null&&i!==void 0?i:new Date)})||!1}function Dc(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates,c=t.filterDate;return Fn(n,{minDate:e?sc(e):void 0,maxDate:r?ic(r):void 0})||(o==null?void 0:o.some(function(l){return Se(n,l instanceof Date?l:l.date)}))||i&&!i.some(function(l){return Se(n,l)})||c&&!c(ie(n))||!1}function Gn(n,a,t,e){var r=G(n),o=Me(n),i=G(a),c=Me(a),l=G(e);return r===i&&r===l?o<=t&&t<=c:r<i?l===r&&o<=t||l===i&&c>=t||l<i&&l>r:!1}function ag(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates;return Fn(n,{minDate:e,maxDate:r})||o&&o.some(function(c){return Se(c instanceof Date?c:c.date,n)})||i&&!i.some(function(c){return Se(c,n)})||!1}function Jn(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates,c=t.filterDate;return Fn(n,{minDate:e,maxDate:r})||(o==null?void 0:o.some(function(l){return Cr(n,l instanceof Date?l:l.date)}))||i&&!i.some(function(l){return Cr(n,l)})||c&&!c(ie(n))||!1}function Zn(n,a,t){if(!a||!t||!xr(a)||!xr(t))return!1;var e=G(a),r=G(t);return e<=n&&r>=n}function cr(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates,c=t.filterDate,l=new Date(n,0,1);return Fn(l,{minDate:e?Or(e):void 0,maxDate:r?cc(r):void 0})||(o==null?void 0:o.some(function(p){return Ke(l,p instanceof Date?p:p.date)}))||i&&!i.some(function(p){return Ke(l,p)})||c&&!c(ie(l))||!1}function er(n,a,t,e){var r=G(n),o=Et(n),i=G(a),c=Et(a),l=G(e);return r===i&&r===l?o<=t&&t<=c:r<i?l===r&&o<=t||l===i&&c>=t||l<i&&l>r:!1}function Fn(n,a){var t,e=a===void 0?{}:a,r=e.minDate,o=e.maxDate;return(t=r&&sn(n,r)<0||o&&sn(n,o)>0)!==null&&t!==void 0?t:!1}function ci(n,a){return a.some(function(t){return Je(t)===Je(n)&&Ze(t)===Ze(n)&&ct(t)===ct(n)})}function li(n,a){var t=a===void 0?{}:a,e=t.excludeTimes,r=t.includeTimes,o=t.filterTime;return e&&ci(n,e)||r&&!ci(n,r)||o&&!o(n)||!1}function di(n,a){var t=a.minTime,e=a.maxTime;if(!t||!e)throw new Error("Both minTime and maxTime props required");var r=ie();r=ar(r,Je(n)),r=or(r,Ze(n)),r=ir(r,ct(n));var o=ie();o=ar(o,Je(t)),o=or(o,Ze(t)),o=ir(o,ct(t));var i=ie();i=ar(i,Je(e)),i=or(i,Ze(e)),i=ir(i,ct(e));var c;try{c=!Nn(r,{start:o,end:i})}catch{c=!1}return c}function ui(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.includeDates,o=Tt(n,1);return e&&yr(e,o)>0||r&&r.every(function(i){return yr(i,o)>0})||!1}function pi(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.includeDates,o=Fe(n,1);return e&&yr(o,e)>0||r&&r.every(function(i){return yr(o,i)>0})||!1}function og(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.includeDates,o=Or(n),i=bc(o);return e&&br(e,i)>0||r&&r.every(function(c){return br(c,i)>0})||!1}function ig(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.includeDates,o=cc(n),i=$a(o,1);return e&&br(i,e)>0||r&&r.every(function(c){return br(i,c)>0})||!1}function fi(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.includeDates,o=cn(n,1);return e&&vr(e,o)>0||r&&r.every(function(i){return vr(i,o)>0})||!1}function sg(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.yearItemNumber,o=r===void 0?Ln:r,i=_n(cn(n,o)),c=vt(i,o).endPeriod,l=e&&G(e);return l&&l>c||!1}function hi(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.includeDates,o=it(n,1);return e&&vr(o,e)>0||r&&r.every(function(i){return vr(o,i)>0})||!1}function cg(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.yearItemNumber,o=r===void 0?Ln:r,i=it(n,o),c=vt(i,o).startPeriod,l=e&&G(e);return l&&l<c||!1}function Cc(n){var a=n.minDate,t=n.includeDates;if(t&&a){var e=t.filter(function(r){return sn(r,a)>=0});return Vo(e)}else return t?Vo(t):a}function Sc(n){var a=n.maxDate,t=n.includeDates;if(t&&a){var e=t.filter(function(r){return sn(r,a)<=0});return Qo(e)}else return t?Qo(t):a}function mi(n,a){var t;n===void 0&&(n=[]),a===void 0&&(a="react-datepicker__day--highlighted");for(var e=new Map,r=0,o=n.length;r<o;r++){var i=n[r];if(st(i)){var c=se(i,"MM.dd.yyyy"),l=e.get(c)||[];l.includes(a)||(l.push(a),e.set(c,l))}else if(typeof i=="object"){var p=Object.keys(i),u=(t=p[0])!==null&&t!==void 0?t:"",h=i[u];if(typeof u=="string"&&Array.isArray(h))for(var x=0,b=h.length;x<b;x++){var y=h[x];if(y){var c=se(y,"MM.dd.yyyy"),l=e.get(c)||[];l.includes(u)||(l.push(u),e.set(c,l))}}}}return e}function lg(n,a){return n.length!==a.length?!1:n.every(function(t,e){return t===a[e]})}function dg(n,a){n===void 0&&(n=[]),a===void 0&&(a="react-datepicker__day--holidays");var t=new Map;return n.forEach(function(e){var r=e.date,o=e.holidayName;if(st(r)){var i=se(r,"MM.dd.yyyy"),c=t.get(i)||{className:"",holidayNames:[]};if(!("className"in c&&c.className===a&&lg(c.holidayNames,[o]))){c.className=a;var l=c.holidayNames;c.holidayNames=l?Ge(Ge([],l,!0),[o],!1):[o],t.set(i,c)}}}),t}function ug(n,a,t,e,r){for(var o=r.length,i=[],c=0;c<o;c++){var l=n,p=r[c];p&&(l=lf(l,Je(p)),l=ba(l,Ze(p)),l=pf(l,ct(p)));var u=ba(n,(t+1)*e);Dt(l,a)&&Lt(l,u)&&p!=null&&i.push(p)}return i}function gi(n){return n<10?"0".concat(n):"".concat(n)}function vt(n,a){a===void 0&&(a=Ln);var t=Math.ceil(G(n)/a)*a,e=t-(a-1);return{startPeriod:e,endPeriod:t}}function pg(n){var a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),24);return Math.round((+t-+a)/36e5)}function xi(n){var a=n.getSeconds(),t=n.getMilliseconds();return B(n.getTime()-a*1e3-t)}function fg(n,a){return xi(n).getTime()===xi(a).getTime()}function yi(n){if(!st(n))throw new Error("Invalid date");var a=new Date(n);return a.setHours(0,0,0,0),a}function bi(n,a){if(!st(n)||!st(a))throw new Error("Invalid date received");var t=yi(n),e=yi(a);return Lt(t,e)}function Mc(n){return n.key===F.Space}var hg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.inputRef=M.createRef(),e.onTimeChange=function(r){var o,i;e.setState({time:r});var c=e.props.date,l=c instanceof Date&&!isNaN(+c),p=l?c:new Date;if(r!=null&&r.includes(":")){var u=r.split(":"),h=u[0],x=u[1];p.setHours(Number(h)),p.setMinutes(Number(x))}(i=(o=e.props).onChange)===null||i===void 0||i.call(o,p)},e.renderTimeInput=function(){var r=e.state.time,o=e.props,i=o.date,c=o.timeString,l=o.customTimeInput;return l?v.cloneElement(l,{date:i,value:r,onChange:e.onTimeChange}):M.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:e.inputRef,onClick:function(){var p;(p=e.inputRef.current)===null||p===void 0||p.focus()},required:!0,value:r,onChange:function(p){e.onTimeChange(p.target.value||c)}})},e.state={time:e.props.timeString},e}return a.getDerivedStateFromProps=function(t,e){return t.timeString!==e.time?{time:t.timeString}:null},a.prototype.render=function(){return M.createElement("div",{className:"react-datepicker__input-time-container"},M.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),M.createElement("div",{className:"react-datepicker-time__input-container"},M.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},a})(v.Component),mg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.dayEl=v.createRef(),t.handleClick=function(e){!t.isDisabled()&&t.props.onClick&&t.props.onClick(e)},t.handleMouseEnter=function(e){!t.isDisabled()&&t.props.onMouseEnter&&t.props.onMouseEnter(e)},t.handleOnKeyDown=function(e){var r,o,i=e.key;i===F.Space&&(e.preventDefault(),e.key=F.Enter),(o=(r=t.props).handleOnKeyDown)===null||o===void 0||o.call(r,e)},t.isSameDay=function(e){return ee(t.props.day,e)},t.isKeyboardSelected=function(){var e;if(t.props.disabledKeyboardNavigation)return!1;var r=t.props.selectsMultiple?(e=t.props.selectedDates)===null||e===void 0?void 0:e.some(function(i){return t.isSameDayOrWeek(i)}):t.isSameDayOrWeek(t.props.selected),o=t.props.preSelection&&t.isDisabled(t.props.preSelection);return!r&&t.isSameDayOrWeek(t.props.preSelection)&&!o},t.isDisabled=function(e){return e===void 0&&(e=t.props.day),Ne(e,{minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals,includeDateIntervals:t.props.includeDateIntervals,includeDates:t.props.includeDates,filterDate:t.props.filterDate})},t.isExcluded=function(){return Fa(t.props.day,{excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals})},t.isStartOfWeek=function(){return ee(t.props.day,kt(t.props.day,t.props.locale,t.props.calendarStartDay))},t.isSameWeek=function(e){return t.props.showWeekPicker&&ee(e,kt(t.props.day,t.props.locale,t.props.calendarStartDay))},t.isSameDayOrWeek=function(e){return t.isSameDay(e)||t.isSameWeek(e)},t.getHighLightedClass=function(){var e=t.props,r=e.day,o=e.highlightDates;if(!o)return!1;var i=se(r,"MM.dd.yyyy");return o.get(i)},t.getHolidaysClass=function(){var e,r=t.props,o=r.day,i=r.holidays;if(!i)return[void 0];var c=se(o,"MM.dd.yyyy");return i.has(c)?[(e=i.get(c))===null||e===void 0?void 0:e.className]:[void 0]},t.isInRange=function(){var e=t.props,r=e.day,o=e.startDate,i=e.endDate;return!o||!i?!1:Pn(r,o,i)},t.isInSelectingRange=function(){var e,r=t.props,o=r.day,i=r.selectsStart,c=r.selectsEnd,l=r.selectsRange,p=r.selectsDisabledDaysInRange,u=r.startDate,h=r.endDate,x=(e=t.props.selectingDate)!==null&&e!==void 0?e:t.props.preSelection;return!(i||c||l)||!x||!p&&t.isDisabled()?!1:i&&h&&(Lt(x,h)||It(x,h))?Pn(o,x,h):c&&u&&(Dt(x,u)||It(x,u))||l&&u&&!h&&(Dt(x,u)||It(x,u))?Pn(o,u,x):!1},t.isSelectingRangeStart=function(){var e;if(!t.isInSelectingRange())return!1;var r=t.props,o=r.day,i=r.startDate,c=r.selectsStart,l=(e=t.props.selectingDate)!==null&&e!==void 0?e:t.props.preSelection;return c?ee(o,l):ee(o,i)},t.isSelectingRangeEnd=function(){var e;if(!t.isInSelectingRange())return!1;var r=t.props,o=r.day,i=r.endDate,c=r.selectsEnd,l=r.selectsRange,p=(e=t.props.selectingDate)!==null&&e!==void 0?e:t.props.preSelection;return c||l?ee(o,p):ee(o,i)},t.isRangeStart=function(){var e=t.props,r=e.day,o=e.startDate,i=e.endDate;return!o||!i?!1:ee(o,r)},t.isRangeEnd=function(){var e=t.props,r=e.day,o=e.startDate,i=e.endDate;return!o||!i?!1:ee(i,r)},t.isWeekend=function(){var e=sh(t.props.day);return e===0||e===6},t.isAfterMonth=function(){return t.props.month!==void 0&&(t.props.month+1)%12===Me(t.props.day)},t.isBeforeMonth=function(){return t.props.month!==void 0&&(Me(t.props.day)+1)%12===t.props.month},t.isCurrentDay=function(){return t.isSameDay(ie())},t.isSelected=function(){var e;return t.props.selectsMultiple?(e=t.props.selectedDates)===null||e===void 0?void 0:e.some(function(r){return t.isSameDayOrWeek(r)}):t.isSameDayOrWeek(t.props.selected)},t.getClassNames=function(e){var r=t.props.dayClassName?t.props.dayClassName(e):void 0;return ke("react-datepicker__day",r,"react-datepicker__day--"+Gm(t.props.day),{"react-datepicker__day--disabled":t.isDisabled(),"react-datepicker__day--excluded":t.isExcluded(),"react-datepicker__day--selected":t.isSelected(),"react-datepicker__day--keyboard-selected":t.isKeyboardSelected(),"react-datepicker__day--range-start":t.isRangeStart(),"react-datepicker__day--range-end":t.isRangeEnd(),"react-datepicker__day--in-range":t.isInRange(),"react-datepicker__day--in-selecting-range":t.isInSelectingRange(),"react-datepicker__day--selecting-range-start":t.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":t.isSelectingRangeEnd(),"react-datepicker__day--today":t.isCurrentDay(),"react-datepicker__day--weekend":t.isWeekend(),"react-datepicker__day--outside-month":t.isAfterMonth()||t.isBeforeMonth()},t.getHighLightedClass(),t.getHolidaysClass())},t.getAriaLabel=function(){var e=t.props,r=e.day,o=e.ariaLabelPrefixWhenEnabled,i=o===void 0?"Choose":o,c=e.ariaLabelPrefixWhenDisabled,l=c===void 0?"Not available":c,p=t.isDisabled()||t.isExcluded()?l:i;return"".concat(p," ").concat(se(r,"PPPP",t.props.locale))},t.getTitle=function(){var e=t.props,r=e.day,o=e.holidays,i=o===void 0?new Map:o,c=e.excludeDates,l=se(r,"MM.dd.yyyy"),p=[];return i.has(l)&&p.push.apply(p,i.get(l).holidayNames),t.isExcluded()&&p.push(c==null?void 0:c.filter(function(u){return u instanceof Date?ee(u,r):ee(u==null?void 0:u.date,r)}).map(function(u){if(!(u instanceof Date))return u==null?void 0:u.message})),p.join(", ")},t.getTabIndex=function(){var e=t.props.selected,r=t.props.preSelection,o=!(t.props.showWeekPicker&&(t.props.showWeekNumber||!t.isStartOfWeek()))&&(t.isKeyboardSelected()||t.isSameDay(e)&&ee(r,e))?0:-1;return o},t.handleFocusDay=function(){var e;t.shouldFocusDay()&&((e=t.dayEl.current)===null||e===void 0||e.focus({preventScroll:!0}))},t.renderDayContents=function(){return t.props.monthShowsDuplicateDaysEnd&&t.isAfterMonth()||t.props.monthShowsDuplicateDaysStart&&t.isBeforeMonth()?null:t.props.renderDayContents?t.props.renderDayContents(ti(t.props.day),t.props.day):ti(t.props.day)},t.render=function(){return M.createElement("div",{ref:t.dayEl,className:t.getClassNames(t.props.day),onKeyDown:t.handleOnKeyDown,onClick:t.handleClick,onMouseEnter:t.props.usePointerEvent?void 0:t.handleMouseEnter,onPointerEnter:t.props.usePointerEvent?t.handleMouseEnter:void 0,tabIndex:t.getTabIndex(),"aria-label":t.getAriaLabel(),role:"option",title:t.getTitle(),"aria-disabled":t.isDisabled(),"aria-current":t.isCurrentDay()?"date":void 0,"aria-selected":t.isSelected()||t.isInRange()},t.renderDayContents(),t.getTitle()!==""&&M.createElement("span",{className:"overlay"},t.getTitle()))},t}return a.prototype.componentDidMount=function(){this.handleFocusDay()},a.prototype.componentDidUpdate=function(){this.handleFocusDay()},a.prototype.shouldFocusDay=function(){var t=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(t=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(t=!1),this.isDayActiveElement()&&(t=!0),this.isDuplicateDay()&&(t=!1)),t},a.prototype.isDayActiveElement=function(){var t,e,r;return((e=(t=this.props.containerRef)===null||t===void 0?void 0:t.current)===null||e===void 0?void 0:e.contains(document.activeElement))&&((r=document.activeElement)===null||r===void 0?void 0:r.classList.contains("react-datepicker__day"))},a.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},a})(v.Component),gg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.weekNumberEl=v.createRef(),t.handleClick=function(e){t.props.onClick&&t.props.onClick(e)},t.handleOnKeyDown=function(e){var r,o,i=e.key;i===F.Space&&(e.preventDefault(),e.key=F.Enter),(o=(r=t.props).handleOnKeyDown)===null||o===void 0||o.call(r,e)},t.isKeyboardSelected=function(){return!t.props.disabledKeyboardNavigation&&!ee(t.props.date,t.props.selected)&&ee(t.props.date,t.props.preSelection)},t.getTabIndex=function(){return t.props.showWeekPicker&&t.props.showWeekNumber&&(t.isKeyboardSelected()||ee(t.props.date,t.props.selected)&&ee(t.props.preSelection,t.props.selected))?0:-1},t.handleFocusWeekNumber=function(e){var r=!1;t.getTabIndex()===0&&!(e!=null&&e.isInputFocused)&&ee(t.props.date,t.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(r=!0),t.props.inline&&!t.props.shouldFocusDayInline&&(r=!1),t.props.containerRef&&t.props.containerRef.current&&t.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(r=!0)),r&&t.weekNumberEl.current&&t.weekNumberEl.current.focus({preventScroll:!0})},t}return Object.defineProperty(a,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),a.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},a.prototype.componentDidUpdate=function(t){this.handleFocusWeekNumber(t)},a.prototype.render=function(){var t=this.props,e=t.weekNumber,r=t.isWeekDisabled,o=t.ariaLabelPrefix,i=o===void 0?a.defaultProps.ariaLabelPrefix:o,c=t.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!c&&!r,"react-datepicker__week-number--selected":!!c&&ee(this.props.date,this.props.selected)};return M.createElement("div",{ref:this.weekNumberEl,className:ke(l),"aria-label":"".concat(i," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex()},e)},a})(v.Component),xg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.isDisabled=function(e){return Ne(e,{minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals,includeDateIntervals:t.props.includeDateIntervals,includeDates:t.props.includeDates,filterDate:t.props.filterDate})},t.handleDayClick=function(e,r){t.props.onDayClick&&t.props.onDayClick(e,r)},t.handleDayMouseEnter=function(e){t.props.onDayMouseEnter&&t.props.onDayMouseEnter(e)},t.handleWeekClick=function(e,r,o){for(var i,c,l,p=new Date(e),u=0;u<7;u++){var h=new Date(e);h.setDate(h.getDate()+u);var x=!t.isDisabled(h);if(x){p=h;break}}typeof t.props.onWeekSelect=="function"&&t.props.onWeekSelect(p,r,o),t.props.showWeekPicker&&t.handleDayClick(p,o),((i=t.props.shouldCloseOnSelect)!==null&&i!==void 0?i:a.defaultProps.shouldCloseOnSelect)&&((l=(c=t.props).setOpen)===null||l===void 0||l.call(c,!1))},t.formatWeekNumber=function(e){return t.props.formatWeekNumber?t.props.formatWeekNumber(e):Xm(e)},t.isWeekDisabled=function(){for(var e=t.startOfWeek(),r=Ae(e,6),o=new Date(e);o<=r;){if(!t.isDisabled(o))return!1;o=Ae(o,1)}return!0},t.renderDays=function(){var e=t.startOfWeek(),r=[],o=t.formatWeekNumber(e);if(t.props.showWeekNumber){var i=t.props.onWeekSelect||t.props.showWeekPicker?t.handleWeekClick.bind(t,e,o):void 0;r.push(M.createElement(gg,te({key:"W"},a.defaultProps,t.props,{weekNumber:o,isWeekDisabled:t.isWeekDisabled(),date:e,onClick:i})))}return r.concat([0,1,2,3,4,5,6].map(function(c){var l=Ae(e,c);return M.createElement(mg,te({},a.defaultProps,t.props,{ariaLabelPrefixWhenEnabled:t.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:t.props.disabledDayAriaLabelPrefix,key:l.valueOf(),day:l,onClick:t.handleDayClick.bind(t,l),onMouseEnter:t.handleDayMouseEnter.bind(t,l)}))}))},t.startOfWeek=function(){return kt(t.props.day,t.props.locale,t.props.calendarStartDay)},t.isKeyboardSelected=function(){return!t.props.disabledKeyboardNavigation&&!ee(t.startOfWeek(),t.props.selected)&&ee(t.startOfWeek(),t.props.preSelection)},t}return Object.defineProperty(a,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),a.prototype.render=function(){var t={"react-datepicker__week":!0,"react-datepicker__week--selected":ee(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()};return M.createElement("div",{className:ke(t)},this.renderDays())},a})(v.Component),Cn,yg=6,en={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},oa=(Cn={},Cn[en.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},Cn[en.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},Cn[en.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},Cn),tr=1;function vi(n,a){return n?en.FOUR_COLUMNS:a?en.TWO_COLUMNS:en.THREE_COLUMNS}var bg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.MONTH_REFS=Ge([],Array(12),!0).map(function(){return v.createRef()}),t.QUARTER_REFS=Ge([],Array(4),!0).map(function(){return v.createRef()}),t.isDisabled=function(e){return Ne(e,{minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals,includeDateIntervals:t.props.includeDateIntervals,includeDates:t.props.includeDates,filterDate:t.props.filterDate})},t.isExcluded=function(e){return Fa(e,{excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals})},t.handleDayClick=function(e,r){var o,i;(i=(o=t.props).onDayClick)===null||i===void 0||i.call(o,e,r,t.props.orderInDisplay)},t.handleDayMouseEnter=function(e){var r,o;(o=(r=t.props).onDayMouseEnter)===null||o===void 0||o.call(r,e)},t.handleMouseLeave=function(){var e,r;(r=(e=t.props).onMouseLeave)===null||r===void 0||r.call(e)},t.isRangeStartMonth=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate;return!i||!c?!1:Se(Ee(o,e),i)},t.isRangeStartQuarter=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate;return!i||!c?!1:Cr(Gt(o,e),i)},t.isRangeEndMonth=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate;return!i||!c?!1:Se(Ee(o,e),c)},t.isRangeEndQuarter=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate;return!i||!c?!1:Cr(Gt(o,e),c)},t.isInSelectingRangeMonth=function(e){var r,o=t.props,i=o.day,c=o.selectsStart,l=o.selectsEnd,p=o.selectsRange,u=o.startDate,h=o.endDate,x=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return!(c||l||p)||!x?!1:c&&h?Gn(x,h,e,i):l&&u||p&&u&&!h?Gn(u,x,e,i):!1},t.isSelectingMonthRangeStart=function(e){var r;if(!t.isInSelectingRangeMonth(e))return!1;var o=t.props,i=o.day,c=o.startDate,l=o.selectsStart,p=Ee(i,e),u=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return l?Se(p,u):Se(p,c)},t.isSelectingMonthRangeEnd=function(e){var r;if(!t.isInSelectingRangeMonth(e))return!1;var o=t.props,i=o.day,c=o.endDate,l=o.selectsEnd,p=o.selectsRange,u=Ee(i,e),h=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return l||p?Se(u,h):Se(u,c)},t.isInSelectingRangeQuarter=function(e){var r,o=t.props,i=o.day,c=o.selectsStart,l=o.selectsEnd,p=o.selectsRange,u=o.startDate,h=o.endDate,x=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return!(c||l||p)||!x?!1:c&&h?er(x,h,e,i):l&&u||p&&u&&!h?er(u,x,e,i):!1},t.isWeekInMonth=function(e){var r=t.props.day,o=Ae(e,6);return Se(e,r)||Se(o,r)},t.isCurrentMonth=function(e,r){return G(e)===G(ie())&&r===Me(ie())},t.isCurrentQuarter=function(e,r){return G(e)===G(ie())&&r===Et(ie())},t.isSelectedMonth=function(e,r,o){return Me(o)===r&&G(e)===G(o)},t.isSelectMonthInList=function(e,r,o){return o.some(function(i){return t.isSelectedMonth(e,r,i)})},t.isSelectedQuarter=function(e,r,o){return Et(e)===r&&G(e)===G(o)},t.renderWeeks=function(){for(var e=[],r=t.props.fixedHeight,o=0,i=!1,c=kt(lt(t.props.day),t.props.locale,t.props.calendarStartDay),l=function(y){return t.props.showWeekPicker?kt(y,t.props.locale,t.props.calendarStartDay):t.props.preSelection},p=function(y){return t.props.showWeekPicker?kt(y,t.props.locale,t.props.calendarStartDay):t.props.selected},u=t.props.selected?p(t.props.selected):void 0,h=t.props.preSelection?l(t.props.preSelection):void 0;e.push(M.createElement(xg,te({},t.props,{ariaLabelPrefix:t.props.weekAriaLabelPrefix,key:o,day:c,month:Me(t.props.day),onDayClick:t.handleDayClick,onDayMouseEnter:t.handleDayMouseEnter,selected:u,preSelection:h,showWeekNumber:t.props.showWeekNumbers}))),!i;){o++,c=gr(c,1);var x=r&&o>=yg,b=!r&&!t.isWeekInMonth(c);if(x||b)if(t.props.peekNextMonth)i=!0;else break}return e},t.onMonthClick=function(e,r){var o=t.isMonthDisabledForLabelDate(r),i=o.isDisabled,c=o.labelDate;i||t.handleDayClick(lt(c),e)},t.onMonthMouseEnter=function(e){var r=t.isMonthDisabledForLabelDate(e),o=r.isDisabled,i=r.labelDate;o||t.handleDayMouseEnter(lt(i))},t.handleMonthNavigation=function(e,r){var o,i,c,l;(i=(o=t.props).setPreSelection)===null||i===void 0||i.call(o,r),(l=(c=t.MONTH_REFS[e])===null||c===void 0?void 0:c.current)===null||l===void 0||l.focus()},t.handleKeyboardNavigation=function(e,r,o){var i,c=t.props,l=c.selected,p=c.preSelection,u=c.setPreSelection,h=c.minDate,x=c.maxDate,b=c.showFourColumnMonthYearPicker,y=c.showTwoColumnMonthYearPicker;if(p){var w=vi(b,y),k=t.getVerticalOffset(w),f=(i=oa[w])===null||i===void 0?void 0:i.grid,C=function(S,D,P){var I,O,T=D,W=P;switch(S){case F.ArrowRight:T=Fe(D,tr),W=P===11?0:P+tr;break;case F.ArrowLeft:T=Tt(D,tr),W=P===0?11:P-tr;break;case F.ArrowUp:T=Tt(D,k),W=!((I=f==null?void 0:f[0])===null||I===void 0)&&I.includes(P)?P+12-k:P-k;break;case F.ArrowDown:T=Fe(D,k),W=!((O=f==null?void 0:f[f.length-1])===null||O===void 0)&&O.includes(P)?P-12+k:P+k;break}return{newCalculatedDate:T,newCalculatedMonth:W}},$=function(S,D,P){for(var I=40,O=S,T=!1,W=0,z=C(O,D,P),U=z.newCalculatedDate,Y=z.newCalculatedMonth;!T;){if(W>=I){U=D,Y=P;break}if(h&&U<h){O=F.ArrowRight;var q=C(O,U,Y);U=q.newCalculatedDate,Y=q.newCalculatedMonth}if(x&&U>x){O=F.ArrowLeft;var q=C(O,U,Y);U=q.newCalculatedDate,Y=q.newCalculatedMonth}if(ag(U,t.props)){var q=C(O,U,Y);U=q.newCalculatedDate,Y=q.newCalculatedMonth}else T=!0;W++}return{newCalculatedDate:U,newCalculatedMonth:Y}};if(r===F.Enter){t.isMonthDisabled(o)||(t.onMonthClick(e,o),u==null||u(l));return}var E=$(r,p,o),A=E.newCalculatedDate,N=E.newCalculatedMonth;switch(r){case F.ArrowRight:case F.ArrowLeft:case F.ArrowUp:case F.ArrowDown:t.handleMonthNavigation(N,A);break}}},t.getVerticalOffset=function(e){var r,o;return(o=(r=oa[e])===null||r===void 0?void 0:r.verticalNavigationOffset)!==null&&o!==void 0?o:0},t.onMonthKeyDown=function(e,r){var o=t.props,i=o.disabledKeyboardNavigation,c=o.handleOnMonthKeyDown,l=e.key;l!==F.Tab&&e.preventDefault(),i||t.handleKeyboardNavigation(e,l,r),c&&c(e)},t.onQuarterClick=function(e,r){var o=Gt(t.props.day,r);Jn(o,t.props)||t.handleDayClick(oi(o),e)},t.onQuarterMouseEnter=function(e){var r=Gt(t.props.day,e);Jn(r,t.props)||t.handleDayMouseEnter(oi(r))},t.handleQuarterNavigation=function(e,r){var o,i,c,l;t.isDisabled(r)||t.isExcluded(r)||((i=(o=t.props).setPreSelection)===null||i===void 0||i.call(o,r),(l=(c=t.QUARTER_REFS[e-1])===null||c===void 0?void 0:c.current)===null||l===void 0||l.focus())},t.onQuarterKeyDown=function(e,r){var o,i,c=e.key;if(!t.props.disabledKeyboardNavigation)switch(c){case F.Enter:t.onQuarterClick(e,r),(i=(o=t.props).setPreSelection)===null||i===void 0||i.call(o,t.props.selected);break;case F.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(r===4?1:r+1,$a(t.props.preSelection,1));break;case F.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(r===1?4:r-1,bc(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var r,o=t.props,i=o.day,c=o.minDate,l=o.maxDate,p=o.excludeDates,u=o.includeDates,h=Ee(i,e);return{isDisabled:(r=(c||l||p||u)&&Dc(h,t.props))!==null&&r!==void 0?r:!1,labelDate:h}},t.isMonthDisabled=function(e){var r=t.isMonthDisabledForLabelDate(e).isDisabled;return r},t.getMonthClassNames=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate,l=r.preSelection,p=r.monthClassName,u=p?p(Ee(o,e)):void 0,h=t.getSelection();return ke("react-datepicker__month-text","react-datepicker__month-".concat(e),u,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":h?t.isSelectMonthInList(o,e,h):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&l&&t.isSelectedMonth(o,e,l)&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":i&&c?Gn(i,c,e,o):void 0,"react-datepicker__month-text--range-start":t.isRangeStartMonth(e),"react-datepicker__month-text--range-end":t.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":t.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":t.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":t.isCurrentMonth(o,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return"-1";var r=Me(t.props.preSelection),o=t.isMonthDisabledForLabelDate(r).isDisabled,i=e===r&&!(o||t.props.disabledKeyboardNavigation)?"0":"-1";return i},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return"-1";var r=Et(t.props.preSelection),o=Jn(t.props.day,t.props),i=e===r&&!(o||t.props.disabledKeyboardNavigation)?"0":"-1";return i},t.getAriaLabel=function(e){var r=t.props,o=r.chooseDayAriaLabelPrefix,i=o===void 0?"Choose":o,c=r.disabledDayAriaLabelPrefix,l=c===void 0?"Not available":c,p=r.day,u=r.locale,h=Ee(p,e),x=t.isDisabled(h)||t.isExcluded(h)?l:i;return"".concat(x," ").concat(se(h,"MMMM yyyy",u))},t.getQuarterClassNames=function(e){var r=t.props,o=r.day,i=r.startDate,c=r.endDate,l=r.selected,p=r.minDate,u=r.maxDate,h=r.excludeDates,x=r.includeDates,b=r.filterDate,y=r.preSelection,w=r.disabledKeyboardNavigation,k=(p||u||h||x||b)&&Jn(Gt(o,e),t.props);return ke("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":k,"react-datepicker__quarter-text--selected":l?t.isSelectedQuarter(o,e,l):void 0,"react-datepicker__quarter-text--keyboard-selected":!w&&y&&t.isSelectedQuarter(o,e,y)&&!k,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":i&&c?er(i,c,e,o):void 0,"react-datepicker__quarter-text--range-start":t.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":t.isRangeEndQuarter(e)})},t.getMonthContent=function(e){var r=t.props,o=r.showFullMonthYearPicker,i=r.renderMonthContent,c=r.locale,l=r.day,p=kc(e,c),u=La(e,c);return i?i(e,p,u,l):o?u:p},t.getQuarterContent=function(e){var r,o=t.props,i=o.renderQuarterContent,c=o.locale,l=rg(e,c);return(r=i==null?void 0:i(e,l))!==null&&r!==void 0?r:l},t.renderMonths=function(){var e,r=t.props,o=r.showTwoColumnMonthYearPicker,i=r.showFourColumnMonthYearPicker,c=r.day,l=r.selected,p=(e=oa[vi(i,o)])===null||e===void 0?void 0:e.grid;return p==null?void 0:p.map(function(u,h){return M.createElement("div",{className:"react-datepicker__month-wrapper",key:h},u.map(function(x,b){return M.createElement("div",{ref:t.MONTH_REFS[x],key:b,onClick:function(y){t.onMonthClick(y,x)},onKeyDown:function(y){Mc(y)&&(y.preventDefault(),y.key=F.Enter),t.onMonthKeyDown(y,x)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(x)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(x)}:void 0,tabIndex:Number(t.getTabIndex(x)),className:t.getMonthClassNames(x),"aria-disabled":t.isMonthDisabled(x),role:"option","aria-label":t.getAriaLabel(x),"aria-current":t.isCurrentMonth(c,x)?"date":void 0,"aria-selected":l?t.isSelectedMonth(c,x,l):void 0},t.getMonthContent(x))}))})},t.renderQuarters=function(){var e=t.props,r=e.day,o=e.selected,i=[1,2,3,4];return M.createElement("div",{className:"react-datepicker__quarter-wrapper"},i.map(function(c,l){return M.createElement("div",{key:l,ref:t.QUARTER_REFS[l],role:"option",onClick:function(p){t.onQuarterClick(p,c)},onKeyDown:function(p){t.onQuarterKeyDown(p,c)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(c)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(c)}:void 0,className:t.getQuarterClassNames(c),"aria-selected":o?t.isSelectedQuarter(r,c,o):void 0,tabIndex:Number(t.getQuarterTabIndex(c)),"aria-current":t.isCurrentQuarter(r,c)?"date":void 0},t.getQuarterContent(c))}))},t.getClassNames=function(){var e=t.props,r=e.selectingDate,o=e.selectsStart,i=e.selectsEnd,c=e.showMonthYearPicker,l=e.showQuarterYearPicker,p=e.showWeekPicker;return ke("react-datepicker__month",{"react-datepicker__month--selecting-range":r&&(o||i)},{"react-datepicker__monthPicker":c},{"react-datepicker__quarterPicker":l},{"react-datepicker__weekPicker":p})},t}return a.prototype.getSelection=function(){var t=this.props,e=t.selected,r=t.selectedDates,o=t.selectsMultiple;if(o)return r;if(e)return[e]},a.prototype.render=function(){var t=this.props,e=t.showMonthYearPicker,r=t.showQuarterYearPicker,o=t.day,i=t.ariaLabelPrefix,c=i===void 0?"Month ":i,l=c?c.trim()+" ":"";return M.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(l).concat(se(o,"MMMM, yyyy",this.props.locale)),role:"listbox"},e?this.renderMonths():r?this.renderQuarters():this.renderWeeks())},a})(v.Component),vg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,r){return M.createElement("div",{className:t.isSelectedMonth(r)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,r),"aria-selected":t.isSelectedMonth(r)?"true":void 0},t.isSelectedMonth(r)?M.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return a.prototype.render=function(){return M.createElement(Rr,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),wg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(r,o){return M.createElement("option",{key:r,value:o},r)})},t.renderSelectMode=function(e){return M.createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(r){return t.onChange(parseInt(r.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,r){return M.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},M.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),M.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return M.createElement(vg,te({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var r=t.state.dropdownVisible,o=[t.renderReadView(!r,e)];return r&&o.unshift(t.renderDropdown(e)),o},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return a.prototype.render=function(){var t=this,e=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(o){return kc(o,t.props.locale)}:function(o){return La(o,t.props.locale)}),r;switch(this.props.dropdownMode){case"scroll":r=this.renderScrollMode(e);break;case"select":r=this.renderSelectMode(e);break}return M.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},r)},a})(v.Component);function kg(n,a){for(var t=[],e=lt(n),r=lt(a);!Dt(e,r);)t.push(ie(e)),e=Fe(e,1);return t}var Dg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.renderOptions=function(){return e.state.monthYearsList.map(function(r){var o=ka(r),i=Ke(e.props.date,r)&&Se(e.props.date,r);return M.createElement("div",{className:i?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:o,onClick:e.onChange.bind(e,o),"aria-selected":i?"true":void 0},i?M.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",se(r,e.props.dateFormat,e.props.locale))})},e.onChange=function(r){return e.props.onChange(r)},e.handleClickOutside=function(){e.props.onCancel()},e.state={monthYearsList:kg(e.props.minDate,e.props.maxDate)},e}return a.prototype.render=function(){var t=ke({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return M.createElement(Rr,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),Cg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=lt(t.props.minDate),r=lt(t.props.maxDate),o=[];!Dt(e,r);){var i=ka(e);o.push(M.createElement("option",{key:i,value:i},se(e,t.props.dateFormat,t.props.locale))),e=Fe(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return M.createElement("select",{value:ka(lt(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var r=se(t.props.date,t.props.dateFormat,t.props.locale);return M.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},M.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),M.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return M.createElement(Dg,te({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,r=[t.renderReadView(!e)];return e&&r.unshift(t.renderDropdown()),r},t.onChange=function(e){t.toggleDropdown();var r=ie(e);Ke(t.props.date,r)&&Se(t.props.date,r)||t.props.onChange(r)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return a.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return M.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},a})(v.Component),Sg=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={height:null},t.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,r,o;t.list&&(t.list.scrollTop=(o=t.centerLi&&a.calcCenterPosition(t.props.monthRef?t.props.monthRef.clientHeight-((r=(e=t.header)===null||e===void 0?void 0:e.clientHeight)!==null&&r!==void 0?r:0):t.list.clientHeight,t.centerLi))!==null&&o!==void 0?o:0)})},t.handleClick=function(e){var r,o;(t.props.minTime||t.props.maxTime)&&di(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&li(e,t.props)||(o=(r=t.props).onChange)===null||o===void 0||o.call(r,e)},t.isSelectedTime=function(e){return t.props.selected&&fg(t.props.selected,e)},t.isDisabledTime=function(e){return(t.props.minTime||t.props.maxTime)&&di(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&li(e,t.props)},t.liClasses=function(e){var r,o=["react-datepicker__time-list-item",t.props.timeClassName?t.props.timeClassName(e):void 0];return t.isSelectedTime(e)&&o.push("react-datepicker__time-list-item--selected"),t.isDisabledTime(e)&&o.push("react-datepicker__time-list-item--disabled"),t.props.injectTimes&&(Je(e)*3600+Ze(e)*60+ct(e))%(((r=t.props.intervals)!==null&&r!==void 0?r:a.defaultProps.intervals)*60)!==0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},t.handleOnKeyDown=function(e,r){var o,i;e.key===F.Space&&(e.preventDefault(),e.key=F.Enter),(e.key===F.ArrowUp||e.key===F.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===F.ArrowDown||e.key===F.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===F.Enter&&t.handleClick(r),(i=(o=t.props).handleOnKeyDown)===null||i===void 0||i.call(o,e)},t.renderTimes=function(){for(var e,r=[],o=typeof t.props.format=="string"?t.props.format:"p",i=(e=t.props.intervals)!==null&&e!==void 0?e:a.defaultProps.intervals,c=t.props.selected||t.props.openToDate||ie(),l=sr(c),p=t.props.injectTimes&&t.props.injectTimes.sort(function(k,f){return k.getTime()-f.getTime()}),u=60*pg(c),h=u/i,x=0;x<h;x++){var b=ba(l,x*i);if(r.push(b),p){var y=ug(l,b,x,i,p);r=r.concat(y)}}var w=r.reduce(function(k,f){return f.getTime()<=c.getTime()?f:k},r[0]);return r.map(function(k){return M.createElement("li",{key:k.valueOf(),onClick:t.handleClick.bind(t,k),className:t.liClasses(k),ref:function(f){k===w&&(t.centerLi=f)},onKeyDown:function(f){t.handleOnKeyDown(f,k)},tabIndex:k===w?0:-1,role:"option","aria-selected":t.isSelectedTime(k)?"true":void 0,"aria-disabled":t.isDisabledTime(k)?"true":void 0},se(k,o,t.props.locale))})},t.renderTimeCaption=function(){return t.props.showTimeCaption===!1?M.createElement(M.Fragment,null):M.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(t.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(e){t.header=e}},M.createElement("div",{className:"react-datepicker-time__header"},t.props.timeCaption))},t}return Object.defineProperty(a,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),a.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},a.prototype.render=function(){var t=this,e,r=this.state.height;return M.createElement("div",{className:"react-datepicker__time-container ".concat(((e=this.props.todayButton)!==null&&e!==void 0?e:a.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),M.createElement("div",{className:"react-datepicker__time"},M.createElement("div",{className:"react-datepicker__time-box"},M.createElement("ul",{className:"react-datepicker__time-list",ref:function(o){t.list=o},style:r?{height:r}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},a.calcCenterPosition=function(t,e){return e.offsetTop-(t/2-e.clientHeight/2)},a})(v.Component),wi=3,Mg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.YEAR_REFS=Ge([],Array(e.props.yearItemNumber),!0).map(function(){return v.createRef()}),e.isDisabled=function(r){return Ne(r,{minDate:e.props.minDate,maxDate:e.props.maxDate,excludeDates:e.props.excludeDates,includeDates:e.props.includeDates,filterDate:e.props.filterDate})},e.isExcluded=function(r){return Fa(r,{excludeDates:e.props.excludeDates})},e.selectingDate=function(){var r;return(r=e.props.selectingDate)!==null&&r!==void 0?r:e.props.preSelection},e.updateFocusOnPaginate=function(r){var o=function(){var i,c;(c=(i=e.YEAR_REFS[r])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus()};window.requestAnimationFrame(o)},e.handleYearClick=function(r,o){e.props.onDayClick&&e.props.onDayClick(r,o)},e.handleYearNavigation=function(r,o){var i,c,l,p,u=e.props,h=u.date,x=u.yearItemNumber;if(!(h===void 0||x===void 0)){var b=vt(h,x).startPeriod;e.isDisabled(o)||e.isExcluded(o)||((c=(i=e.props).setPreSelection)===null||c===void 0||c.call(i,o),r-b<0?e.updateFocusOnPaginate(x-(b-r)):r-b>=x?e.updateFocusOnPaginate(Math.abs(x-(r-b))):(p=(l=e.YEAR_REFS[r-b])===null||l===void 0?void 0:l.current)===null||p===void 0||p.focus())}},e.isSameDay=function(r,o){return ee(r,o)},e.isCurrentYear=function(r){return r===G(ie())},e.isRangeStart=function(r){return e.props.startDate&&e.props.endDate&&Ke(qe(ie(),r),e.props.startDate)},e.isRangeEnd=function(r){return e.props.startDate&&e.props.endDate&&Ke(qe(ie(),r),e.props.endDate)},e.isInRange=function(r){return Zn(r,e.props.startDate,e.props.endDate)},e.isInSelectingRange=function(r){var o=e.props,i=o.selectsStart,c=o.selectsEnd,l=o.selectsRange,p=o.startDate,u=o.endDate;return!(i||c||l)||!e.selectingDate()?!1:i&&u?Zn(r,e.selectingDate(),u):c&&p||l&&p&&!u?Zn(r,p,e.selectingDate()):!1},e.isSelectingRangeStart=function(r){var o;if(!e.isInSelectingRange(r))return!1;var i=e.props,c=i.startDate,l=i.selectsStart,p=qe(ie(),r);return l?Ke(p,(o=e.selectingDate())!==null&&o!==void 0?o:null):Ke(p,c??null)},e.isSelectingRangeEnd=function(r){var o;if(!e.isInSelectingRange(r))return!1;var i=e.props,c=i.endDate,l=i.selectsEnd,p=i.selectsRange,u=qe(ie(),r);return l||p?Ke(u,(o=e.selectingDate())!==null&&o!==void 0?o:null):Ke(u,c??null)},e.isKeyboardSelected=function(r){if(!(e.props.date===void 0||e.props.selected==null||e.props.preSelection==null)){var o=e.props,i=o.minDate,c=o.maxDate,l=o.excludeDates,p=o.includeDates,u=o.filterDate,h=_n(qe(e.props.date,r)),x=(i||c||l||p||u)&&cr(r,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!ee(h,_n(e.props.selected))&&ee(h,_n(e.props.preSelection))&&!x}},e.onYearClick=function(r,o){var i=e.props.date;i!==void 0&&e.handleYearClick(_n(qe(i,o)),r)},e.onYearKeyDown=function(r,o){var i,c,l=r.key,p=e.props,u=p.date,h=p.yearItemNumber,x=p.handleOnKeyDown;if(l!==F.Tab&&r.preventDefault(),!e.props.disabledKeyboardNavigation)switch(l){case F.Enter:if(e.props.selected==null)break;e.onYearClick(r,o),(c=(i=e.props).setPreSelection)===null||c===void 0||c.call(i,e.props.selected);break;case F.ArrowRight:if(e.props.preSelection==null)break;e.handleYearNavigation(o+1,it(e.props.preSelection,1));break;case F.ArrowLeft:if(e.props.preSelection==null)break;e.handleYearNavigation(o-1,cn(e.props.preSelection,1));break;case F.ArrowUp:{if(u===void 0||h===void 0||e.props.preSelection==null)break;var b=vt(u,h).startPeriod,y=wi,w=o-y;if(w<b){var k=h%y;o>=b&&o<b+k?y=k:y+=k,w=o-y}e.handleYearNavigation(w,cn(e.props.preSelection,y));break}case F.ArrowDown:{if(u===void 0||h===void 0||e.props.preSelection==null)break;var f=vt(u,h).endPeriod,y=wi,w=o+y;if(w>f){var k=h%y;o<=f&&o>f-k?y=k:y+=k,w=o+y}e.handleYearNavigation(w,it(e.props.preSelection,y));break}}x&&x(r)},e.getYearClassNames=function(r){var o=e.props,i=o.date,c=o.minDate,l=o.maxDate,p=o.selected,u=o.excludeDates,h=o.includeDates,x=o.filterDate,b=o.yearClassName;return ke("react-datepicker__year-text","react-datepicker__year-".concat(r),i?b==null?void 0:b(qe(i,r)):void 0,{"react-datepicker__year-text--selected":p?r===G(p):void 0,"react-datepicker__year-text--disabled":(c||l||u||h||x)&&cr(r,e.props),"react-datepicker__year-text--keyboard-selected":e.isKeyboardSelected(r),"react-datepicker__year-text--range-start":e.isRangeStart(r),"react-datepicker__year-text--range-end":e.isRangeEnd(r),"react-datepicker__year-text--in-range":e.isInRange(r),"react-datepicker__year-text--in-selecting-range":e.isInSelectingRange(r),"react-datepicker__year-text--selecting-range-start":e.isSelectingRangeStart(r),"react-datepicker__year-text--selecting-range-end":e.isSelectingRangeEnd(r),"react-datepicker__year-text--today":e.isCurrentYear(r)})},e.getYearTabIndex=function(r){if(e.props.disabledKeyboardNavigation||e.props.preSelection==null)return"-1";var o=G(e.props.preSelection),i=cr(r,e.props);return r===o&&!i?"0":"-1"},e.getYearContent=function(r){return e.props.renderYearContent?e.props.renderYearContent(r):r},e}return a.prototype.render=function(){var t=this,e=[],r=this.props,o=r.date,i=r.yearItemNumber,c=r.onYearMouseEnter,l=r.onYearMouseLeave;if(o===void 0)return null;for(var p=vt(o,i),u=p.startPeriod,h=p.endPeriod,x=function(w){e.push(M.createElement("div",{ref:b.YEAR_REFS[w-u],onClick:function(k){t.onYearClick(k,w)},onKeyDown:function(k){Mc(k)&&(k.preventDefault(),k.key=F.Enter),t.onYearKeyDown(k,w)},tabIndex:Number(b.getYearTabIndex(w)),className:b.getYearClassNames(w),onMouseEnter:b.props.usePointerEvent?void 0:function(k){return c(k,w)},onPointerEnter:b.props.usePointerEvent?function(k){return c(k,w)}:void 0,onMouseLeave:b.props.usePointerEvent?void 0:function(k){return l(k,w)},onPointerLeave:b.props.usePointerEvent?function(k){return l(k,w)}:void 0,key:w,"aria-current":b.isCurrentYear(w)?"date":void 0},b.getYearContent(w)))},b=this,y=u;y<=h;y++)x(y);return M.createElement("div",{className:"react-datepicker__year"},M.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},e))},a})(v.Component);function _g(n,a,t,e){for(var r=[],o=0;o<2*a+1;o++){var i=n+a-o,c=!0;t&&(c=G(t)<=i),e&&c&&(c=G(e)>=i),c&&r.push(i)}return r}var Pg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;e.renderOptions=function(){var c=e.props.year,l=e.state.yearsList.map(function(h){return M.createElement("div",{className:c===h?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:h,onClick:e.onChange.bind(e,h),"aria-selected":c===h?"true":void 0},c===h?M.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",h)}),p=e.props.minDate?G(e.props.minDate):null,u=e.props.maxDate?G(e.props.maxDate):null;return(!u||!e.state.yearsList.find(function(h){return h===u}))&&l.unshift(M.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},M.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!p||!e.state.yearsList.find(function(h){return h===p}))&&l.push(M.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},M.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),l},e.onChange=function(c){e.props.onChange(c)},e.handleClickOutside=function(){e.props.onCancel()},e.shiftYears=function(c){var l=e.state.yearsList.map(function(p){return p+c});e.setState({yearsList:l})},e.incrementYears=function(){return e.shiftYears(1)},e.decrementYears=function(){return e.shiftYears(-1)};var r=t.yearDropdownItemNumber,o=t.scrollableYearDropdown,i=r||(o?10:5);return e.state={yearsList:_g(e.props.year,i,e.props.minDate,e.props.maxDate)},e.dropdownRef=v.createRef(),e}return a.prototype.componentDidMount=function(){var t=this.dropdownRef.current;if(t){var e=t.children?Array.from(t.children):null,r=e?e.find(function(o){return o.ariaSelected}):null;t.scrollTop=r&&r instanceof HTMLElement?r.offsetTop+(r.clientHeight-t.clientHeight)/2:(t.scrollHeight-t.clientHeight)/2}},a.prototype.render=function(){var t=ke({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return M.createElement(Rr,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),Ig=(function(n){be(a,n);function a(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?G(t.props.minDate):1900,r=t.props.maxDate?G(t.props.maxDate):2100,o=[],i=e;i<=r;i++)o.push(M.createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return M.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return M.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(r){return t.toggleDropdown(r)}},M.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),M.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return M.createElement(Pg,te({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,r=[t.renderReadView(!e)];return e&&r.unshift(t.renderDropdown()),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,r){var o;(o=t.onSelect)===null||o===void 0||o.call(t,e,r),t.setOpen()},t.onSelect=function(e,r){var o,i;(i=(o=t.props).onSelect)===null||i===void 0||i.call(o,e,r)},t.setOpen=function(){var e,r;(r=(e=t.props).setOpen)===null||r===void 0||r.call(e,!0)},t}return a.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return M.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},a})(v.Component),jg=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Eg=function(n){var a=(n.className||"").split(/\s+/);return jg.some(function(t){return a.indexOf(t)>=0})},Tg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.monthContainer=void 0,e.handleClickOutside=function(r){e.props.onClickOutside(r)},e.setClickOutsideRef=function(){return e.containerRef.current},e.handleDropdownFocus=function(r){var o,i;Eg(r.target)&&((i=(o=e.props).onDropdownFocus)===null||i===void 0||i.call(o,r))},e.getDateInView=function(){var r=e.props,o=r.preSelection,i=r.selected,c=r.openToDate,l=Cc(e.props),p=Sc(e.props),u=ie(),h=c||i||o;return h||(l&&Lt(u,l)?l:p&&Dt(u,p)?p:u)},e.increaseMonth=function(){e.setState(function(r){var o=r.date;return{date:Fe(o,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(r){var o=r.date;return{date:Tt(o,1)}},function(){return e.handleMonthChange(e.state.date)})},e.handleDayClick=function(r,o,i){e.props.onSelect(r,o,i),e.props.setPreSelection&&e.props.setPreSelection(r)},e.handleDayMouseEnter=function(r){e.setState({selectingDate:r}),e.props.onDayMouseEnter&&e.props.onDayMouseEnter(r)},e.handleMonthMouseLeave=function(){e.setState({selectingDate:void 0}),e.props.onMonthMouseLeave&&e.props.onMonthMouseLeave()},e.handleYearMouseEnter=function(r,o){e.setState({selectingDate:qe(ie(),o)}),e.props.onYearMouseEnter&&e.props.onYearMouseEnter(r,o)},e.handleYearMouseLeave=function(r,o){e.props.onYearMouseLeave&&e.props.onYearMouseLeave(r,o)},e.handleYearChange=function(r){var o,i,c,l;(i=(o=e.props).onYearChange)===null||i===void 0||i.call(o,r),e.setState({isRenderAriaLiveMessage:!0}),e.props.adjustDateOnChange&&(e.props.onSelect(r),(l=(c=e.props).setOpen)===null||l===void 0||l.call(c,!0)),e.props.setPreSelection&&e.props.setPreSelection(r)},e.getEnabledPreSelectionDateForMonth=function(r){if(!Ne(r,e.props))return r;for(var o=lt(r),i=Zm(r),c=hf(i,o),l=null,p=0;p<=c;p++){var u=Ae(o,p);if(!Ne(u,e.props)){l=u;break}}return l},e.handleMonthChange=function(r){var o,i,c,l=(o=e.getEnabledPreSelectionDateForMonth(r))!==null&&o!==void 0?o:r;e.handleCustomMonthChange(l),e.props.adjustDateOnChange&&(e.props.onSelect(l),(c=(i=e.props).setOpen)===null||c===void 0||c.call(i,!0)),e.props.setPreSelection&&e.props.setPreSelection(l)},e.handleCustomMonthChange=function(r){var o,i;(i=(o=e.props).onMonthChange)===null||i===void 0||i.call(o,r),e.setState({isRenderAriaLiveMessage:!0})},e.handleMonthYearChange=function(r){e.handleYearChange(r),e.handleMonthChange(r)},e.changeYear=function(r){e.setState(function(o){var i=o.date;return{date:qe(i,Number(r))}},function(){return e.handleYearChange(e.state.date)})},e.changeMonth=function(r){e.setState(function(o){var i=o.date;return{date:Ee(i,Number(r))}},function(){return e.handleMonthChange(e.state.date)})},e.changeMonthYear=function(r){e.setState(function(o){var i=o.date;return{date:qe(Ee(i,Me(r)),G(r))}},function(){return e.handleMonthYearChange(e.state.date)})},e.header=function(r){r===void 0&&(r=e.state.date);var o=kt(r,e.props.locale,e.props.calendarStartDay),i=[];return e.props.showWeekNumbers&&i.push(M.createElement("div",{key:"W",className:"react-datepicker__day-name"},e.props.weekLabel||"#")),i.concat([0,1,2,3,4,5,6].map(function(c){var l=Ae(o,c),p=e.formatWeekday(l,e.props.locale),u=e.props.weekDayClassName?e.props.weekDayClassName(l):void 0;return M.createElement("div",{key:c,"aria-label":se(l,"EEEE",e.props.locale),className:ke("react-datepicker__day-name",u)},p)}))},e.formatWeekday=function(r,o){return e.props.formatWeekDay?eg(r,e.props.formatWeekDay,o):e.props.useWeekdaysShort?ng(r,o):tg(r,o)},e.decreaseYear=function(){e.setState(function(r){var o,i=r.date;return{date:cn(i,e.props.showYearPicker?(o=e.props.yearItemNumber)!==null&&o!==void 0?o:a.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.clearSelectingDate=function(){e.setState({selectingDate:void 0})},e.renderPreviousButton=function(){var r,o,i;if(!e.props.renderCustomHeader){var c=(r=e.props.monthsShown)!==null&&r!==void 0?r:a.defaultProps.monthsShown,l=e.props.showPreviousMonths?c-1:0,p=(o=e.props.monthSelectedIn)!==null&&o!==void 0?o:l,u=Tt(e.state.date,p),h;switch(!0){case e.props.showMonthYearPicker:h=fi(e.state.date,e.props);break;case e.props.showYearPicker:h=sg(e.state.date,e.props);break;case e.props.showQuarterYearPicker:h=og(e.state.date,e.props);break;default:h=ui(u,e.props);break}if(!(!((i=e.props.forceShowMonthNavigation)!==null&&i!==void 0?i:a.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&h||e.props.showTimeSelectOnly)){var x=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],b=["react-datepicker__navigation","react-datepicker__navigation--previous"],y=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(y=e.decreaseYear),h&&e.props.showDisabledMonthNavigation&&(b.push("react-datepicker__navigation--previous--disabled"),y=void 0);var w=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,k=e.props,f=k.previousMonthButtonLabel,C=f===void 0?a.defaultProps.previousMonthButtonLabel:f,$=k.previousYearButtonLabel,E=$===void 0?a.defaultProps.previousYearButtonLabel:$,A=e.props,N=A.previousMonthAriaLabel,S=N===void 0?typeof C=="string"?C:"Previous Month":N,D=A.previousYearAriaLabel,P=D===void 0?typeof E=="string"?E:"Previous Year":D;return M.createElement("button",{type:"button",className:b.join(" "),onClick:y,onKeyDown:e.props.handleOnKeyDown,"aria-label":w?P:S},M.createElement("span",{className:x.join(" ")},w?E:C))}}},e.increaseYear=function(){e.setState(function(r){var o,i=r.date;return{date:it(i,e.props.showYearPicker?(o=e.props.yearItemNumber)!==null&&o!==void 0?o:a.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.renderNextButton=function(){var r;if(!e.props.renderCustomHeader){var o;switch(!0){case e.props.showMonthYearPicker:o=hi(e.state.date,e.props);break;case e.props.showYearPicker:o=cg(e.state.date,e.props);break;case e.props.showQuarterYearPicker:o=ig(e.state.date,e.props);break;default:o=pi(e.state.date,e.props);break}if(!(!((r=e.props.forceShowMonthNavigation)!==null&&r!==void 0?r:a.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&o||e.props.showTimeSelectOnly)){var i=["react-datepicker__navigation","react-datepicker__navigation--next"],c=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];e.props.showTimeSelect&&i.push("react-datepicker__navigation--next--with-time"),e.props.todayButton&&i.push("react-datepicker__navigation--next--with-today-button");var l=e.increaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(l=e.increaseYear),o&&e.props.showDisabledMonthNavigation&&(i.push("react-datepicker__navigation--next--disabled"),l=void 0);var p=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,u=e.props,h=u.nextMonthButtonLabel,x=h===void 0?a.defaultProps.nextMonthButtonLabel:h,b=u.nextYearButtonLabel,y=b===void 0?a.defaultProps.nextYearButtonLabel:b,w=e.props,k=w.nextMonthAriaLabel,f=k===void 0?typeof x=="string"?x:"Next Month":k,C=w.nextYearAriaLabel,$=C===void 0?typeof y=="string"?y:"Next Year":C;return M.createElement("button",{type:"button",className:i.join(" "),onClick:l,onKeyDown:e.props.handleOnKeyDown,"aria-label":p?$:f},M.createElement("span",{className:c.join(" ")},p?y:x))}}},e.renderCurrentMonth=function(r){r===void 0&&(r=e.state.date);var o=["react-datepicker__current-month"];return e.props.showYearDropdown&&o.push("react-datepicker__current-month--hasYearDropdown"),e.props.showMonthDropdown&&o.push("react-datepicker__current-month--hasMonthDropdown"),e.props.showMonthYearDropdown&&o.push("react-datepicker__current-month--hasMonthYearDropdown"),M.createElement("h2",{className:o.join(" ")},se(r,e.props.dateFormat,e.props.locale))},e.renderYearDropdown=function(r){if(r===void 0&&(r=!1),!(!e.props.showYearDropdown||r))return M.createElement(Ig,te({},a.defaultProps,e.props,{date:e.state.date,onChange:e.changeYear,year:G(e.state.date)}))},e.renderMonthDropdown=function(r){if(r===void 0&&(r=!1),!(!e.props.showMonthDropdown||r))return M.createElement(wg,te({},a.defaultProps,e.props,{month:Me(e.state.date),onChange:e.changeMonth}))},e.renderMonthYearDropdown=function(r){if(r===void 0&&(r=!1),!(!e.props.showMonthYearDropdown||r))return M.createElement(Cg,te({},a.defaultProps,e.props,{date:e.state.date,onChange:e.changeMonthYear}))},e.handleTodayButtonClick=function(r){e.props.onSelect(ii(),r),e.props.setPreSelection&&e.props.setPreSelection(ii())},e.renderTodayButton=function(){if(!(!e.props.todayButton||e.props.showTimeSelectOnly))return M.createElement("div",{className:"react-datepicker__today-button",onClick:e.handleTodayButtonClick},e.props.todayButton)},e.renderDefaultHeader=function(r){var o=r.monthDate,i=r.i;return M.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(o),M.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode),onFocus:e.handleDropdownFocus},e.renderMonthDropdown(i!==0),e.renderMonthYearDropdown(i!==0),e.renderYearDropdown(i!==0)),M.createElement("div",{className:"react-datepicker__day-names"},e.header(o)))},e.renderCustomHeader=function(r){var o,i,c=r.monthDate,l=r.i;if(e.props.showTimeSelect&&!e.state.monthContainer||e.props.showTimeSelectOnly)return null;var p=ui(e.state.date,e.props),u=pi(e.state.date,e.props),h=fi(e.state.date,e.props),x=hi(e.state.date,e.props),b=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return M.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:e.props.onDropdownFocus},(i=(o=e.props).renderCustomHeader)===null||i===void 0?void 0:i.call(o,te(te({},e.state),{customHeaderCount:l,monthDate:c,changeMonth:e.changeMonth,changeYear:e.changeYear,decreaseMonth:e.decreaseMonth,increaseMonth:e.increaseMonth,decreaseYear:e.decreaseYear,increaseYear:e.increaseYear,prevMonthButtonDisabled:p,nextMonthButtonDisabled:u,prevYearButtonDisabled:h,nextYearButtonDisabled:x})),b&&M.createElement("div",{className:"react-datepicker__day-names"},e.header(c)))},e.renderYearHeader=function(r){var o=r.monthDate,i=e.props,c=i.showYearPicker,l=i.yearItemNumber,p=l===void 0?a.defaultProps.yearItemNumber:l,u=vt(o,p),h=u.startPeriod,x=u.endPeriod;return M.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},c?"".concat(h," - ").concat(x):G(o))},e.renderHeader=function(r){var o=r.monthDate,i=r.i,c=i===void 0?0:i,l={monthDate:o,i:c};switch(!0){case e.props.renderCustomHeader!==void 0:return e.renderCustomHeader(l);case(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker):return e.renderYearHeader(l);default:return e.renderDefaultHeader(l)}},e.renderMonths=function(){var r,o;if(!(e.props.showTimeSelectOnly||e.props.showYearPicker)){for(var i=[],c=(r=e.props.monthsShown)!==null&&r!==void 0?r:a.defaultProps.monthsShown,l=e.props.showPreviousMonths?c-1:0,p=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?it(e.state.date,l):Tt(e.state.date,l),u=(o=e.props.monthSelectedIn)!==null&&o!==void 0?o:l,h=0;h<c;++h){var x=h-u+l,b=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?it(p,x):Fe(p,x),y="month-".concat(h),w=h<c-1,k=h>0;i.push(M.createElement("div",{key:y,ref:function(f){e.monthContainer=f??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:b,i:h}),M.createElement(bg,te({},a.defaultProps,e.props,{ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:b,onDayClick:e.handleDayClick,handleOnKeyDown:e.props.handleOnDayKeyDown,handleOnMonthKeyDown:e.props.handleOnKeyDown,onDayMouseEnter:e.handleDayMouseEnter,onMouseLeave:e.handleMonthMouseLeave,orderInDisplay:h,selectingDate:e.state.selectingDate,monthShowsDuplicateDaysEnd:w,monthShowsDuplicateDaysStart:k}))))}return i}},e.renderYears=function(){if(!e.props.showTimeSelectOnly&&e.props.showYearPicker)return M.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),M.createElement(Mg,te({},a.defaultProps,e.props,{selectingDate:e.state.selectingDate,date:e.state.date,onDayClick:e.handleDayClick,clearSelectingDate:e.clearSelectingDate,onYearMouseEnter:e.handleYearMouseEnter,onYearMouseLeave:e.handleYearMouseLeave})))},e.renderTimeSection=function(){if(e.props.showTimeSelect&&(e.state.monthContainer||e.props.showTimeSelectOnly))return M.createElement(Sg,te({},a.defaultProps,e.props,{onChange:e.props.onTimeChange,format:e.props.timeFormat,intervals:e.props.timeIntervals,monthRef:e.state.monthContainer}))},e.renderInputTimeSection=function(){var r=e.props.selected?new Date(e.props.selected):void 0,o=r&&at(r)&&!!e.props.selected,i=o?"".concat(gi(r.getHours()),":").concat(gi(r.getMinutes())):"";if(e.props.showTimeInput)return M.createElement(hg,te({},a.defaultProps,e.props,{date:r,timeString:i,onChange:e.props.onTimeChange}))},e.renderAriaLiveRegion=function(){var r,o=vt(e.state.date,(r=e.props.yearItemNumber)!==null&&r!==void 0?r:a.defaultProps.yearItemNumber),i=o.startPeriod,c=o.endPeriod,l;return e.props.showYearPicker?l="".concat(i," - ").concat(c):e.props.showMonthYearPicker||e.props.showQuarterYearPicker?l=G(e.state.date):l="".concat(La(Me(e.state.date),e.props.locale)," ").concat(G(e.state.date)),M.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&l)},e.renderChildren=function(){if(e.props.children)return M.createElement("div",{className:"react-datepicker__children-container"},e.props.children)},e.containerRef=v.createRef(),e.state={date:e.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},e}return Object.defineProperty(a,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:Ln}},enumerable:!1,configurable:!0}),a.prototype.componentDidMount=function(){var t=this;this.props.showTimeSelect&&(this.assignMonthContainer=(function(){t.setState({monthContainer:t.monthContainer})})())},a.prototype.componentDidUpdate=function(t){var e=this;if(this.props.preSelection&&(!ee(this.props.preSelection,t.preSelection)||this.props.monthSelectedIn!==t.monthSelectedIn)){var r=!Se(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return r&&e.handleCustomMonthChange(e.state.date)})}else this.props.openToDate&&!ee(this.props.openToDate,t.openToDate)&&this.setState({date:this.props.openToDate})},a.prototype.render=function(){var t=this.props.container||qm;return M.createElement(Rr,{onClickOutside:this.handleClickOutside,style:{display:"contents"},containerRef:this.containerRef,ignoreClass:this.props.outsideClickIgnoreClass},M.createElement(t,{className:ke("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren()))},a})(v.Component),$g=function(n){var a=n.icon,t=n.className,e=t===void 0?"":t,r=n.onClick,o="react-datepicker__calendar-icon";return typeof a=="string"?M.createElement("i",{className:"".concat(o," ").concat(a," ").concat(e),"aria-hidden":"true",onClick:r}):M.isValidElement(a)?M.cloneElement(a,{className:"".concat(a.props.className||""," ").concat(o," ").concat(e),onClick:function(i){typeof a.props.onClick=="function"&&a.props.onClick(i),typeof r=="function"&&r(i)}}):M.createElement("svg",{className:"".concat(o," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:r},M.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},_c=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.portalRoot=null,e.el=document.createElement("div"),e}return a.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},a.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},a.prototype.render=function(){return gl.createPortal(this.props.children,this.el)},a})(v.Component),Ng="[tabindex], a, button, input, select, textarea",Og=function(n){return(n instanceof HTMLAnchorElement||!n.disabled)&&n.tabIndex!==-1},Pc=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.getTabChildren=function(){var r;return Array.prototype.slice.call((r=e.tabLoopRef.current)===null||r===void 0?void 0:r.querySelectorAll(Ng),1,-1).filter(Og)},e.handleFocusStart=function(){var r=e.getTabChildren();r&&r.length>1&&r[r.length-1].focus()},e.handleFocusEnd=function(){var r=e.getTabChildren();r&&r.length>1&&r[0].focus()},e.tabLoopRef=v.createRef(),e}return a.prototype.render=function(){var t;return((t=this.props.enableTabLoop)!==null&&t!==void 0?t:a.defaultProps.enableTabLoop)?M.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},M.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,M.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},a.defaultProps={enableTabLoop:!0},a})(v.Component);function Rg(n){var a=function(t){var e,r=typeof t.hidePopper=="boolean"?t.hidePopper:!0,o=v.useRef(null),i=zm(te({open:!r,whileElementsMounted:Dp,placement:t.popperPlacement,middleware:Ge([Tp({padding:15}),Ep(10),$p({element:o})],(e=t.popperModifiers)!==null&&e!==void 0?e:[],!0)},t.popperProps)),c=te(te({},t),{hidePopper:r,popperProps:te(te({},i),{arrowRef:o})});return M.createElement(n,te({},c))};return a}var Ag=(function(n){be(a,n);function a(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(a,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),a.prototype.render=function(){var t=this.props,e=t.className,r=t.wrapperClassName,o=t.hidePopper,i=o===void 0?a.defaultProps.hidePopper:o,c=t.popperComponent,l=t.targetComponent,p=t.enableTabLoop,u=t.popperOnKeyDown,h=t.portalId,x=t.portalHost,b=t.popperProps,y=t.showArrow,w=void 0;if(!i){var k=ke("react-datepicker-popper",e);w=M.createElement(Pc,{enableTabLoop:p},M.createElement("div",{ref:b.refs.setFloating,style:b.floatingStyles,className:k,"data-placement":b.placement,onKeyDown:u},c,y&&M.createElement(Am,{ref:b.arrowRef,context:b.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(w=v.createElement(this.props.popperContainer,{},w)),h&&!i&&(w=M.createElement(_c,{portalId:h,portalHost:x},w));var f=ke("react-datepicker-wrapper",r);return M.createElement(M.Fragment,null,M.createElement("div",{ref:b.refs.setReference,className:f},l),w)},a})(v.Component),Lg=Rg(Ag),ki="react-datepicker-ignore-onclickoutside";function Fg(n,a){return n&&a?Me(n)!==Me(a)||G(n)!==G(a):n!==a}var ia="Date input not valid.",Yg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.calendar=null,e.input=null,e.getPreSelection=function(){return e.props.openToDate?e.props.openToDate:e.props.selectsEnd&&e.props.startDate?e.props.startDate:e.props.selectsStart&&e.props.endDate?e.props.endDate:ie()},e.modifyHolidays=function(){var r;return(r=e.props.holidays)===null||r===void 0?void 0:r.reduce(function(o,i){var c=new Date(i.date);return at(c)?Ge(Ge([],o,!0),[te(te({},i),{date:c})],!1):o},[])},e.calcInitialState=function(){var r,o=e.getPreSelection(),i=Cc(e.props),c=Sc(e.props),l=i&&Lt(o,sr(i))?i:c&&Dt(o,si(c))?c:o;return{open:e.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(r=e.props.selectsRange?e.props.startDate:e.props.selected)!==null&&r!==void 0?r:l,highlightDates:mi(e.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},e.resetHiddenStatus=function(){e.setState(te(te({},e.state),{wasHidden:!1}))},e.setHiddenStatus=function(){e.setState(te(te({},e.state),{wasHidden:!0}))},e.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&e.setHiddenStatus()},e.clearPreventFocusTimeout=function(){e.preventFocusTimeout&&clearTimeout(e.preventFocusTimeout)},e.safeFocus=function(){setTimeout(function(){var r,o;(o=(r=e.input)===null||r===void 0?void 0:r.focus)===null||o===void 0||o.call(r,{preventScroll:!0})},0)},e.safeBlur=function(){setTimeout(function(){var r,o;(o=(r=e.input)===null||r===void 0?void 0:r.blur)===null||o===void 0||o.call(r)},0)},e.setFocus=function(){e.safeFocus()},e.setBlur=function(){e.safeBlur(),e.cancelFocusInput()},e.setOpen=function(r,o){o===void 0&&(o=!1),e.setState({open:r,preSelection:r&&e.state.open?e.state.preSelection:e.calcInitialState().preSelection,lastPreSelectChange:sa},function(){r||e.setState(function(i){return{focused:o?i.focused:!1}},function(){!o&&e.setBlur(),e.setState({inputValue:null})})})},e.inputOk=function(){return st(e.state.preSelection)},e.isCalendarOpen=function(){return e.props.open===void 0?e.state.open&&!e.props.disabled&&!e.props.readOnly:e.props.open},e.handleFocus=function(r){var o,i,c=e.state.wasHidden,l=c?e.state.open:!0;c&&e.resetHiddenStatus(),!e.state.preventFocus&&l&&((i=(o=e.props).onFocus)===null||i===void 0||i.call(o,r),!e.props.preventOpenOnFocus&&!e.props.readOnly&&e.setOpen(!0)),e.setState({focused:!0})},e.sendFocusBackToInput=function(){e.preventFocusTimeout&&e.clearPreventFocusTimeout(),e.setState({preventFocus:!0},function(){e.preventFocusTimeout=setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})})},e.cancelFocusInput=function(){clearTimeout(e.inputFocusTimeout),e.inputFocusTimeout=void 0},e.deferFocusInput=function(){e.cancelFocusInput(),e.inputFocusTimeout=setTimeout(function(){return e.setFocus()},1)},e.handleDropdownFocus=function(){e.cancelFocusInput()},e.handleBlur=function(r){var o,i;(!e.state.open||e.props.withPortal||e.props.showTimeInput)&&((i=(o=e.props).onBlur)===null||i===void 0||i.call(o,r)),e.setState({focused:!1})},e.handleCalendarClickOutside=function(r){var o,i;e.props.inline||e.setOpen(!1),(i=(o=e.props).onClickOutside)===null||i===void 0||i.call(o,r),e.props.withPortal&&r.preventDefault()},e.handleChange=function(){for(var r,o,i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];var l=i[0];if(!(e.props.onChangeRaw&&(e.props.onChangeRaw.apply(e,i),!l||typeof l.isDefaultPrevented!="function"||l.isDefaultPrevented()))){e.setState({inputValue:(l==null?void 0:l.target)instanceof HTMLInputElement?l.target.value:null,lastPreSelectChange:Wg});var p=e.props,u=p.dateFormat,h=u===void 0?a.defaultProps.dateFormat:u,x=p.strictParsing,b=x===void 0?a.defaultProps.strictParsing:x,y=p.selectsRange,w=p.startDate,k=p.endDate,f=(l==null?void 0:l.target)instanceof HTMLInputElement?l.target.value:"";if(y){var C=f.split("-",2).map(function(I){return I.trim()}),$=C[0],E=C[1],A=ra($??"",h,e.props.locale,b),N=ra(E??"",h,e.props.locale,b),S=(w==null?void 0:w.getTime())!==(A==null?void 0:A.getTime()),D=(k==null?void 0:k.getTime())!==(N==null?void 0:N.getTime());if(!S&&!D||A&&Ne(A,e.props)||N&&Ne(N,e.props))return;(o=(r=e.props).onChange)===null||o===void 0||o.call(r,[A,N],l)}else{var P=ra(f,h,e.props.locale,b,e.props.minDate);e.props.showTimeSelectOnly&&e.props.selected&&P&&!ee(P,e.props.selected)&&(P=Mm(e.props.selected,{hours:Je(P),minutes:Ze(P),seconds:ct(P)})),(P||!f)&&e.setSelected(P,l,!0)}}},e.handleSelect=function(r,o,i){if(e.props.shouldCloseOnSelect&&!e.props.showTimeSelect&&e.sendFocusBackToInput(),e.props.onChangeRaw&&e.props.onChangeRaw(o),e.setSelected(r,o,!1,i),e.props.showDateSelect&&e.setState({isRenderAriaLiveMessage:!0}),!e.props.shouldCloseOnSelect||e.props.showTimeSelect)e.setPreSelection(r);else if(!e.props.inline){e.props.selectsRange||e.setOpen(!1);var c=e.props,l=c.startDate,p=c.endDate;l&&!p&&(e.props.swapRange||!bi(r,l))&&e.setOpen(!1)}},e.setSelected=function(r,o,i,c){var l,p,u=r;if(e.props.showYearPicker){if(u!==null&&cr(G(u),e.props))return}else if(e.props.showMonthYearPicker){if(u!==null&&Dc(u,e.props))return}else if(u!==null&&Ne(u,e.props))return;var h=e.props,x=h.onChange,b=h.selectsRange,y=h.startDate,w=h.endDate,k=h.selectsMultiple,f=h.selectedDates,C=h.minTime,$=h.swapRange;if(!It(e.props.selected,u)||e.props.allowSameDay||b||k)if(u!==null&&(e.props.selected&&(!i||!e.props.showTimeSelect&&!e.props.showTimeSelectOnly&&!e.props.showTimeInput)&&(u=aa(u,{hour:Je(e.props.selected),minute:Ze(e.props.selected),second:ct(e.props.selected)})),!i&&(e.props.showTimeSelect||e.props.showTimeSelectOnly)&&C&&(u=aa(u,{hour:C.getHours(),minute:C.getMinutes(),second:C.getSeconds()})),e.props.inline||e.setState({preSelection:u}),e.props.focusSelectedMonth||e.setState({monthSelectedIn:c})),b){var E=!y&&!w,A=y&&!w,N=y&&w;E?x==null||x([u,null],o):A&&(u===null?x==null||x([null,null],o):bi(u,y)?$?x==null||x([u,y],o):x==null||x([u,null],o):x==null||x([y,u],o)),N&&(x==null||x([u,null],o))}else if(k){if(u!==null)if(!(f!=null&&f.length))x==null||x([u],o);else{var S=f.some(function(P){return ee(P,u)});if(S){var D=f.filter(function(P){return!ee(P,u)});x==null||x(D,o)}else x==null||x(Ge(Ge([],f,!0),[u],!1),o)}}else x==null||x(u,o);i||((p=(l=e.props).onSelect)===null||p===void 0||p.call(l,u,o),e.setState({inputValue:null}))},e.setPreSelection=function(r){var o=st(e.props.minDate),i=st(e.props.maxDate),c=!0;if(r){var l=sr(r);if(o&&i)c=Pn(r,e.props.minDate,e.props.maxDate);else if(o){var p=sr(e.props.minDate);c=Dt(r,p)||It(l,p)}else if(i){var u=si(e.props.maxDate);c=Lt(r,u)||It(l,u)}}c&&e.setState({preSelection:r})},e.toggleCalendar=function(){e.setOpen(!e.state.open)},e.handleTimeChange=function(r){var o,i;if(!(e.props.selectsRange||e.props.selectsMultiple)){var c=e.props.selected?e.props.selected:e.getPreSelection(),l=e.props.selected?r:aa(c,{hour:Je(r),minute:Ze(r)});e.setState({preSelection:l}),(i=(o=e.props).onChange)===null||i===void 0||i.call(o,l),e.props.shouldCloseOnSelect&&!e.props.showTimeInput&&(e.sendFocusBackToInput(),e.setOpen(!1)),e.props.showTimeInput&&e.setOpen(!0),(e.props.showTimeSelectOnly||e.props.showTimeSelect)&&e.setState({isRenderAriaLiveMessage:!0}),e.setState({inputValue:null})}},e.onInputClick=function(){var r,o;!e.props.disabled&&!e.props.readOnly&&e.setOpen(!0),(o=(r=e.props).onInputClick)===null||o===void 0||o.call(r)},e.onInputKeyDown=function(r){var o,i,c,l,p,u;(i=(o=e.props).onKeyDown)===null||i===void 0||i.call(o,r);var h=r.key;if(!e.state.open&&!e.props.inline&&!e.props.preventOpenOnFocus){(h===F.ArrowDown||h===F.ArrowUp||h===F.Enter)&&((c=e.onInputClick)===null||c===void 0||c.call(e));return}if(e.state.open){if(h===F.ArrowDown||h===F.ArrowUp){r.preventDefault();var x=e.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":e.props.showWeekPicker&&e.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':e.props.showFullMonthYearPicker||e.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',b=((l=e.calendar)===null||l===void 0?void 0:l.containerRef.current)instanceof Element&&e.calendar.containerRef.current.querySelector(x);b instanceof HTMLElement&&b.focus({preventScroll:!0});return}var y=ie(e.state.preSelection);h===F.Enter?(r.preventDefault(),r.target.blur(),e.inputOk()&&e.state.lastPreSelectChange===sa?(e.handleSelect(y,r),!e.props.shouldCloseOnSelect&&e.setPreSelection(y)):e.setOpen(!1)):h===F.Escape?(r.preventDefault(),r.target.blur(),e.sendFocusBackToInput(),e.setOpen(!1)):h===F.Tab&&e.setOpen(!1),e.inputOk()||(u=(p=e.props).onInputError)===null||u===void 0||u.call(p,{code:1,msg:ia})}},e.onPortalKeyDown=function(r){var o=r.key;o===F.Escape&&(r.preventDefault(),e.setState({preventFocus:!0},function(){e.setOpen(!1),setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})}))},e.onDayKeyDown=function(r){var o,i,c,l,p,u,h=e.props,x=h.minDate,b=h.maxDate,y=h.disabledKeyboardNavigation,w=h.showWeekPicker,k=h.shouldCloseOnSelect,f=h.locale,C=h.calendarStartDay,$=h.adjustDateOnChange,E=h.inline;if((i=(o=e.props).onKeyDown)===null||i===void 0||i.call(o,r),!y){var A=r.key,N=r.shiftKey,S=ie(e.state.preSelection),D=function(U,Y){var q=Y;switch(U){case F.ArrowRight:q=w?gr(Y,1):Ae(Y,1);break;case F.ArrowLeft:q=w?ni(Y):lm(Y);break;case F.ArrowUp:q=ni(Y);break;case F.ArrowDown:q=gr(Y,1);break;case F.PageUp:q=N?cn(Y,1):Tt(Y,1);break;case F.PageDown:q=N?it(Y,1):Fe(Y,1);break;case F.Home:q=kt(Y,f,C);break;case F.End:q=Jm(Y);break}return q},P=function(U,Y){for(var q=40,_=U,J=!1,me=0,ye=D(U,Y);!J;){if(me>=q){ye=Y;break}x&&ye<x&&(_=F.ArrowRight,ye=Ne(x,e.props)?D(_,ye):x),b&&ye>b&&(_=F.ArrowLeft,ye=Ne(b,e.props)?D(_,ye):b),Ne(ye,e.props)?((_===F.PageUp||_===F.Home)&&(_=F.ArrowRight),(_===F.PageDown||_===F.End)&&(_=F.ArrowLeft),ye=D(_,ye)):J=!0,me++}return ye};if(A===F.Enter){r.preventDefault(),e.handleSelect(S,r),!k&&e.setPreSelection(S);return}else if(A===F.Escape){r.preventDefault(),e.setOpen(!1),e.inputOk()||(l=(c=e.props).onInputError)===null||l===void 0||l.call(c,{code:1,msg:ia});return}var I=null;switch(A){case F.ArrowLeft:case F.ArrowRight:case F.ArrowUp:case F.ArrowDown:case F.PageUp:case F.PageDown:case F.Home:case F.End:I=P(A,S);break}if(!I){(u=(p=e.props).onInputError)===null||u===void 0||u.call(p,{code:1,msg:ia});return}if(r.preventDefault(),e.setState({lastPreSelectChange:sa}),$&&e.setSelected(I),e.setPreSelection(I),E){var O=Me(S),T=Me(I),W=G(S),z=G(I);O!==T||W!==z?e.setState({shouldFocusDayInline:!0}):e.setState({shouldFocusDayInline:!1})}}},e.onPopperKeyDown=function(r){var o=r.key;o===F.Escape&&(r.preventDefault(),e.sendFocusBackToInput())},e.onClearClick=function(r){r&&r.preventDefault&&r.preventDefault(),e.sendFocusBackToInput();var o=e.props,i=o.selectsRange,c=o.onChange;i?c==null||c([null,null],r):c==null||c(null,r),e.setState({inputValue:null})},e.clear=function(){e.onClearClick()},e.onScroll=function(r){typeof e.props.closeOnScroll=="boolean"&&e.props.closeOnScroll?(r.target===document||r.target===document.documentElement||r.target===document.body)&&e.setOpen(!1):typeof e.props.closeOnScroll=="function"&&e.props.closeOnScroll(r)&&e.setOpen(!1)},e.renderCalendar=function(){var r,o;return!e.props.inline&&!e.isCalendarOpen()?null:M.createElement(Tg,te({showMonthYearDropdown:void 0,ref:function(i){e.calendar=i}},e.props,e.state,{setOpen:e.setOpen,dateFormat:(r=e.props.dateFormatCalendar)!==null&&r!==void 0?r:a.defaultProps.dateFormatCalendar,onSelect:e.handleSelect,onClickOutside:e.handleCalendarClickOutside,holidays:dg(e.modifyHolidays()),outsideClickIgnoreClass:ki,onDropdownFocus:e.handleDropdownFocus,onTimeChange:e.handleTimeChange,className:e.props.calendarClassName,container:e.props.calendarContainer,handleOnKeyDown:e.props.onKeyDown,handleOnDayKeyDown:e.onDayKeyDown,setPreSelection:e.setPreSelection,dropdownMode:(o=e.props.dropdownMode)!==null&&o!==void 0?o:a.defaultProps.dropdownMode}),e.props.children)},e.renderAriaLiveRegion=function(){var r=e.props,o=r.dateFormat,i=o===void 0?a.defaultProps.dateFormat:o,c=r.locale,l=e.props.showTimeInput||e.props.showTimeSelect,p=l?"PPPPp":"PPPP",u;return e.props.selectsRange?u="Selected start date: ".concat($e(e.props.startDate,{dateFormat:p,locale:c}),". ").concat(e.props.endDate?"End date: "+$e(e.props.endDate,{dateFormat:p,locale:c}):""):e.props.showTimeSelectOnly?u="Selected time: ".concat($e(e.props.selected,{dateFormat:i,locale:c})):e.props.showYearPicker?u="Selected year: ".concat($e(e.props.selected,{dateFormat:"yyyy",locale:c})):e.props.showMonthYearPicker?u="Selected month: ".concat($e(e.props.selected,{dateFormat:"MMMM yyyy",locale:c})):e.props.showQuarterYearPicker?u="Selected quarter: ".concat($e(e.props.selected,{dateFormat:"yyyy, QQQ",locale:c})):u="Selected date: ".concat($e(e.props.selected,{dateFormat:p,locale:c})),M.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},u)},e.renderDateInput=function(){var r,o,i,c=ke(e.props.className,(r={},r[ki]=e.state.open,r)),l=e.props.customInput||M.createElement("input",{type:"text"}),p=e.props.customInputRef||"ref",u=e.props,h=u.dateFormat,x=h===void 0?a.defaultProps.dateFormat:h,b=u.locale,y=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?Vm(e.props.startDate,e.props.endDate,{dateFormat:x,locale:b}):e.props.selectsMultiple?Um((i=e.props.selectedDates)!==null&&i!==void 0?i:[],{dateFormat:x,locale:b}):$e(e.props.selected,{dateFormat:x,locale:b});return v.cloneElement(l,(o={},o[p]=function(w){e.input=w},o.value=y,o.onBlur=e.handleBlur,o.onChange=e.handleChange,o.onClick=e.onInputClick,o.onFocus=e.handleFocus,o.onKeyDown=e.onInputKeyDown,o.id=e.props.id,o.name=e.props.name,o.form=e.props.form,o.autoFocus=e.props.autoFocus,o.placeholder=e.props.placeholderText,o.disabled=e.props.disabled,o.autoComplete=e.props.autoComplete,o.className=ke(l.props.className,c),o.title=e.props.title,o.readOnly=e.props.readOnly,o.required=e.props.required,o.tabIndex=e.props.tabIndex,o["aria-describedby"]=e.props.ariaDescribedBy,o["aria-invalid"]=e.props.ariaInvalid,o["aria-labelledby"]=e.props.ariaLabelledBy,o["aria-required"]=e.props.ariaRequired,o))},e.renderClearButton=function(){var r=e.props,o=r.isClearable,i=r.disabled,c=r.selected,l=r.startDate,p=r.endDate,u=r.clearButtonTitle,h=r.clearButtonClassName,x=h===void 0?"":h,b=r.ariaLabelClose,y=b===void 0?"Close":b,w=r.selectedDates;return o&&(c!=null||l!=null||p!=null||w!=null&&w.length)?M.createElement("button",{type:"button",className:ke("react-datepicker__close-icon",x,{"react-datepicker__close-icon--disabled":i}),disabled:i,"aria-label":y,onClick:e.onClearClick,title:u,tabIndex:-1}):null},e.state=e.calcInitialState(),e.preventFocusTimeout=void 0,e}return Object.defineProperty(a,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:Ln,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),a.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},a.prototype.componentDidUpdate=function(t,e){var r,o,i,c;t.inline&&Fg(t.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&t.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),t.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:mi(this.props.highlightDates)}),!e.focused&&!It(t.selected,this.props.selected)&&this.setState({inputValue:null}),e.open!==this.state.open&&(e.open===!1&&this.state.open===!0&&((o=(r=this.props).onCalendarOpen)===null||o===void 0||o.call(r)),e.open===!0&&this.state.open===!1&&((c=(i=this.props).onCalendarClose)===null||c===void 0||c.call(i)))},a.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},a.prototype.renderInputContainer=function(){var t=this.props,e=t.showIcon,r=t.icon,o=t.calendarIconClassname,i=t.calendarIconClassName,c=t.toggleCalendarOnIconClick,l=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),M.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&M.createElement($g,te({icon:r,className:ke(i,!i&&o,l&&"react-datepicker-ignore-onclickoutside")},c?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},a.prototype.render=function(){var t=this.renderCalendar();if(this.props.inline)return t;if(this.props.withPortal){var e=this.state.open?M.createElement(Pc,{enableTabLoop:this.props.enableTabLoop},M.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=M.createElement(_c,te({portalId:this.props.portalId},this.props),e)),M.createElement("div",null,this.renderInputContainer(),e)}return M.createElement(Lg,te({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:t,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},a})(v.Component),Wg="input",sa="navigate";function Ar(n){return!!n&&!_l(n.providerType)}function Bg(){const{data:n}=ge({queryKey:["feature-flag","proceeds-to-treasury"],queryFn:Pl,staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const Di=m.div`
|
|
353
|
+
position: fixed;
|
|
354
|
+
inset: 0;
|
|
355
|
+
z-index: 10000;
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
justify-content: center;
|
|
359
|
+
padding: 16px;
|
|
360
|
+
background: rgba(22, 21, 24, 0.55);
|
|
361
|
+
`,Ci=m.div`
|
|
362
|
+
width: 560px;
|
|
363
|
+
max-width: 100%;
|
|
364
|
+
max-height: 92vh;
|
|
365
|
+
overflow-y: auto;
|
|
366
|
+
background: ${d.colors.white};
|
|
367
|
+
border-radius: 16px;
|
|
368
|
+
padding: 12px 16px 16px;
|
|
369
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
370
|
+
display: flex;
|
|
371
|
+
flex-direction: column;
|
|
372
|
+
gap: 24px;
|
|
373
|
+
`,Si=m.div`
|
|
374
|
+
display: flex;
|
|
375
|
+
align-items: center;
|
|
376
|
+
justify-content: space-between;
|
|
377
|
+
gap: 8px;
|
|
378
|
+
padding-bottom: 16px;
|
|
379
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
380
|
+
`,Mi=m.h2`
|
|
381
|
+
margin: 0;
|
|
382
|
+
font-family: ${d.font.sans};
|
|
383
|
+
font-weight: 600;
|
|
384
|
+
font-size: 20px;
|
|
385
|
+
line-height: 1.6;
|
|
386
|
+
color: ${d.colors.text};
|
|
387
|
+
`,_i=m.button`
|
|
388
|
+
flex: none;
|
|
389
|
+
display: grid;
|
|
390
|
+
place-items: center;
|
|
391
|
+
width: 24px;
|
|
392
|
+
height: 24px;
|
|
393
|
+
border: 0;
|
|
394
|
+
background: none;
|
|
395
|
+
cursor: pointer;
|
|
396
|
+
color: ${d.colors.text};
|
|
397
|
+
|
|
398
|
+
.ico {
|
|
399
|
+
width: 18px;
|
|
400
|
+
height: 18px;
|
|
401
|
+
}
|
|
402
|
+
&:disabled {
|
|
403
|
+
opacity: 0.4;
|
|
404
|
+
cursor: default;
|
|
405
|
+
}
|
|
406
|
+
&:focus-visible {
|
|
407
|
+
outline: 2px solid ${d.colors.accent};
|
|
408
|
+
outline-offset: 2px;
|
|
409
|
+
}
|
|
410
|
+
`,Hg=m.p`
|
|
411
|
+
margin: 0;
|
|
412
|
+
font-family: ${d.font.sans};
|
|
413
|
+
font-size: 14px;
|
|
414
|
+
line-height: 1.57;
|
|
415
|
+
color: ${d.colors.text};
|
|
416
|
+
text-align: left;
|
|
417
|
+
`,zg=m.div`
|
|
418
|
+
display: flex;
|
|
419
|
+
align-items: center;
|
|
420
|
+
gap: 12px;
|
|
421
|
+
`,qg=m.div`
|
|
422
|
+
flex: none;
|
|
423
|
+
display: grid;
|
|
424
|
+
place-items: center;
|
|
425
|
+
width: 180px;
|
|
426
|
+
height: 180px;
|
|
427
|
+
border-radius: 16px;
|
|
428
|
+
background: ${d.colors.media};
|
|
429
|
+
border: 1px solid ${d.colors.gray4};
|
|
430
|
+
overflow: hidden;
|
|
431
|
+
|
|
432
|
+
img {
|
|
433
|
+
width: 150px;
|
|
434
|
+
height: 150px;
|
|
435
|
+
object-fit: contain;
|
|
436
|
+
filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.1));
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
${d.media.maxWidth("mobile")} {
|
|
440
|
+
width: 120px;
|
|
441
|
+
height: 120px;
|
|
442
|
+
|
|
443
|
+
img {
|
|
444
|
+
width: 100px;
|
|
445
|
+
height: 100px;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
`,Kg=m.div`
|
|
449
|
+
flex: 1 1 0;
|
|
450
|
+
min-width: 0;
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
gap: 4px;
|
|
454
|
+
padding: 8px;
|
|
455
|
+
`,Qg=m.p`
|
|
456
|
+
margin: 0;
|
|
457
|
+
font-family: ${d.font.sans};
|
|
458
|
+
font-weight: 600;
|
|
459
|
+
font-size: 20px;
|
|
460
|
+
line-height: 1.57;
|
|
461
|
+
color: ${d.colors.text};
|
|
462
|
+
`,Vg=m.p`
|
|
463
|
+
margin: 0;
|
|
464
|
+
font-family: ${d.font.sans};
|
|
465
|
+
font-size: 10px;
|
|
466
|
+
line-height: 1.43;
|
|
467
|
+
color: ${d.colors.muted};
|
|
468
|
+
`,Ug=m.div`
|
|
469
|
+
display: flex;
|
|
470
|
+
gap: 12px;
|
|
471
|
+
|
|
472
|
+
${d.media.maxWidth("mobile")} {
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
}
|
|
475
|
+
`,Pi=m.label`
|
|
476
|
+
flex: 1 1 0;
|
|
477
|
+
min-width: 0;
|
|
478
|
+
display: flex;
|
|
479
|
+
flex-direction: column;
|
|
480
|
+
gap: 4px;
|
|
481
|
+
`,Ii=m.span`
|
|
482
|
+
font-family: ${d.font.sans};
|
|
483
|
+
font-size: 12px;
|
|
484
|
+
color: ${d.colors.muted};
|
|
485
|
+
`,Xg=m.div`
|
|
486
|
+
display: flex;
|
|
487
|
+
align-items: center;
|
|
488
|
+
justify-content: space-between;
|
|
489
|
+
gap: 4px;
|
|
490
|
+
height: 42px;
|
|
491
|
+
padding: 0 8px;
|
|
492
|
+
border: 0.5px solid ${d.colors.text};
|
|
493
|
+
border-radius: 8px;
|
|
494
|
+
background: ${d.colors.white};
|
|
495
|
+
|
|
496
|
+
&:focus-within {
|
|
497
|
+
border-color: ${d.colors.magenta};
|
|
498
|
+
}
|
|
499
|
+
&[aria-invalid='true'] {
|
|
500
|
+
border-color: ${d.colors.err};
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.ccy {
|
|
504
|
+
flex: none;
|
|
505
|
+
width: 22px;
|
|
506
|
+
height: 22px;
|
|
507
|
+
color: ${d.colors.rarity};
|
|
508
|
+
}
|
|
509
|
+
.cal {
|
|
510
|
+
flex: none;
|
|
511
|
+
width: 18px;
|
|
512
|
+
height: 18px;
|
|
513
|
+
color: ${d.colors.text};
|
|
514
|
+
}
|
|
515
|
+
`,Gg=m.input`
|
|
516
|
+
flex: 1 1 auto;
|
|
517
|
+
min-width: 0;
|
|
518
|
+
border: 0;
|
|
519
|
+
outline: none;
|
|
520
|
+
background: transparent;
|
|
521
|
+
font-family: ${d.font.sans};
|
|
522
|
+
font-size: 13px;
|
|
523
|
+
color: ${d.colors.text};
|
|
524
|
+
|
|
525
|
+
&::placeholder {
|
|
526
|
+
color: ${d.colors.muted2};
|
|
527
|
+
}
|
|
528
|
+
/* Strip the number spinners — the glyph + USD hint carry the affordance. */
|
|
529
|
+
&::-webkit-outer-spin-button,
|
|
530
|
+
&::-webkit-inner-spin-button {
|
|
531
|
+
-webkit-appearance: none;
|
|
532
|
+
margin: 0;
|
|
533
|
+
}
|
|
534
|
+
&[type='number'] {
|
|
535
|
+
-moz-appearance: textfield;
|
|
536
|
+
appearance: textfield;
|
|
537
|
+
}
|
|
538
|
+
`,Jg=m.span`
|
|
539
|
+
flex: none;
|
|
540
|
+
font-family: ${d.font.sans};
|
|
541
|
+
font-size: 10px;
|
|
542
|
+
color: ${d.colors.muted2};
|
|
543
|
+
`,Zg=m.div`
|
|
544
|
+
.react-datepicker-wrapper {
|
|
545
|
+
display: block;
|
|
546
|
+
width: 100%;
|
|
547
|
+
}
|
|
548
|
+
.react-datepicker__input-container {
|
|
549
|
+
display: flex;
|
|
550
|
+
align-items: center;
|
|
551
|
+
}
|
|
552
|
+
.react-datepicker__input-container input {
|
|
553
|
+
width: 100%;
|
|
554
|
+
height: 42px;
|
|
555
|
+
padding: 0 8px;
|
|
556
|
+
border: 0.5px solid ${d.colors.text};
|
|
557
|
+
border-radius: 8px;
|
|
558
|
+
background: ${d.colors.white};
|
|
559
|
+
font-family: ${d.font.sans};
|
|
560
|
+
font-size: 13px;
|
|
561
|
+
color: ${d.colors.text};
|
|
562
|
+
outline: none;
|
|
563
|
+
}
|
|
564
|
+
.react-datepicker__input-container input:focus {
|
|
565
|
+
border-color: ${d.colors.magenta};
|
|
566
|
+
}
|
|
567
|
+
&[data-invalid='true'] .react-datepicker__input-container input {
|
|
568
|
+
border-color: ${d.colors.err};
|
|
569
|
+
}
|
|
570
|
+
/* The showIcon calendar glyph inside the field. */
|
|
571
|
+
.react-datepicker__calendar-icon {
|
|
572
|
+
fill: ${d.colors.text};
|
|
573
|
+
opacity: 0.85;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/* ---- Calendar popup: white / on-brand (override react-datepicker defaults) ---- */
|
|
577
|
+
.react-datepicker-popper {
|
|
578
|
+
z-index: 40;
|
|
579
|
+
}
|
|
580
|
+
.react-datepicker {
|
|
581
|
+
font-family: ${d.font.sans};
|
|
582
|
+
font-size: 13px;
|
|
583
|
+
color: ${d.colors.text};
|
|
584
|
+
background: ${d.colors.white};
|
|
585
|
+
border: 1px solid rgba(22, 21, 24, 0.1);
|
|
586
|
+
border-radius: 12px;
|
|
587
|
+
box-shadow: 0 12px 32px rgba(22, 21, 24, 0.14);
|
|
588
|
+
overflow: hidden;
|
|
589
|
+
}
|
|
590
|
+
.react-datepicker__triangle {
|
|
591
|
+
display: none;
|
|
592
|
+
}
|
|
593
|
+
.react-datepicker__header {
|
|
594
|
+
background: ${d.colors.white};
|
|
595
|
+
border-bottom: 1px solid rgba(22, 21, 24, 0.1);
|
|
596
|
+
padding-top: 12px;
|
|
597
|
+
}
|
|
598
|
+
.react-datepicker__current-month {
|
|
599
|
+
color: ${d.colors.text};
|
|
600
|
+
font-weight: 600;
|
|
601
|
+
font-size: 14px;
|
|
602
|
+
}
|
|
603
|
+
.react-datepicker__day-name {
|
|
604
|
+
color: ${d.colors.muted2};
|
|
605
|
+
}
|
|
606
|
+
.react-datepicker__day {
|
|
607
|
+
color: ${d.colors.text};
|
|
608
|
+
border-radius: 8px;
|
|
609
|
+
}
|
|
610
|
+
.react-datepicker__day:hover {
|
|
611
|
+
background: rgba(105, 31, 169, 0.1);
|
|
612
|
+
}
|
|
613
|
+
.react-datepicker__day--selected,
|
|
614
|
+
.react-datepicker__day--keyboard-selected {
|
|
615
|
+
background: ${d.colors.accent};
|
|
616
|
+
color: ${d.colors.white};
|
|
617
|
+
}
|
|
618
|
+
.react-datepicker__day--today {
|
|
619
|
+
font-weight: 700;
|
|
620
|
+
}
|
|
621
|
+
.react-datepicker__day--disabled {
|
|
622
|
+
color: ${d.colors.muted2};
|
|
623
|
+
opacity: 0.5;
|
|
624
|
+
}
|
|
625
|
+
.react-datepicker__navigation-icon::before {
|
|
626
|
+
border-color: ${d.colors.accent};
|
|
627
|
+
}
|
|
628
|
+
.react-datepicker__today-button {
|
|
629
|
+
background: ${d.colors.white};
|
|
630
|
+
border-top: 1px solid rgba(22, 21, 24, 0.1);
|
|
631
|
+
color: ${d.colors.accent};
|
|
632
|
+
font-weight: 600;
|
|
633
|
+
padding: 10px;
|
|
634
|
+
}
|
|
635
|
+
`,ex=m.button`
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 48px;
|
|
638
|
+
border: 0;
|
|
639
|
+
border-radius: 16px;
|
|
640
|
+
cursor: pointer;
|
|
641
|
+
background: ${d.colors.accent};
|
|
642
|
+
color: ${d.colors.white};
|
|
643
|
+
font-family: ${d.font.sans};
|
|
644
|
+
font-weight: 600;
|
|
645
|
+
font-size: 15px;
|
|
646
|
+
line-height: 24px;
|
|
647
|
+
letter-spacing: 0.46px;
|
|
648
|
+
text-transform: uppercase;
|
|
649
|
+
|
|
650
|
+
&:hover:not(:disabled) {
|
|
651
|
+
background: ${d.colors.accentHover};
|
|
652
|
+
}
|
|
653
|
+
&:focus-visible {
|
|
654
|
+
outline: 2px solid ${d.colors.accent};
|
|
655
|
+
outline-offset: 2px;
|
|
656
|
+
}
|
|
657
|
+
&:disabled {
|
|
658
|
+
cursor: not-allowed;
|
|
659
|
+
background: rgba(105, 31, 169, 0.2);
|
|
660
|
+
color: ${d.colors.white};
|
|
661
|
+
}
|
|
662
|
+
`;m.p`
|
|
663
|
+
margin: 0;
|
|
664
|
+
font-family: ${d.font.sans};
|
|
665
|
+
font-size: 13px;
|
|
666
|
+
color: ${d.colors.muted};
|
|
667
|
+
text-align: center;
|
|
668
|
+
`;const tx=m.p`
|
|
669
|
+
margin: 0;
|
|
670
|
+
font-family: ${d.font.sans};
|
|
671
|
+
font-size: 12px;
|
|
672
|
+
line-height: 1.5;
|
|
673
|
+
color: ${d.colors.muted};
|
|
674
|
+
`,nx=m.div`
|
|
675
|
+
display: flex;
|
|
676
|
+
flex-direction: column;
|
|
677
|
+
align-items: center;
|
|
678
|
+
gap: 16px;
|
|
679
|
+
padding: 24px 16px;
|
|
680
|
+
border-radius: 16px;
|
|
681
|
+
background: rgba(193, 238, 207, 0.5);
|
|
682
|
+
text-align: center;
|
|
683
|
+
`,rx=m.div`
|
|
684
|
+
display: grid;
|
|
685
|
+
place-items: center;
|
|
686
|
+
width: 64px;
|
|
687
|
+
height: 64px;
|
|
688
|
+
border-radius: 50%;
|
|
689
|
+
background: ${d.colors.ok};
|
|
690
|
+
color: ${d.colors.white};
|
|
691
|
+
|
|
692
|
+
.ico {
|
|
693
|
+
width: 34px;
|
|
694
|
+
height: 34px;
|
|
695
|
+
}
|
|
696
|
+
`,ax=m.p`
|
|
697
|
+
margin: 0;
|
|
698
|
+
font-family: ${d.font.sans};
|
|
699
|
+
font-size: 20px;
|
|
700
|
+
line-height: 1.334;
|
|
701
|
+
color: ${d.colors.text2};
|
|
702
|
+
|
|
703
|
+
b {
|
|
704
|
+
font-weight: 700;
|
|
705
|
+
}
|
|
706
|
+
`,ox=m.div`
|
|
707
|
+
display: flex;
|
|
708
|
+
gap: 12px;
|
|
709
|
+
|
|
710
|
+
${d.media.maxWidth("mobile")} {
|
|
711
|
+
flex-direction: column-reverse;
|
|
712
|
+
}
|
|
713
|
+
`,ix=m.button`
|
|
714
|
+
flex: 1 1 0;
|
|
715
|
+
height: 48px;
|
|
716
|
+
border: 2px solid ${d.colors.accent};
|
|
717
|
+
border-radius: 12px;
|
|
718
|
+
background: transparent;
|
|
719
|
+
color: ${d.colors.accent};
|
|
720
|
+
cursor: pointer;
|
|
721
|
+
font-family: ${d.font.sans};
|
|
722
|
+
font-weight: 600;
|
|
723
|
+
font-size: 13px;
|
|
724
|
+
line-height: 24px;
|
|
725
|
+
letter-spacing: 0.46px;
|
|
726
|
+
text-transform: uppercase;
|
|
727
|
+
|
|
728
|
+
&:hover {
|
|
729
|
+
background: rgba(105, 31, 169, 0.06);
|
|
730
|
+
}
|
|
731
|
+
&:focus-visible {
|
|
732
|
+
outline: 2px solid ${d.colors.accent};
|
|
733
|
+
outline-offset: 2px;
|
|
734
|
+
}
|
|
735
|
+
`,sx=m.button`
|
|
736
|
+
flex: 1 1 0;
|
|
737
|
+
height: 48px;
|
|
738
|
+
border: 0;
|
|
739
|
+
border-radius: 12px;
|
|
740
|
+
background: ${d.colors.accent};
|
|
741
|
+
color: ${d.colors.softWhite};
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
font-family: ${d.font.sans};
|
|
744
|
+
font-weight: 600;
|
|
745
|
+
font-size: 13px;
|
|
746
|
+
line-height: 24px;
|
|
747
|
+
letter-spacing: 0.46px;
|
|
748
|
+
text-transform: uppercase;
|
|
749
|
+
|
|
750
|
+
&:hover {
|
|
751
|
+
background: ${d.colors.accentHover};
|
|
752
|
+
}
|
|
753
|
+
&:focus-visible {
|
|
754
|
+
outline: 2px solid ${d.colors.accent};
|
|
755
|
+
outline-offset: 2px;
|
|
756
|
+
}
|
|
757
|
+
`,cx=30;function ji(n){const a=new Date;return a.setHours(0,0,0,0),a.setDate(a.getDate()+n),a}function lx({asset:n,session:a,creator:t,onListed:e,onClose:r}){const o=Yt(),i=Ft(),c=Bg(),{data:l}=ge({queryKey:["collection-meta",n.contractAddress],enabled:!t&&!!n.contractAddress,staleTime:5*6e4,queryFn:()=>js(n.contractAddress)}),p=t||(l==null?void 0:l.creator),{data:u}=Sr(p),h=p?u!=null&&u.name?Mr(u.name):Ma(p):null,[x,b]=v.useState("10"),[y,w]=v.useState(()=>ji(cx)),[k,f]=v.useState(null),[C,$]=v.useState(!1),[E,A]=v.useState(null),[N,S]=v.useState("form"),D=Ar(a),P=Number(x),I=Number.isInteger(P)&&P>0,O=y?y.getTime():NaN,T=!!y&&O>Date.now(),W=ji(1),z=I?`$${Jt(P).toFixed(2)}`:"$0";async function U(){if(f(null),!I){f(g("sellModal.errorWholeNumber"));return}if(!T){f(g("sellModal.invalidDate"));return}if(!D){$(!0);try{const _=vo(n.contractAddress,n.chainId),J=await Ls(_,a.address);if($(!1),!J){S("authorize");return}}catch{$(!1)}}await Y()}async function Y(){if(f(null),!I){f(g("sellModal.errorWholeNumber"));return}if(!T){f(g("sellModal.invalidDate"));return}$(!0);try{await Su({signer:a.signer,contractAddress:n.contractAddress,chainId:n.chainId});const _=await Mu({signer:a.signer,nft:{contractAddress:n.contractAddress,tokenId:n.tokenId,network:n.network,chainId:n.chainId},usdPrice:Jt(P),expiresAtMs:O}),J=await Is(_,a.identity);A(P),ue("Shop Listed Item",{item_id:n.itemId??n.tokenId??null,contract_address:n.contractAddress,price_credits:P,price_usd:Jt(P),listing_type:"secondary",is_primary:!1}),On.success(g("sellModal.toastOnSale",{name:n.name})),o.invalidateQueries({queryKey:["my-assets",a.address]}),e==null||e(P,J==null?void 0:J.id)}catch(_){Te(_,{flow:"list_secondary"}),ue("Shop Listing Failed",{listing_type:"secondary",error_code:Xe(_)}),f(bt(_,g("sellModal.errorGeneric")))}finally{$(!1)}}function q(){r(),i("/my-items")}return E!==null?s.jsx(Di,{onClick:r,role:"presentation",children:s.jsxs(Ci,{onClick:_=>_.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("sellModal.successHeader"),children:[s.jsxs(Si,{children:[s.jsx(Mi,{children:g("sellModal.successHeader")}),s.jsx(_i,{onClick:r,"aria-label":g("getCredits.done"),children:s.jsx(V,{name:"close",className:"ico"})})]}),s.jsxs(nx,{children:[s.jsx(rx,{"aria-hidden":!0,children:s.jsx(V,{name:"check",className:"ico"})}),s.jsxs(ax,{children:[s.jsx("b",{children:g("sellModal.successOnSale")})," ",g("sellModal.successManage")]})]}),s.jsxs(ox,{children:[s.jsx(ix,{onClick:q,children:g("sellModal.myItems")}),s.jsx(sx,{onClick:r,children:g("getCredits.done")})]})]})}):N==="authorize"?s.jsx(Rs,{auth:vo(n.contractAddress,n.chainId),signer:a.signer,title:g("authorizeStep.sellTitle"),name:n.name,image:n.image,icon:s.jsx(V,{name:"pen",className:"ico"}),reason:g("authorizeStep.sellReason",{name:n.name}),onAuthorized:()=>{S("form"),Y()},onCancel:()=>S("form"),onClose:r}):s.jsx(Di,{onClick:C?void 0:r,role:"presentation",children:s.jsxs(Ci,{"data-testid":"modal",onClick:_=>_.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("sellModal.sellProduct"),children:[s.jsxs(Si,{children:[s.jsx(Mi,{children:g("sellModal.sellProduct")}),s.jsx(_i,{onClick:r,disabled:C,"aria-label":g("sellModal.cancel"),children:s.jsx(V,{name:"close",className:"ico"})})]}),s.jsx(Hg,{children:g("sellModal.subtitle")}),s.jsxs(zg,{children:[s.jsx(qg,{children:n.image?s.jsx("img",{src:n.image,alt:""}):null}),s.jsxs(Kg,{children:[s.jsx(Qg,{children:n.name}),h?s.jsx(Vg,{children:g("sellModal.byCreator",{name:h})}):null]})]}),s.jsxs(Ug,{children:[s.jsxs(Pi,{children:[s.jsx(Ii,{children:g("sellModal.priceShort")}),s.jsxs(Xg,{"aria-invalid":x.length>0&&!I,children:[s.jsx(Pe,{className:"ccy"}),s.jsx(Gg,{type:"number",min:"1",step:"1",inputMode:"numeric",value:x,onChange:_=>b(_.target.value),disabled:C,"aria-label":g("sellModal.priceLabel",{currency:"credits"})}),s.jsx(Jg,{"aria-hidden":!0,children:z})]})]}),s.jsxs(Pi,{children:[s.jsx(Ii,{children:g("sellModal.expirationLabel")}),s.jsx(Zg,{"data-invalid":!!y&&!T,children:s.jsx(Yg,{selected:y,onChange:w,minDate:W,dateFormat:"MM/dd/yyyy",placeholderText:"MM/DD/YYYY",disabled:C,showIcon:!0,showPopperArrow:!1,todayButton:g("sellModal.today"),ariaLabelledBy:void 0,"aria-label":g("sellModal.expirationLabel")})})]})]}),c&&I?s.jsx(tx,{children:g("sellModal.proceedsCredits",{count:P})}):null,s.jsx(dt,{message:k}),s.jsx(ex,{onClick:()=>void U(),disabled:C||!I||!T,children:C?D?g("sellModal.puttingOnSale"):g("sellModal.confirmListing"):g("sellModal.putUpForSale")})]})})}const dx=m.div`
|
|
758
|
+
position: fixed;
|
|
759
|
+
inset: 0;
|
|
760
|
+
z-index: 10000;
|
|
761
|
+
display: flex;
|
|
762
|
+
align-items: center;
|
|
763
|
+
justify-content: center;
|
|
764
|
+
padding: 16px;
|
|
765
|
+
background: rgba(22, 21, 24, 0.55);
|
|
766
|
+
`,ux=m.div`
|
|
767
|
+
width: 560px;
|
|
768
|
+
max-width: 100%;
|
|
769
|
+
max-height: 92vh;
|
|
770
|
+
overflow-y: auto;
|
|
771
|
+
background: ${d.colors.white};
|
|
772
|
+
border-radius: 16px;
|
|
773
|
+
padding: 12px 16px 16px;
|
|
774
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
775
|
+
display: flex;
|
|
776
|
+
flex-direction: column;
|
|
777
|
+
gap: 24px;
|
|
778
|
+
|
|
779
|
+
${d.media.maxWidth("mobile")} {
|
|
780
|
+
padding: 12px 16px 16px;
|
|
781
|
+
}
|
|
782
|
+
`,px=m.div`
|
|
783
|
+
display: flex;
|
|
784
|
+
flex-direction: column;
|
|
785
|
+
gap: 4px;
|
|
786
|
+
padding-bottom: 16px;
|
|
787
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
788
|
+
`,fx=m.div`
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
justify-content: space-between;
|
|
792
|
+
gap: 8px;
|
|
793
|
+
`,hx=m.h2`
|
|
794
|
+
margin: 0;
|
|
795
|
+
font-family: ${d.font.sans};
|
|
796
|
+
font-weight: 600;
|
|
797
|
+
font-size: 20px;
|
|
798
|
+
line-height: 1.6;
|
|
799
|
+
color: ${d.colors.text};
|
|
800
|
+
`,mx=m.button`
|
|
801
|
+
flex: none;
|
|
802
|
+
display: grid;
|
|
803
|
+
place-items: center;
|
|
804
|
+
width: 24px;
|
|
805
|
+
height: 24px;
|
|
806
|
+
border: 0;
|
|
807
|
+
background: none;
|
|
808
|
+
cursor: pointer;
|
|
809
|
+
color: ${d.colors.text};
|
|
810
|
+
|
|
811
|
+
.ico {
|
|
812
|
+
width: 18px;
|
|
813
|
+
height: 18px;
|
|
814
|
+
}
|
|
815
|
+
&:disabled {
|
|
816
|
+
opacity: 0.4;
|
|
817
|
+
cursor: default;
|
|
818
|
+
}
|
|
819
|
+
&:focus-visible {
|
|
820
|
+
outline: 2px solid ${d.colors.accent};
|
|
821
|
+
outline-offset: 2px;
|
|
822
|
+
}
|
|
823
|
+
`,gx=m.div`
|
|
824
|
+
display: flex;
|
|
825
|
+
align-items: center;
|
|
826
|
+
gap: 12px;
|
|
827
|
+
`,xx=m.img`
|
|
828
|
+
flex: none;
|
|
829
|
+
width: 72px;
|
|
830
|
+
height: 72px;
|
|
831
|
+
border-radius: 12px;
|
|
832
|
+
object-fit: cover;
|
|
833
|
+
background: ${d.colors.media};
|
|
834
|
+
`,yx=m.p`
|
|
835
|
+
margin: 0;
|
|
836
|
+
font-family: ${d.font.sans};
|
|
837
|
+
font-weight: 600;
|
|
838
|
+
font-size: 18px;
|
|
839
|
+
line-height: 1.4;
|
|
840
|
+
color: ${d.colors.text};
|
|
841
|
+
`,bx=m.label`
|
|
842
|
+
display: flex;
|
|
843
|
+
flex-direction: column;
|
|
844
|
+
gap: 6px;
|
|
845
|
+
`,vx=m.span`
|
|
846
|
+
font-family: ${d.font.sans};
|
|
847
|
+
font-size: 12px;
|
|
848
|
+
color: ${d.colors.muted};
|
|
849
|
+
`,wx=m.input`
|
|
850
|
+
width: 100%;
|
|
851
|
+
height: 44px;
|
|
852
|
+
padding: 0 12px;
|
|
853
|
+
border: 1px solid ${d.colors.text};
|
|
854
|
+
border-radius: 8px;
|
|
855
|
+
background: ${d.colors.white};
|
|
856
|
+
font-family: ${d.font.sans};
|
|
857
|
+
font-size: 14px;
|
|
858
|
+
color: ${d.colors.text};
|
|
859
|
+
|
|
860
|
+
&::placeholder {
|
|
861
|
+
color: ${d.colors.muted2};
|
|
862
|
+
}
|
|
863
|
+
&:focus-visible {
|
|
864
|
+
outline: none;
|
|
865
|
+
border-color: ${d.colors.magenta};
|
|
866
|
+
}
|
|
867
|
+
&[aria-invalid='true'] {
|
|
868
|
+
border-color: ${d.colors.err};
|
|
869
|
+
}
|
|
870
|
+
&:disabled {
|
|
871
|
+
opacity: 0.6;
|
|
872
|
+
}
|
|
873
|
+
`,kx=m.p`
|
|
874
|
+
margin: 0;
|
|
875
|
+
padding: 12px 14px;
|
|
876
|
+
border-radius: 10px;
|
|
877
|
+
background: rgba(255, 45, 85, 0.1);
|
|
878
|
+
font-family: ${d.font.sans};
|
|
879
|
+
font-size: 13px;
|
|
880
|
+
line-height: 1.5;
|
|
881
|
+
color: ${d.colors.text2};
|
|
882
|
+
`,Ei=m.div`
|
|
883
|
+
display: flex;
|
|
884
|
+
gap: 12px;
|
|
885
|
+
|
|
886
|
+
${d.media.maxWidth("mobile")} {
|
|
887
|
+
flex-direction: column-reverse;
|
|
888
|
+
}
|
|
889
|
+
`,Dx=m.button`
|
|
890
|
+
flex: 1;
|
|
891
|
+
height: 48px;
|
|
892
|
+
border: 2px solid ${d.colors.blackBtn};
|
|
893
|
+
border-radius: 16px;
|
|
894
|
+
background: transparent;
|
|
895
|
+
color: ${d.colors.text};
|
|
896
|
+
cursor: pointer;
|
|
897
|
+
font-family: ${d.font.sans};
|
|
898
|
+
font-weight: 600;
|
|
899
|
+
font-size: 15px;
|
|
900
|
+
line-height: 24px;
|
|
901
|
+
letter-spacing: 0.46px;
|
|
902
|
+
text-transform: uppercase;
|
|
903
|
+
|
|
904
|
+
&:hover:not(:disabled) {
|
|
905
|
+
background: rgba(36, 33, 41, 0.06);
|
|
906
|
+
}
|
|
907
|
+
&:focus-visible {
|
|
908
|
+
outline: 2px solid ${d.colors.accent};
|
|
909
|
+
outline-offset: 2px;
|
|
910
|
+
}
|
|
911
|
+
&:disabled {
|
|
912
|
+
opacity: 0.5;
|
|
913
|
+
cursor: default;
|
|
914
|
+
}
|
|
915
|
+
`,Ti=m.button`
|
|
916
|
+
flex: 1;
|
|
917
|
+
display: inline-flex;
|
|
918
|
+
align-items: center;
|
|
919
|
+
justify-content: center;
|
|
920
|
+
gap: 8px;
|
|
921
|
+
height: 48px;
|
|
922
|
+
border: 0;
|
|
923
|
+
border-radius: 16px;
|
|
924
|
+
background: ${d.colors.blackBtn};
|
|
925
|
+
color: ${d.colors.softWhite};
|
|
926
|
+
cursor: pointer;
|
|
927
|
+
font-family: ${d.font.sans};
|
|
928
|
+
font-weight: 600;
|
|
929
|
+
font-size: 15px;
|
|
930
|
+
line-height: 24px;
|
|
931
|
+
letter-spacing: 0.46px;
|
|
932
|
+
text-transform: uppercase;
|
|
933
|
+
|
|
934
|
+
&:hover:not(:disabled) {
|
|
935
|
+
filter: brightness(1.35);
|
|
936
|
+
}
|
|
937
|
+
&:focus-visible {
|
|
938
|
+
outline: 2px solid ${d.colors.accent};
|
|
939
|
+
outline-offset: 2px;
|
|
940
|
+
}
|
|
941
|
+
&:disabled {
|
|
942
|
+
opacity: 0.55;
|
|
943
|
+
cursor: default;
|
|
944
|
+
}
|
|
945
|
+
`,Cx=m.div`
|
|
946
|
+
display: flex;
|
|
947
|
+
flex-direction: column;
|
|
948
|
+
align-items: center;
|
|
949
|
+
gap: 16px;
|
|
950
|
+
padding: 24px 16px;
|
|
951
|
+
border-radius: 16px;
|
|
952
|
+
background: rgba(193, 238, 207, 0.5);
|
|
953
|
+
text-align: center;
|
|
954
|
+
`,Sx=m.div`
|
|
955
|
+
display: grid;
|
|
956
|
+
place-items: center;
|
|
957
|
+
width: 64px;
|
|
958
|
+
height: 64px;
|
|
959
|
+
border-radius: 50%;
|
|
960
|
+
background: ${d.colors.ok};
|
|
961
|
+
color: ${d.colors.white};
|
|
962
|
+
|
|
963
|
+
.ico {
|
|
964
|
+
width: 34px;
|
|
965
|
+
height: 34px;
|
|
966
|
+
}
|
|
967
|
+
`,Mx=m.p`
|
|
968
|
+
margin: 0;
|
|
969
|
+
font-family: ${d.font.sans};
|
|
970
|
+
font-size: 16px;
|
|
971
|
+
line-height: 1.34;
|
|
972
|
+
color: ${d.colors.text2};
|
|
973
|
+
|
|
974
|
+
b {
|
|
975
|
+
font-weight: 700;
|
|
976
|
+
}
|
|
977
|
+
`;function _x(n){return/^0x[a-fA-F0-9]{40}$/.test(n.trim())}function Px({item:n,session:a,onClose:t,onTransferred:e}){const[r,o]=v.useState(""),[i,c]=v.useState(!1),[l,p]=v.useState(null),[u,h]=v.useState(!1),x=r.trim(),b=_x(x),y=b&&x.toLowerCase()===a.address.toLowerCase(),w=x.length===0?null:b?y?g("transfer.selfAddress"):null:g("transfer.invalidAddress"),k=b&&!y&&!i;async function f(){if(k){p(null),c(!0);try{await cu({contractAddress:n.contractAddress,chainId:n.chainId,tokenId:n.tokenId,to:x,signer:a.signer}),ue("Shop Transferred Item",{contract_address:n.contractAddress,token_id:n.tokenId}),h(!0),On.success(g("transfer.toastSuccess",{name:n.name})),e==null||e()}catch(C){nn(C)||Te(C,{flow:"transfer-item",tokenId:n.tokenId}),ue("Shop Transfer Failed",{error_code:Xe(C)}),p(nn(C)?g("getCredits.errorCanceled"):bt(C,g("transfer.errorGeneric")))}finally{c(!1)}}}return s.jsx(dx,{onClick:i?void 0:t,role:"presentation",children:s.jsxs(ux,{onClick:C=>C.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("transfer.title"),children:[s.jsx(px,{children:s.jsxs(fx,{children:[s.jsx(hx,{children:g("transfer.title")}),s.jsx(mx,{onClick:t,disabled:i,"aria-label":g("sellModal.cancel"),children:s.jsx(V,{name:"close",className:"ico"})})]})}),u?s.jsxs(s.Fragment,{children:[s.jsxs(Cx,{children:[s.jsx(Sx,{"aria-hidden":!0,children:s.jsx(V,{name:"check",className:"ico"})}),s.jsx(Mx,{children:g("transfer.successBody",{name:n.name})})]}),s.jsx(Ei,{children:s.jsx(Ti,{onClick:t,children:g("getCredits.done")})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(gx,{children:[n.thumbnail?s.jsx(xx,{src:n.thumbnail,alt:""}):null,s.jsx(yx,{children:n.name})]}),s.jsxs(bx,{children:[s.jsx(vx,{children:g("transfer.addressLabel")}),s.jsx(wx,{type:"text",spellCheck:!1,autoComplete:"off",placeholder:"0x…",value:r,onChange:C=>o(C.target.value),disabled:i,"aria-invalid":!!w,"aria-label":g("transfer.addressLabel")}),w?s.jsx(dt,{message:w}):null]}),s.jsx(kx,{children:g("transfer.warning")}),s.jsx(dt,{message:l}),s.jsxs(Ei,{children:[s.jsx(Dx,{onClick:t,disabled:i,children:g("sellModal.cancel")}),s.jsx(Ti,{onClick:()=>void f(),disabled:!k,children:i?g("transfer.transferring"):g("transfer.transfer")})]})]})]})})}const $i=m.div`
|
|
978
|
+
position: fixed;
|
|
979
|
+
inset: 0;
|
|
980
|
+
z-index: 10000;
|
|
981
|
+
display: flex;
|
|
982
|
+
align-items: center;
|
|
983
|
+
justify-content: center;
|
|
984
|
+
padding: 16px;
|
|
985
|
+
background: rgba(22, 21, 24, 0.55);
|
|
986
|
+
`,Ni=m.div`
|
|
987
|
+
width: 560px;
|
|
988
|
+
max-width: 100%;
|
|
989
|
+
max-height: 92vh;
|
|
990
|
+
overflow-y: auto;
|
|
991
|
+
background: ${d.colors.white};
|
|
992
|
+
border-radius: 16px;
|
|
993
|
+
padding: 12px 16px 16px;
|
|
994
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
995
|
+
display: flex;
|
|
996
|
+
flex-direction: column;
|
|
997
|
+
gap: 24px;
|
|
998
|
+
`,Oi=m.div`
|
|
999
|
+
display: flex;
|
|
1000
|
+
align-items: center;
|
|
1001
|
+
justify-content: space-between;
|
|
1002
|
+
gap: 8px;
|
|
1003
|
+
padding-bottom: 16px;
|
|
1004
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
1005
|
+
`,Ri=m.h2`
|
|
1006
|
+
margin: 0;
|
|
1007
|
+
font-family: ${d.font.sans};
|
|
1008
|
+
font-weight: 600;
|
|
1009
|
+
font-size: 20px;
|
|
1010
|
+
line-height: 1.6;
|
|
1011
|
+
color: ${d.colors.text};
|
|
1012
|
+
`,Ai=m.button`
|
|
1013
|
+
flex: none;
|
|
1014
|
+
display: grid;
|
|
1015
|
+
place-items: center;
|
|
1016
|
+
width: 24px;
|
|
1017
|
+
height: 24px;
|
|
1018
|
+
border: 0;
|
|
1019
|
+
background: none;
|
|
1020
|
+
cursor: pointer;
|
|
1021
|
+
color: ${d.colors.text};
|
|
1022
|
+
|
|
1023
|
+
.ico {
|
|
1024
|
+
width: 18px;
|
|
1025
|
+
height: 18px;
|
|
1026
|
+
}
|
|
1027
|
+
&:disabled {
|
|
1028
|
+
opacity: 0.4;
|
|
1029
|
+
cursor: default;
|
|
1030
|
+
}
|
|
1031
|
+
&:focus-visible {
|
|
1032
|
+
outline: 2px solid ${d.colors.accent};
|
|
1033
|
+
outline-offset: 2px;
|
|
1034
|
+
}
|
|
1035
|
+
`,Ix=m.p`
|
|
1036
|
+
margin: 0;
|
|
1037
|
+
font-family: ${d.font.sans};
|
|
1038
|
+
font-size: 14px;
|
|
1039
|
+
line-height: 1.57;
|
|
1040
|
+
color: ${d.colors.text};
|
|
1041
|
+
text-align: left;
|
|
1042
|
+
`,jx=m.div`
|
|
1043
|
+
display: flex;
|
|
1044
|
+
align-items: center;
|
|
1045
|
+
gap: 12px;
|
|
1046
|
+
`,Ex=m.div`
|
|
1047
|
+
flex: none;
|
|
1048
|
+
display: grid;
|
|
1049
|
+
place-items: center;
|
|
1050
|
+
width: 180px;
|
|
1051
|
+
height: 180px;
|
|
1052
|
+
border-radius: 16px;
|
|
1053
|
+
background: ${d.colors.media};
|
|
1054
|
+
border: 1px solid ${d.colors.gray4};
|
|
1055
|
+
overflow: hidden;
|
|
1056
|
+
|
|
1057
|
+
img {
|
|
1058
|
+
width: 150px;
|
|
1059
|
+
height: 150px;
|
|
1060
|
+
object-fit: contain;
|
|
1061
|
+
filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.1));
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
${d.media.maxWidth("mobile")} {
|
|
1065
|
+
width: 120px;
|
|
1066
|
+
height: 120px;
|
|
1067
|
+
|
|
1068
|
+
img {
|
|
1069
|
+
width: 100px;
|
|
1070
|
+
height: 100px;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
`,Tx=m.div`
|
|
1074
|
+
flex: 1 1 0;
|
|
1075
|
+
min-width: 0;
|
|
1076
|
+
display: flex;
|
|
1077
|
+
flex-direction: column;
|
|
1078
|
+
gap: 4px;
|
|
1079
|
+
padding: 8px;
|
|
1080
|
+
`,$x=m.p`
|
|
1081
|
+
margin: 0;
|
|
1082
|
+
font-family: ${d.font.sans};
|
|
1083
|
+
font-weight: 600;
|
|
1084
|
+
font-size: 20px;
|
|
1085
|
+
line-height: 1.57;
|
|
1086
|
+
color: ${d.colors.text};
|
|
1087
|
+
`,Nx=m.p`
|
|
1088
|
+
margin: 0;
|
|
1089
|
+
font-family: ${d.font.sans};
|
|
1090
|
+
font-size: 10px;
|
|
1091
|
+
line-height: 1.43;
|
|
1092
|
+
color: ${d.colors.muted};
|
|
1093
|
+
`,Ox=m.label`
|
|
1094
|
+
display: flex;
|
|
1095
|
+
flex-direction: column;
|
|
1096
|
+
gap: 4px;
|
|
1097
|
+
`,Rx=m.span`
|
|
1098
|
+
font-family: ${d.font.sans};
|
|
1099
|
+
font-size: 12px;
|
|
1100
|
+
color: ${d.colors.muted};
|
|
1101
|
+
`,Ax=m.div`
|
|
1102
|
+
display: flex;
|
|
1103
|
+
align-items: center;
|
|
1104
|
+
justify-content: space-between;
|
|
1105
|
+
gap: 4px;
|
|
1106
|
+
height: 42px;
|
|
1107
|
+
padding: 0 8px;
|
|
1108
|
+
border: 0.5px solid ${d.colors.text};
|
|
1109
|
+
border-radius: 8px;
|
|
1110
|
+
background: ${d.colors.white};
|
|
1111
|
+
|
|
1112
|
+
&:focus-within {
|
|
1113
|
+
border-color: ${d.colors.magenta};
|
|
1114
|
+
}
|
|
1115
|
+
&[aria-invalid='true'] {
|
|
1116
|
+
border-color: ${d.colors.err};
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
.ccy {
|
|
1120
|
+
flex: none;
|
|
1121
|
+
width: 22px;
|
|
1122
|
+
height: 22px;
|
|
1123
|
+
color: ${d.colors.rarity};
|
|
1124
|
+
}
|
|
1125
|
+
`,Lx=m.input`
|
|
1126
|
+
flex: 1 1 auto;
|
|
1127
|
+
min-width: 0;
|
|
1128
|
+
border: 0;
|
|
1129
|
+
outline: none;
|
|
1130
|
+
background: transparent;
|
|
1131
|
+
font-family: ${d.font.sans};
|
|
1132
|
+
font-size: 13px;
|
|
1133
|
+
color: ${d.colors.text};
|
|
1134
|
+
|
|
1135
|
+
&::placeholder {
|
|
1136
|
+
color: ${d.colors.muted2};
|
|
1137
|
+
}
|
|
1138
|
+
/* Strip the number spinners — the glyph + USD hint carry the affordance. */
|
|
1139
|
+
&::-webkit-outer-spin-button,
|
|
1140
|
+
&::-webkit-inner-spin-button {
|
|
1141
|
+
-webkit-appearance: none;
|
|
1142
|
+
margin: 0;
|
|
1143
|
+
}
|
|
1144
|
+
&[type='number'] {
|
|
1145
|
+
-moz-appearance: textfield;
|
|
1146
|
+
appearance: textfield;
|
|
1147
|
+
}
|
|
1148
|
+
`,Fx=m.span`
|
|
1149
|
+
flex: none;
|
|
1150
|
+
font-family: ${d.font.sans};
|
|
1151
|
+
font-size: 10px;
|
|
1152
|
+
color: ${d.colors.muted2};
|
|
1153
|
+
`,ca=m.p`
|
|
1154
|
+
margin: 0;
|
|
1155
|
+
font-family: ${d.font.sans};
|
|
1156
|
+
font-size: 12px;
|
|
1157
|
+
line-height: 1.5;
|
|
1158
|
+
color: ${d.colors.muted};
|
|
1159
|
+
`,Yx=m.button`
|
|
1160
|
+
width: 100%;
|
|
1161
|
+
height: 48px;
|
|
1162
|
+
border: 0;
|
|
1163
|
+
border-radius: 16px;
|
|
1164
|
+
cursor: pointer;
|
|
1165
|
+
background: ${d.colors.accent};
|
|
1166
|
+
color: ${d.colors.white};
|
|
1167
|
+
font-family: ${d.font.sans};
|
|
1168
|
+
font-weight: 600;
|
|
1169
|
+
font-size: 15px;
|
|
1170
|
+
line-height: 24px;
|
|
1171
|
+
letter-spacing: 0.46px;
|
|
1172
|
+
text-transform: uppercase;
|
|
1173
|
+
|
|
1174
|
+
&:hover:not(:disabled) {
|
|
1175
|
+
background: ${d.colors.accentHover};
|
|
1176
|
+
}
|
|
1177
|
+
&:focus-visible {
|
|
1178
|
+
outline: 2px solid ${d.colors.accent};
|
|
1179
|
+
outline-offset: 2px;
|
|
1180
|
+
}
|
|
1181
|
+
&:disabled {
|
|
1182
|
+
cursor: not-allowed;
|
|
1183
|
+
background: rgba(105, 31, 169, 0.2);
|
|
1184
|
+
color: ${d.colors.white};
|
|
1185
|
+
}
|
|
1186
|
+
`,Wx=m.p`
|
|
1187
|
+
margin: 0;
|
|
1188
|
+
font-family: ${d.font.sans};
|
|
1189
|
+
font-size: 13px;
|
|
1190
|
+
color: ${d.colors.muted};
|
|
1191
|
+
text-align: center;
|
|
1192
|
+
`,Bx=m.div`
|
|
1193
|
+
display: flex;
|
|
1194
|
+
flex-direction: column;
|
|
1195
|
+
align-items: center;
|
|
1196
|
+
gap: 16px;
|
|
1197
|
+
padding: 24px 16px;
|
|
1198
|
+
border-radius: 16px;
|
|
1199
|
+
background: rgba(193, 238, 207, 0.5);
|
|
1200
|
+
text-align: center;
|
|
1201
|
+
`,Hx=m.div`
|
|
1202
|
+
display: grid;
|
|
1203
|
+
place-items: center;
|
|
1204
|
+
width: 64px;
|
|
1205
|
+
height: 64px;
|
|
1206
|
+
border-radius: 50%;
|
|
1207
|
+
background: ${d.colors.ok};
|
|
1208
|
+
color: ${d.colors.white};
|
|
1209
|
+
|
|
1210
|
+
.ico {
|
|
1211
|
+
width: 34px;
|
|
1212
|
+
height: 34px;
|
|
1213
|
+
}
|
|
1214
|
+
`,zx=m.p`
|
|
1215
|
+
margin: 0;
|
|
1216
|
+
font-family: ${d.font.sans};
|
|
1217
|
+
font-size: 20px;
|
|
1218
|
+
line-height: 1.334;
|
|
1219
|
+
color: ${d.colors.text2};
|
|
1220
|
+
|
|
1221
|
+
b {
|
|
1222
|
+
font-weight: 700;
|
|
1223
|
+
}
|
|
1224
|
+
`,qx=m.p`
|
|
1225
|
+
margin: 0;
|
|
1226
|
+
display: inline-flex;
|
|
1227
|
+
align-items: center;
|
|
1228
|
+
gap: 4px;
|
|
1229
|
+
font-family: ${d.font.sans};
|
|
1230
|
+
font-size: 14px;
|
|
1231
|
+
line-height: 1.43;
|
|
1232
|
+
color: ${d.colors.text2};
|
|
1233
|
+
|
|
1234
|
+
strong {
|
|
1235
|
+
display: inline-flex;
|
|
1236
|
+
align-items: center;
|
|
1237
|
+
gap: 4px;
|
|
1238
|
+
font-weight: 700;
|
|
1239
|
+
}
|
|
1240
|
+
.ccy-mark {
|
|
1241
|
+
width: 18px;
|
|
1242
|
+
height: 18px;
|
|
1243
|
+
color: ${d.colors.rarity};
|
|
1244
|
+
}
|
|
1245
|
+
`,Kx=m.div`
|
|
1246
|
+
display: flex;
|
|
1247
|
+
gap: 12px;
|
|
1248
|
+
|
|
1249
|
+
${d.media.maxWidth("mobile")} {
|
|
1250
|
+
flex-direction: column-reverse;
|
|
1251
|
+
}
|
|
1252
|
+
`,Qx=m.button`
|
|
1253
|
+
flex: 1 1 0;
|
|
1254
|
+
height: 48px;
|
|
1255
|
+
border: 2px solid ${d.colors.accent};
|
|
1256
|
+
border-radius: 12px;
|
|
1257
|
+
background: transparent;
|
|
1258
|
+
color: ${d.colors.accent};
|
|
1259
|
+
cursor: pointer;
|
|
1260
|
+
font-family: ${d.font.sans};
|
|
1261
|
+
font-weight: 600;
|
|
1262
|
+
font-size: 13px;
|
|
1263
|
+
line-height: 24px;
|
|
1264
|
+
letter-spacing: 0.46px;
|
|
1265
|
+
text-transform: uppercase;
|
|
1266
|
+
|
|
1267
|
+
&:hover {
|
|
1268
|
+
background: rgba(105, 31, 169, 0.06);
|
|
1269
|
+
}
|
|
1270
|
+
&:focus-visible {
|
|
1271
|
+
outline: 2px solid ${d.colors.accent};
|
|
1272
|
+
outline-offset: 2px;
|
|
1273
|
+
}
|
|
1274
|
+
`,Vx=m.button`
|
|
1275
|
+
flex: 1 1 0;
|
|
1276
|
+
height: 48px;
|
|
1277
|
+
border: 0;
|
|
1278
|
+
border-radius: 12px;
|
|
1279
|
+
background: ${d.colors.accent};
|
|
1280
|
+
color: ${d.colors.softWhite};
|
|
1281
|
+
cursor: pointer;
|
|
1282
|
+
font-family: ${d.font.sans};
|
|
1283
|
+
font-weight: 600;
|
|
1284
|
+
font-size: 13px;
|
|
1285
|
+
line-height: 24px;
|
|
1286
|
+
letter-spacing: 0.46px;
|
|
1287
|
+
text-transform: uppercase;
|
|
1288
|
+
|
|
1289
|
+
&:hover {
|
|
1290
|
+
background: ${d.colors.accentHover};
|
|
1291
|
+
}
|
|
1292
|
+
&:focus-visible {
|
|
1293
|
+
outline: 2px solid ${d.colors.accent};
|
|
1294
|
+
outline-offset: 2px;
|
|
1295
|
+
}
|
|
1296
|
+
`,Ux=1e3*60*60*24*182;function Xx({item:n,session:a,onListed:t,onClose:e}){const r=Yt(),o=Ft(),[i,c]=v.useState("10"),[l,p]=v.useState(null),[u,h]=v.useState(null),[x,b]=v.useState(!1),[y,w]=v.useState(null),[k,f]=v.useState(null),C=tn.chainId,$=Ar(a),{data:E}=Sr(a.address),A=E!=null&&E.name?Mr(E.name):Ma(a.address),N=Number(i),S=Number.isInteger(N)&&N>0,D=S?`$${Jt(N).toFixed(2)}`:"$0";v.useEffect(()=>{let T=!1;return(async()=>{try{const W=await _u({contractAddress:n.contractAddress,chainId:C});T||w(W)}catch{T||w(!1)}})(),()=>{T=!0}},[n.contractAddress,C]);async function P(){h(null);const T=Number(i);if(!Number.isInteger(T)||T<=0){h(g("primaryList.errorWholeNumber"));return}b(!0);try{y||(p(g("primaryList.statusEnabling")),await Pu({signer:a.signer,contractAddress:n.contractAddress,chainId:C}),w(!0)),p(g("primaryList.statusPublishing"));const W=await Iu({signer:a.signer,item:{contractAddress:n.contractAddress,itemId:n.blockchainItemId,network:Re.Network.MATIC,chainId:C},usdPrice:Jt(T),uses:n.remainingSupply,expiresAtMs:Date.now()+Ux});p(g("primaryList.statusFinishing")),await Is(W,a.identity),p(null),f(T),ue("Shop Listed Item",{item_id:n.blockchainItemId,contract_address:n.contractAddress,price_credits:T,price_usd:Jt(T),listing_type:"primary",is_primary:!0}),On.success(g("primaryList.toastOnSale",{name:n.name})),t==null||t(T),r.invalidateQueries({queryKey:["publishable-items"]}),r.invalidateQueries({queryKey:["collection-sale-state"]}),r.invalidateQueries({queryKey:["shop-items"]}),r.invalidateQueries({queryKey:["catalog-items"]}),r.invalidateQueries({queryKey:["overview-listings"]}),r.invalidateQueries({queryKey:["upsell-listings"]})}catch(W){Te(W,{flow:"list_primary"}),ue("Shop Listing Failed",{listing_type:"primary",error_code:Xe(W)}),h(bt(W,g("primaryList.errorGeneric"))),p(null)}finally{b(!1)}}function I(){e(),o(Il(n.contractAddress,n.blockchainItemId))}const O=y===null?g("primaryList.checking"):x?$?g("primaryList.publishing"):g("primaryList.confirmListing"):y===!1?g("primaryList.enableAndPutOnSale"):g("primaryList.putOnSale");return k!==null?s.jsx($i,{onClick:e,role:"presentation",children:s.jsxs(Ni,{onClick:T=>T.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("primaryList.successTitle"),children:[s.jsxs(Oi,{children:[s.jsx(Ri,{children:g("primaryList.successTitle")}),s.jsx(Ai,{onClick:e,"aria-label":g("getCredits.done"),children:s.jsx(V,{name:"close",className:"ico"})})]}),s.jsxs(Bx,{children:[s.jsx(Hx,{"aria-hidden":!0,children:s.jsx(V,{name:"check",className:"ico"})}),s.jsx(zx,{children:s.jsx("b",{children:n.name})}),s.jsxs(qx,{children:[g("primaryList.listedFor")," ",s.jsxs("strong",{children:[s.jsx(Pe,{className:"ccy-mark"})," ",k]})," ",g("primaryList.dotAvailable",{count:n.remainingSupply})]})]}),s.jsxs(Kx,{children:[s.jsx(Qx,{onClick:e,children:g("getCredits.done")}),s.jsx(Vx,{onClick:I,children:g("primaryList.viewInShop")})]})]})}):s.jsx($i,{onClick:x?void 0:e,role:"presentation",children:s.jsxs(Ni,{"data-testid":"modal",onClick:T=>T.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("primaryList.publishTitle",{name:n.name}),children:[s.jsxs(Oi,{children:[s.jsx(Ri,{children:g("primaryList.publishTitle",{name:n.name})}),s.jsx(Ai,{onClick:e,disabled:x,"aria-label":g("primaryList.cancel"),children:s.jsx(V,{name:"close",className:"ico"})})]}),s.jsx(Ix,{children:g("primaryList.fromCollection",{collectionName:n.collectionName,count:n.remainingSupply})}),s.jsxs(jx,{children:[s.jsx(Ex,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(Tx,{children:[s.jsx($x,{children:n.name}),A?s.jsx(Nx,{children:g("primaryList.byCreator",{name:A})}):null]})]}),s.jsxs(Ox,{children:[s.jsx(Rx,{children:g("primaryList.priceShort")}),s.jsxs(Ax,{"aria-invalid":i.length>0&&!S,children:[s.jsx(Pe,{className:"ccy"}),s.jsx(Lx,{type:"number",min:"1",step:"1",inputMode:"numeric",value:i,onChange:T=>c(T.target.value),disabled:x,"aria-label":g("primaryList.priceLabel",{currency:wt.name})}),s.jsx(Fx,{"aria-hidden":!0,children:D})]})]}),s.jsx(ca,{children:g("primaryList.pricedInWhole",{currency:wt.name,currencySingular:wt.nameSingular})}),y===!1&&!x?s.jsx(ca,{children:$?g("primaryList.firstTimeManaged",{collectionName:n.collectionName}):g("primaryList.firstTimeConfirm",{collectionName:n.collectionName})}):y===!0&&!x?s.jsx(ca,{children:$?g("primaryList.readyManaged"):g("primaryList.readyConfirm")}):null,l?s.jsx(Wx,{children:l}):null,s.jsx(dt,{message:u}),s.jsx(Yx,{onClick:()=>void P(),disabled:x||y===null||!S,children:O})]})})}const Ic=["function issueTokens(address[] _beneficiaries, uint256[] _itemIds)"];function jc(n){return/^0x[a-fA-F0-9]{40}$/.test(n.trim())}function Ec(n){return n.reduce((a,t)=>a+Math.max(0,Math.floor(t.amount||0)),0)}function Gx(n,a){const t=n.filter(r=>r.address.trim().length>0||(r.amount||0)>0);if(t.length===0)return!1;for(const r of t)if(!jc(r.address)||!Number.isInteger(r.amount)||r.amount<1)return!1;const e=Ec(t);return e>=1&&e<=a}function Jx(n,a){const t=[],e=[];for(const r of n){const o=r.address.trim(),i=Math.max(0,Math.floor(r.amount||0));if(!(!o||i===0))for(let c=0;c<i;c++)t.push(o),e.push(a)}return{beneficiaries:t,itemIds:e}}async function Zx(n){const{contractAddress:a,chainId:t,beneficiaries:e,itemIds:r,signer:o}=n,i={...ma(Ps.ERC721CollectionV2,t),address:a},c=new Ou(Ic).encodeFunctionData("issueTokens",[e,r]),l=vu(),p=wu(o.provider,l),u=await $u(p,l,c,i,{serverURL:Fs.relayerUrl});return await ku(u,"the mint"),u}async function ey(n){const{signer:a,contractAddress:t,chainId:e,entries:r,itemId:o}=n,{beneficiaries:i,itemIds:c}=Jx(r,o);if(i.length===0)throw new Error("No copies to issue");if(Fs.enabled)try{return await Zx({contractAddress:t,chainId:e,beneficiaries:i,itemIds:c,signer:a})}catch(h){if(h instanceof Eu&&h.code===Tu.USER_DENIED||h instanceof yu)throw h;console.warn("[issue] gasless meta-tx failed, falling back to a direct tx:",h)}return await bu(a.provider,e),(await(await new Nu(t,Ic,a).issueTokens(i,c,ju(e))).wait()).transactionHash}const ty=m.div`
|
|
1297
|
+
position: fixed;
|
|
1298
|
+
inset: 0;
|
|
1299
|
+
z-index: 10000;
|
|
1300
|
+
display: flex;
|
|
1301
|
+
align-items: center;
|
|
1302
|
+
justify-content: center;
|
|
1303
|
+
padding: 16px;
|
|
1304
|
+
background: rgba(22, 21, 24, 0.55);
|
|
1305
|
+
`,ny=m.div`
|
|
1306
|
+
width: 560px;
|
|
1307
|
+
max-width: 100%;
|
|
1308
|
+
max-height: 92vh;
|
|
1309
|
+
overflow-y: auto;
|
|
1310
|
+
background: ${d.colors.white};
|
|
1311
|
+
border-radius: 16px;
|
|
1312
|
+
padding: 12px 16px 16px;
|
|
1313
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
1314
|
+
display: flex;
|
|
1315
|
+
flex-direction: column;
|
|
1316
|
+
gap: 20px;
|
|
1317
|
+
`,ry=m.div`
|
|
1318
|
+
display: flex;
|
|
1319
|
+
align-items: center;
|
|
1320
|
+
justify-content: space-between;
|
|
1321
|
+
gap: 8px;
|
|
1322
|
+
padding-bottom: 16px;
|
|
1323
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
1324
|
+
`,ay=m.h2`
|
|
1325
|
+
margin: 0;
|
|
1326
|
+
font-family: ${d.font.sans};
|
|
1327
|
+
font-weight: 600;
|
|
1328
|
+
font-size: 20px;
|
|
1329
|
+
line-height: 1.6;
|
|
1330
|
+
color: ${d.colors.text};
|
|
1331
|
+
`,oy=m.button`
|
|
1332
|
+
flex: none;
|
|
1333
|
+
display: grid;
|
|
1334
|
+
place-items: center;
|
|
1335
|
+
width: 24px;
|
|
1336
|
+
height: 24px;
|
|
1337
|
+
border: 0;
|
|
1338
|
+
background: none;
|
|
1339
|
+
cursor: pointer;
|
|
1340
|
+
color: ${d.colors.text};
|
|
1341
|
+
|
|
1342
|
+
.ico {
|
|
1343
|
+
width: 18px;
|
|
1344
|
+
height: 18px;
|
|
1345
|
+
}
|
|
1346
|
+
&:disabled {
|
|
1347
|
+
opacity: 0.4;
|
|
1348
|
+
cursor: default;
|
|
1349
|
+
}
|
|
1350
|
+
&:focus-visible {
|
|
1351
|
+
outline: 2px solid ${d.colors.accent};
|
|
1352
|
+
outline-offset: 2px;
|
|
1353
|
+
}
|
|
1354
|
+
`,iy=m.p`
|
|
1355
|
+
margin: 0;
|
|
1356
|
+
font-family: ${d.font.sans};
|
|
1357
|
+
font-size: 14px;
|
|
1358
|
+
line-height: 1.57;
|
|
1359
|
+
color: ${d.colors.text};
|
|
1360
|
+
text-align: left;
|
|
1361
|
+
`,sy=m.div`
|
|
1362
|
+
display: flex;
|
|
1363
|
+
align-items: center;
|
|
1364
|
+
gap: 12px;
|
|
1365
|
+
`,cy=m.div`
|
|
1366
|
+
flex: none;
|
|
1367
|
+
display: grid;
|
|
1368
|
+
place-items: center;
|
|
1369
|
+
width: 56px;
|
|
1370
|
+
height: 56px;
|
|
1371
|
+
border-radius: 12px;
|
|
1372
|
+
background: ${d.colors.media};
|
|
1373
|
+
border: 1px solid ${d.colors.gray4};
|
|
1374
|
+
overflow: hidden;
|
|
1375
|
+
|
|
1376
|
+
img {
|
|
1377
|
+
width: 48px;
|
|
1378
|
+
height: 48px;
|
|
1379
|
+
object-fit: contain;
|
|
1380
|
+
filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.1));
|
|
1381
|
+
}
|
|
1382
|
+
`,ly=m.p`
|
|
1383
|
+
margin: 0;
|
|
1384
|
+
font-family: ${d.font.sans};
|
|
1385
|
+
font-weight: 600;
|
|
1386
|
+
font-size: 16px;
|
|
1387
|
+
line-height: 1.4;
|
|
1388
|
+
color: ${d.colors.text};
|
|
1389
|
+
`,dy=m.div`
|
|
1390
|
+
display: flex;
|
|
1391
|
+
flex-direction: column;
|
|
1392
|
+
gap: 10px;
|
|
1393
|
+
`,uy=m.div`
|
|
1394
|
+
display: flex;
|
|
1395
|
+
align-items: flex-start;
|
|
1396
|
+
gap: 8px;
|
|
1397
|
+
`,py=m.label`
|
|
1398
|
+
flex: 1 1 auto;
|
|
1399
|
+
min-width: 0;
|
|
1400
|
+
display: flex;
|
|
1401
|
+
flex-direction: column;
|
|
1402
|
+
gap: 4px;
|
|
1403
|
+
`,fy=m.label`
|
|
1404
|
+
flex: none;
|
|
1405
|
+
width: 96px;
|
|
1406
|
+
display: flex;
|
|
1407
|
+
flex-direction: column;
|
|
1408
|
+
gap: 4px;
|
|
1409
|
+
`,Li=m.span`
|
|
1410
|
+
font-family: ${d.font.sans};
|
|
1411
|
+
font-size: 12px;
|
|
1412
|
+
color: ${d.colors.muted};
|
|
1413
|
+
`,Fi=m.input`
|
|
1414
|
+
height: 42px;
|
|
1415
|
+
padding: 0 10px;
|
|
1416
|
+
border: 0.5px solid ${d.colors.text};
|
|
1417
|
+
border-radius: 8px;
|
|
1418
|
+
background: ${d.colors.white};
|
|
1419
|
+
font-family: ${d.font.sans};
|
|
1420
|
+
font-size: 13px;
|
|
1421
|
+
color: ${d.colors.text};
|
|
1422
|
+
outline: none;
|
|
1423
|
+
|
|
1424
|
+
&::placeholder {
|
|
1425
|
+
color: ${d.colors.muted2};
|
|
1426
|
+
}
|
|
1427
|
+
&:focus {
|
|
1428
|
+
border-color: ${d.colors.magenta};
|
|
1429
|
+
}
|
|
1430
|
+
&[aria-invalid='true'] {
|
|
1431
|
+
border-color: ${d.colors.err};
|
|
1432
|
+
}
|
|
1433
|
+
/* Strip the number spinners on the amount input. */
|
|
1434
|
+
&::-webkit-outer-spin-button,
|
|
1435
|
+
&::-webkit-inner-spin-button {
|
|
1436
|
+
-webkit-appearance: none;
|
|
1437
|
+
margin: 0;
|
|
1438
|
+
}
|
|
1439
|
+
&[type='number'] {
|
|
1440
|
+
-moz-appearance: textfield;
|
|
1441
|
+
appearance: textfield;
|
|
1442
|
+
}
|
|
1443
|
+
`,hy=m.button`
|
|
1444
|
+
flex: none;
|
|
1445
|
+
margin-top: 22px;
|
|
1446
|
+
display: grid;
|
|
1447
|
+
place-items: center;
|
|
1448
|
+
width: 42px;
|
|
1449
|
+
height: 42px;
|
|
1450
|
+
border: 0.5px solid ${d.colors.gray4};
|
|
1451
|
+
border-radius: 8px;
|
|
1452
|
+
background: ${d.colors.white};
|
|
1453
|
+
color: ${d.colors.muted};
|
|
1454
|
+
cursor: pointer;
|
|
1455
|
+
|
|
1456
|
+
.ico {
|
|
1457
|
+
width: 16px;
|
|
1458
|
+
height: 16px;
|
|
1459
|
+
}
|
|
1460
|
+
&:hover:not(:disabled) {
|
|
1461
|
+
color: ${d.colors.err};
|
|
1462
|
+
border-color: ${d.colors.err};
|
|
1463
|
+
}
|
|
1464
|
+
&:disabled {
|
|
1465
|
+
opacity: 0.35;
|
|
1466
|
+
cursor: default;
|
|
1467
|
+
}
|
|
1468
|
+
&:focus-visible {
|
|
1469
|
+
outline: 2px solid ${d.colors.accent};
|
|
1470
|
+
outline-offset: 2px;
|
|
1471
|
+
}
|
|
1472
|
+
`,my=m.button`
|
|
1473
|
+
align-self: flex-start;
|
|
1474
|
+
display: inline-flex;
|
|
1475
|
+
align-items: center;
|
|
1476
|
+
gap: 6px;
|
|
1477
|
+
border: 0;
|
|
1478
|
+
background: none;
|
|
1479
|
+
padding: 0;
|
|
1480
|
+
cursor: pointer;
|
|
1481
|
+
font-family: ${d.font.sans};
|
|
1482
|
+
font-weight: 600;
|
|
1483
|
+
font-size: 13px;
|
|
1484
|
+
color: ${d.colors.accent};
|
|
1485
|
+
|
|
1486
|
+
.ico {
|
|
1487
|
+
width: 16px;
|
|
1488
|
+
height: 16px;
|
|
1489
|
+
}
|
|
1490
|
+
&:disabled {
|
|
1491
|
+
opacity: 0.4;
|
|
1492
|
+
cursor: default;
|
|
1493
|
+
}
|
|
1494
|
+
&:focus-visible {
|
|
1495
|
+
outline: 2px solid ${d.colors.accent};
|
|
1496
|
+
outline-offset: 2px;
|
|
1497
|
+
}
|
|
1498
|
+
`,gy=m.p`
|
|
1499
|
+
margin: 0;
|
|
1500
|
+
font-family: ${d.font.sans};
|
|
1501
|
+
font-size: 13px;
|
|
1502
|
+
line-height: 1.5;
|
|
1503
|
+
color: ${n=>n.over?d.colors.err:d.colors.text};
|
|
1504
|
+
|
|
1505
|
+
strong {
|
|
1506
|
+
font-weight: 700;
|
|
1507
|
+
}
|
|
1508
|
+
`,xy=m.p`
|
|
1509
|
+
margin: 0;
|
|
1510
|
+
font-family: ${d.font.sans};
|
|
1511
|
+
font-size: 12px;
|
|
1512
|
+
line-height: 1.5;
|
|
1513
|
+
color: ${d.colors.muted};
|
|
1514
|
+
`;m.p`
|
|
1515
|
+
margin: 0;
|
|
1516
|
+
font-family: ${d.font.sans};
|
|
1517
|
+
font-size: 13px;
|
|
1518
|
+
color: ${d.colors.muted};
|
|
1519
|
+
text-align: center;
|
|
1520
|
+
`;const yy=m.p`
|
|
1521
|
+
margin: 0;
|
|
1522
|
+
font-family: ${d.font.sans};
|
|
1523
|
+
font-size: 11px;
|
|
1524
|
+
color: ${d.colors.err};
|
|
1525
|
+
`,Yi=m.div`
|
|
1526
|
+
display: flex;
|
|
1527
|
+
gap: 12px;
|
|
1528
|
+
|
|
1529
|
+
${d.media.maxWidth("mobile")} {
|
|
1530
|
+
flex-direction: column-reverse;
|
|
1531
|
+
}
|
|
1532
|
+
`,by=m.button`
|
|
1533
|
+
flex: 1 1 0;
|
|
1534
|
+
height: 48px;
|
|
1535
|
+
border: 2px solid ${d.colors.accent};
|
|
1536
|
+
border-radius: 12px;
|
|
1537
|
+
background: transparent;
|
|
1538
|
+
color: ${d.colors.accent};
|
|
1539
|
+
cursor: pointer;
|
|
1540
|
+
font-family: ${d.font.sans};
|
|
1541
|
+
font-weight: 600;
|
|
1542
|
+
font-size: 13px;
|
|
1543
|
+
line-height: 24px;
|
|
1544
|
+
letter-spacing: 0.46px;
|
|
1545
|
+
text-transform: uppercase;
|
|
1546
|
+
|
|
1547
|
+
&:hover:not(:disabled) {
|
|
1548
|
+
background: rgba(105, 31, 169, 0.06);
|
|
1549
|
+
}
|
|
1550
|
+
&:disabled {
|
|
1551
|
+
opacity: 0.5;
|
|
1552
|
+
cursor: not-allowed;
|
|
1553
|
+
}
|
|
1554
|
+
&:focus-visible {
|
|
1555
|
+
outline: 2px solid ${d.colors.accent};
|
|
1556
|
+
outline-offset: 2px;
|
|
1557
|
+
}
|
|
1558
|
+
`,Wi=m.button`
|
|
1559
|
+
flex: 1 1 0;
|
|
1560
|
+
height: 48px;
|
|
1561
|
+
border: 0;
|
|
1562
|
+
border-radius: 12px;
|
|
1563
|
+
cursor: pointer;
|
|
1564
|
+
background: ${d.colors.accent};
|
|
1565
|
+
color: ${d.colors.white};
|
|
1566
|
+
font-family: ${d.font.sans};
|
|
1567
|
+
font-weight: 600;
|
|
1568
|
+
font-size: 13px;
|
|
1569
|
+
line-height: 24px;
|
|
1570
|
+
letter-spacing: 0.46px;
|
|
1571
|
+
text-transform: uppercase;
|
|
1572
|
+
|
|
1573
|
+
&:hover:not(:disabled) {
|
|
1574
|
+
background: ${d.colors.accentHover};
|
|
1575
|
+
}
|
|
1576
|
+
&:focus-visible {
|
|
1577
|
+
outline: 2px solid ${d.colors.accent};
|
|
1578
|
+
outline-offset: 2px;
|
|
1579
|
+
}
|
|
1580
|
+
&:disabled {
|
|
1581
|
+
cursor: not-allowed;
|
|
1582
|
+
background: rgba(105, 31, 169, 0.2);
|
|
1583
|
+
color: ${d.colors.white};
|
|
1584
|
+
}
|
|
1585
|
+
`,vy=m.div`
|
|
1586
|
+
display: flex;
|
|
1587
|
+
flex-direction: column;
|
|
1588
|
+
align-items: center;
|
|
1589
|
+
gap: 16px;
|
|
1590
|
+
padding: 24px 16px;
|
|
1591
|
+
border-radius: 16px;
|
|
1592
|
+
background: rgba(193, 238, 207, 0.5);
|
|
1593
|
+
text-align: center;
|
|
1594
|
+
`,wy=m.div`
|
|
1595
|
+
display: grid;
|
|
1596
|
+
place-items: center;
|
|
1597
|
+
width: 64px;
|
|
1598
|
+
height: 64px;
|
|
1599
|
+
border-radius: 50%;
|
|
1600
|
+
background: ${d.colors.ok};
|
|
1601
|
+
color: ${d.colors.white};
|
|
1602
|
+
|
|
1603
|
+
.ico {
|
|
1604
|
+
width: 34px;
|
|
1605
|
+
height: 34px;
|
|
1606
|
+
}
|
|
1607
|
+
`,ky=m.p`
|
|
1608
|
+
margin: 0;
|
|
1609
|
+
font-family: ${d.font.sans};
|
|
1610
|
+
font-size: 20px;
|
|
1611
|
+
line-height: 1.334;
|
|
1612
|
+
color: ${d.colors.text2};
|
|
1613
|
+
|
|
1614
|
+
b {
|
|
1615
|
+
font-weight: 700;
|
|
1616
|
+
}
|
|
1617
|
+
`;function Dy(n){return n.map(a=>({address:a.address,amount:Number(a.amount)}))}function Cy({item:n,session:a,onClose:t,onIssued:e}){const r=Yt(),[o,i]=v.useState([{address:"",amount:"1"}]),[c,l]=v.useState(!1),[p,u]=v.useState(null),[h,x]=v.useState(null),b=v.useRef(null),y=Ar(a),w=Dy(o),k=Ec(w),f=Gx(w,n.available),C=k>n.available;v.useEffect(()=>{var P;(P=b.current)==null||P.focus();function D(I){I.key==="Escape"&&!c&&t()}return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[c,t]);function $(D,P){i(I=>I.map((O,T)=>T===D?{...O,...P}:O))}function E(){i(D=>[...D,{address:"",amount:"1"}])}function A(D){i(P=>P.length<=1?P:P.filter((I,O)=>O!==D))}async function N(){if(!(!f||c)){u(null),l(!0);try{await ey({signer:a.signer,contractAddress:n.contractAddress,chainId:n.chainId,entries:w,itemId:n.itemId}),ue("Shop Issued Item",{contract_address:n.contractAddress,item_id:n.itemId,recipients:w.filter(D=>D.address.trim().length>0).length,copies:k}),x(k),On.success(g("issue.toastSuccess",{count:k,name:n.name})),r.invalidateQueries({queryKey:["publishable-item"]}),r.invalidateQueries({queryKey:["publishable-items"]}),e==null||e()}catch(D){nn(D)||Te(D,{flow:"issue-item",itemId:n.itemId}),ue("Shop Issue Failed",{error_code:Xe(D)}),u(nn(D)?g("getCredits.errorCanceled"):bt(D,g("issue.errorGeneric")))}finally{l(!1)}}}const S=c?y?g("issue.issuing"):g("issue.confirm"):k>0?g("issue.issueCount",{count:k}):g("issue.issue");return s.jsx(ty,{onClick:c?void 0:t,role:"presentation",children:s.jsxs(ny,{ref:b,tabIndex:-1,"data-testid":"issue-modal",onClick:D=>D.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("issue.title"),children:[s.jsxs(ry,{children:[s.jsx(ay,{children:g("issue.title")}),s.jsx(oy,{onClick:t,disabled:c,"aria-label":g("sellModal.cancel"),children:s.jsx(V,{name:"close",className:"ico"})})]}),h!==null?s.jsxs(s.Fragment,{children:[s.jsxs(vy,{children:[s.jsx(wy,{"aria-hidden":!0,children:s.jsx(V,{name:"check",className:"ico"})}),s.jsx(ky,{children:g("issue.successBody",{count:h,name:n.name})})]}),s.jsx(Yi,{children:s.jsx(Wi,{onClick:t,children:g("getCredits.done")})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(sy,{children:[s.jsx(cy,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsx(ly,{children:n.name})]}),s.jsx(iy,{children:g("issue.subtitle")}),s.jsx(dy,{children:o.map((D,P)=>{const I=D.address.trim(),O=I.length>0&&!jc(I),T=Number(D.amount),W=D.amount.length>0&&(!Number.isInteger(T)||T<1);return s.jsxs(uy,{children:[s.jsxs(py,{children:[s.jsx(Li,{children:g("issue.addressLabel")}),s.jsx(Fi,{type:"text",spellCheck:!1,autoComplete:"off",placeholder:"0x…",value:D.address,onChange:z=>$(P,{address:z.target.value}),disabled:c,"aria-invalid":O,"aria-label":g("issue.addressLabel")}),O?s.jsx(yy,{children:g("issue.invalidAddress")}):null]}),s.jsxs(fy,{children:[s.jsx(Li,{children:g("issue.amountLabel")}),s.jsx(Fi,{type:"number",min:"1",step:"1",inputMode:"numeric",value:D.amount,onChange:z=>$(P,{amount:z.target.value}),disabled:c,"aria-invalid":W,"aria-label":g("issue.amountLabel")})]}),s.jsx(hy,{onClick:()=>A(P),disabled:c||o.length<=1,"aria-label":g("issue.removeRow"),children:s.jsx(V,{name:"close",className:"ico"})})]},P)})}),s.jsxs(my,{onClick:E,disabled:c,children:[s.jsx(V,{name:"plus",className:"ico"}),g("issue.addRow")]}),s.jsxs(gy,{over:C,"aria-live":"polite",children:[s.jsx("strong",{children:k})," / ",n.available," ",g("issue.itemsToIssue")]}),C?s.jsx(xy,{children:g("issue.overCap",{available:n.available})}):null,s.jsx(dt,{message:p}),s.jsxs(Yi,{children:[s.jsx(by,{onClick:t,disabled:c,children:g("sellModal.cancel")}),s.jsx(Wi,{onClick:()=>void N(),disabled:!f||c,children:S})]})]})]})})}const Sy=m.div`
|
|
1618
|
+
position: fixed;
|
|
1619
|
+
inset: 0;
|
|
1620
|
+
z-index: 10000;
|
|
1621
|
+
display: flex;
|
|
1622
|
+
align-items: center;
|
|
1623
|
+
justify-content: center;
|
|
1624
|
+
padding: 16px;
|
|
1625
|
+
background: rgba(22, 21, 24, 0.55);
|
|
1626
|
+
`,My=m.div`
|
|
1627
|
+
width: 760px;
|
|
1628
|
+
max-width: 100%;
|
|
1629
|
+
background: ${d.colors.white};
|
|
1630
|
+
border-radius: 16px;
|
|
1631
|
+
padding: 12px 16px 16px;
|
|
1632
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
1633
|
+
display: flex;
|
|
1634
|
+
flex-direction: column;
|
|
1635
|
+
gap: 16px;
|
|
1636
|
+
`,_y=m.div`
|
|
1637
|
+
display: flex;
|
|
1638
|
+
align-items: center;
|
|
1639
|
+
justify-content: space-between;
|
|
1640
|
+
gap: 8px;
|
|
1641
|
+
padding-bottom: 16px;
|
|
1642
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
1643
|
+
`,Py=m.h2`
|
|
1644
|
+
margin: 0;
|
|
1645
|
+
font-family: ${d.font.sans};
|
|
1646
|
+
font-weight: 600;
|
|
1647
|
+
font-size: 20px;
|
|
1648
|
+
line-height: 1.6;
|
|
1649
|
+
color: ${d.colors.text};
|
|
1650
|
+
`,Iy=m.button`
|
|
1651
|
+
flex: none;
|
|
1652
|
+
display: grid;
|
|
1653
|
+
place-items: center;
|
|
1654
|
+
width: 24px;
|
|
1655
|
+
height: 24px;
|
|
1656
|
+
border: 0;
|
|
1657
|
+
background: none;
|
|
1658
|
+
cursor: pointer;
|
|
1659
|
+
color: ${d.colors.text};
|
|
1660
|
+
|
|
1661
|
+
.ico {
|
|
1662
|
+
width: 18px;
|
|
1663
|
+
height: 18px;
|
|
1664
|
+
}
|
|
1665
|
+
&:focus-visible {
|
|
1666
|
+
outline: 2px solid ${d.colors.accent};
|
|
1667
|
+
outline-offset: 2px;
|
|
1668
|
+
}
|
|
1669
|
+
`,jy=m.video`
|
|
1670
|
+
display: block;
|
|
1671
|
+
width: 100%;
|
|
1672
|
+
max-height: 70vh;
|
|
1673
|
+
border-radius: 12px;
|
|
1674
|
+
background: ${d.colors.blackBtn};
|
|
1675
|
+
`;function Ey({src:n,itemName:a,onClose:t}){const e=v.useRef(null);return v.useEffect(()=>{var o;(o=e.current)==null||o.focus();function r(i){i.key==="Escape"&&t()}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),s.jsx(Sy,{onClick:t,role:"presentation",children:s.jsxs(My,{ref:e,tabIndex:-1,onClick:r=>r.stopPropagation(),"data-testid":"modal",role:"dialog","aria-modal":"true","aria-label":g("itemDetail.showcaseTitle"),children:[s.jsxs(_y,{children:[s.jsx(Py,{children:a||g("itemDetail.showcaseTitle")}),s.jsx(Iy,{onClick:t,"aria-label":g("itemDetail.showcaseClose"),children:s.jsx(V,{name:"close",size:18})})]}),s.jsx(jy,{src:n,"data-testid":"showcase-video",controls:!0,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto"})]})})}const{colors:pt,radius:Ty}=d,$y=m.div`
|
|
1676
|
+
position: fixed;
|
|
1677
|
+
inset: 0;
|
|
1678
|
+
z-index: 60;
|
|
1679
|
+
display: grid;
|
|
1680
|
+
place-items: center;
|
|
1681
|
+
padding: 20px;
|
|
1682
|
+
`,Ny=m.div`
|
|
1683
|
+
position: absolute;
|
|
1684
|
+
inset: 0;
|
|
1685
|
+
background: rgba(22, 21, 24, 0.45);
|
|
1686
|
+
`,Oy=m.div`
|
|
1687
|
+
position: relative;
|
|
1688
|
+
z-index: 1;
|
|
1689
|
+
width: 100%;
|
|
1690
|
+
max-width: 420px;
|
|
1691
|
+
background: ${pt.white};
|
|
1692
|
+
border-radius: ${Ty.banner};
|
|
1693
|
+
padding: 24px;
|
|
1694
|
+
box-shadow: 0 24px 60px rgba(22, 21, 24, 0.28);
|
|
1695
|
+
animation: cart-pop-in 0.16s ease;
|
|
1696
|
+
`,Ry=m.div`
|
|
1697
|
+
display: flex;
|
|
1698
|
+
align-items: center;
|
|
1699
|
+
gap: 14px;
|
|
1700
|
+
margin-bottom: 18px;
|
|
1701
|
+
`,Ay=m.div`
|
|
1702
|
+
width: 64px;
|
|
1703
|
+
height: 64px;
|
|
1704
|
+
flex: none;
|
|
1705
|
+
border-radius: 12px;
|
|
1706
|
+
overflow: hidden;
|
|
1707
|
+
background: ${pt.media};
|
|
1708
|
+
|
|
1709
|
+
& img {
|
|
1710
|
+
width: 100%;
|
|
1711
|
+
height: 100%;
|
|
1712
|
+
object-fit: contain;
|
|
1713
|
+
}
|
|
1714
|
+
`,Ly=m.div`
|
|
1715
|
+
font-weight: 700;
|
|
1716
|
+
font-size: 16px;
|
|
1717
|
+
color: ${pt.text};
|
|
1718
|
+
margin-bottom: 6px;
|
|
1719
|
+
`,Fy=m.div`
|
|
1720
|
+
background: ${pt.panel};
|
|
1721
|
+
border-radius: 14px;
|
|
1722
|
+
padding: 16px;
|
|
1723
|
+
margin-bottom: 14px;
|
|
1724
|
+
`,Bi=m.div`
|
|
1725
|
+
color: ${pt.muted};
|
|
1726
|
+
font-size: 13px;
|
|
1727
|
+
font-weight: 600;
|
|
1728
|
+
margin-bottom: 6px;
|
|
1729
|
+
`,Hi=m.div`
|
|
1730
|
+
display: flex;
|
|
1731
|
+
align-items: center;
|
|
1732
|
+
gap: 8px;
|
|
1733
|
+
font-weight: 700;
|
|
1734
|
+
font-size: 24px;
|
|
1735
|
+
color: ${pt.text};
|
|
1736
|
+
|
|
1737
|
+
&[data-approx] {
|
|
1738
|
+
color: ${pt.text2};
|
|
1739
|
+
}
|
|
1740
|
+
`,Yy=m.span`
|
|
1741
|
+
color: ${pt.muted};
|
|
1742
|
+
`,zi=m(Pe)`
|
|
1743
|
+
width: 20px;
|
|
1744
|
+
height: 20px;
|
|
1745
|
+
color: ${pt.text};
|
|
1746
|
+
`,qi=m.div`
|
|
1747
|
+
margin-top: 6px;
|
|
1748
|
+
font-size: 13px;
|
|
1749
|
+
`,Wy=m.div`
|
|
1750
|
+
font-size: 13px;
|
|
1751
|
+
margin-bottom: 6px;
|
|
1752
|
+
`,Tc=ln`
|
|
1753
|
+
margin: 6px 0 0;
|
|
1754
|
+
font-size: 13px;
|
|
1755
|
+
`,Ki=m.p`
|
|
1756
|
+
${Tc};
|
|
1757
|
+
`,By=m(dt)`
|
|
1758
|
+
${Tc};
|
|
1759
|
+
`,Hy=m.div`
|
|
1760
|
+
display: flex;
|
|
1761
|
+
gap: 10px;
|
|
1762
|
+
margin-top: 18px;
|
|
1763
|
+
`,Qi=m(Rn)`
|
|
1764
|
+
flex: 1;
|
|
1765
|
+
`;function Vi(n){if(nn(n))return g("errors.rejected");const a=(n.message??"").toLowerCase();return a.includes("insufficient")?g("marketCheckout.error.insufficient",{currency:wt.name}):a.includes("not found")||a.includes("no active listing")||a.includes("404")?g("marketCheckout.error.soldOrRemoved"):a.includes("your own listing")?g("errors.cantBuyOwn"):g("marketCheckout.error.generic")}function zy(n){return{id:n.tradeId,tradeId:n.tradeId,name:n.name,creator:n.creator,contractAddress:n.contractAddress,itemId:n.itemId,category:n.category,wearableCategory:n.wearableCategory??void 0,rarity:n.rarity,network:n.network,chainId:n.chainId,thumbnail:n.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function $c({listing:n,rate:a,onClose:t,onSold:e}){const{session:r}=Nt(),{data:o,isError:i}=Ss(r),c=Yt(),l=Ft(),[p,u]=v.useState("confirm"),[h,x]=v.useState(g("marketCheckout.lockingPrice")),[b,y]=v.useState(null),[w,k]=v.useState(null),f=v.useRef(null),C=v.useRef(tc()),$=lr(Vr(n.manaWei,a));v.useEffect(()=>{let I=!1;if(!r){u("error"),y(g("buyModal.signInToCheckout"));return}return(async()=>{try{const T=await Ts(n.tradeId);if(!T)throw new Error("not found");if(Ms(T,r.address))throw new Error("You can't buy your own listing.");const W=Vr(n.manaWei,a);if(!Number.isFinite(W)||W<=0)throw new Error("price unavailable");const{credit:z,maxCreditedValue:U,usdCents:Y}=await ha(r.identity,W,n.tradeId);if(I){N([z.id]);return}f.current=z.id,k({trade:T,credit:z,maxCreditedValue:U,usdCents:Y,credits:lr(Y)}),x("")}catch(T){if(I)return;console.error("[market] authorize failed",T),ue(rt(T)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Xe(T),value_usd:Math.round(Vr(n.manaWei,a))/100}),u("error"),y(Vi(T))}})(),()=>{I=!0,f.current&&r&&(S([f.current]),f.current=null)}},[]);const E=!!w&&o!=null&&o.credits<w.credits;async function A(){if(!r||!w)return;if(E){ue("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:w.credits,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,w.credits-((o==null?void 0:o.credits)??0))}),N([w.credit.id]),f.current=null,l("/credits");return}u("working"),y(null);let I=!1,O;try{x(g("marketCheckout.confirming"));const W={trade:w.trade,buyer:r.address,signer:r.signer,credits:[w.credit],maxCreditedValue:w.maxCreditedValue,onBroadcast:({txHash:z})=>C.current.broadcast(w.credit.id,z),onReverted:({txHash:z})=>{z&&C.current.reverted(z)}};if(C.current.submitStarted(w.credit.id),As())try{O=await Ys(W),C.current.broadcast(w.credit.id,O),await Ws(O),I=!0}catch(z){if(z instanceof Bs)I=!0;else if(z instanceof Hs){if(z.reason==="relayer-unreachable")throw C.current.unobservable(w.credit.id),z;O=await dr(W)}else throw O&&C.current.reverted(O),z}else O=await dr(W)}catch(W){C.current.submitFinished(w.credit.id),console.error("[market] buy now failed",W),N([w.credit.id]),f.current=null,ue(rt(W)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(W),value_usd:w.usdCents/100}),c.invalidateQueries({queryKey:["usd-balance"]}),y(Vi(W)),u("error");const z=(W.message??"").toLowerCase();(z.includes("not found")||z.includes("no active listing")||z.includes("404"))&&e();return}C.current.submitFinished(w.credit.id),f.current=null;try{c.invalidateQueries({queryKey:["usd-balance"]}),ue("Shop Completed Purchase",{items:[{item_id:n.itemId??null,contract_address:n.contractAddress,token_id:null,price_usd:w.usdCents/100}],value_credits:w.credits,value_usd:w.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:I,transaction_hash:O??null}),c.invalidateQueries({queryKey:["detail-trade"]}),c.invalidateQueries({queryKey:["shop-item"]}),c.invalidateQueries({queryKey:["item-resales",n.contractAddress,n.itemId]}),c.invalidateQueries({queryKey:["shop-items"]}),c.invalidateQueries({queryKey:["catalog-items"]}),c.invalidateQueries({queryKey:["my-assets"]}),c.invalidateQueries({queryKey:["purchases"]})}catch(W){Te(W,{flow:"market_buy_now",step:"post_purchase"})}const T={items:[zy(n)],txHash:O};l("/success",{state:T})}function N(I){if(!r||I.length===0)return;const O=I.filter(T=>!C.current.mayBeConsumed(T));O.length!==0&&_s(r.identity,O).catch(()=>{})}function S(I){N(I.filter(O=>!C.current.isInFlight(O)))}function D(){r&&w&&N([w.credit.id]),f.current=null,t()}const P=p==="working";return s.jsxs($y,{role:"dialog","aria-modal":"true","aria-label":g("buyModal.dialogAria",{name:n.name}),children:[s.jsx(Ny,{onClick:P?void 0:D,"aria-hidden":!0}),s.jsxs(Oy,{children:[s.jsxs(Ry,{children:[s.jsx(Ay,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs("div",{children:[s.jsx(Ly,{title:n.name,children:n.name||g("buyModal.itemFallback")}),s.jsx(Es,{"data-variant":"rarity",children:n.rarity})]})]}),s.jsx(Fy,{children:w?s.jsxs(s.Fragment,{children:[s.jsx(Bi,{children:g("marketCheckout.finalPrice")}),s.jsxs(Hi,{children:[s.jsx(zi,{}),go(w.credits)]}),s.jsxs(qi,{className:"muted",children:[g("marketCheckout.lockedForPurchase")," · $",(w.usdCents/100).toFixed(2)]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Bi,{children:g("marketCheckout.todaysPrice")}),s.jsxs(Hi,{"data-approx":!0,children:[s.jsx(Yy,{"aria-hidden":!0,children:"≈"}),s.jsx(zi,{}),go($)]}),s.jsx(qi,{className:"muted",children:h||g("marketCheckout.lockingPrice")})]})}),r?s.jsxs(Wy,{className:"muted",children:[g("marketCheckout.yourBalance")," ",s.jsx(Pe,{className:"ccy-mark"})," ",jl(o,i)]}):null,E?s.jsx(Ki,{className:"muted",children:g("marketCheckout.needMore",{currency:wt.name})}):null,h&&p==="working"?s.jsx(Ki,{className:"muted",children:h}):null,s.jsx(By,{message:b}),s.jsxs(Hy,{children:[s.jsx(Qi,{variant:"ghost",onClick:D,disabled:P,children:g("buyModal.cancel")}),s.jsx(Qi,{variant:"purple",onClick:()=>void A(),disabled:P||!w,children:P?g("marketCheckout.buying"):E?g("nav.getCredits",{currency:wt.name}):g("marketCheckout.confirmPurchase")})]})]})]})}function qy(n,a,{enabled:t=!0,first:e}={}){const{data:r,isFetched:o}=ge({queryKey:["related-items",n,a,e],enabled:t&&!!n&&!!a,staleTime:3e5,queryFn:()=>El(n,a,{first:e})});return{items:r??[],isFetched:o}}const{colors:ce,media:Ya}=d,Ky=Tl`
|
|
1766
|
+
to {
|
|
1767
|
+
transform: rotate(360deg);
|
|
1768
|
+
}
|
|
1769
|
+
`,Qy=m.div``,Vy=m.span`
|
|
1770
|
+
width: 34px;
|
|
1771
|
+
height: 34px;
|
|
1772
|
+
border-radius: 50%;
|
|
1773
|
+
border: 3px solid ${ce.line};
|
|
1774
|
+
border-top-color: ${ce.accent};
|
|
1775
|
+
animation: ${Ky} 0.8s linear infinite;
|
|
1776
|
+
|
|
1777
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1778
|
+
animation-duration: 2.4s;
|
|
1779
|
+
}
|
|
1780
|
+
`,Uy=m.p``;m.div``;m.button`
|
|
1781
|
+
border: 0;
|
|
1782
|
+
background: none;
|
|
1783
|
+
cursor: pointer;
|
|
1784
|
+
padding: 6px 16px;
|
|
1785
|
+
border-radius: 999px;
|
|
1786
|
+
font-weight: 600;
|
|
1787
|
+
font-size: 12px;
|
|
1788
|
+
text-transform: uppercase;
|
|
1789
|
+
letter-spacing: 0.04em;
|
|
1790
|
+
color: ${ce.muted};
|
|
1791
|
+
transition:
|
|
1792
|
+
background 0.12s ease,
|
|
1793
|
+
color 0.12s ease;
|
|
1794
|
+
|
|
1795
|
+
&[data-active] {
|
|
1796
|
+
background: ${ce.text};
|
|
1797
|
+
color: ${ce.white};
|
|
1798
|
+
}
|
|
1799
|
+
&:not([data-active]):hover {
|
|
1800
|
+
color: ${ce.text};
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
${Ya.maxWidth("lg")} {
|
|
1804
|
+
padding: 9px 13px;
|
|
1805
|
+
border-radius: 0;
|
|
1806
|
+
background: ${ce.white};
|
|
1807
|
+
color: ${ce.text2};
|
|
1808
|
+
|
|
1809
|
+
&[data-active] {
|
|
1810
|
+
background: ${ce.text};
|
|
1811
|
+
color: ${ce.white};
|
|
1812
|
+
}
|
|
1813
|
+
&:first-of-type {
|
|
1814
|
+
border-top-left-radius: 999px;
|
|
1815
|
+
border-bottom-left-radius: 999px;
|
|
1816
|
+
}
|
|
1817
|
+
&:last-of-type {
|
|
1818
|
+
border-top-right-radius: 999px;
|
|
1819
|
+
border-bottom-right-radius: 999px;
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
`;m.span`
|
|
1823
|
+
${Ya.maxWidth("lg")} {
|
|
1824
|
+
display: none;
|
|
1825
|
+
}
|
|
1826
|
+
`;m(V)`
|
|
1827
|
+
display: none;
|
|
1828
|
+
|
|
1829
|
+
${Ya.maxWidth("lg")} {
|
|
1830
|
+
display: block;
|
|
1831
|
+
}
|
|
1832
|
+
`;const Xy=m.div`
|
|
1833
|
+
& .MuiBox-root {
|
|
1834
|
+
position: static;
|
|
1835
|
+
width: 100%;
|
|
1836
|
+
margin: 0;
|
|
1837
|
+
padding: 0;
|
|
1838
|
+
display: flex;
|
|
1839
|
+
align-items: center;
|
|
1840
|
+
gap: 10px;
|
|
1841
|
+
}
|
|
1842
|
+
& .MuiButtonBase-root {
|
|
1843
|
+
min-width: 0;
|
|
1844
|
+
padding: 0;
|
|
1845
|
+
margin: 0;
|
|
1846
|
+
border-radius: 50%;
|
|
1847
|
+
display: inline-flex;
|
|
1848
|
+
align-items: center;
|
|
1849
|
+
justify-content: center;
|
|
1850
|
+
background: none !important;
|
|
1851
|
+
box-shadow: none !important;
|
|
1852
|
+
color: ${ce.muted};
|
|
1853
|
+
flex: 0 0 auto;
|
|
1854
|
+
transition:
|
|
1855
|
+
background 0.12s ease,
|
|
1856
|
+
color 0.12s ease;
|
|
1857
|
+
}
|
|
1858
|
+
& .MuiButtonBase-root .MuiSvgIcon-root {
|
|
1859
|
+
font-size: 20px;
|
|
1860
|
+
margin: 0;
|
|
1861
|
+
}
|
|
1862
|
+
& .MuiBox-root > .MuiButtonBase-root:first-child {
|
|
1863
|
+
width: 34px;
|
|
1864
|
+
height: 34px;
|
|
1865
|
+
background: ${ce.accent} !important;
|
|
1866
|
+
color: ${ce.white};
|
|
1867
|
+
}
|
|
1868
|
+
& .MuiBox-root > .MuiButtonBase-root:first-child:hover {
|
|
1869
|
+
background: ${ce.text} !important;
|
|
1870
|
+
}
|
|
1871
|
+
& .MuiBox-root > input + .MuiButtonBase-root {
|
|
1872
|
+
width: 30px;
|
|
1873
|
+
height: 30px;
|
|
1874
|
+
color: ${ce.muted};
|
|
1875
|
+
}
|
|
1876
|
+
& .MuiBox-root > input + .MuiButtonBase-root:hover {
|
|
1877
|
+
background: ${ce.media} !important;
|
|
1878
|
+
color: ${ce.text};
|
|
1879
|
+
}
|
|
1880
|
+
& input[type='range'] {
|
|
1881
|
+
flex: 1 1 auto;
|
|
1882
|
+
width: auto;
|
|
1883
|
+
min-width: 0;
|
|
1884
|
+
height: 4px;
|
|
1885
|
+
margin: 0;
|
|
1886
|
+
padding: 0;
|
|
1887
|
+
-webkit-appearance: none;
|
|
1888
|
+
appearance: none;
|
|
1889
|
+
background: transparent;
|
|
1890
|
+
cursor: pointer;
|
|
1891
|
+
}
|
|
1892
|
+
& input[type='range']::-webkit-slider-runnable-track {
|
|
1893
|
+
height: 4px;
|
|
1894
|
+
border-radius: 999px;
|
|
1895
|
+
background: ${ce.lineStrong};
|
|
1896
|
+
}
|
|
1897
|
+
& input[type='range']::-moz-range-track {
|
|
1898
|
+
height: 4px;
|
|
1899
|
+
border-radius: 999px;
|
|
1900
|
+
background: ${ce.lineStrong};
|
|
1901
|
+
}
|
|
1902
|
+
& input[type='range']::-webkit-slider-thumb {
|
|
1903
|
+
-webkit-appearance: none;
|
|
1904
|
+
appearance: none;
|
|
1905
|
+
width: 13px;
|
|
1906
|
+
height: 13px;
|
|
1907
|
+
margin-top: -4.5px;
|
|
1908
|
+
border-radius: 50%;
|
|
1909
|
+
background: ${ce.accent};
|
|
1910
|
+
border: 2px solid ${ce.white};
|
|
1911
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.3);
|
|
1912
|
+
cursor: pointer;
|
|
1913
|
+
}
|
|
1914
|
+
& input[type='range']::-moz-range-thumb {
|
|
1915
|
+
width: 13px;
|
|
1916
|
+
height: 13px;
|
|
1917
|
+
border-radius: 50%;
|
|
1918
|
+
background: ${ce.accent};
|
|
1919
|
+
border: 2px solid ${ce.white};
|
|
1920
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.3);
|
|
1921
|
+
cursor: pointer;
|
|
1922
|
+
}
|
|
1923
|
+
& input[type='range']:focus-visible {
|
|
1924
|
+
outline: none;
|
|
1925
|
+
}
|
|
1926
|
+
& input[type='range']:focus-visible::-webkit-slider-thumb {
|
|
1927
|
+
outline: 2px solid ${ce.accent};
|
|
1928
|
+
outline-offset: 2px;
|
|
1929
|
+
}
|
|
1930
|
+
`,Ui="shop-item-preview";function Gy({item:n}){const a=Nt(S=>{var D;return(D=S.session)==null?void 0:D.address}),{data:t,isLoading:e}=Sr(a),r=a&&t?a:"default",o=n.category==="emote",[i]=v.useState("avatar"),c=!o&&i==="item",l=c||!e,p=En(S=>S.fittingOpen),{ref:u,active:h}=Au(),x=l&&h&&!p,[b,y]=v.useState(!0);v.useEffect(()=>{y(!0)},[n.id,c]),v.useEffect(()=>{x&&y(!0)},[x]);const w=v.useRef(null);v.useEffect(()=>{if(x)return()=>{Lu(w.current),w.current=null}},[x]);const[k,f]=v.useState(Re.PreviewRenderer.UNITY),C=k===Re.PreviewRenderer.BABYLON,$=!!a&&!!t,E=$&&$l(n,Nl(t)),A=Ol(n)[0],N=$&&!E&&!o;return s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:u,"data-preview-viewport":!0,"aria-hidden":!0}),x?s.jsx(Rl,{id:Ui,contractAddress:n.contractAddress,tokenId:n.tokenId??void 0,itemId:n.tokenId?void 0:n.itemId??void 0,profile:c?void 0:E?r:"default",bodyShape:c||E?void 0:A,type:o?void 0:c?Re.PreviewType.WEARABLE:Re.PreviewType.AVATAR,emote:o||c?void 0:Re.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:o?1.5:void 0,wheelStart:o?100:void 0,unity:!0,onRenderer:f,onLoad:()=>{var S;y(!1),w.current=((S=document.getElementById(Ui))==null?void 0:S.contentWindow)??null}}):null,!x||b?s.jsx(Qy,{"data-preview-loading":!0,"aria-busy":"true","aria-label":g("itemPreview.loading"),children:s.jsx(Vy,{"aria-hidden":!0})}):null,N&&!c?s.jsx(Uy,{"data-preview-note":!0,children:g("itemPreview.shownOnBody",{shape:Al(A)})}):null,!C||!o?null:s.jsx(Xy,{"data-preview-controls":!0,"data-testid":"emote-controls",children:s.jsx(Ru,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})})]})}const Jy=m.div`
|
|
1931
|
+
position: fixed;
|
|
1932
|
+
inset: 0;
|
|
1933
|
+
z-index: 10000;
|
|
1934
|
+
display: flex;
|
|
1935
|
+
align-items: center;
|
|
1936
|
+
justify-content: center;
|
|
1937
|
+
padding: 16px;
|
|
1938
|
+
background: rgba(22, 21, 24, 0.55);
|
|
1939
|
+
`,Zy=m.div`
|
|
1940
|
+
display: flex;
|
|
1941
|
+
flex-direction: column;
|
|
1942
|
+
gap: 12px;
|
|
1943
|
+
width: 1128px;
|
|
1944
|
+
max-width: 100%;
|
|
1945
|
+
max-height: 92vh;
|
|
1946
|
+
background: ${d.colors.white};
|
|
1947
|
+
border-radius: 16px;
|
|
1948
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
1949
|
+
|
|
1950
|
+
&:focus {
|
|
1951
|
+
outline: none;
|
|
1952
|
+
}
|
|
1953
|
+
`,eb=m.div`
|
|
1954
|
+
flex: none;
|
|
1955
|
+
display: flex;
|
|
1956
|
+
align-items: center;
|
|
1957
|
+
gap: 8px;
|
|
1958
|
+
padding: 16px;
|
|
1959
|
+
border-bottom: 1px solid ${d.colors.gray4};
|
|
1960
|
+
`,tb=m.h2`
|
|
1961
|
+
flex: 1 1 auto;
|
|
1962
|
+
min-width: 0;
|
|
1963
|
+
margin: 0;
|
|
1964
|
+
font-family: ${d.font.sans};
|
|
1965
|
+
font-weight: 600;
|
|
1966
|
+
font-size: 20px;
|
|
1967
|
+
line-height: 1.6;
|
|
1968
|
+
color: ${d.colors.text};
|
|
1969
|
+
`,nb=m.button`
|
|
1970
|
+
flex: none;
|
|
1971
|
+
display: grid;
|
|
1972
|
+
place-items: center;
|
|
1973
|
+
width: 18.5px;
|
|
1974
|
+
height: 18.5px;
|
|
1975
|
+
padding: 0;
|
|
1976
|
+
border: 0;
|
|
1977
|
+
background: none;
|
|
1978
|
+
cursor: pointer;
|
|
1979
|
+
color: ${d.colors.text};
|
|
1980
|
+
|
|
1981
|
+
.ico {
|
|
1982
|
+
width: 18.5px;
|
|
1983
|
+
height: 18.5px;
|
|
1984
|
+
}
|
|
1985
|
+
&:focus-visible {
|
|
1986
|
+
outline: 2px solid ${d.colors.accent};
|
|
1987
|
+
outline-offset: 4px;
|
|
1988
|
+
}
|
|
1989
|
+
`,rb=m.div`
|
|
1990
|
+
flex: 1 1 auto;
|
|
1991
|
+
min-height: 0;
|
|
1992
|
+
overflow-y: auto;
|
|
1993
|
+
display: flex;
|
|
1994
|
+
flex-direction: column;
|
|
1995
|
+
gap: 8px;
|
|
1996
|
+
padding: 0 16px 24px;
|
|
1997
|
+
`,ab=m.div`
|
|
1998
|
+
position: sticky;
|
|
1999
|
+
top: 0;
|
|
2000
|
+
z-index: 1;
|
|
2001
|
+
display: flex;
|
|
2002
|
+
align-items: center;
|
|
2003
|
+
justify-content: space-between;
|
|
2004
|
+
gap: 8px;
|
|
2005
|
+
padding-bottom: 8px;
|
|
2006
|
+
background: ${d.colors.white};
|
|
2007
|
+
`,ob=m.p`
|
|
2008
|
+
margin: 0;
|
|
2009
|
+
font-family: ${d.font.sans};
|
|
2010
|
+
font-size: 14px;
|
|
2011
|
+
line-height: 1.43;
|
|
2012
|
+
color: ${d.colors.muted};
|
|
2013
|
+
`,ib=m.div`
|
|
2014
|
+
position: relative;
|
|
2015
|
+
flex: none;
|
|
2016
|
+
display: inline-flex;
|
|
2017
|
+
align-items: center;
|
|
2018
|
+
padding: 4px 4px 4px 12px;
|
|
2019
|
+
border: 0.5px solid ${d.colors.lineStrong};
|
|
2020
|
+
border-radius: 8px;
|
|
2021
|
+
background: ${d.colors.white};
|
|
2022
|
+
|
|
2023
|
+
select {
|
|
2024
|
+
appearance: none;
|
|
2025
|
+
/* 24px design gap + the 24px chevron that sits on top of it. */
|
|
2026
|
+
padding: 0 48px 0 0;
|
|
2027
|
+
border: 0;
|
|
2028
|
+
background: none;
|
|
2029
|
+
font-family: ${d.font.sans};
|
|
2030
|
+
font-weight: 500;
|
|
2031
|
+
font-size: 12px;
|
|
2032
|
+
line-height: 1.43;
|
|
2033
|
+
color: ${d.colors.text2};
|
|
2034
|
+
cursor: pointer;
|
|
2035
|
+
outline: none;
|
|
2036
|
+
}
|
|
2037
|
+
select:focus-visible {
|
|
2038
|
+
outline: 2px solid ${d.colors.accent};
|
|
2039
|
+
outline-offset: 2px;
|
|
2040
|
+
border-radius: 4px;
|
|
2041
|
+
}
|
|
2042
|
+
.chev {
|
|
2043
|
+
position: absolute;
|
|
2044
|
+
right: 4px;
|
|
2045
|
+
width: 24px;
|
|
2046
|
+
height: 24px;
|
|
2047
|
+
color: ${d.colors.text2};
|
|
2048
|
+
pointer-events: none;
|
|
2049
|
+
}
|
|
2050
|
+
`,sb=m.div`
|
|
2051
|
+
flex: none;
|
|
2052
|
+
border: 1px solid ${d.colors.lineStrong};
|
|
2053
|
+
border-radius: 16px;
|
|
2054
|
+
/* The four equal columns need the design width to hold their content, so a narrower modal scrolls
|
|
2055
|
+
the table here rather than letting the page scroll sideways. */
|
|
2056
|
+
overflow-x: auto;
|
|
2057
|
+
overflow-y: hidden;
|
|
2058
|
+
background: ${d.colors.white};
|
|
2059
|
+
`,cb=m.table`
|
|
2060
|
+
width: 100%;
|
|
2061
|
+
min-width: 1096px;
|
|
2062
|
+
table-layout: fixed;
|
|
2063
|
+
border-collapse: collapse;
|
|
2064
|
+
|
|
2065
|
+
th {
|
|
2066
|
+
height: 48px;
|
|
2067
|
+
padding: 8px 8px 8px 16px;
|
|
2068
|
+
text-align: left;
|
|
2069
|
+
vertical-align: middle;
|
|
2070
|
+
background: ${d.colors.media};
|
|
2071
|
+
border-right: 0.5px solid ${d.colors.lineStrong};
|
|
2072
|
+
font-family: ${d.font.sans};
|
|
2073
|
+
font-weight: 600;
|
|
2074
|
+
font-size: 16px;
|
|
2075
|
+
line-height: 1.5;
|
|
2076
|
+
color: ${d.colors.text};
|
|
2077
|
+
text-transform: capitalize;
|
|
2078
|
+
}
|
|
2079
|
+
th:last-of-type {
|
|
2080
|
+
border-right: 0;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
td {
|
|
2084
|
+
height: 56px;
|
|
2085
|
+
padding: 8px 8px 8px 16px;
|
|
2086
|
+
vertical-align: middle;
|
|
2087
|
+
border-right: 0.5px solid ${d.colors.lineStrong};
|
|
2088
|
+
border-bottom: 0.5px solid ${d.colors.lineStrong};
|
|
2089
|
+
font-family: ${d.font.sans};
|
|
2090
|
+
font-size: 14px;
|
|
2091
|
+
line-height: 1.43;
|
|
2092
|
+
color: ${d.colors.text2};
|
|
2093
|
+
}
|
|
2094
|
+
td:last-of-type {
|
|
2095
|
+
border-right: 0;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
tbody tr:hover,
|
|
2099
|
+
tbody tr:focus-within {
|
|
2100
|
+
background: ${d.colors.media};
|
|
2101
|
+
}
|
|
2102
|
+
tbody tr:hover td,
|
|
2103
|
+
tbody tr:focus-within td {
|
|
2104
|
+
border-bottom-color: ${d.colors.media};
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
/* Stack every cell into a card — a 4-column grid is unusable at phone widths. The column name is
|
|
2108
|
+
carried on each cell's data-label so it survives translation. */
|
|
2109
|
+
${d.media.maxWidth("mobile")} {
|
|
2110
|
+
min-width: 0;
|
|
2111
|
+
|
|
2112
|
+
thead {
|
|
2113
|
+
display: none;
|
|
2114
|
+
}
|
|
2115
|
+
tr {
|
|
2116
|
+
display: block;
|
|
2117
|
+
border-bottom: 0.5px solid ${d.colors.lineStrong};
|
|
2118
|
+
}
|
|
2119
|
+
tr:last-of-type {
|
|
2120
|
+
border-bottom: 0;
|
|
2121
|
+
}
|
|
2122
|
+
td {
|
|
2123
|
+
display: block;
|
|
2124
|
+
height: auto;
|
|
2125
|
+
padding: 8px 16px;
|
|
2126
|
+
border-right: 0;
|
|
2127
|
+
border-bottom: 0;
|
|
2128
|
+
}
|
|
2129
|
+
td:first-of-type {
|
|
2130
|
+
padding-top: 12px;
|
|
2131
|
+
}
|
|
2132
|
+
td:last-of-type {
|
|
2133
|
+
padding-bottom: 12px;
|
|
2134
|
+
}
|
|
2135
|
+
td[data-label]::before {
|
|
2136
|
+
content: attr(data-label);
|
|
2137
|
+
display: block;
|
|
2138
|
+
margin-bottom: 2px;
|
|
2139
|
+
font-size: 12px;
|
|
2140
|
+
line-height: 1.43;
|
|
2141
|
+
color: ${d.colors.muted};
|
|
2142
|
+
text-transform: capitalize;
|
|
2143
|
+
}
|
|
2144
|
+
tbody tr:hover td,
|
|
2145
|
+
tbody tr:focus-within td {
|
|
2146
|
+
border-bottom-color: transparent;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
`,Nc=`
|
|
2150
|
+
display: flex;
|
|
2151
|
+
align-items: center;
|
|
2152
|
+
gap: 10px;
|
|
2153
|
+
min-width: 0;
|
|
2154
|
+
|
|
2155
|
+
.owner-ava {
|
|
2156
|
+
flex: none;
|
|
2157
|
+
display: inline-grid;
|
|
2158
|
+
place-items: center;
|
|
2159
|
+
width: 32px;
|
|
2160
|
+
height: 32px;
|
|
2161
|
+
border: 2.286px solid rgba(255, 255, 255, 0.5);
|
|
2162
|
+
border-radius: 50%;
|
|
2163
|
+
background: ${d.colors.media};
|
|
2164
|
+
object-fit: cover;
|
|
2165
|
+
overflow: hidden;
|
|
2166
|
+
color: ${d.colors.white};
|
|
2167
|
+
font-weight: 700;
|
|
2168
|
+
font-size: 13px;
|
|
2169
|
+
}
|
|
2170
|
+
.owner-name {
|
|
2171
|
+
min-width: 0;
|
|
2172
|
+
overflow: hidden;
|
|
2173
|
+
text-overflow: ellipsis;
|
|
2174
|
+
white-space: nowrap;
|
|
2175
|
+
font-family: ${d.font.sans};
|
|
2176
|
+
font-size: 14px;
|
|
2177
|
+
line-height: 1.43;
|
|
2178
|
+
color: ${d.colors.text2};
|
|
2179
|
+
}
|
|
2180
|
+
`,lb=m.div`
|
|
2181
|
+
${Nc}
|
|
2182
|
+
`,db=m.button`
|
|
2183
|
+
${Nc}
|
|
2184
|
+
padding: 0;
|
|
2185
|
+
border: 0;
|
|
2186
|
+
background: none;
|
|
2187
|
+
font: inherit;
|
|
2188
|
+
text-align: left;
|
|
2189
|
+
cursor: pointer;
|
|
2190
|
+
|
|
2191
|
+
&:hover .owner-name {
|
|
2192
|
+
text-decoration: underline;
|
|
2193
|
+
}
|
|
2194
|
+
&:focus-visible {
|
|
2195
|
+
outline: 2px solid ${d.colors.accent};
|
|
2196
|
+
outline-offset: 2px;
|
|
2197
|
+
border-radius: 4px;
|
|
2198
|
+
}
|
|
2199
|
+
`,Xi=m.span`
|
|
2200
|
+
color: ${d.colors.muted};
|
|
2201
|
+
`,ub=m.div`
|
|
2202
|
+
display: flex;
|
|
2203
|
+
align-items: center;
|
|
2204
|
+
justify-content: space-between;
|
|
2205
|
+
gap: 4px;
|
|
2206
|
+
|
|
2207
|
+
.amount {
|
|
2208
|
+
display: inline-flex;
|
|
2209
|
+
align-items: center;
|
|
2210
|
+
gap: 4px;
|
|
2211
|
+
font-family: ${d.font.sans};
|
|
2212
|
+
font-weight: 600;
|
|
2213
|
+
font-size: 16px;
|
|
2214
|
+
line-height: 1.5;
|
|
2215
|
+
color: ${d.colors.text2};
|
|
2216
|
+
}
|
|
2217
|
+
/* The credits mark is always near-black here — never the violet accent. */
|
|
2218
|
+
.amount .ccy {
|
|
2219
|
+
flex: none;
|
|
2220
|
+
width: 22px;
|
|
2221
|
+
height: 22px;
|
|
2222
|
+
color: ${d.colors.text2};
|
|
2223
|
+
}
|
|
2224
|
+
.approx {
|
|
2225
|
+
color: ${d.colors.muted};
|
|
2226
|
+
font-weight: 600;
|
|
2227
|
+
}
|
|
2228
|
+
`,pb=m.div`
|
|
2229
|
+
flex: none;
|
|
2230
|
+
display: flex;
|
|
2231
|
+
align-items: center;
|
|
2232
|
+
gap: 8px;
|
|
2233
|
+
opacity: 0;
|
|
2234
|
+
transition: opacity 0.12s ease;
|
|
2235
|
+
|
|
2236
|
+
tr:hover &,
|
|
2237
|
+
tr:focus-within &,
|
|
2238
|
+
&[data-persistent='true'] {
|
|
2239
|
+
opacity: 1;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
@media (hover: none) {
|
|
2243
|
+
opacity: 1;
|
|
2244
|
+
}
|
|
2245
|
+
${d.media.maxWidth("mobile")} {
|
|
2246
|
+
opacity: 1;
|
|
2247
|
+
}
|
|
2248
|
+
`,Oc=`
|
|
2249
|
+
display: inline-flex;
|
|
2250
|
+
align-items: center;
|
|
2251
|
+
justify-content: center;
|
|
2252
|
+
gap: 8px;
|
|
2253
|
+
height: 40px;
|
|
2254
|
+
padding: 0 12px;
|
|
2255
|
+
border: 0;
|
|
2256
|
+
border-radius: 12px;
|
|
2257
|
+
cursor: pointer;
|
|
2258
|
+
font-family: ${d.font.sans};
|
|
2259
|
+
font-weight: 600;
|
|
2260
|
+
font-size: 13px;
|
|
2261
|
+
line-height: 24px;
|
|
2262
|
+
letter-spacing: 0.46px;
|
|
2263
|
+
text-transform: uppercase;
|
|
2264
|
+
text-align: center;
|
|
2265
|
+
white-space: nowrap;
|
|
2266
|
+
|
|
2267
|
+
.ico {
|
|
2268
|
+
width: 20px;
|
|
2269
|
+
height: 20px;
|
|
2270
|
+
}
|
|
2271
|
+
&:focus-visible {
|
|
2272
|
+
outline: 2px solid ${d.colors.accent};
|
|
2273
|
+
outline-offset: 2px;
|
|
2274
|
+
}
|
|
2275
|
+
`,fb=m.button`
|
|
2276
|
+
${Oc}
|
|
2277
|
+
min-width: 106px;
|
|
2278
|
+
background: ${d.colors.text2};
|
|
2279
|
+
color: ${d.colors.softWhite};
|
|
2280
|
+
|
|
2281
|
+
&:hover:not(:disabled) {
|
|
2282
|
+
filter: brightness(1.35);
|
|
2283
|
+
}
|
|
2284
|
+
&:disabled {
|
|
2285
|
+
opacity: 0.55;
|
|
2286
|
+
cursor: default;
|
|
2287
|
+
}
|
|
2288
|
+
`,Gi=m.button`
|
|
2289
|
+
${Oc}
|
|
2290
|
+
background: ${d.colors.accent};
|
|
2291
|
+
color: ${d.colors.softWhite};
|
|
2292
|
+
|
|
2293
|
+
&:hover:not(:disabled) {
|
|
2294
|
+
background: ${d.colors.accentHover};
|
|
2295
|
+
}
|
|
2296
|
+
`,hb=m.span`
|
|
2297
|
+
display: inline-flex;
|
|
2298
|
+
align-items: center;
|
|
2299
|
+
height: 40px;
|
|
2300
|
+
padding: 0 12px;
|
|
2301
|
+
border-radius: 12px;
|
|
2302
|
+
background: ${d.colors.chip};
|
|
2303
|
+
font-family: ${d.font.sans};
|
|
2304
|
+
font-weight: 600;
|
|
2305
|
+
font-size: 13px;
|
|
2306
|
+
line-height: 24px;
|
|
2307
|
+
color: ${d.colors.muted};
|
|
2308
|
+
white-space: nowrap;
|
|
2309
|
+
`,mb=m.div`
|
|
2310
|
+
flex: none;
|
|
2311
|
+
display: flex;
|
|
2312
|
+
align-items: center;
|
|
2313
|
+
justify-content: flex-end;
|
|
2314
|
+
gap: 8px;
|
|
2315
|
+
`,gb=m.p`
|
|
2316
|
+
margin: 0;
|
|
2317
|
+
font-family: ${d.font.sans};
|
|
2318
|
+
font-size: 12px;
|
|
2319
|
+
line-height: 1;
|
|
2320
|
+
color: ${d.colors.gray0};
|
|
2321
|
+
`,Ji=m.button`
|
|
2322
|
+
display: grid;
|
|
2323
|
+
place-items: center;
|
|
2324
|
+
padding: 10px;
|
|
2325
|
+
border: 1px solid ${d.colors.text2};
|
|
2326
|
+
border-radius: 4px;
|
|
2327
|
+
background: ${d.colors.white};
|
|
2328
|
+
color: ${d.colors.text2};
|
|
2329
|
+
cursor: pointer;
|
|
2330
|
+
|
|
2331
|
+
/* One chevron glyph turned into ‹ / › so no extra asset is needed. */
|
|
2332
|
+
.ico {
|
|
2333
|
+
width: 11px;
|
|
2334
|
+
height: 11px;
|
|
2335
|
+
transform: rotate(-90deg);
|
|
2336
|
+
}
|
|
2337
|
+
&[data-dir='prev'] .ico {
|
|
2338
|
+
transform: rotate(90deg);
|
|
2339
|
+
}
|
|
2340
|
+
&:disabled {
|
|
2341
|
+
border-color: ${d.colors.lineStrong};
|
|
2342
|
+
color: ${d.colors.lineStrong};
|
|
2343
|
+
cursor: default;
|
|
2344
|
+
}
|
|
2345
|
+
&:focus-visible {
|
|
2346
|
+
outline: 2px solid ${d.colors.accent};
|
|
2347
|
+
outline-offset: 2px;
|
|
2348
|
+
}
|
|
2349
|
+
`,xb=m.p`
|
|
2350
|
+
margin: 0;
|
|
2351
|
+
padding: 32px 0;
|
|
2352
|
+
font-family: ${d.font.sans};
|
|
2353
|
+
font-size: 14px;
|
|
2354
|
+
line-height: 1.43;
|
|
2355
|
+
color: ${d.colors.muted};
|
|
2356
|
+
text-align: center;
|
|
2357
|
+
`;m.div`
|
|
2358
|
+
display: flex;
|
|
2359
|
+
flex-direction: column;
|
|
2360
|
+
gap: 8px;
|
|
2361
|
+
margin-top: 16px;
|
|
2362
|
+
|
|
2363
|
+
.classic-title {
|
|
2364
|
+
font-family: ${d.font.sans};
|
|
2365
|
+
font-weight: 600;
|
|
2366
|
+
font-size: 15px;
|
|
2367
|
+
color: ${d.colors.text2};
|
|
2368
|
+
}
|
|
2369
|
+
.classic-note {
|
|
2370
|
+
font-family: ${d.font.sans};
|
|
2371
|
+
font-size: 13px;
|
|
2372
|
+
color: ${d.colors.muted};
|
|
2373
|
+
}
|
|
2374
|
+
`;m.span`
|
|
2375
|
+
display: inline-flex;
|
|
2376
|
+
align-items: center;
|
|
2377
|
+
padding: 2px 8px;
|
|
2378
|
+
border-radius: ${d.radius.chip};
|
|
2379
|
+
background: ${d.colors.chip};
|
|
2380
|
+
font-family: ${d.font.sans};
|
|
2381
|
+
font-size: 11px;
|
|
2382
|
+
letter-spacing: 0.4px;
|
|
2383
|
+
text-transform: uppercase;
|
|
2384
|
+
color: ${d.colors.muted};
|
|
2385
|
+
`;m.a`
|
|
2386
|
+
display: inline-flex;
|
|
2387
|
+
align-items: center;
|
|
2388
|
+
gap: 6px;
|
|
2389
|
+
height: 40px;
|
|
2390
|
+
padding: 0 14px;
|
|
2391
|
+
border: 1px solid ${d.colors.lineStrong};
|
|
2392
|
+
border-radius: 12px;
|
|
2393
|
+
color: ${d.colors.accent};
|
|
2394
|
+
font-family: ${d.font.sans};
|
|
2395
|
+
font-weight: 600;
|
|
2396
|
+
font-size: 13px;
|
|
2397
|
+
text-decoration: none;
|
|
2398
|
+
|
|
2399
|
+
&:hover {
|
|
2400
|
+
background: ${d.colors.chip};
|
|
2401
|
+
}
|
|
2402
|
+
.ico {
|
|
2403
|
+
width: 14px;
|
|
2404
|
+
height: 14px;
|
|
2405
|
+
}
|
|
2406
|
+
`;const nr=10,yb=!1;function bb(n){return/^0x[a-fA-F0-9]{40}$/.test(n)?`${n.slice(0,6)}…${n.slice(-4)}`:n}function vb(n){let a=0;for(let t=0;t<n.length;t++)a=a*31+n.charCodeAt(t)>>>0;return`hsl(${a%360}, 52%, 45%)`}function wb(n,a){var t;return(((t=n==null?void 0:n.trim())==null?void 0:t[0])||a.replace(/^0x/i,"")[0]||"?").toUpperCase()}function kb(n){return n%100>=11&&n%100<=13?"th":["th","st","nd","rd"][n%10]??"th"}function Db(n,a){const t=new Date(n);return Number.isNaN(t.getTime())?"—":a==="en"?`${new Intl.DateTimeFormat("en",{month:"long"}).format(t)} ${t.getDate()}${kb(t.getDate())}, ${t.getFullYear()}`:new Intl.DateTimeFormat(a,{day:"numeric",month:"long",year:"numeric"}).format(t)}function Cb(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Sb({r:n,seller:a,issuedId:t,labels:e,locale:r,isOwn:o,isLegacy:i,inCart:c,fallbackImage:l,onAdd:p,onBuyNative:u,onBuyLegacy:h}){var A,N;const x=Ft(),{data:b}=Sr(a),y=(N=(A=b==null?void 0:b.avatar)==null?void 0:A.snapshots)==null?void 0:N.face256,[w,k]=v.useState(!1);v.useEffect(()=>k(!1),[y]);const f=!!y&&!w,C=a?b!=null&&b.name?Mr(b.name):bb(a):void 0,$=f?s.jsx("img",{className:"owner-ava",src:y,alt:"",loading:"lazy",onError:()=>k(!0)}):a?s.jsx("span",{className:"owner-ava",style:{backgroundColor:vb(a)},"aria-hidden":!0,children:wb(b==null?void 0:b.name,a)}):l?s.jsx("img",{className:"owner-ava",src:l,alt:"","aria-hidden":!0}):s.jsx("span",{className:"owner-ava","aria-hidden":!0}),E=s.jsxs(s.Fragment,{children:[$,C?s.jsx("span",{className:"owner-name","data-testid":"resale-seller",children:C}):null]});return s.jsxs("tr",{"data-testid":"resale-row","data-source":n.source,"data-own":o?"true":void 0,children:[s.jsx("td",{"data-label":e.owner,children:a?s.jsx(db,{type:"button",onClick:()=>x(`/items/creator/${a}`),children:E}):s.jsx(lb,{children:E})}),s.jsx("td",{"data-label":e.itemNumber,children:t?s.jsxs("span",{"data-testid":"resale-issued",children:["#",t]}):s.jsx(Xi,{children:"—"})}),s.jsx("td",{"data-label":e.expiration,children:n.saleEndsAt?Db(n.saleEndsAt,r):s.jsx(Xi,{children:"—"})}),s.jsx("td",{"data-label":e.price,children:s.jsxs(ub,{children:[s.jsxs("span",{className:"amount",children:[i?s.jsx("span",{className:"approx","aria-hidden":!0,children:"≈"}):null,s.jsx(Pe,{className:"ccy"}),s.jsx("span",{children:Qe(n.priceCredits)})]}),s.jsx(pb,{"data-persistent":o?"true":void 0,children:o?s.jsx(hb,{"data-testid":"resale-own",children:g("resales.yourListing")}):i?s.jsx(Gi,{onClick:h,"aria-label":g("assetCard.buyNow"),"data-testid":"resale-buy",children:g("resales.buy")}):s.jsxs(s.Fragment,{children:[s.jsxs(fb,{onClick:p,disabled:c,"aria-label":c?g("assetCard.inCart"):g("assetCard.addToCart"),"data-testid":"resale-add",children:[s.jsx(V,{name:"cart",className:"ico"}),s.jsx("span",{children:c?g("assetCard.inCart"):g("resales.add")})]}),s.jsx(Gi,{onClick:u,"aria-label":g("assetCard.buyNow"),"data-testid":"resale-buy",children:g("resales.buy")})]})})]})})]})}function Mb({item:n,onClose:a}){var q;const t=n.contractAddress,e=n.itemId,r=Yt(),o=En(_=>_.add),i=En(_=>_.items),{session:c}=Nt(),l=Ll(_=>_.locale),p=(q=c==null?void 0:c.address)==null?void 0:q.toLowerCase(),u=v.useRef(null),[h,x]=v.useState(null),[b,y]=v.useState(null),[w,k]=v.useState("cheapest"),[f,C]=v.useState(0),$=!!h||!!b;v.useEffect(()=>{var _;(_=u.current)==null||_.focus()},[]),v.useEffect(()=>{function _(me){me.key==="Escape"&&!$&&a()}window.addEventListener("keydown",_);const J=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",_),document.body.style.overflow=J}},[$,a]);const{data:E=[],isLoading:A}=ge({queryKey:["item-resales",t,e],enabled:!!t&&!!e,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>Ns(t,e)}),N=v.useMemo(()=>w==="cheapest"?E:[...E].sort((_,J)=>J.priceCredits-_.priceCredits),[E,w]),S=Math.max(1,Math.ceil(N.length/nr)),D=Math.min(f,S-1),P=N.slice(D*nr,D*nr+nr),I=P.filter(_=>!_.seller||!_.issuedId).map(_=>_.tokenId).filter(_=>!!_),{data:O={}}=ge({queryKey:["resale-token-info",t,I.join(",")],enabled:!!t&&I.length>0,staleTime:6e4,queryFn:()=>Fl(t,I)}),{data:T=[]}=ge({queryKey:["item-classic-orders",t,e],enabled:yb,queryFn:()=>Yl(t,e)}),W=E.some(_=>_.source==="legacy"),{data:z}=$s(W);function U(){r.invalidateQueries({queryKey:["item-resales",t,e]})}const Y={owner:g("resales.colOwner"),itemNumber:g("resales.colItemNumber"),expiration:g("resales.colExpiration"),price:g("resales.colPrice")};return s.jsxs(s.Fragment,{children:[s.jsx(Jy,{onClick:$?void 0:a,role:"presentation",children:s.jsxs(Zy,{ref:u,tabIndex:-1,onClick:_=>_.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("resales.modalTitle"),"data-testid":"resellers-modal",children:[s.jsxs(eb,{children:[s.jsx(tb,{children:g("resales.modalTitle")}),s.jsx(nb,{onClick:a,"aria-label":g("resales.close"),"data-testid":"resellers-close",children:s.jsx(V,{name:"close"})})]}),s.jsxs(rb,{children:[s.jsxs(ab,{children:[s.jsx(ob,{"data-testid":"resales-count",children:g("resales.count",{count:E.length})}),s.jsxs(ib,{children:[s.jsxs("select",{value:w,onChange:_=>{k(_.target.value),C(0)},"aria-label":g("resales.sortLabel"),"data-testid":"resales-sort",children:[s.jsx("option",{value:"cheapest",children:g("resales.sortCheapest")}),s.jsx("option",{value:"most_expensive",children:g("resales.sortExpensive")})]}),s.jsx(V,{name:"chevron-down",className:"chev"})]})]}),A?null:N.length===0?s.jsx(xb,{"data-testid":"resales-empty",children:g("resales.empty")}):null,N.length>0?s.jsxs(s.Fragment,{children:[s.jsx(sb,{children:s.jsxs(cb,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",children:Y.owner}),s.jsx("th",{scope:"col",children:Y.itemNumber}),s.jsx("th",{scope:"col",children:Y.expiration}),s.jsx("th",{scope:"col",children:Y.price})]})}),s.jsx("tbody",{children:P.map(_=>{const J=_.source==="legacy",me=i.some(mt=>mt.id===_.id),ye=_.tokenId&&O[_.tokenId]||{},Ye=_.issuedId??ye.issuedId,Ce=_.seller??ye.seller,ve={..._,name:_.name||n.name,thumbnail:_.thumbnail||n.thumbnail,rarity:_.rarity||n.rarity,category:_.category||n.category,wearableCategory:_.wearableCategory??n.wearableCategory,gender:_.gender??n.gender},ht=!!Ce&&!!p&&Ce.toLowerCase()===p;return s.jsx(Sb,{r:ve,seller:Ce,issuedId:Ye,labels:Y,locale:l,isOwn:ht,isLegacy:J,inCart:me,fallbackImage:ve.thumbnail,onAdd:()=>o(ve,"item_detail"),onBuyNative:()=>x(ve),onBuyLegacy:()=>y(Cb(ve))},_.tradeId??_.id)})})]})}),S>1?s.jsxs(mb,{children:[s.jsx(Ji,{"data-dir":"prev",onClick:()=>C(_=>Math.max(0,_-1)),disabled:D===0,"aria-label":g("resales.prevPage"),"data-testid":"resale-prev-page",children:s.jsx(V,{name:"chevron-down"})}),s.jsx(gb,{"data-testid":"resale-page-label",children:g("resales.page",{page:D+1,total:S})}),s.jsx(Ji,{onClick:()=>C(_=>Math.min(S-1,_+1)),disabled:D>=S-1,"aria-label":g("resales.nextPage"),"data-testid":"resale-next-page",children:s.jsx(V,{name:"chevron-down"})})]}):null]}):null,null]})]})}),h?s.jsx(ya,{item:h,onClose:()=>{x(null),U()}}):null,b&&z?s.jsx($c,{listing:b,rate:z,onClose:()=>y(null),onSold:()=>{y(null),U()}}):null]})}function Wa(){return tn.shopServerUrl||null}function Rc(){return!!Wa()}async function _b(n,a,t){const e=Wa();if(!e)return{subscribed:!1};const r=new URLSearchParams({contractAddress:n,itemId:a}),o=`${e}/notify-requests?${r.toString()}`,i=await Os(o,{method:"GET",identity:t,metadata:{}});if(!i.ok)throw new Error(`getNotifyRequest ${i.status}`);return Ib(i,"getNotifyRequest")}async function Pb(n,a){const t=Wa();if(!t)throw new Error("createNotifyRequest: no shop-server host configured");const e=`${t}/notify-requests`,r=await Os(e,{method:"POST",identity:a,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`createNotifyRequest ${r.status}: ${await r.text()}`);const o=await r.text();if(o.trim()&&!jb(o))throw new Error("createNotifyRequest: response was not JSON")}async function Ib(n,a){try{return await n.json()}catch{throw new Error(`${a}: response was not JSON`)}}function jb(n){try{return JSON.parse(n),!0}catch{return!1}}const{colors:Oe,radius:Ac}=d,Lc=ln`
|
|
2407
|
+
display: flex;
|
|
2408
|
+
flex-direction: column;
|
|
2409
|
+
gap: 8px;
|
|
2410
|
+
width: 100%;
|
|
2411
|
+
`,Eb=m.form`
|
|
2412
|
+
${Lc};
|
|
2413
|
+
`,Zi=m.div`
|
|
2414
|
+
${Lc};
|
|
2415
|
+
|
|
2416
|
+
&[data-done] {
|
|
2417
|
+
flex-direction: row;
|
|
2418
|
+
align-items: center;
|
|
2419
|
+
gap: 16px;
|
|
2420
|
+
padding: 12px;
|
|
2421
|
+
border-radius: 16px;
|
|
2422
|
+
background: rgba(193, 238, 207, 0.5);
|
|
2423
|
+
}
|
|
2424
|
+
`,Tb=m.label`
|
|
2425
|
+
font-size: 14px;
|
|
2426
|
+
color: ${Oe.text};
|
|
2427
|
+
`,$b=m.div`
|
|
2428
|
+
display: flex;
|
|
2429
|
+
align-items: stretch;
|
|
2430
|
+
gap: 8px;
|
|
2431
|
+
`,Nb=m.input`
|
|
2432
|
+
flex: 1;
|
|
2433
|
+
min-width: 0;
|
|
2434
|
+
height: 42px;
|
|
2435
|
+
padding: 0 16px;
|
|
2436
|
+
border: 1px solid ${Oe.muted};
|
|
2437
|
+
border-radius: ${Ac.btn};
|
|
2438
|
+
background: ${Oe.white};
|
|
2439
|
+
font-size: 16px;
|
|
2440
|
+
color: ${Oe.text};
|
|
2441
|
+
|
|
2442
|
+
&::placeholder {
|
|
2443
|
+
color: ${Oe.muted2};
|
|
2444
|
+
}
|
|
2445
|
+
&:focus-visible {
|
|
2446
|
+
outline: none;
|
|
2447
|
+
border-color: ${Oe.accent};
|
|
2448
|
+
box-shadow: 0 0 0 1px ${Oe.accent};
|
|
2449
|
+
}
|
|
2450
|
+
`,es=m.button`
|
|
2451
|
+
flex-shrink: 0;
|
|
2452
|
+
height: 42px;
|
|
2453
|
+
padding: 0 16px;
|
|
2454
|
+
border: 0;
|
|
2455
|
+
border-radius: ${Ac.btn};
|
|
2456
|
+
background: ${Oe.accent};
|
|
2457
|
+
color: ${Oe.softWhite};
|
|
2458
|
+
font-weight: 600;
|
|
2459
|
+
font-size: 15px;
|
|
2460
|
+
text-transform: uppercase;
|
|
2461
|
+
letter-spacing: 0.46px;
|
|
2462
|
+
cursor: pointer;
|
|
2463
|
+
transition: opacity 0.15s ease;
|
|
2464
|
+
|
|
2465
|
+
&[data-full] {
|
|
2466
|
+
width: 100%;
|
|
2467
|
+
flex-shrink: 1;
|
|
2468
|
+
}
|
|
2469
|
+
&:hover:not(:disabled) {
|
|
2470
|
+
opacity: 0.9;
|
|
2471
|
+
}
|
|
2472
|
+
&:disabled {
|
|
2473
|
+
opacity: 0.5;
|
|
2474
|
+
cursor: default;
|
|
2475
|
+
}
|
|
2476
|
+
`,Ob=m.span`
|
|
2477
|
+
display: inline-flex;
|
|
2478
|
+
align-items: center;
|
|
2479
|
+
justify-content: center;
|
|
2480
|
+
flex-shrink: 0;
|
|
2481
|
+
width: 20px;
|
|
2482
|
+
height: 20px;
|
|
2483
|
+
border-radius: 50%;
|
|
2484
|
+
background: #34ce76;
|
|
2485
|
+
color: ${Oe.white};
|
|
2486
|
+
`,Rb=m.span`
|
|
2487
|
+
font-size: 16px;
|
|
2488
|
+
line-height: 1.5;
|
|
2489
|
+
color: ${Oe.text2};
|
|
2490
|
+
`;function ts(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim())}function Ab({item:n}){const a=Nt(k=>k.session),t=Nt(k=>k.signIn),[e,r]=v.useState(""),[o,i]=v.useState(!1),[c,l]=v.useState(!1),[p,u]=v.useState(null),h=Rc(),x=h&&!!a&&!!n.contractAddress&&!!n.itemId,{data:b}=ge({queryKey:["notify-request",n.contractAddress,n.itemId,a==null?void 0:a.address],enabled:x,queryFn:()=>_b(n.contractAddress,n.itemId,a.identity)});v.useEffect(()=>{b!=null&&b.email&&r(k=>k||b.email)},[b==null?void 0:b.email]),v.useEffect(()=>{if(!a||!h)return;let k=!1;return Wl().then(f=>{!k&&f&&r(C=>C||f)}),()=>{k=!0}},[h,a]);const y=c||!!(b!=null&&b.subscribed);async function w(k){if(k.preventDefault(),!(!a||!n.itemId||!ts(e)||o)){i(!0),u(null);try{await Pb({contractAddress:n.contractAddress,itemId:n.itemId,chainId:n.chainId,email:e.trim()},a.identity),l(!0)}catch(f){Te(f,{flow:"notify-me",contractAddress:n.contractAddress,itemId:n.itemId}),u(g("notifyMe.error"))}finally{i(!1)}}}return h?a?y?s.jsxs(Zi,{"data-done":!0,"data-testid":"notify-subscribed",children:[s.jsx(Ob,{"aria-hidden":!0,children:s.jsx(V,{name:"check",size:12})}),s.jsx(Rb,{children:g("notifyMe.subscribedBody")})]}):s.jsxs(Eb,{onSubmit:k=>void w(k),"data-testid":"notify",children:[s.jsx(Tb,{htmlFor:"notify-email",children:g("notifyMe.label")}),s.jsxs($b,{children:[s.jsx(Nb,{id:"notify-email",type:"email",inputMode:"email",autoComplete:"email",placeholder:g("notifyMe.placeholder"),value:e,onChange:k=>r(k.target.value),"data-testid":"notify-email"}),s.jsx(es,{type:"submit",disabled:!ts(e)||o,"data-testid":"notify-submit",children:o?g("notifyMe.working"):g("notifyMe.cta")})]}),s.jsx(dt,{message:p})]}):s.jsx(Zi,{"data-testid":"notify",children:s.jsx(es,{type:"button","data-full":!0,onClick:t,"data-testid":"notify-signin",children:g("notifyMe.signInCta")})}):null}const Fc="shop:recently-viewed",Yc=12;function Lb(){try{const n=localStorage.getItem(Fc);if(!n)return[];const a=JSON.parse(n);return Array.isArray(a)?a.slice(0,Yc):[]}catch{return[]}}function Fb(n){if(n!=null&&n.id)try{const a=[n,...Lb().filter(t=>t.id!==n.id)].slice(0,Yc);localStorage.setItem(Fc,JSON.stringify(a))}catch{}}const Yb=m(Bl)`
|
|
2491
|
+
display: flex;
|
|
2492
|
+
flex-direction: column;
|
|
2493
|
+
overflow: hidden;
|
|
2494
|
+
gap: 1px;
|
|
2495
|
+
background: ${d.colors.lineStrong};
|
|
2496
|
+
|
|
2497
|
+
/* Rows stack; each cell (<img>) covers its share. A single row (≤2 thumbnails, data-full) spans the
|
|
2498
|
+
full height. */
|
|
2499
|
+
& [data-collage-row] {
|
|
2500
|
+
display: flex;
|
|
2501
|
+
flex: 1 1 50%;
|
|
2502
|
+
min-height: 0;
|
|
2503
|
+
gap: 1px;
|
|
2504
|
+
}
|
|
2505
|
+
& [data-collage-row][data-full] {
|
|
2506
|
+
flex-basis: 100%;
|
|
2507
|
+
}
|
|
2508
|
+
& [data-collage-row] img {
|
|
2509
|
+
flex: 1 1 0;
|
|
2510
|
+
min-width: 0;
|
|
2511
|
+
width: 100%;
|
|
2512
|
+
height: 100%;
|
|
2513
|
+
object-fit: cover;
|
|
2514
|
+
display: block;
|
|
2515
|
+
}
|
|
2516
|
+
`;function Wb({contractAddress:n,name:a,items:t,className:e}){const r=Ft();if(!n||!a)return null;const o=(t??[]).map(l=>l.thumbnail).filter(l=>!!l).slice(0,4),i=o.slice(0,2),c=o.slice(2,4);return s.jsxs(Hl,{as:"button","data-link":!0,className:e,"data-testid":"creator",onClick:l=>{l.stopPropagation(),r(`/collection/${n}`)},children:[o.length>0?s.jsxs(Yb,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[s.jsx("span",{"data-collage-row":!0,"data-full":c.length===0||void 0,children:i.map((l,p)=>s.jsx("img",{src:l,alt:""},p))}),c.length>0?s.jsx("span",{"data-collage-row":!0,children:c.map((l,p)=>s.jsx("img",{src:l,alt:""},p))}):null]}):null,s.jsx(zl,{"data-testid":"creator-name",children:Mr(a)})]})}const{colors:R,radius:un,media:De,font:Bb}=d,ns=m.div`
|
|
2517
|
+
max-width: 1721px;
|
|
2518
|
+
margin: 0 auto;
|
|
2519
|
+
|
|
2520
|
+
${De.maxWidth("lg")} {
|
|
2521
|
+
padding-bottom: 88px;
|
|
2522
|
+
}
|
|
2523
|
+
`,Hb=m.nav`
|
|
2524
|
+
display: flex;
|
|
2525
|
+
align-items: center;
|
|
2526
|
+
gap: 8px;
|
|
2527
|
+
font-size: 13px;
|
|
2528
|
+
color: ${R.muted};
|
|
2529
|
+
margin-bottom: 24px;
|
|
2530
|
+
`,zb=m.button`
|
|
2531
|
+
background: none;
|
|
2532
|
+
border: 0;
|
|
2533
|
+
padding: 0;
|
|
2534
|
+
font: inherit;
|
|
2535
|
+
color: ${R.muted};
|
|
2536
|
+
|
|
2537
|
+
&:hover {
|
|
2538
|
+
color: ${R.text};
|
|
2539
|
+
}
|
|
2540
|
+
`,qb=m.span`
|
|
2541
|
+
color: ${R.muted2};
|
|
2542
|
+
`,Kb=m.span`
|
|
2543
|
+
color: ${R.text};
|
|
2544
|
+
font-weight: 600;
|
|
2545
|
+
`,Qb=m.div`
|
|
2546
|
+
display: grid;
|
|
2547
|
+
grid-template-columns: minmax(0, 1045fr) minmax(0, 514fr);
|
|
2548
|
+
gap: 48px;
|
|
2549
|
+
align-items: start;
|
|
2550
|
+
|
|
2551
|
+
${De.maxWidth("lg")} {
|
|
2552
|
+
grid-template-columns: 1fr;
|
|
2553
|
+
gap: 24px;
|
|
2554
|
+
}
|
|
2555
|
+
`,Vb=m.div`
|
|
2556
|
+
position: relative;
|
|
2557
|
+
aspect-ratio: 1045 / 752;
|
|
2558
|
+
border-radius: 16px;
|
|
2559
|
+
overflow: hidden;
|
|
2560
|
+
background: ${R.media};
|
|
2561
|
+
|
|
2562
|
+
${De.maxWidth("lg")} {
|
|
2563
|
+
aspect-ratio: 1 / 1;
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
& iframe,
|
|
2567
|
+
& > * {
|
|
2568
|
+
width: 100%;
|
|
2569
|
+
height: 100%;
|
|
2570
|
+
border: 0;
|
|
2571
|
+
display: block;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
/* Invisible viewport sentinel for the IntersectionObserver that pauses the preview off-screen.
|
|
2575
|
+
Absolute + pointer-events:none so it neither takes layout space (undoing the greedy child sizing
|
|
2576
|
+
above) nor blocks the preview controls. */
|
|
2577
|
+
& > [data-preview-viewport] {
|
|
2578
|
+
position: absolute;
|
|
2579
|
+
inset: 0;
|
|
2580
|
+
pointer-events: none;
|
|
2581
|
+
z-index: 0;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
& > [data-preview-toggle] {
|
|
2585
|
+
position: absolute;
|
|
2586
|
+
top: 16px;
|
|
2587
|
+
left: 16px;
|
|
2588
|
+
z-index: 2;
|
|
2589
|
+
width: auto;
|
|
2590
|
+
height: auto;
|
|
2591
|
+
display: inline-flex;
|
|
2592
|
+
gap: 2px;
|
|
2593
|
+
padding: 3px;
|
|
2594
|
+
background: rgba(255, 255, 255, 0.92);
|
|
2595
|
+
border: 1px solid ${R.line};
|
|
2596
|
+
border-radius: 999px;
|
|
2597
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
& > [data-preview-controls] {
|
|
2601
|
+
position: absolute;
|
|
2602
|
+
bottom: 16px;
|
|
2603
|
+
left: 50%;
|
|
2604
|
+
transform: translateX(-50%);
|
|
2605
|
+
z-index: 2;
|
|
2606
|
+
width: min(360px, 88%);
|
|
2607
|
+
height: auto;
|
|
2608
|
+
display: flex;
|
|
2609
|
+
align-items: center;
|
|
2610
|
+
background: rgba(255, 255, 255, 0.94);
|
|
2611
|
+
backdrop-filter: blur(6px);
|
|
2612
|
+
border: 1px solid ${R.line};
|
|
2613
|
+
border-radius: ${un.pill};
|
|
2614
|
+
padding: 6px 12px;
|
|
2615
|
+
box-shadow: 0 2px 10px rgba(22, 21, 24, 0.12);
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
& > [data-preview-note] {
|
|
2619
|
+
position: absolute;
|
|
2620
|
+
bottom: 14px;
|
|
2621
|
+
left: 50%;
|
|
2622
|
+
transform: translateX(-50%);
|
|
2623
|
+
z-index: 2;
|
|
2624
|
+
width: auto;
|
|
2625
|
+
height: auto;
|
|
2626
|
+
max-width: 88%;
|
|
2627
|
+
margin: 0;
|
|
2628
|
+
text-align: center;
|
|
2629
|
+
background: rgba(22, 21, 24, 0.78);
|
|
2630
|
+
color: ${R.white};
|
|
2631
|
+
font-size: 12px;
|
|
2632
|
+
font-weight: 500;
|
|
2633
|
+
padding: 6px 12px;
|
|
2634
|
+
border-radius: 999px;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
& > [data-preview-loading] {
|
|
2638
|
+
position: absolute;
|
|
2639
|
+
inset: 0;
|
|
2640
|
+
z-index: 1;
|
|
2641
|
+
display: flex;
|
|
2642
|
+
align-items: center;
|
|
2643
|
+
justify-content: center;
|
|
2644
|
+
width: 100%;
|
|
2645
|
+
height: 100%;
|
|
2646
|
+
background: transparent;
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
& > [data-fav-preview] {
|
|
2650
|
+
display: none;
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
/* Bottom-LEFT: the emote controls and the preview note both own the bottom centre, and the mobile
|
|
2654
|
+
wearable/avatar toggle owns the bottom right, so this is the one free corner on every route. */
|
|
2655
|
+
& > [data-play-showcase] {
|
|
2656
|
+
position: absolute;
|
|
2657
|
+
bottom: 16px;
|
|
2658
|
+
left: 16px;
|
|
2659
|
+
z-index: 2;
|
|
2660
|
+
width: auto;
|
|
2661
|
+
height: auto;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
${De.maxWidth("lg")} {
|
|
2665
|
+
& > [data-preview-toggle] {
|
|
2666
|
+
top: auto;
|
|
2667
|
+
left: auto;
|
|
2668
|
+
bottom: 12px;
|
|
2669
|
+
right: 12px;
|
|
2670
|
+
gap: 0;
|
|
2671
|
+
padding: 0;
|
|
2672
|
+
background: transparent;
|
|
2673
|
+
border: 0;
|
|
2674
|
+
box-shadow: 0 1px 4px rgba(22, 21, 24, 0.18);
|
|
2675
|
+
overflow: hidden;
|
|
2676
|
+
}
|
|
2677
|
+
& > [data-fav-preview] {
|
|
2678
|
+
display: grid;
|
|
2679
|
+
position: absolute;
|
|
2680
|
+
top: 12px;
|
|
2681
|
+
right: 12px;
|
|
2682
|
+
z-index: 3;
|
|
2683
|
+
width: 40px;
|
|
2684
|
+
height: 40px;
|
|
2685
|
+
background: rgba(255, 255, 255, 0.92);
|
|
2686
|
+
box-shadow: 0 1px 4px rgba(22, 21, 24, 0.18);
|
|
2687
|
+
}
|
|
2688
|
+
& > [data-fav-preview]:hover {
|
|
2689
|
+
background: ${R.white};
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
`,Ub=m.div``;m.span`
|
|
2693
|
+
position: absolute;
|
|
2694
|
+
inset: 0;
|
|
2695
|
+
width: 100%;
|
|
2696
|
+
height: 100%;
|
|
2697
|
+
border-radius: inherit;
|
|
2698
|
+
`;const Xb=m.div`
|
|
2699
|
+
display: flex;
|
|
2700
|
+
flex-direction: column;
|
|
2701
|
+
gap: 0;
|
|
2702
|
+
`,Gb=m.div`
|
|
2703
|
+
display: flex;
|
|
2704
|
+
align-items: flex-start;
|
|
2705
|
+
justify-content: space-between;
|
|
2706
|
+
gap: 12px;
|
|
2707
|
+
|
|
2708
|
+
${De.maxWidth("lg")} {
|
|
2709
|
+
order: 0;
|
|
2710
|
+
}
|
|
2711
|
+
`,Jb=m.h1`
|
|
2712
|
+
font-size: 28px;
|
|
2713
|
+
font-weight: 600;
|
|
2714
|
+
line-height: 34px;
|
|
2715
|
+
color: ${R.text2};
|
|
2716
|
+
|
|
2717
|
+
${De.maxWidth("lg")} {
|
|
2718
|
+
font-size: 20px;
|
|
2719
|
+
line-height: 24px;
|
|
2720
|
+
}
|
|
2721
|
+
`,rs=m.button`
|
|
2722
|
+
flex: none;
|
|
2723
|
+
width: 40px;
|
|
2724
|
+
height: 40px;
|
|
2725
|
+
border-radius: 50%;
|
|
2726
|
+
border: 0;
|
|
2727
|
+
background: ${R.media};
|
|
2728
|
+
display: grid;
|
|
2729
|
+
place-items: center;
|
|
2730
|
+
color: ${R.text2};
|
|
2731
|
+
cursor: pointer;
|
|
2732
|
+
transition:
|
|
2733
|
+
color 0.12s ease,
|
|
2734
|
+
background 0.12s ease;
|
|
2735
|
+
|
|
2736
|
+
&:hover {
|
|
2737
|
+
background: ${R.line};
|
|
2738
|
+
}
|
|
2739
|
+
&[data-on] {
|
|
2740
|
+
color: ${R.dclRed};
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
${De.maxWidth("lg")} {
|
|
2744
|
+
&[data-fav-title] {
|
|
2745
|
+
display: none;
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
`,Zb=m.button`
|
|
2749
|
+
display: inline-flex;
|
|
2750
|
+
align-items: center;
|
|
2751
|
+
gap: 8px;
|
|
2752
|
+
padding: 8px 14px;
|
|
2753
|
+
border: 1px solid ${R.line};
|
|
2754
|
+
border-radius: ${un.pill};
|
|
2755
|
+
background: rgba(255, 255, 255, 0.94);
|
|
2756
|
+
backdrop-filter: blur(6px);
|
|
2757
|
+
box-shadow: 0 2px 10px rgba(22, 21, 24, 0.12);
|
|
2758
|
+
color: ${R.text};
|
|
2759
|
+
font-size: 13px;
|
|
2760
|
+
font-weight: 600;
|
|
2761
|
+
cursor: pointer;
|
|
2762
|
+
transition: background 0.12s ease;
|
|
2763
|
+
|
|
2764
|
+
&:hover {
|
|
2765
|
+
background: ${R.white};
|
|
2766
|
+
}
|
|
2767
|
+
&:focus-visible {
|
|
2768
|
+
outline: 2px solid ${R.accent};
|
|
2769
|
+
outline-offset: 2px;
|
|
2770
|
+
}
|
|
2771
|
+
`,Ut=m.div`
|
|
2772
|
+
display: inline-flex;
|
|
2773
|
+
align-items: center;
|
|
2774
|
+
gap: 5px;
|
|
2775
|
+
font-size: 12px;
|
|
2776
|
+
font-weight: 500;
|
|
2777
|
+
text-transform: uppercase;
|
|
2778
|
+
letter-spacing: 0;
|
|
2779
|
+
color: ${R.muted};
|
|
2780
|
+
`,ev=m.div`
|
|
2781
|
+
display: flex;
|
|
2782
|
+
align-items: center;
|
|
2783
|
+
gap: 8px;
|
|
2784
|
+
flex-wrap: wrap;
|
|
2785
|
+
margin-top: 12px;
|
|
2786
|
+
|
|
2787
|
+
${De.maxWidth("lg")} {
|
|
2788
|
+
order: 1;
|
|
2789
|
+
margin-top: 10px;
|
|
2790
|
+
}
|
|
2791
|
+
`,ze=m(Es)`
|
|
2792
|
+
height: 24px;
|
|
2793
|
+
padding: 0 8px;
|
|
2794
|
+
gap: 3px;
|
|
2795
|
+
font-size: 13px;
|
|
2796
|
+
font-weight: 500;
|
|
2797
|
+
border-radius: 4px;
|
|
2798
|
+
letter-spacing: 0.02em;
|
|
2799
|
+
text-transform: uppercase;
|
|
2800
|
+
|
|
2801
|
+
&[data-variant='cat'] {
|
|
2802
|
+
background: ${R.chip};
|
|
2803
|
+
color: ${R.text2};
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/* The blocked-VRM-export badge. Warning orange, tinted at 20% for the fill — the marketplace's own
|
|
2807
|
+
#ff7439 on #ff743933, kept identical so the same restriction reads the same in both places. It is the
|
|
2808
|
+
one chip in this row that reports a limitation rather than a feature, and it should not blend in. */
|
|
2809
|
+
&[data-variant='blocked'] {
|
|
2810
|
+
background: rgba(255, 116, 57, 0.2);
|
|
2811
|
+
color: #ff7439;
|
|
2812
|
+
cursor: help;
|
|
2813
|
+
}
|
|
2814
|
+
&[data-variant='blocked']:focus-visible {
|
|
2815
|
+
outline: 2px solid #ff7439;
|
|
2816
|
+
outline-offset: 2px;
|
|
2817
|
+
}
|
|
2818
|
+
`,tv=m.div`
|
|
2819
|
+
display: flex;
|
|
2820
|
+
flex-direction: column;
|
|
2821
|
+
align-items: flex-start;
|
|
2822
|
+
gap: 8px;
|
|
2823
|
+
`,Ca=m(tv)`
|
|
2824
|
+
gap: 11px;
|
|
2825
|
+
`,as=m.p`
|
|
2826
|
+
margin: 0;
|
|
2827
|
+
color: ${R.text2};
|
|
2828
|
+
font-size: 14px;
|
|
2829
|
+
line-height: 30px;
|
|
2830
|
+
display: -webkit-box;
|
|
2831
|
+
-webkit-box-orient: vertical;
|
|
2832
|
+
-webkit-line-clamp: 4;
|
|
2833
|
+
overflow: hidden;
|
|
2834
|
+
|
|
2835
|
+
&[data-expanded] {
|
|
2836
|
+
-webkit-line-clamp: unset;
|
|
2837
|
+
overflow: visible;
|
|
2838
|
+
}
|
|
2839
|
+
`,nv=m.button`
|
|
2840
|
+
font-size: 13px;
|
|
2841
|
+
align-self: flex-start;
|
|
2842
|
+
`,Wc=ln`
|
|
2843
|
+
display: grid;
|
|
2844
|
+
grid-template-columns: 1fr 1fr;
|
|
2845
|
+
gap: 16px;
|
|
2846
|
+
`,Bc=m.div`
|
|
2847
|
+
${Wc};
|
|
2848
|
+
/* Clears the chips above. The pair below sits at 32px, so this is the tighter of the two steps: the
|
|
2849
|
+
description belongs to the heading block it follows, the creator/collection pair is a new subject. */
|
|
2850
|
+
margin-top: 24px;
|
|
2851
|
+
|
|
2852
|
+
${De.maxWidth("lg")} {
|
|
2853
|
+
order: 3;
|
|
2854
|
+
grid-template-columns: 1fr;
|
|
2855
|
+
/* Stacked, the two blocks need real separation — as one column they would read as one paragraph. */
|
|
2856
|
+
gap: 20px;
|
|
2857
|
+
margin-top: 20px;
|
|
2858
|
+
}
|
|
2859
|
+
`,Sa=m.div`
|
|
2860
|
+
min-width: 0;
|
|
2861
|
+
`,Hc=m.div`
|
|
2862
|
+
${Wc};
|
|
2863
|
+
margin-top: 32px;
|
|
2864
|
+
|
|
2865
|
+
${De.maxWidth("lg")} {
|
|
2866
|
+
order: 2;
|
|
2867
|
+
margin-top: 20px;
|
|
2868
|
+
}
|
|
2869
|
+
`,In=m.div`
|
|
2870
|
+
display: flex;
|
|
2871
|
+
flex-direction: column;
|
|
2872
|
+
gap: 15px;
|
|
2873
|
+
min-width: 0;
|
|
2874
|
+
|
|
2875
|
+
&[data-collection] {
|
|
2876
|
+
align-items: flex-start;
|
|
2877
|
+
}
|
|
2878
|
+
`,zc=ln`
|
|
2879
|
+
&[data-testid='creator'] {
|
|
2880
|
+
color: ${R.accent};
|
|
2881
|
+
font-size: 14px;
|
|
2882
|
+
gap: 12px;
|
|
2883
|
+
}
|
|
2884
|
+
[data-avatar] {
|
|
2885
|
+
width: 48px;
|
|
2886
|
+
height: 48px;
|
|
2887
|
+
}
|
|
2888
|
+
[data-letter] {
|
|
2889
|
+
font-size: 18px;
|
|
2890
|
+
}
|
|
2891
|
+
[data-testid='creator-name'] {
|
|
2892
|
+
color: ${R.accent};
|
|
2893
|
+
font-weight: 500;
|
|
2894
|
+
text-decoration: underline;
|
|
2895
|
+
}
|
|
2896
|
+
&[data-link]:hover [data-testid='creator-name'] {
|
|
2897
|
+
color: ${R.brandViolet};
|
|
2898
|
+
}
|
|
2899
|
+
`,rv=m(ql)`
|
|
2900
|
+
${zc}
|
|
2901
|
+
`,av=m(Wb)`
|
|
2902
|
+
${zc}
|
|
2903
|
+
`,qc=m.hr`
|
|
2904
|
+
border: 0;
|
|
2905
|
+
border-top: 1px solid ${R.gray4};
|
|
2906
|
+
margin: 24px 0 0;
|
|
2907
|
+
width: 100%;
|
|
2908
|
+
|
|
2909
|
+
${De.maxWidth("lg")} {
|
|
2910
|
+
order: 4;
|
|
2911
|
+
margin-top: 20px;
|
|
2912
|
+
}
|
|
2913
|
+
`,ov=m.div`
|
|
2914
|
+
margin-top: 16px;
|
|
2915
|
+
|
|
2916
|
+
${De.maxWidth("lg")} {
|
|
2917
|
+
order: 5;
|
|
2918
|
+
margin-top: 16px;
|
|
2919
|
+
}
|
|
2920
|
+
`,iv=m.div`
|
|
2921
|
+
display: flex;
|
|
2922
|
+
align-items: flex-start;
|
|
2923
|
+
gap: 16px;
|
|
2924
|
+
width: 100%;
|
|
2925
|
+
`,sv=m.div`
|
|
2926
|
+
flex: 1 1 auto;
|
|
2927
|
+
min-width: 0;
|
|
2928
|
+
display: flex;
|
|
2929
|
+
flex-direction: column;
|
|
2930
|
+
gap: 8px;
|
|
2931
|
+
`,os=m.div`
|
|
2932
|
+
flex: 0 0 auto;
|
|
2933
|
+
display: flex;
|
|
2934
|
+
flex-direction: column;
|
|
2935
|
+
align-items: flex-end;
|
|
2936
|
+
gap: 8px;
|
|
2937
|
+
text-align: right;
|
|
2938
|
+
`,is=m.div`
|
|
2939
|
+
font-size: 18px;
|
|
2940
|
+
font-weight: 500;
|
|
2941
|
+
line-height: 1;
|
|
2942
|
+
color: ${R.text2};
|
|
2943
|
+
|
|
2944
|
+
&[data-out] {
|
|
2945
|
+
font-size: 14px;
|
|
2946
|
+
font-weight: 600;
|
|
2947
|
+
text-transform: uppercase;
|
|
2948
|
+
letter-spacing: 0.02em;
|
|
2949
|
+
color: ${R.muted1};
|
|
2950
|
+
}
|
|
2951
|
+
`,ss=m.div`
|
|
2952
|
+
font-size: 14px;
|
|
2953
|
+
font-weight: 600;
|
|
2954
|
+
text-transform: uppercase;
|
|
2955
|
+
letter-spacing: 0;
|
|
2956
|
+
color: ${R.muted1};
|
|
2957
|
+
`,Xt=m.div`
|
|
2958
|
+
display: flex;
|
|
2959
|
+
align-items: center;
|
|
2960
|
+
gap: 10px;
|
|
2961
|
+
font-weight: 700;
|
|
2962
|
+
color: ${R.text};
|
|
2963
|
+
|
|
2964
|
+
/* Not for sale: "Not for Sale" + an info tooltip, 14px semibold, no PRICE label. */
|
|
2965
|
+
&[data-variant='none'] {
|
|
2966
|
+
display: inline-flex;
|
|
2967
|
+
align-items: center;
|
|
2968
|
+
gap: 6px;
|
|
2969
|
+
font-size: 14px;
|
|
2970
|
+
font-weight: 600;
|
|
2971
|
+
color: ${R.text};
|
|
2972
|
+
}
|
|
2973
|
+
&[data-variant='sale'] {
|
|
2974
|
+
flex-wrap: wrap;
|
|
2975
|
+
gap: 10px 14px;
|
|
2976
|
+
color: ${R.dclRed};
|
|
2977
|
+
}
|
|
2978
|
+
`;m.span`
|
|
2979
|
+
display: flex;
|
|
2980
|
+
align-items: center;
|
|
2981
|
+
gap: 10px;
|
|
2982
|
+
font-weight: 700;
|
|
2983
|
+
color: ${R.dclRed};
|
|
2984
|
+
`;const Sn=m.span`
|
|
2985
|
+
font-size: 30px;
|
|
2986
|
+
line-height: 1;
|
|
2987
|
+
`,cv=m.span`
|
|
2988
|
+
display: inline-flex;
|
|
2989
|
+
color: ${R.muted2};
|
|
2990
|
+
cursor: help;
|
|
2991
|
+
|
|
2992
|
+
&:focus-visible {
|
|
2993
|
+
outline: 2px solid ${R.accent};
|
|
2994
|
+
outline-offset: 2px;
|
|
2995
|
+
border-radius: ${un.chip};
|
|
2996
|
+
}
|
|
2997
|
+
`,lv=m.span`
|
|
2998
|
+
font-size: 24px;
|
|
2999
|
+
font-weight: 700;
|
|
3000
|
+
color: ${R.text};
|
|
3001
|
+
margin-right: -2px;
|
|
3002
|
+
`,dv=m.div`
|
|
3003
|
+
font-size: 13px;
|
|
3004
|
+
margin-top: 6px;
|
|
3005
|
+
`,uv=m.span`
|
|
3006
|
+
display: inline-flex;
|
|
3007
|
+
align-items: center;
|
|
3008
|
+
gap: 6px;
|
|
3009
|
+
color: ${R.muted};
|
|
3010
|
+
text-decoration: line-through;
|
|
3011
|
+
font-weight: 600;
|
|
3012
|
+
font-size: 20px;
|
|
3013
|
+
`,pv=m.span`
|
|
3014
|
+
display: inline-flex;
|
|
3015
|
+
align-items: center;
|
|
3016
|
+
background: ${R.dclRed};
|
|
3017
|
+
color: ${R.white};
|
|
3018
|
+
font-weight: 800;
|
|
3019
|
+
font-size: 13px;
|
|
3020
|
+
letter-spacing: 0.03em;
|
|
3021
|
+
text-transform: uppercase;
|
|
3022
|
+
border-radius: 6px;
|
|
3023
|
+
padding: 4px 10px;
|
|
3024
|
+
`,fv=m(Kl)`
|
|
3025
|
+
display: inline-flex;
|
|
3026
|
+
align-items: center;
|
|
3027
|
+
gap: 5px;
|
|
3028
|
+
background: ${R.rarityBg};
|
|
3029
|
+
color: ${R.accent};
|
|
3030
|
+
font-size: 13px;
|
|
3031
|
+
font-weight: 700;
|
|
3032
|
+
border-radius: 6px;
|
|
3033
|
+
padding: 4px 10px;
|
|
3034
|
+
white-space: nowrap;
|
|
3035
|
+
`,hv=m.div`
|
|
3036
|
+
display: flex;
|
|
3037
|
+
flex-direction: column;
|
|
3038
|
+
gap: 12px;
|
|
3039
|
+
margin-top: 20px;
|
|
3040
|
+
|
|
3041
|
+
${De.maxWidth("lg")} {
|
|
3042
|
+
order: 6;
|
|
3043
|
+
|
|
3044
|
+
&[data-buttons] {
|
|
3045
|
+
position: fixed;
|
|
3046
|
+
left: 0;
|
|
3047
|
+
right: 0;
|
|
3048
|
+
bottom: 0;
|
|
3049
|
+
z-index: 40;
|
|
3050
|
+
margin-top: 0;
|
|
3051
|
+
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
|
|
3052
|
+
background: ${R.softWhite};
|
|
3053
|
+
box-shadow: 0 -4px 16px rgba(22, 21, 24, 0.12);
|
|
3054
|
+
}
|
|
3055
|
+
&[data-dual] {
|
|
3056
|
+
flex-direction: row;
|
|
3057
|
+
align-items: stretch;
|
|
3058
|
+
gap: 12px;
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
`,Ba=ln`
|
|
3062
|
+
&& {
|
|
3063
|
+
width: 100%;
|
|
3064
|
+
height: 48px;
|
|
3065
|
+
border-radius: 16px;
|
|
3066
|
+
padding: 0 12px;
|
|
3067
|
+
display: flex;
|
|
3068
|
+
align-items: center;
|
|
3069
|
+
justify-content: center;
|
|
3070
|
+
gap: 8px;
|
|
3071
|
+
font-size: 15px;
|
|
3072
|
+
font-weight: 600;
|
|
3073
|
+
line-height: 24px;
|
|
3074
|
+
letter-spacing: 0.46px;
|
|
3075
|
+
text-transform: uppercase;
|
|
3076
|
+
}
|
|
3077
|
+
`,la=m(Rn)`
|
|
3078
|
+
${Ba};
|
|
3079
|
+
|
|
3080
|
+
${De.maxWidth("lg")} {
|
|
3081
|
+
[data-dual] && {
|
|
3082
|
+
flex: 1 1 auto;
|
|
3083
|
+
width: auto;
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
`,cs=m(Rn)`
|
|
3087
|
+
${Ba};
|
|
3088
|
+
&& {
|
|
3089
|
+
background: ${R.blackBtn};
|
|
3090
|
+
color: ${R.softWhite};
|
|
3091
|
+
border: 0;
|
|
3092
|
+
|
|
3093
|
+
.ico {
|
|
3094
|
+
width: 20px;
|
|
3095
|
+
height: 20px;
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
&&:hover:not(:disabled) {
|
|
3099
|
+
background: ${R.blackBtn};
|
|
3100
|
+
filter: brightness(1.35);
|
|
3101
|
+
}
|
|
3102
|
+
`,mv=m.button`
|
|
3103
|
+
align-self: center;
|
|
3104
|
+
border: 0;
|
|
3105
|
+
background: none;
|
|
3106
|
+
padding: 8px 0;
|
|
3107
|
+
color: ${d.colors.accent};
|
|
3108
|
+
font-weight: 600;
|
|
3109
|
+
font-size: 13px;
|
|
3110
|
+
line-height: 24px;
|
|
3111
|
+
letter-spacing: 0.46px;
|
|
3112
|
+
text-transform: uppercase;
|
|
3113
|
+
text-decoration: underline;
|
|
3114
|
+
cursor: pointer;
|
|
3115
|
+
|
|
3116
|
+
&:disabled {
|
|
3117
|
+
opacity: 0.5;
|
|
3118
|
+
cursor: default;
|
|
3119
|
+
}
|
|
3120
|
+
`,ls=m(Rn)`
|
|
3121
|
+
${Ba};
|
|
3122
|
+
&& {
|
|
3123
|
+
background: transparent;
|
|
3124
|
+
border: 2px solid ${R.blackBtn};
|
|
3125
|
+
color: ${R.text};
|
|
3126
|
+
}
|
|
3127
|
+
&&:hover:not(:disabled) {
|
|
3128
|
+
background: rgba(36, 33, 41, 0.06);
|
|
3129
|
+
}
|
|
3130
|
+
`,da=m.span`
|
|
3131
|
+
display: none;
|
|
3132
|
+
align-items: center;
|
|
3133
|
+
gap: 6px;
|
|
3134
|
+
|
|
3135
|
+
${De.maxWidth("lg")} {
|
|
3136
|
+
[data-dual] & {
|
|
3137
|
+
display: inline-flex;
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
`,ds=m.button`
|
|
3141
|
+
width: 100%;
|
|
3142
|
+
height: 48px;
|
|
3143
|
+
display: flex;
|
|
3144
|
+
align-items: center;
|
|
3145
|
+
justify-content: center;
|
|
3146
|
+
gap: 8px;
|
|
3147
|
+
background: ${R.blackBtn};
|
|
3148
|
+
color: ${R.softWhite};
|
|
3149
|
+
border: 0;
|
|
3150
|
+
border-radius: 16px;
|
|
3151
|
+
font-weight: 600;
|
|
3152
|
+
font-size: 15px;
|
|
3153
|
+
text-transform: uppercase;
|
|
3154
|
+
letter-spacing: 0.46px;
|
|
3155
|
+
cursor: pointer;
|
|
3156
|
+
transition: background 0.15s ease;
|
|
3157
|
+
|
|
3158
|
+
/* Hover is the design's gray-0, not a brightness lift. */
|
|
3159
|
+
&:hover:not(:disabled) {
|
|
3160
|
+
background: ${R.gray0};
|
|
3161
|
+
}
|
|
3162
|
+
&:disabled {
|
|
3163
|
+
opacity: 0.55;
|
|
3164
|
+
cursor: default;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
${De.maxWidth("lg")} {
|
|
3168
|
+
[data-dual] & {
|
|
3169
|
+
flex: 0 0 auto;
|
|
3170
|
+
width: 56px;
|
|
3171
|
+
padding: 0;
|
|
3172
|
+
}
|
|
3173
|
+
[data-dual] & .ico {
|
|
3174
|
+
margin: 0;
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
`,us=m.span`
|
|
3178
|
+
${De.maxWidth("lg")} {
|
|
3179
|
+
[data-dual] & {
|
|
3180
|
+
display: none;
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
`,gv=m.p`
|
|
3184
|
+
margin: 12px 0 0;
|
|
3185
|
+
font-size: 13px;
|
|
3186
|
+
color: ${R.muted};
|
|
3187
|
+
|
|
3188
|
+
& a {
|
|
3189
|
+
color: ${R.accent};
|
|
3190
|
+
font-weight: 600;
|
|
3191
|
+
}
|
|
3192
|
+
`,xv=m.p`
|
|
3193
|
+
margin: 4px 0 0;
|
|
3194
|
+
font-size: 13px;
|
|
3195
|
+
color: ${R.muted};
|
|
3196
|
+
|
|
3197
|
+
& a {
|
|
3198
|
+
color: ${R.accent};
|
|
3199
|
+
font-weight: 600;
|
|
3200
|
+
}
|
|
3201
|
+
`;m.div`
|
|
3202
|
+
max-width: 1721px;
|
|
3203
|
+
margin: 0 auto;
|
|
3204
|
+
min-height: 46vh;
|
|
3205
|
+
display: flex;
|
|
3206
|
+
flex-direction: column;
|
|
3207
|
+
align-items: center;
|
|
3208
|
+
justify-content: center;
|
|
3209
|
+
text-align: center;
|
|
3210
|
+
gap: 14px;
|
|
3211
|
+
`;const yv=m(Rn)`
|
|
3212
|
+
margin-top: 6px;
|
|
3213
|
+
`,bv=m(V)`
|
|
3214
|
+
opacity: 0.4;
|
|
3215
|
+
`,vv=m.h1`
|
|
3216
|
+
font-size: 22px;
|
|
3217
|
+
`,wv=m.div`
|
|
3218
|
+
display: flex;
|
|
3219
|
+
flex-direction: column;
|
|
3220
|
+
`,ps=m.span`
|
|
3221
|
+
display: block;
|
|
3222
|
+
height: 15px;
|
|
3223
|
+
width: 84px;
|
|
3224
|
+
border-radius: 4px;
|
|
3225
|
+
`,kv=m.div`
|
|
3226
|
+
display: flex;
|
|
3227
|
+
flex-direction: column;
|
|
3228
|
+
align-self: stretch;
|
|
3229
|
+
gap: 16px;
|
|
3230
|
+
padding: 8px 0;
|
|
3231
|
+
`,Dv=m.span`
|
|
3232
|
+
display: inline-flex;
|
|
3233
|
+
align-items: center;
|
|
3234
|
+
height: 48px;
|
|
3235
|
+
gap: 10px;
|
|
3236
|
+
background: none !important;
|
|
3237
|
+
|
|
3238
|
+
&::before,
|
|
3239
|
+
&::after {
|
|
3240
|
+
content: '';
|
|
3241
|
+
display: block;
|
|
3242
|
+
}
|
|
3243
|
+
&::before {
|
|
3244
|
+
width: 40px;
|
|
3245
|
+
height: 40px;
|
|
3246
|
+
border-radius: 50%;
|
|
3247
|
+
background: ${R.media};
|
|
3248
|
+
}
|
|
3249
|
+
&::after {
|
|
3250
|
+
width: 96px;
|
|
3251
|
+
height: 14px;
|
|
3252
|
+
border-radius: 6px;
|
|
3253
|
+
background: ${R.media};
|
|
3254
|
+
}
|
|
3255
|
+
`,Cv=m.span`
|
|
3256
|
+
height: 34px;
|
|
3257
|
+
width: 70%;
|
|
3258
|
+
margin: 3px 0;
|
|
3259
|
+
border-radius: 8px;
|
|
3260
|
+
`,Sv=m.div`
|
|
3261
|
+
display: flex;
|
|
3262
|
+
gap: 8px;
|
|
3263
|
+
/* Same as Chips above, so the row does not move when the real chips arrive. */
|
|
3264
|
+
margin-top: 12px;
|
|
3265
|
+
`,ua=m.span`
|
|
3266
|
+
height: 24px;
|
|
3267
|
+
width: 88px;
|
|
3268
|
+
border-radius: 6px;
|
|
3269
|
+
`,pa=m.span`
|
|
3270
|
+
height: 14px;
|
|
3271
|
+
width: 100%;
|
|
3272
|
+
border-radius: 6px;
|
|
3273
|
+
|
|
3274
|
+
&[data-short] {
|
|
3275
|
+
width: 55%;
|
|
3276
|
+
}
|
|
3277
|
+
`,Mv=m.span`
|
|
3278
|
+
display: block;
|
|
3279
|
+
height: 30px;
|
|
3280
|
+
width: 40%;
|
|
3281
|
+
margin: 16px 0 13px;
|
|
3282
|
+
border-radius: 8px;
|
|
3283
|
+
`,_v=m.span`
|
|
3284
|
+
display: block;
|
|
3285
|
+
height: 42px;
|
|
3286
|
+
width: 100%;
|
|
3287
|
+
border-radius: 8px;
|
|
3288
|
+
margin-top: 20px;
|
|
3289
|
+
`,Mn=m(Pe)`
|
|
3290
|
+
width: 30px;
|
|
3291
|
+
height: 30px;
|
|
3292
|
+
color: ${R.text};
|
|
3293
|
+
|
|
3294
|
+
&[data-was] {
|
|
3295
|
+
width: 20px;
|
|
3296
|
+
height: 20px;
|
|
3297
|
+
color: ${R.muted};
|
|
3298
|
+
}
|
|
3299
|
+
`,fa=m(Pe)`
|
|
3300
|
+
width: 20px;
|
|
3301
|
+
height: 20px;
|
|
3302
|
+
`,Pv=m.div`
|
|
3303
|
+
display: flex;
|
|
3304
|
+
align-items: center;
|
|
3305
|
+
justify-content: space-between;
|
|
3306
|
+
gap: 8px;
|
|
3307
|
+
padding: 8px;
|
|
3308
|
+
margin: 16px 0;
|
|
3309
|
+
border-radius: ${un.btn};
|
|
3310
|
+
background: #f4e9ff;
|
|
3311
|
+
`,Iv=m.span`
|
|
3312
|
+
display: flex;
|
|
3313
|
+
align-items: center;
|
|
3314
|
+
gap: 8px;
|
|
3315
|
+
font-size: 14px;
|
|
3316
|
+
line-height: 14px;
|
|
3317
|
+
color: ${R.text};
|
|
3318
|
+
`,jv=m(V)`
|
|
3319
|
+
width: 20px;
|
|
3320
|
+
height: 20px;
|
|
3321
|
+
color: ${R.rarity};
|
|
3322
|
+
`,Ev=m(V)`
|
|
3323
|
+
width: 24px;
|
|
3324
|
+
height: 24px;
|
|
3325
|
+
color: ${R.rarity};
|
|
3326
|
+
`,Tv=m.div`
|
|
3327
|
+
display: flex;
|
|
3328
|
+
align-items: center;
|
|
3329
|
+
justify-content: space-between;
|
|
3330
|
+
gap: 8px;
|
|
3331
|
+
width: 100%;
|
|
3332
|
+
margin-top: 16px;
|
|
3333
|
+
|
|
3334
|
+
&[data-centered] {
|
|
3335
|
+
justify-content: center;
|
|
3336
|
+
}
|
|
3337
|
+
`,$v=m.span`
|
|
3338
|
+
display: flex;
|
|
3339
|
+
align-items: center;
|
|
3340
|
+
gap: 2px;
|
|
3341
|
+
font-size: 14px;
|
|
3342
|
+
font-weight: 600;
|
|
3343
|
+
color: ${R.muted};
|
|
3344
|
+
|
|
3345
|
+
& .ico {
|
|
3346
|
+
width: 20px;
|
|
3347
|
+
height: 20px;
|
|
3348
|
+
color: ${R.muted};
|
|
3349
|
+
}
|
|
3350
|
+
`,Nv=m.span`
|
|
3351
|
+
font-size: 16px;
|
|
3352
|
+
font-weight: 700;
|
|
3353
|
+
padding-left: 2px;
|
|
3354
|
+
`,fs=m.button`
|
|
3355
|
+
border: 0;
|
|
3356
|
+
background: none;
|
|
3357
|
+
padding: 0;
|
|
3358
|
+
cursor: pointer;
|
|
3359
|
+
font-family: ${Bb.sans};
|
|
3360
|
+
font-size: 13px;
|
|
3361
|
+
font-weight: 600;
|
|
3362
|
+
letter-spacing: 0.46px;
|
|
3363
|
+
text-transform: uppercase;
|
|
3364
|
+
text-decoration: underline;
|
|
3365
|
+
color: ${R.accent};
|
|
3366
|
+
|
|
3367
|
+
&:hover {
|
|
3368
|
+
color: ${R.accentHover};
|
|
3369
|
+
}
|
|
3370
|
+
&:focus-visible {
|
|
3371
|
+
outline: 2px solid ${R.accent};
|
|
3372
|
+
outline-offset: 2px;
|
|
3373
|
+
border-radius: ${un.chip};
|
|
3374
|
+
}
|
|
3375
|
+
`,Ov=m.div`
|
|
3376
|
+
display: flex;
|
|
3377
|
+
flex-direction: column;
|
|
3378
|
+
gap: 16px;
|
|
3379
|
+
width: 100%;
|
|
3380
|
+
padding: 16px 0;
|
|
3381
|
+
`,hs=m.div`
|
|
3382
|
+
display: flex;
|
|
3383
|
+
align-items: center;
|
|
3384
|
+
justify-content: space-between;
|
|
3385
|
+
gap: 8px;
|
|
3386
|
+
width: 100%;
|
|
3387
|
+
|
|
3388
|
+
&[data-variant='original'] {
|
|
3389
|
+
color: ${R.muted2};
|
|
3390
|
+
}
|
|
3391
|
+
`,ms=m.span`
|
|
3392
|
+
display: flex;
|
|
3393
|
+
align-items: center;
|
|
3394
|
+
gap: 4px;
|
|
3395
|
+
font-size: 14px;
|
|
3396
|
+
font-weight: 600;
|
|
3397
|
+
|
|
3398
|
+
[data-variant='original'] & {
|
|
3399
|
+
color: ${R.muted2};
|
|
3400
|
+
}
|
|
3401
|
+
[data-variant='resale'] & {
|
|
3402
|
+
color: ${R.text};
|
|
3403
|
+
}
|
|
3404
|
+
`,gs=m.span`
|
|
3405
|
+
display: flex;
|
|
3406
|
+
align-items: center;
|
|
3407
|
+
gap: 2px;
|
|
3408
|
+
padding: 0 2px;
|
|
3409
|
+
|
|
3410
|
+
[data-variant='original'] & .ico {
|
|
3411
|
+
width: 20px;
|
|
3412
|
+
height: 20px;
|
|
3413
|
+
color: ${R.muted2};
|
|
3414
|
+
}
|
|
3415
|
+
[data-variant='resale'] & .ico {
|
|
3416
|
+
width: 24px;
|
|
3417
|
+
height: 24px;
|
|
3418
|
+
color: ${R.rarity};
|
|
3419
|
+
}
|
|
3420
|
+
`,xs=m.span`
|
|
3421
|
+
[data-variant='original'] & {
|
|
3422
|
+
font-size: 16px;
|
|
3423
|
+
font-weight: 700;
|
|
3424
|
+
text-decoration: line-through;
|
|
3425
|
+
}
|
|
3426
|
+
[data-variant='resale'] & {
|
|
3427
|
+
font-size: 25px;
|
|
3428
|
+
font-weight: 700;
|
|
3429
|
+
color: ${R.text};
|
|
3430
|
+
}
|
|
3431
|
+
`,Rv=m.span`
|
|
3432
|
+
font-size: 14px;
|
|
3433
|
+
font-weight: 600;
|
|
3434
|
+
|
|
3435
|
+
[data-variant='original'] & {
|
|
3436
|
+
color: ${R.muted2};
|
|
3437
|
+
}
|
|
3438
|
+
`,Av=m.span`
|
|
3439
|
+
font-size: 14px;
|
|
3440
|
+
font-weight: 600;
|
|
3441
|
+
color: ${R.text2};
|
|
3442
|
+
`,ys=m.span`
|
|
3443
|
+
display: inline-flex;
|
|
3444
|
+
width: 12px;
|
|
3445
|
+
height: 12px;
|
|
3446
|
+
color: ${R.muted2};
|
|
3447
|
+
`,Lv=m.div`
|
|
3448
|
+
display: flex;
|
|
3449
|
+
flex-direction: column;
|
|
3450
|
+
gap: 12px;
|
|
3451
|
+
width: 100%;
|
|
3452
|
+
`,Fv=m.div`
|
|
3453
|
+
display: flex;
|
|
3454
|
+
justify-content: center;
|
|
3455
|
+
`,Lr=ln`
|
|
3456
|
+
display: block;
|
|
3457
|
+
background: linear-gradient(100deg, #efeef2 30%, #e2e0e7 50%, #efeef2 70%);
|
|
3458
|
+
background-size: 200% 100%;
|
|
3459
|
+
animation: shimmer 1.4s infinite linear;
|
|
3460
|
+
|
|
3461
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3462
|
+
animation: none;
|
|
3463
|
+
}
|
|
3464
|
+
`,Yv=m.div`
|
|
3465
|
+
display: flex;
|
|
3466
|
+
flex-direction: column;
|
|
3467
|
+
gap: 12px;
|
|
3468
|
+
width: 100%;
|
|
3469
|
+
/* Reserve the divider→CTA rhythm so the block is the same height loading vs loaded. */
|
|
3470
|
+
padding-top: 4px;
|
|
3471
|
+
`,Wv=m.span`
|
|
3472
|
+
${Lr};
|
|
3473
|
+
width: 120px;
|
|
3474
|
+
height: 30px;
|
|
3475
|
+
border-radius: ${un.btn};
|
|
3476
|
+
margin-bottom: 4px;
|
|
3477
|
+
`,bs=m.span`
|
|
3478
|
+
${Lr};
|
|
3479
|
+
width: 100%;
|
|
3480
|
+
height: 48px;
|
|
3481
|
+
border-radius: 16px;
|
|
3482
|
+
`,vs=m.div`
|
|
3483
|
+
display: flex;
|
|
3484
|
+
align-items: center;
|
|
3485
|
+
gap: 12px;
|
|
3486
|
+
`,ws=m.span`
|
|
3487
|
+
${Lr};
|
|
3488
|
+
flex: none;
|
|
3489
|
+
width: 48px;
|
|
3490
|
+
height: 48px;
|
|
3491
|
+
border-radius: 50%;
|
|
3492
|
+
`,ks=m.span`
|
|
3493
|
+
${Lr};
|
|
3494
|
+
width: 96px;
|
|
3495
|
+
height: 16px;
|
|
3496
|
+
border-radius: 6px;
|
|
3497
|
+
`;function Bv(n){return Object.values(Re.Rarity).includes(n)}function Hv(n){return n==="male"?g("itemDetail.genderMale"):n==="female"?g("itemDetail.genderFemale"):n==="unisex"?g("itemDetail.genderUnisex"):null}function Ds(n){return n.wearableCategory?n.wearableCategory.replace(/_/g," "):n.category==="emote"?g("itemDetail.categoryEmote"):g("itemDetail.categoryWearable")}function gw(){var mo;const{contractAddress:n,itemId:a,tokenId:t}=xl(),e=!!t,r=a??Rp(t)??null,o=yl(),i=o.state,c=Ft(),l=!!(i!=null&&i.market),p=(i==null?void 0:i.marketPriceCredits)??null,u=Yt(),h=En(j=>j.add),x=En(j=>j.items),b=Ql(j=>j.toggle),{session:y,signIn:w}=Nt(),k=Ar(y),[f,C]=v.useState(()=>{if(i!=null&&i.item){const j={...i.item,tradeId:i.tradeId??i.item.tradeId};return e?{...j,tokenId:t,itemId:j.itemId??r}:{...j,tokenId:void 0,itemId:a??j.itemId}}return{id:`${n}-${t??a}`,name:"",creator:"",contractAddress:n??"",itemId:r,category:"wearable",rarity:"common",network:"MATIC",chainId:tn.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:t??void 0,tradeId:i==null?void 0:i.tradeId}}),[$,E]=v.useState(!1),[A,N]=v.useState(!!(i!=null&&i.resumeBuy));v.useEffect(()=>{i!=null&&i.resumeBuy&&E(!0)},[i==null?void 0:i.resumeBuy]);function S(){if(y){E(!0);return}l||su({type:"item-buy",path:o.pathname}),w()}const D=v.useRef(!1);v.useEffect(()=>{if(!y||D.current)return;const j=iu("item-buy");!j||j.path!==o.pathname||(D.current=!0,N(!0),E(!0))},[y]);const{data:P=[],isFetched:I}=ge({queryKey:["collection-items",f.contractAddress],enabled:!!f.contractAddress,queryFn:()=>id(f.contractAddress,{first:20}).then(j=>j.items)}),O=f.available==null&&!f.tokenId,{data:T,isLoading:W}=ge({queryKey:["shop-item",f.contractAddress,r],enabled:!l&&!e&&!!f.contractAddress&&!!r&&(!(i!=null&&i.item)||O),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>sd(f.contractAddress,r)});v.useEffect(()=>{T&&C(j=>j.tradeId?j.available!=null&&j.wearableCategory?j:{...j,available:j.available??T.available,wearableCategory:j.wearableCategory??T.wearableCategory}:{...T})},[T]);const[z,U]=v.useState(!1),{data:Y=""}=ge({queryKey:["item-desc",f.contractAddress,f.itemId],enabled:!!f.contractAddress&&!!f.itemId,staleTime:5*6e4,queryFn:()=>cd(f.contractAddress,f.itemId)}),{data:q,isLoading:_}=ge({queryKey:["collection-meta",f.contractAddress],enabled:!!f.contractAddress,staleTime:5*6e4,queryFn:()=>js(f.contractAddress)});v.useEffect(()=>{const j=(T==null?void 0:T.creator)||(q==null?void 0:q.creator);j&&C(de=>de.creator?de:{...de,creator:j})},[T,q]),v.useEffect(()=>{if(e||f.name||T||P.length===0)return;const j=r&&P.find(de=>de.itemId===r)||P.find(de=>de.contractAddress===f.contractAddress);j&&C(de=>({...j,tradeId:de.tradeId??j.tradeId}))},[P,T]);const J=v.useMemo(()=>{const j=new Set,de=[];for(const je of P){if(je.id===f.id||f.itemId&&je.itemId===f.itemId||f.tokenId&&je.tokenId===f.tokenId)continue;const nt=`${je.contractAddress}-${je.itemId??je.tokenId??je.id}`;j.has(nt)||(j.add(nt),de.push(je))}return de},[P,f.id,f.itemId,f.tokenId]),me=I&&J.length===0,{items:ye}=qy(f.contractAddress,r,{enabled:me}),{data:Ye,isLoading:Ce}=ge({queryKey:["detail-trade",f.id,f.tradeId,f.contractAddress,f.itemId],enabled:!!f.contractAddress,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:async()=>{if(f.tradeId)return f.tradeId;if(!e&&f.itemId){const j=await ld(f.contractAddress,f.itemId);return(j==null?void 0:j.id)??null}return null}}),{data:ve}=ge({queryKey:["item-traits",f.contractAddress,r],enabled:!!f.contractAddress&&!!r,staleTime:5*6e4,retry:1,queryFn:()=>dd(f.contractAddress,r)}),ht=(ve==null?void 0:ve.isSmart)??f.isSmart,mt=(ve==null?void 0:ve.utility)??null,Bt=(ve==null?void 0:ve.urn)??null,{data:Fr}=ge({queryKey:["item-vrm",Bt],enabled:!!Bt&&f.category==="wearable",staleTime:30*6e4,retry:!1,queryFn:()=>ud(Bt)}),[pn,Yn]=v.useState(!1),{data:Ht}=ge({queryKey:["item-video",f.contractAddress,r],enabled:ht&&!!f.contractAddress&&!!r,staleTime:30*6e4,retry:!1,queryFn:()=>du(f.contractAddress,r)}),gt=v.useMemo(()=>f.emoteLoop!==void 0?f:(r?P.find(de=>de.itemId===r):void 0)??f,[f,P,r]),L=Eo(u,f.tradeId)??Eo(u,Ye),K=!!L,Q=Vl(),{data:ne=[]}=ge({queryKey:["item-resales",f.contractAddress,f.itemId],enabled:Q&&!l&&!!f.contractAddress&&!!f.itemId,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>Ns(f.contractAddress,f.itemId)}),Z=ne.length>0?ne[0].priceCredits:null,xe=e&&f.tokenId?ne.find(j=>j.tokenId===f.tokenId)??null:null,We=v.useMemo(()=>{const j=ne[0];return j?{...j,name:j.name||f.name,thumbnail:j.thumbnail||f.thumbnail,rarity:j.rarity||f.rarity,category:j.category||f.category,wearableCategory:j.wearableCategory??f.wearableCategory,gender:j.gender??f.gender}:null},[ne,f]),[fn,hn]=v.useState(null),[Wn,Yr]=v.useState(!1),mn=f.manaWei??null,{data:gn}=$s(l||!!mn),zt=mn&&gn?Ul(mn,gn):null;v.useEffect(()=>{zt!=null&&C(j=>j.priceCredits===zt?j:{...j,priceCredits:zt})},[zt]);const Wr=v.useMemo(()=>{if(!l||!(i!=null&&i.item))return null;const j=i.item;return j.manaWei?{tradeId:j.tradeId??j.id,listingType:"primary",contractAddress:j.contractAddress,itemId:j.itemId??"",name:j.name,thumbnail:j.thumbnail,rarity:j.rarity,category:j.category,wearableCategory:j.wearableCategory??null,creator:j.creator,manaWei:j.manaWei,available:1,network:j.network,chainId:j.chainId,createdAt:0}:null},[l,i==null?void 0:i.item]),Kc=l&&p!=null&&!!gn&&!!Wr,Qc=Xl({priceCredits:f.priceCredits,compareAtCredits:f.compareAtCredits,saleEndsAt:f.saleEndsAt}),xn=v.useMemo(()=>({...f,tradeId:L,id:L??f.id}),[f,L]),Br=x.some(j=>j.id===xn.id),Bn=!xn.tokenId,Vc=((mo=x.find(j=>j.id===xn.id))==null?void 0:mo.quantity)??0,Hr=Bn&&typeof f.available=="number"&&Vc>=f.available,{key:Ha,faved:xt}=Gl(f),za=v.useRef(null);v.useEffect(()=>{!f.name||Ce||za.current===f.id||(za.current=f.id,ue("Shop Viewed Item",{...Jl(f),for_sale:K}),Fb(f))},[f.id,f.name,Ce,K]);const Hn=`${n}/${t??a}`,qa=v.useRef(Hn);v.useEffect(()=>{if(qa.current!==Hn){if(qa.current=Hn,i!=null&&i.item){const j={...i.item,tradeId:i.tradeId??i.item.tradeId};C(e?{...j,tokenId:t,itemId:j.itemId??r}:{...j,tokenId:void 0,itemId:a??j.itemId})}typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}},[Hn]);function Uc(){!K||zr||Ce||!Bn&&Br||Hr||h(xn,"item_detail")}const zn=Bv(f.rarity)?f.rarity:Re.Rarity.COMMON,Ka=Hv(f.gender),Qa=Zl(f),Va=ed(f.gender),Xc=K&&Qc,Gc=g("itemDetail.moreFromCollection"),Jc=g("itemDetail.relatedItems"),zr=td(f,y==null?void 0:y.address),[Zc,Ua]=v.useState(!1),[el,Xa]=v.useState(!1),[tl,Ga]=v.useState(!1),[nl,Ja]=v.useState(!1),[yn,bn]=v.useState(null),[et,qn]=v.useState(null),[rl,Za]=v.useState(null),{data:X,isLoading:Kn}=ge({queryKey:["owned-token",f.contractAddress,f.tokenId,y==null?void 0:y.address],enabled:!l&&!!(y!=null&&y.address)&&!!f.contractAddress&&!!f.tokenId,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>y?pd(y.address,f.contractAddress,f.tokenId):null});v.useEffect(()=>{X&&C(j=>j.name?{...j,issuedId:j.issuedId??X.issuedId,priceCredits:X.listingPrice??0,tradeId:X.tradeId}:{id:X.id,name:X.name,creator:"",contractAddress:X.contractAddress,itemId:X.itemId,category:X.category,rarity:X.rarity??"common",network:X.network,chainId:X.chainId,thumbnail:X.image,priceCredits:X.listingPrice??0,gender:null,isSmart:!1,tokenId:X.tokenId,issuedId:X.issuedId,tradeId:X.tradeId})},[X]),v.useEffect(()=>{xe&&C(j=>j.priceCredits===xe.priceCredits&&j.tradeId?j:{...j,priceCredits:xe.priceCredits,tradeId:j.tradeId??xe.tradeId})},[xe]),v.useEffect(()=>{yn!=null&&X!=null&&X.isOnSale&&X.listingPrice===yn&&bn(null)},[X,yn]);const eo=!l&&!!f.contractAddress&&!!f.tokenId&&!f.name&&!T&&!Kn&&!X,{data:we,isFetched:al}=ge({queryKey:["public-token",f.contractAddress,f.tokenId],enabled:eo,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>fd(f.contractAddress,f.tokenId)});v.useEffect(()=>{we&&C(j=>j.name?j.issuedId?j:{...j,issuedId:we.issuedId}:{id:we.id,name:we.name,creator:"",contractAddress:we.contractAddress,itemId:we.itemId,category:we.category,rarity:we.rarity??"common",network:we.network,chainId:we.chainId,thumbnail:we.image,priceCredits:we.listingPrice??0,gender:null,isSmart:!1,tokenId:we.tokenId,issuedId:we.issuedId,tradeId:we.tradeId})},[we]);const{data:Be}=ge({queryKey:["publishable-item",f.contractAddress,f.itemId,y==null?void 0:y.address],enabled:zr&&!!y&&!!f.itemId,queryFn:async()=>y?(await uu(y.address,y.identity)).find(de=>de.contractAddress.toLowerCase()===f.contractAddress.toLowerCase()&&de.blockchainItemId===f.itemId)??null:null}),tt=e&&!!X,qr=!e&&zr,He=!l&&(qr||tt),to=yn!=null?!0:tt?!!(X!=null&&X.isOnSale):K,vn=tt?X==null?void 0:X.tradeId:L,no=tt?!!X:!!Be,ol=qr||tt&&Q,ro=yn??(tt?(X==null?void 0:X.listingPrice)??0:0),{data:ao=0}=ge({queryKey:["owned-item-count",f.contractAddress,a,y==null?void 0:y.address],enabled:!e&&!l&&!!(y!=null&&y.address)&&!!f.contractAddress&&!!a,staleTime:3e4,queryFn:()=>y?hd(y.address,f.contractAddress,a):0});async function St(){await Promise.all([u.invalidateQueries({queryKey:["owned-token",f.contractAddress,f.tokenId]}),u.invalidateQueries({queryKey:["detail-trade"]}),u.invalidateQueries({queryKey:["shop-item"]}),u.invalidateQueries({queryKey:["collection-sale-state"]}),u.invalidateQueries({queryKey:["shop-items"]}),u.invalidateQueries({queryKey:["catalog-items"]}),u.invalidateQueries({queryKey:["publishable-items"]}),u.invalidateQueries({queryKey:["publishable-item",f.contractAddress,f.itemId]}),u.invalidateQueries({queryKey:["item-resales",f.contractAddress,f.itemId]})])}async function oo(j={}){const de=j.own!==!1;if(!y||!vn)return!1;Za(null),de&&qn("remove");try{const je=await Ts(vn);return await lu({trade:je,signer:y.signer}),j.silent||On.success(g("myAssets.removedFromSale",{name:f.name})),bn(null),Ap(u,vn),C(nt=>nt.tradeId===vn?{...nt,tradeId:void 0}:nt),St(),Zr(u,{address:y.address,contractAddress:f.contractAddress,tokenId:f.tokenId},{kind:"removed"}),!0}catch(je){const nt=nn(je);return nt||Te(je,{flow:"remove-listing",tradeId:vn}),Za(nt?g("getCredits.errorCanceled"):g("myAssets.removeListingError")),!1}finally{de&&qn(null)}}function io(){tt?Ua(!0):Xa(!0)}async function il(){qn("update");try{await oo({silent:!0,own:!1})&&io()}finally{qn(null)}}function so(){Ua(!1),Xa(!1),St()}const co=K?Ce?g("itemDetail.checking"):Hr?g("itemDetail.maxInCart"):!Bn&&Br?g("assetCard.inCart"):g("assetCard.addToCart"):g("itemDetail.notForSale"),sl=typeof f.available=="number"&&f.available>0&&!f.tokenId&&!l,lo=!l&&!f.tokenId&&f.available===0,qt=lo&&!He&&!!We,Qn=!!We&&x.some(j=>j.id===We.id),cl=!He&&K&&!l,ll=l||!He&&(K||qt&&!!We||Rc()),dl=!f.name&&(!!T||!!X||!!we),uo=W||!!f.contractAddress&&!I||!f.name&&Kn||dl||eo&&!al,po=!f.name&&!uo,ul=!!f.name&&Lp({isMarket:l,forSale:K,priceKnown:f.priceCredits>0&&(!mn||zt!=null)||He,stillResolving:uo||!!mn&&zt==null,manage:He,soldOutWithResale:qt,resolvingTrade:Ce,isTokenRoute:e,ownedAssetLoading:Kn,deepLinkLoading:W}),fo=!f.creator&&(W||_||Kn),ho=!(q!=null&&q.name)&&_,pl=/^https?:\/\//i.test(f.thumbnail);return nd(po?{title:g("seo.item.notFoundTitle"),noindex:!0}:f.name?{title:f.name,description:Y||g("seo.item.fallbackDescription",{name:f.name,rarity:f.rarity,category:Ds(f),creator:Ma(f.creator)}),image:pl?f.thumbnail:void 0,type:"product"}:{}),po?s.jsxs(ns,{"data-notfound":!0,children:[s.jsx(bv,{name:"cart"}),s.jsx(vv,{children:g("itemDetail.notAvailableTitle")}),s.jsx("p",{className:"muted",children:g("itemDetail.notAvailableBody")}),s.jsx(yv,{variant:"purple",onClick:()=>c("/items"),children:g("notFound.cta")})]}):s.jsxs(ns,{children:[s.jsxs(Hb,{"aria-label":g("itemDetail.breadcrumbAria"),children:[s.jsx(zb,{onClick:()=>c("/items"),children:g("nav.collectibles")}),s.jsx(qb,{children:"/"}),s.jsx(Kb,{children:f.name||g("itemDetail.itemFallback")})]}),s.jsxs(Qb,{children:[s.jsxs(Vb,{"data-testid":"item-preview",children:[f.name?s.jsx(Gy,{item:f}):s.jsx(Ub,{"aria-busy":"true","aria-label":g("itemPreview.loading"),children:s.jsx("span",{className:"skeleton","aria-hidden":!0})}),Ha?s.jsx(rs,{"data-fav-preview":!0,"data-on":xt||void 0,onClick:()=>b(f),"aria-pressed":xt,"aria-label":xt?g("assetCard.removeFromFavorites"):g("assetCard.addToFavorites"),children:s.jsx(V,{name:xt?"heart-solid":"heart",size:18})}):null,Ht?s.jsxs(Zb,{"data-play-showcase":!0,onClick:()=>Yn(!0),"data-testid":"play-showcase",children:[s.jsx(V,{name:"play",size:18}),g("itemDetail.playShowcase")]}):null]}),s.jsx(Xb,{"data-testid":"item-info",children:f.name?s.jsxs(s.Fragment,{children:[s.jsxs(Gb,{children:[s.jsxs(Jb,{children:[f.name,e&&f.issuedId?` #${f.issuedId}`:""]}),Ha?s.jsx(rs,{"data-fav-title":!0,"data-on":xt||void 0,onClick:()=>b(f),"aria-pressed":xt,"aria-label":xt?g("assetCard.removeFromFavorites"):g("assetCard.addToFavorites"),children:s.jsx(V,{name:xt?"heart-solid":"heart",size:18})}):null]}),s.jsxs(ev,{children:[s.jsx(ze,{"data-variant":"rarity",style:{background:od(zn),color:ad(zn)},title:rd(f.rarity),children:f.rarity}),s.jsxs(ze,{children:[Qa?s.jsx(V,{name:Qa,size:18,color:d.colors.text2}):null,Ds(f)]}),Ka?s.jsxs(ze,{children:[Va?s.jsx(V,{name:Va,size:18,color:d.colors.text2}):null,Ka]}):null,!e&&f.issuedId?s.jsxs(ze,{"data-testid":"detail-issued",children:["#",f.issuedId]}):null,ht?s.jsxs(ze,{"data-testid":"detail-smart",children:[s.jsx(V,{name:"smart",size:18,color:d.colors.text2}),g("itemDetail.smart")]}):null,gt.emoteLoop!==void 0?s.jsxs(ze,{"data-testid":"detail-play-mode",children:[s.jsx(V,{name:gt.emoteLoop?"play-loop":"play-once",size:18,color:d.colors.text2}),gt.emoteLoop?g("itemDetail.playLoop"):g("itemDetail.playOnce")]}):null,gt.emoteHasSound?s.jsxs(ze,{"data-testid":"detail-sound",children:[s.jsx(V,{name:"sound",size:18,color:d.colors.text2}),g("itemDetail.emoteSound")]}):null,gt.emoteHasProps?s.jsxs(ze,{"data-testid":"detail-props",children:[s.jsx(V,{name:"props",size:18,color:d.colors.text2}),g("itemDetail.emoteProps")]}):null,Fr?s.jsx(ko,{content:g("itemDetail.exportBlockedTooltip"),children:s.jsxs(ze,{"data-variant":"blocked","data-testid":"detail-export-blocked",tabIndex:0,"aria-label":g("itemDetail.exportBlockedTooltip"),children:[s.jsx(V,{name:"ban",size:16}),g("itemDetail.exportBlocked")]})}):null,mt?s.jsxs(ze,{"data-testid":"detail-utility-chip",children:[s.jsx(V,{name:"utility",size:18,color:d.colors.text2}),g("itemDetail.utility")]}):null]}),Y||mt?s.jsxs(Bc,{children:[Y?s.jsx(Sa,{children:s.jsxs(Ca,{children:[s.jsx(Ut,{children:g("itemDetail.description")}),s.jsx(as,{"data-expanded":z||void 0,children:Y}),Y.length>140?s.jsx(nv,{className:"link",onClick:()=>U(j=>!j),children:z?g("itemDetail.showLess"):g("itemDetail.readMore")}):null]})}):null,mt?s.jsx(Sa,{children:s.jsxs(Ca,{"data-testid":"detail-utility",children:[s.jsx(Ut,{children:g("itemDetail.utility")}),s.jsx(as,{"data-expanded":!0,children:mt})]})}):null]}):null,f.creator||q!=null&&q.name||fo||ho?s.jsxs(Hc,{children:[f.creator?s.jsxs(In,{children:[s.jsx(Ut,{children:g("itemDetail.creator")}),s.jsx(rv,{address:f.creator,linkToProfile:!0,hidePrefix:!0})]}):fo?s.jsxs(In,{children:[s.jsx(Ut,{children:g("itemDetail.creator")}),s.jsxs(vs,{"aria-hidden":!0,"data-testid":"creator-loading",children:[s.jsx(ws,{}),s.jsx(ks,{})]})]}):null,q!=null&&q.name?s.jsxs(In,{"data-collection":!0,children:[s.jsx(Ut,{children:g("itemDetail.collection")}),s.jsx(av,{contractAddress:f.contractAddress,name:q.name,items:P})]}):ho?s.jsxs(In,{"data-collection":!0,children:[s.jsx(Ut,{children:g("itemDetail.collection")}),s.jsxs(vs,{"aria-hidden":!0,"data-testid":"collection-loading",children:[s.jsx(ws,{}),s.jsx(ks,{})]})]}):null]}):null,s.jsx(qc,{}),ul?s.jsxs(Yv,{"aria-hidden":!0,"data-testid":"sale-loading",children:[s.jsx(Wv,{}),s.jsx(bs,{}),s.jsx(bs,{})]}):s.jsxs(s.Fragment,{children:[Q&&!He&&!l&&K&&!f.tokenId?s.jsxs(Pv,{"data-testid":"buy-from-creator",children:[s.jsxs(Iv,{children:[s.jsx(jv,{name:"buy-from-creator"}),g("itemDetail.buyFromCreator")]}),s.jsx(Ev,{name:"check-rounded"})]}):null,qt?s.jsxs(Ov,{"data-testid":"sold-out",children:[s.jsxs(hs,{"data-variant":"original",children:[s.jsxs(ms,{children:[g("itemDetail.originalPrice"),s.jsxs(gs,{children:[s.jsx(Pe,{className:"ico"}),s.jsx(xs,{children:f.priceCredits})]}),s.jsx(ys,{"aria-hidden":!0,children:s.jsx(V,{name:"info",size:12})})]}),s.jsx(Rv,{"data-testid":"out-of-stock",children:g("itemDetail.soldOut")})]}),s.jsxs(hs,{"data-variant":"resale",children:[s.jsxs(ms,{children:[g("itemDetail.resalePrice"),s.jsxs(gs,{children:[s.jsx(Pe,{className:"ico"}),s.jsx(xs,{children:Z})]}),s.jsx(ys,{"aria-hidden":!0,children:s.jsx(V,{name:"info",size:12})})]}),s.jsxs(Av,{children:[g("itemDetail.stock")," ",ne.length,"/",Re.Rarity.getMaxSupply(zn).toLocaleString()]})]})]}):s.jsx(ov,{children:s.jsxs(iv,{children:[s.jsxs(sv,{children:[l||K?s.jsx(ss,{children:g("itemDetail.price")}):null,l?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{"data-variant":"market","data-testid":"item-price",children:p==null?s.jsx(Sn,{children:"—"}):s.jsxs(s.Fragment,{children:[s.jsx(lv,{"aria-hidden":!0,children:"≈"}),s.jsx(Mn,{}),s.jsx(Sn,{children:p})]})}),s.jsx(dv,{className:"muted",children:g("assetCard.marketPrice")})]}):K?Xc?s.jsxs(Xt,{"data-variant":"sale","data-testid":"item-price",children:[s.jsxs(Xt,{children:[s.jsx(Mn,{}),s.jsx(Sn,{children:f.priceCredits})]}),s.jsxs(uv,{children:[s.jsx(Mn,{"data-was":!0}),f.compareAtCredits]}),xo(f.compareAtCredits,f.priceCredits)>0?s.jsx(pv,{children:g("assetCard.saleWithDiscount",{pct:xo(f.compareAtCredits,f.priceCredits)})}):null,s.jsx(fv,{endsAt:f.saleEndsAt})]}):s.jsxs(Xt,{"data-testid":"item-price",children:[s.jsx(Mn,{}),s.jsx(Sn,{children:f.priceCredits})]}):to&&ro?s.jsxs(Xt,{"data-testid":"item-price",children:[s.jsx(Mn,{}),s.jsx(Sn,{children:ro})]}):He?null:s.jsxs(Xt,{"data-variant":"none","data-testid":"item-price",children:[s.jsx("span",{children:g("itemDetail.notForSale")}),s.jsx(ko,{content:g("itemDetail.notForSaleHint"),children:s.jsx(cv,{tabIndex:0,role:"img","aria-label":g("itemDetail.notForSaleHint"),children:s.jsx(V,{name:"info",size:14})})})]})]}),sl?s.jsxs(os,{children:[s.jsx(ss,{children:g("itemDetail.stock")}),s.jsxs(is,{children:[(f.available??0).toLocaleString(),"/",Re.Rarity.getMaxSupply(zn).toLocaleString()]})]}):lo?s.jsx(os,{children:s.jsx(is,{"data-out":!0,"data-testid":"out-of-stock",children:g("itemDetail.outOfStock")})}):null]})}),s.jsx(hv,{"data-buttons":ll||void 0,"data-dual":cl||void 0,children:l?s.jsxs(la,{variant:"purple",onClick:S,disabled:!Kc,children:[s.jsx("span",{children:g("assetCard.buyNow")}),p!=null?s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),p]}):null]}):He?s.jsxs(Lv,{"data-testid":"manage-actions",children:[s.jsx(dt,{message:rl}),to?s.jsxs(s.Fragment,{children:[s.jsxs(cs,{onClick:()=>void il(),disabled:et!==null||!no,children:[et!=="update"?s.jsx(V,{name:"pen",className:"ico"}):null,s.jsx("span",{children:et==="update"?k?g("itemDetail.updateCanceling"):g("itemDetail.updateConfirmCancel"):g("itemDetail.manageUpdatePrice")})]}),s.jsx(ls,{onClick:()=>void oo(),disabled:et!==null,children:s.jsx("span",{children:et==="remove"?g("myAssets.removing"):g("itemDetail.manageRemove")})})]}):s.jsxs(s.Fragment,{children:[ol?s.jsx(cs,{onClick:()=>{tt&&ue("Shop Started Listing",{listing_type:"secondary",item_id:f.itemId??f.tokenId??null}),io()},disabled:et!==null||!no,children:s.jsx("span",{children:g("itemDetail.manageList")})}):null,tt?s.jsx(ls,{onClick:()=>Ga(!0),disabled:et!==null,children:s.jsx("span",{children:g("itemDetail.manageTransfer")})}):null]}),qr&&Be?s.jsx(mv,{type:"button",onClick:()=>Ja(!0),disabled:et!==null,children:g("itemDetail.manageIssue")}):null,et==="update"?s.jsx(xv,{children:g("itemDetail.updateHelper")}):null,Z!=null?s.jsx(Fv,{children:s.jsx(fs,{onClick:()=>Yr(!0),"data-testid":"view-resellers",children:g("itemDetail.viewAllResellers")})}):null]}):K?s.jsxs(s.Fragment,{children:[s.jsxs(la,{variant:"purple",onClick:S,disabled:Ce,children:[s.jsx("span",{children:g("assetCard.buyNow")}),s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),f.priceCredits]})]}),s.jsxs(ds,{onClick:Uc,disabled:Ce||(Bn?Hr:Br),"aria-label":co,children:[s.jsx(V,{name:"cart-solid"}),s.jsx(us,{children:co})]})]}):qt&&We?s.jsxs(s.Fragment,{children:[s.jsxs(la,{variant:"purple",onClick:()=>y?hn(We):w(),children:[s.jsx("span",{children:g("assetCard.buyNow")}),s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),We.priceCredits]})]}),s.jsxs(ds,{onClick:()=>{Qn||h(We,"item_detail")},disabled:Qn,"aria-label":Qn?g("assetCard.inCart"):g("assetCard.addToCart"),children:[s.jsx(V,{name:"cart-solid"}),s.jsx(us,{children:Qn?g("assetCard.inCart"):g("assetCard.addToCart")})]})]}):s.jsx(s.Fragment,{children:s.jsx(Ab,{item:f})})}),!He&&!l&&Z!=null?s.jsxs(Tv,{"data-testid":"lowest-price","data-centered":qt||void 0,children:[qt?null:s.jsxs($v,{children:[g("itemDetail.lowestPrice"),s.jsx(Pe,{className:"ico"}),s.jsx(Nv,{children:Z})]}),s.jsx(fs,{onClick:()=>Yr(!0),"data-testid":"view-resellers",children:g("itemDetail.viewAllResellers")})]}):null,!He&&!l&&ao>0?s.jsxs(gv,{"data-testid":"you-own-note",children:[g("itemDetail.youOwnN",{count:ao})," ",s.jsx(bl,{to:"/my-items",children:g("nav.myAssets")})]}):null]})]}):s.jsx(zv,{})})]}),me?s.jsx(yo,{title:Jc,items:ye}):s.jsx(yo,{title:Gc,items:J,onViewAll:f.contractAddress?()=>c(`/collection/${f.contractAddress}`):void 0}),$&&l&&Wr&&gn?s.jsx($c,{listing:Wr,rate:gn,onClose:()=>E(!1),onSold:()=>E(!1)}):$&&!l?s.jsx(ya,{item:xn,resume:A,onClose:()=>{E(!1),N(!1)}}):null,fn?s.jsx(ya,{item:fn,onClose:()=>{hn(null),St()}}):null,Q&&Wn&&f.itemId?s.jsx(Mb,{item:f,onClose:()=>Yr(!1)}):null,Zc&&X&&y?s.jsx(lx,{asset:X,session:y,creator:f.creator,onListed:(j,de)=>{bn(j),St(),Zr(u,{address:y.address,contractAddress:f.contractAddress,tokenId:f.tokenId},{kind:"listed",priceCredits:j,tradeId:de})},onClose:so}):null,tl&&y&&f.tokenId?s.jsx(Px,{item:{contractAddress:f.contractAddress,chainId:f.chainId,tokenId:f.tokenId,name:f.name,thumbnail:f.thumbnail},session:y,onClose:()=>{Ga(!1),St()},onTransferred:()=>{bn(null),St(),Zr(u,{address:y.address,contractAddress:f.contractAddress,tokenId:f.tokenId},{kind:"gone"})}}):null,el&&Be&&y?s.jsx(Xx,{item:Be,session:y,onListed:j=>bn(j),onClose:so}):null,nl&&Be&&y?s.jsx(Cy,{item:{contractAddress:Be.contractAddress,chainId:tn.chainId,itemId:Be.blockchainItemId,name:Be.name,thumbnail:Be.thumbnail,available:Be.remainingSupply},session:y,onClose:()=>{Ja(!1),St()}}):null,pn&&Ht?s.jsx(Ey,{src:Ht,itemName:f.name,onClose:()=>Yn(!1)}):null]})}function zv(){return s.jsxs(wv,{"aria-hidden":!0,children:[s.jsx(Cv,{className:"skeleton"}),s.jsxs(Sv,{children:[s.jsx(ua,{className:"skeleton"}),s.jsx(ua,{className:"skeleton"}),s.jsx(ua,{className:"skeleton"})]}),s.jsx(Bc,{children:[0,1].map(n=>s.jsx(Sa,{children:s.jsxs(Ca,{children:[s.jsx(ps,{className:"skeleton"}),s.jsxs(kv,{children:[s.jsx(pa,{className:"skeleton"}),s.jsx(pa,{className:"skeleton"}),s.jsx(pa,{className:"skeleton","data-short":!0})]})]})},n))}),s.jsx(Hc,{children:[0,1].map(n=>s.jsxs(In,{...n===1?{"data-collection":!0}:{},children:[s.jsx(ps,{className:"skeleton"}),s.jsx(Dv,{})]},n))}),s.jsx(qc,{}),s.jsx(Mv,{className:"skeleton"}),s.jsx(_v,{className:"skeleton"})]})}export{gw as ItemDetail,gw as default};
|