@dcl/shop 0.7.3-31002809274.commit-68e2004 → 0.7.3-31004613129.commit-29bd738
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-DHRw9r_G.js +381 -0
- package/_assets/{AnimatedBackground-BPNjZnHs.js → AnimatedBackground-lOgqKL4d.js} +1 -1
- package/_assets/{Assets-B9gu6JnA.js → Assets-VGMfDLPY.js} +7 -7
- package/_assets/{Assets.styles-DiCnesUC.js → Assets.styles-B_PmcugB.js} +1 -1
- package/_assets/{Authorizations-BQzDrrA_.js → Authorizations-BDp7n41u.js} +4 -4
- package/_assets/Cart-Bs53nlQk.js +695 -0
- package/_assets/{CircularProgress-CQb8cfhx.js → CircularProgress-BPWY_F37.js} +3 -3
- package/_assets/{Collection-DvApaJVE.js → Collection-qqEYK-rA.js} +3 -3
- package/_assets/{CollectionCarousel-3Ff7fmHM.js → CollectionCarousel-C_JJAdFF.js} +47 -47
- package/_assets/{ContentClient-Bv-dXg1a.js → ContentClient-C2puvDPt.js} +1 -1
- package/_assets/{Creator-phXYNMmi.js → Creator-BsWzWPDC.js} +14 -14
- package/_assets/{DeploymentBuilder-DbR23a3M.js → DeploymentBuilder-jIyneWTC.js} +1 -1
- package/_assets/{ErrorNotice-Biw7jacR.js → ErrorNotice-BiqT0Cec.js} +1 -1
- package/_assets/{ExchangeController-j0EaU5ur.js → ExchangeController-PF6wI6Mp.js} +1 -1
- package/_assets/{Faq-CYehw8Xd.js → Faq-CwuXgMC7.js} +2 -2
- package/_assets/{GetCredits-B5t5SiEY.js → GetCredits-CY9xW-3-.js} +4 -4
- package/_assets/{Grow-BbO3nPWz.js → Grow-nUylTs5m.js} +1 -1
- package/_assets/{HelpersUtil-Bm2I2riv.js → HelpersUtil-Bwy8o8bw.js} +1 -1
- package/_assets/ItemDetail-wxRF5CUO.js +3516 -0
- package/_assets/LazyEmoteControls-DBB9eg39.js +2 -0
- package/_assets/{LoadMore-DMhOO7Nq.js → LoadMore-oc9uIc47.js} +2 -2
- package/_assets/ManaPricingBanner.styles-CEtfxA02.js +74 -0
- package/_assets/{MyAssets-pppiT6fl.js → MyAssets-BFWp9KWR.js} +2 -2
- package/_assets/{MyFavorites-B8NF0NVk.js → MyFavorites-BC0Zj7CR.js} +1 -1
- package/_assets/{NotFound-ySn_lkJ7.js → NotFound-BZASz5NG.js} +4 -4
- package/_assets/{NotificationsBell-Mz-RqcfB.js → NotificationsBell-DvmmUfvh.js} +1 -1
- package/_assets/{OutfitDetail-dru3bX0e.js → OutfitDetail-UMdvdT0P.js} +4 -4
- package/_assets/{OutfitPreview-RhS9kvYc.js → OutfitPreview-BgPOBB1N.js} +2 -2
- package/_assets/{OutfitStudio-B-MkV2Nw.js → OutfitStudio-BUW7MldY.js} +8 -8
- package/_assets/{StoreSettings-DMlPpaxq.js → StoreSettings-Cf-k3hGA.js} +1 -1
- package/_assets/{Success-DGiWm-dB.js → Success-cUrjdiUL.js} +4 -4
- package/_assets/{SwapController-DC-RT5b2.js → SwapController-DDZdhbmi.js} +1 -1
- package/_assets/{Tooltip-DIS1AoSo.js → Tooltip-eMANvv6_.js} +1 -1
- package/_assets/{TradeService-CW14jFoK.js → TradeService-K5TbzQm1.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Bn14TsAB.js → W3MFrameProviderSingleton-ipn1OWk5.js} +3 -3
- package/_assets/{WebCryptoP256-DN6bPKJH.js → WebCryptoP256-BzRIl457.js} +1 -1
- package/_assets/authorizations-gBmiqrl2.js +1 -0
- package/_assets/{basic-Db4hGFC-.js → basic-BX6XcCy2.js} +1 -1
- package/_assets/{biconomy-yx9AAdUi.js → biconomy-FZ6cxo6V.js} +1 -1
- package/_assets/{builder-Db8kqGSp.js → builder-C63nhwMn.js} +1 -1
- package/_assets/buy-BQ9t9Zrr.js +1 -0
- package/_assets/buy-gasless-B-y8WMZ-.js +1 -0
- package/_assets/{categories-BMCKe30t.js → categories-4GVQVLVO.js} +1 -1
- package/_assets/{ccip-DSJk995u.js → ccip-D3QGl9dR.js} +1 -1
- package/_assets/{ccip-kyphTkC8.js → ccip-Dk-2B020.js} +1 -1
- package/_assets/{collectionPage.styles-Dmgr28GG.js → collectionPage.styles-D9v6voUC.js} +4 -4
- package/_assets/{controller-BxSHfLz5.js → controller-BuNan0kN.js} +2 -2
- package/_assets/{core-FJbXZcd9.js → core-BGdcId97.js} +4 -4
- package/_assets/{createSvgIcon-BVj0atRc.js → createSvgIcon-W_IY7RAQ.js} +1 -1
- package/_assets/{custom-8lpWNVH1.js → custom-BvhiNuVl.js} +1 -1
- package/_assets/{data-capture-ZsoqccWO.js → data-capture-CmgoF3cw.js} +1 -1
- package/_assets/{email-TmqKH5rK.js → email-DKRlv_02.js} +1 -1
- package/_assets/{embedded-wallet-D8AjSmuZ.js → embedded-wallet-DOzPMXtH.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-B1CecDgm.js → emotion-styled.browser.esm-Ddpetkdy.js} +1 -1
- package/_assets/{engine-CTKRqGmj.js → engine-T7LkHRv2.js} +1 -1
- package/_assets/errors-CPlWFAEN.js +1 -0
- package/_assets/{estimate-l1-fee-DpS-XaOF.js → estimate-l1-fee-DfTmkotx.js} +1 -1
- package/_assets/{ethers-CtNGBird.js → ethers-BHogtzPD.js} +1 -1
- package/_assets/{execute-Bz7pyjbp.js → execute-DY3XaITL.js} +2 -2
- package/_assets/{features-W9H6sjcF.js → features-B0RaX-b9.js} +1 -1
- package/_assets/{fetchTokenMetadata-COd7SGVt.js → fetchTokenMetadata-CYkVqirC.js} +2 -2
- package/_assets/{field.styles-CdYHVXFs.js → field.styles-CGEOSW7q.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CMuxAyIB.js → get-ecosystem-wallet-info-CdwwL-l8.js} +1 -1
- package/_assets/{getBalance-DQubrLKJ.js → getBalance-CNjN-sP8.js} +1 -1
- package/_assets/{getNFT-CSRtW3h-.js → getNFT-BfCcimFc.js} +1 -1
- package/_assets/{getNFT-BNY2enZa.js → getNFT-Dp7PGXVr.js} +1 -1
- package/_assets/{grid.styles-DH_ZretM.js → grid.styles-DszJKyog.js} +1 -1
- package/_assets/{hashTypedData-Dqqcre1R.js → hashTypedData-Qed0bO5s.js} +1 -1
- package/_assets/{hashTypedData-BA0RWbmG.js → hashTypedData-nM2s3pqE.js} +1 -1
- package/_assets/{in-app-BvYCjHKb.js → in-app-BIFA2e_r.js} +1 -1
- package/_assets/{in-app-wallet-calls-CxpZt-vc.js → in-app-wallet-calls-BS-El40Z.js} +1 -1
- package/_assets/{index-kUOBQ2KK.js → index-7NadBeuh.js} +1 -1
- package/_assets/{index-C-IYvYAw.js → index-B42zNTgr.js} +1 -1
- package/_assets/{index-4grC8vnQ.js → index-BIBRNTUK.js} +104 -104
- package/_assets/{index-BiAcVSuI.js → index-BMd58yCH.js} +1 -1
- package/_assets/{index-Cr_vaK1b.js → index-BVQ9R8Ou.js} +1 -1
- package/_assets/{index-DOPim6Hs.js → index-BZON-2rL.js} +1 -1
- package/_assets/{index-CtwVaZjN.js → index-BZQAtid_.js} +1 -1
- package/_assets/{index-DYoWqsAK.js → index-Ba80g_QU.js} +1 -1
- package/_assets/{index-C0jkYp6u.js → index-BiJICnih.js} +1 -1
- package/_assets/{index-DhygeoM5.js → index-BiwxPZf9.js} +3 -3
- package/_assets/{index-DDe_P04W.js → index-BkRxRlme.js} +1 -1
- package/_assets/{index-Vcg4k-hF.js → index-Bl0AjSkb.js} +1 -1
- package/_assets/{index-CkZ39O4D.js → index-BxSBXkoJ.js} +1 -1
- package/_assets/{index-CjpWKs8Q.js → index-C1B5cU5h.js} +1 -1
- package/_assets/{index-Bl9hxKO2.js → index-C2Q5s1eA.js} +1 -1
- package/_assets/{index-DZOsxVd8.js → index-C9FU26y1.js} +1 -1
- package/_assets/{index-BmtMCuH8.js → index-CAAOpbIF.js} +1 -1
- package/_assets/{index-BfAg05xe.js → index-CBJPuKa9.js} +1 -1
- package/_assets/{index-Cfy91mWw.js → index-CLwUPuZs.js} +1 -1
- package/_assets/{index-Ch2NaYC8.js → index-CRVeI5_c.js} +1 -1
- package/_assets/{index-DsSWYz9j.js → index-CTeErQvD.js} +1 -1
- package/_assets/{index-l92NuJVf.js → index-CVEuy3QH.js} +1 -1
- package/_assets/{index-DBGfpyip.js → index-Ci9bIwy_.js} +1 -1
- package/_assets/{index-DFCfS17C.js → index-ClflEUAF.js} +1 -1
- package/_assets/{index-DLrjz4Tx.js → index-CnEDwKLU.js} +1 -1
- package/_assets/{index-BsEcuD0O.js → index-CzV_L3_6.js} +2 -2
- package/_assets/{index-BjtZr1Rk.js → index-D1j9ElOD.js} +1 -1
- package/_assets/{index-CNepofQh.js → index-DBjvq-XI.js} +1 -1
- package/_assets/{index-WguW8tuP.js → index-DBr7T_eT.js} +1 -1
- package/_assets/{index-BpsXe6IR.js → index-DMepoE3Z.js} +1 -1
- package/_assets/{index-BGOWhyHo.js → index-DMtPghPO.js} +3 -3
- package/_assets/{index-CNDHrB-N.js → index-DNr9nntg.js} +1 -1
- package/_assets/{index-CefOdSuo.js → index-DT2QfQDk.js} +1 -1
- package/_assets/{index-BJNlk-SI.js → index-DTS28jX1.js} +1 -1
- package/_assets/{index-DBkJBt2j.js → index-DWVWkLU-.js} +2 -2
- package/_assets/{index-jjnXqv_1.js → index-DYx3Y8hN.js} +1 -1
- package/_assets/{index-DtS2WMUT.js → index-DdGXSTOn.js} +1 -1
- package/_assets/{index-Bw6vREOp.js → index-DdKv_wFT.js} +2 -2
- package/_assets/{index-DIYqluqo.js → index-DeSzNtSp.js} +3 -3
- package/_assets/{index-Wj_hpWlf.js → index-DlVK89jK.js} +1 -1
- package/_assets/{index-o5wXH6k1.js → index-DpxbmIMg.js} +1 -1
- package/_assets/{index-qsorFlMF.js → index-DrQ4_MN_.js} +1 -1
- package/_assets/{index-DBwuf2dy.js → index-DsSyWLy-.js} +1 -1
- package/_assets/{index-CN8Fwkg_.js → index-DxkHHnyf.js} +2 -2
- package/_assets/{index-Lb7odxFK.js → index-DyqDagNo.js} +1 -1
- package/_assets/{index-Bqt5iJBo.js → index-EMfiBMg7.js} +1 -1
- package/_assets/{index-B91rfq1c.js → index-Lyytmv-l.js} +1 -1
- package/_assets/{index-BogeqjBp.js → index-N1lD9YVF.js} +1 -1
- package/_assets/{index-CxlN6NCL.js → index-RY9Ezazi.js} +2 -2
- package/_assets/{index-CRKbJ2OP.js → index-S3QJcEor.js} +1 -1
- package/_assets/{index-DG6oakSS.js → index-U9sHU96u.js} +1 -1
- package/_assets/{index-Cj_FIJ6O.js → index-WJ3npObe.js} +1 -1
- package/_assets/{index-CTvMZ0av.js → index-_IBCVipy.js} +1 -1
- package/_assets/{index-DFAt726n.js → index-lM2OO31J.js} +3 -3
- package/_assets/{index-CuJbAAma.js → index-oAhypoXM.js} +1 -1
- package/_assets/{index-BDuns4Lg.js → index-oUhlt_Bb.js} +1 -1
- package/_assets/{index-DAPvhTCu.js → index-qY7j72YC.js} +1 -1
- package/_assets/{index-vZmAzias.js → index-rNjzxsiO.js} +1 -1
- package/_assets/{index.es-vm3av0ZU.js → index.es-BmKNbSKx.js} +1 -1
- package/_assets/{index.es-Db0bppXh.js → index.es-BwDqaf8R.js} +4 -4
- package/_assets/{index.es-DRPff5jo.js → index.es-Dcp_TMfU.js} +1 -1
- package/_assets/{localBatchGatewayRequest-BT4bgYX3.js → localBatchGatewayRequest-JfP-082C.js} +1 -1
- package/_assets/{networks-BjCyq87b.js → networks-BCXn0uun.js} +1 -1
- package/_assets/{onramp-MxLeUwo5.js → onramp-BC8u85Rq.js} +1 -1
- package/_assets/{openzeppelin-NiqHvD0o.js → openzeppelin-BA7UqeqU.js} +1 -1
- package/_assets/{parseNft-DXKUZt78.js → parseNft-zNfP6wMG.js} +2 -2
- package/_assets/{parseSignature-JjWPQjiQ.js → parseSignature-BqSmw9-v.js} +3 -3
- package/_assets/{parseSignature-CHSFJk_c.js → parseSignature-DWC-KHKy.js} +1 -1
- package/_assets/{passkeys-Dp5NPgWw.js → passkeys-CIu_Utx8.js} +1 -1
- package/_assets/{pay-with-exchange-CxuzzGwq.js → pay-with-exchange-DsggiL3i.js} +1 -1
- package/_assets/{qr-overlay-C29AmkL1.js → qr-overlay-Drv1G6MN.js} +1 -1
- package/_assets/{receive-BSxHY6Lk.js → receive-CeqabMKU.js} +1 -1
- package/_assets/{resolveImplementation-DBwFo6J8.js → resolveImplementation-CQyxSY4d.js} +1 -1
- package/_assets/{rpc-B7hkwqRp.js → rpc-B3h6KQXA.js} +1 -1
- package/_assets/{secp256k1-BmlNWGtD.js → secp256k1-B5_ud9a2.js} +1 -1
- package/_assets/{secp256k1-80kUQxfu.js → secp256k1-CrlTAPJ_.js} +1 -1
- package/_assets/{secp256k1-dBN4ORWU.js → secp256k1-i_L0DASD.js} +1 -1
- package/_assets/{send-batch-transaction-BkwLmlea.js → send-batch-transaction-BsS_vCy3.js} +1 -1
- package/_assets/{send-eip712-transaction-6nm-uQAt.js → send-eip712-transaction-Cr4-Q79f.js} +2 -2
- package/_assets/{send-gasless-transaction-ASekpRez.js → send-gasless-transaction-BGa7BHKv.js} +2 -2
- package/_assets/{send-transaction-Bzhp2g8b.js → send-transaction-Ckey7MpC.js} +2 -2
- package/_assets/{send-C63T079L.js → send-u523DWGF.js} +1 -1
- package/_assets/{sendMetaTransaction-BATUzHIf.js → sendMetaTransaction-C_M5KgcT.js} +1 -1
- package/_assets/{sendRawTransaction-_Kv849f3.js → sendRawTransaction-C7O5sdy-.js} +3 -3
- package/_assets/{serializeTransaction-ZzhlS1TB.js → serializeTransaction-Bqahk7NV.js} +1 -1
- package/_assets/{session-proposal-DzR3pRyS.js → session-proposal-10rDfTdh.js} +1 -1
- package/_assets/{session-request-VXo9pQwV.js → session-request-DLQ4W5j6.js} +2 -2
- package/_assets/{signing-CGrYz3PN.js → signing-DgL5hw-1.js} +3 -3
- package/_assets/{socials-B-JrWB2l.js → socials-Iclu6gpv.js} +1 -1
- package/_assets/{styled-gTPQAN-Y.js → styled-BtpmW8vE.js} +2 -2
- package/_assets/{swaps-CyAk4mTe.js → swaps-Dio5DiT_.js} +1 -1
- package/_assets/{thirdweb-8szcRqMp.js → thirdweb-0ZVJwYkE.js} +3 -3
- package/_assets/{to-serializable-transaction-CF8YxIRs.js → to-serializable-transaction-DegngUV6.js} +2 -2
- package/_assets/{transactionReceipt-CGVPV54W.js → transactionReceipt-CmwM9KP5.js} +1 -1
- package/_assets/{transactions-BIRi6SwZ.js → transactions-DELzUAyE.js} +1 -1
- package/_assets/{useCreditPacks-B-X7zfCn.js → useCreditPacks-CfD1NWa_.js} +1 -1
- package/_assets/useImportable-BT9O6VkF.js +1 -0
- package/_assets/{useInfiniteGrid-6IGMMT5_.js → useInfiniteGrid-DtKMGQpL.js} +1 -1
- package/_assets/{useTheme-BwoD3vEY.js → useTheme-DWUAjMsm.js} +1 -1
- package/_assets/{verifyHash-C5CdkBh3.js → verifyHash-Dfknpu50.js} +1 -1
- package/_assets/{w3m-modal-B3GHykWz.js → w3m-modal-C0qGnhfo.js} +1 -1
- package/_assets/{w3m-modal-B3F6Mnna.js → w3m-modal-CdoCVhdl.js} +1 -1
- package/_assets/{wait-for-tx-receipt-C_FjDUYj.js → wait-for-tx-receipt-Bwjk5Mq0.js} +1 -1
- package/_assets/{wallets-DzQ1vri5.js → wallets-CTtGK85J.js} +5 -5
- package/_assets/{web-connector-B4iFaMmt.js → web-connector-DVU2yQ5E.js} +3 -3
- package/_assets/{writeContract-DaZaDo8I.js → writeContract-C0uKNOQ8.js} +1 -1
- package/_assets/{zoraTestnet-W4T_ajaY.js → zoraTestnet-CwVNTWsU.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-DRU10G0s.js +0 -381
- package/_assets/Cart-BHkq2PkV.js +0 -695
- package/_assets/ItemDetail-D-C6pe19.js +0 -3497
- package/_assets/LazyEmoteControls-BxXOD9g-.js +0 -2
- package/_assets/ManaPricingBanner.styles-D0ksfubq.js +0 -74
- package/_assets/authorizations-BJlchz9P.js +0 -1
- package/_assets/buy-DHqPe2Je.js +0 -1
- package/_assets/buy-gasless-CvTXQoUY.js +0 -1
- package/_assets/errors-CCUK8cBW.js +0 -1
- package/_assets/trade-encoding-dpFoczNW.js +0 -1
- package/_assets/useImportable-C11MUaBr.js +0 -1
|
@@ -1,3497 +0,0 @@
|
|
|
1
|
-
var xl=Object.defineProperty;var yl=(n,a,t)=>a in n?xl(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var H=(n,a,t)=>yl(n,typeof a!="symbol"?a+"":a,t);import{r as v,a as bl,j as s,d as Yt,l as _s,R as S,h as vl,u as wl,b as kl,L as Dl}from"./react-DehiWSvs.js";import{s as m,t as d,d as g,I as Q,a3 as Cl,w as Pe,az as Qe,e as wt,bP as Kr,k as Ot,b6 as Ps,b7 as Sl,x as Wt,be as Ml,av as js,aw as lr,bg as ha,S as ue,bk as Xe,bj as rt,cv as _l,A as Te,bi as Qr,bh as Is,b5 as Pl,r as jl,c as nn,g as ma,a as Il,C as Es,v as El,n as ge,F as Tl,W as Sr,ag as Mr,y as Ma,b4 as Zt,p as Ts,z as Rn,bq as $s,cw as $l,B as An,af as dn,au as Vr,K as Ns,bR as go,bS as Nl,i as Os,cx as Ol,o as Rl,Q as Tn,cy as Al,cz as Ll,cA as Fl,aa as Yl,cB as Wl,cC as Bl,ai as Rs,cD as As,cE as Hl,cF as zl,b as Ls,cG as ql,cH as Kl,cI as Ql,cJ as Vl,ay as Ul,cK as Xl,ah as Gl,l as Jl,m as Zl,cL as ed,cM as td,cN as nd,a4 as rd,a5 as ad,as as od,q as id,a6 as sd,a7 as cd,a8 as ld,cO as xo,bp as dd,cP as ud,cQ as pd,cR as fd,cS as hd,cT as md,cU as gd,cV as xd,cW as yd}from"./index-4grC8vnQ.js";import{d as Ae}from"./dcl-schemas-Dr9BTjb7.js";import{$ as Ur,m as bd,K as vd,V as wd,Q as Fs,R as kd,M as Dd,S as Cd,C as Sd,H as Md,a as _d,T as Pd,X as jd,b as Id,B as Ed,c as Td,d as $d,e as Nd,f as Qt,j as Vn,k as Vt,W as Od,p as Rd,q as Ad,P as Ld,x as Fd,y as Yd,z as Wd,D as Bd,E as Hd,F as zd,G as qd,I as Kd,J as Qd,L as Vd,l as Ud,n as Xd,o as Gd,a0 as Jd,a1 as Zd,A as eu,r as tu,s as nu,t as ru,u as au,v as ou,w as iu,a2 as su,a3 as cu,a4 as lu,N as du,O as yo,U as uu}from"./CollectionCarousel-3Ff7fmHM.js";import{a as dr,t as pu,c as fu}from"./buy-DHqPe2Je.js";import{b as hu,a as mu}from"./builder-Db8kqGSp.js";import{u as gu,M as xu,l as yu,c as bu}from"./useCreditPacks-B-X7zfCn.js";import{m as bo}from"./mana-matic-C4e1sNO3.js";import{j as Ys,a as Ws,n as vu,k as wu,b as vo,g as Bs,M as ku,e as Du,r as Cu,m as Su,c as Mu}from"./authorizations-BJlchz9P.js";import{a as Hs,w as zs,S as qs,G as Ks}from"./buy-gasless-CvTXQoUY.js";import{R as wo}from"./resume-buy-Bf0zIH7y.js";import{a as _u,f as bt,i as rn}from"./errors-CCUK8cBW.js";import{E as dt}from"./ErrorNotice-Biw7jacR.js";import{C as Pu}from"./CircularProgress-CQb8cfhx.js";import{f as ju,h as Iu,i as Eu,e as Tu,d as $u,a as Nu}from"./trade-encoding-dpFoczNW.js";import{M as Ou,E as Ru,s as Au}from"./sendMetaTransaction-BATUzHIf.js";import{C as Lu,I as Fu}from"./ethers-CtNGBird.js";import{E as Yu}from"./LazyEmoteControls-BxXOD9g-.js";import{u as Wu,d as Bu}from"./disposePreview-8oEf57G7.js";import{T as ko}from"./Tooltip-DIS1AoSo.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./clsx-WwvpwSg0.js";import"./styled-gTPQAN-Y.js";const an=Math.min,Et=Math.max,ur=Math.round,Un=Math.floor,ot=n=>({x:n,y:n}),Hu={left:"right",right:"left",bottom:"top",top:"bottom"};function zu(n,a,t){return Et(n,an(a,t))}function _r(n,a){return typeof n=="function"?n(a):n}function on(n){return n.split("-")[0]}function Ln(n){return n.split("-")[1]}function qu(n){return n==="x"?"y":"x"}function _a(n){return n==="y"?"height":"width"}function jt(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Pa(n){return qu(jt(n))}function Ku(n,a,t){t===void 0&&(t=!1);const e=Ln(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 Qu(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"],Vu=["top","bottom"],Uu=["bottom","top"];function Xu(n,a,t){switch(n){case"top":case"bottom":return t?a?Co:Do:a?Do:Co;case"left":case"right":return a?Vu:Uu;default:return[]}}function Gu(n,a,t,e){const r=Ln(n);let o=Xu(on(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=on(n);return Hu[a]+n.slice(a.length)}function Ju(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 Qs(n){return typeof n!="number"?Ju(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=jt(a),i=Pa(a),c=_a(i),l=on(a),f=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 y;switch(l){case"top":y={x:u,y:e.y-r.height};break;case"bottom":y={x:u,y:e.y+e.height};break;case"right":y={x:e.x+e.width,y:h};break;case"left":y={x:e.x-r.width,y:h};break;default:y={x:e.x,y:e.y}}const b=Ln(a);return b&&(y[i]+=x*(b==="end"?1:-1)*(t&&f?-1:1)),y}async function Zu(n,a){var t;a===void 0&&(a={});const{x:e,y:r,platform:o,rects:i,elements:c,strategy:l}=n,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:x=!1,padding:y=0}=_r(a,n),b=Qs(y),k=c[x?h==="floating"?"reference":"floating":h],p=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:f,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},R=fr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:$,strategy:l}):C);return{top:(p.top-R.top+b.top)/E.y,bottom:(R.bottom-p.bottom+b.bottom)/E.y,left:(p.left-R.left+b.left)/E.x,right:(R.right-p.right+b.right)/E.x}}const ep=50,tp=async(n,a,t)=>{const{placement:e="bottom",strategy:r="absolute",middleware:o=[],platform:i}=t,c=i.detectOverflow?i:{...i,detectOverflow:Zu},l=await(i.isRTL==null?void 0:i.isRTL(a));let f=await i.getElementRects({reference:n,floating:a,strategy:r}),{x:u,y:h}=So(f,e,l),x=e,y=0;const b={};for(let w=0;w<o.length;w++){const k=o[w];if(!k)continue;const{name:p,fn:C}=k,{x:$,y:E,data:R,reset:N}=await C({x:u,y:h,initialPlacement:e,placement:x,strategy:r,middlewareData:b,rects:f,platform:c,elements:{reference:n,floating:a}});u=$??u,h=E??h,b[p]={...b[p],...R},N&&y<ep&&(y++,typeof N=="object"&&(N.placement&&(x=N.placement),N.rects&&(f=N.rects===!0?await i.getElementRects({reference:n,floating:a,strategy:r}):N.rects),{x:u,y:h}=So(f,x,l)),w=-1)}return{x:u,y:h,placement:x,strategy:r,middlewareData:b}},np=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:f,padding:u=0}=_r(n,a)||{};if(f==null)return{};const h=Qs(u),x={x:t,y:e},y=Pa(r),b=_a(y),w=await i.getDimensions(f),k=y==="y",p=k?"top":"left",C=k?"bottom":"right",$=k?"clientHeight":"clientWidth",E=o.reference[b]+o.reference[y]-x[y]-o.floating[b],R=x[y]-o.reference[y],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let M=N?N[$]:0;(!M||!await(i.isElement==null?void 0:i.isElement(N)))&&(M=c.floating[$]||o.floating[b]);const D=E/2-R/2,_=M/2-w[b]/2-1,j=an(h[p],_),O=an(h[C],_),T=M-w[b]-O,W=M/2-w[b]/2+D,z=zu(j,W,T),U=!l.arrow&&Ln(r)!=null&&W!==z&&o.reference[b]/2-(W<j?j:O)-w[b]/2<0,Y=U?W<j?W-j:W-T:0;return{[y]:x[y]+Y,data:{[y]:z,centerOffset:W-z-Y,...U&&{alignmentOffset:Y}},reset:U}}}),rp=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:f}=a,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...k}=_r(n,a);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const p=on(r),C=jt(c),$=on(c)===c,E=await(l.isRTL==null?void 0:l.isRTL(f.floating)),R=x||($||!w?[pr(c)]:Qu(c)),N=b!=="none";!x&&N&&R.push(...Gu(c,w,b,E));const M=[c,...R],D=await l.detectOverflow(a,k),_=[];let j=((e=o.flip)==null?void 0:e.overflows)||[];if(u&&_.push(D[p]),h){const z=Ku(r,i,E);_.push(D[z[0]],D[z[1]])}if(j=[...j,{placement:r,overflows:_}],!_.every(z=>z<=0)){var O,T;const z=(((O=o.flip)==null?void 0:O.index)||0)+1,U=M[z];if(U&&(!(h==="alignment"?C!==jt(U):!1)||j.every(P=>jt(P.placement)===C?P.overflows[0]>0:!0)))return{data:{index:z,overflows:j},reset:{placement:U}};let Y=(T=j.filter(K=>K.overflows[0]<=0).sort((K,P)=>K.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!Y)switch(y){case"bestFit":{var W;const K=(W=j.filter(P=>{if(N){const Z=jt(P.placement);return Z===C||Z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(Z=>Z>0).reduce((Z,me)=>Z+me,0)]).sort((P,Z)=>P[1]-Z[1])[0])==null?void 0:W[0];K&&(Y=K);break}case"initialPlacement":Y=c;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}},ap=new Set(["left","top"]);async function op(n,a){const{placement:t,platform:e,elements:r}=n,o=await(e.isRTL==null?void 0:e.isRTL(r.floating)),i=on(t),c=Ln(t),l=jt(t)==="y",f=ap.has(i)?-1:1,u=o&&l?-1:1,h=_r(a,n);let{mainAxis:x,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),l?{x:y*u,y:x*f}:{x:x*f,y:y*u}}const ip=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 op(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 un(n){return Vs(n)?(n.nodeName||"").toLowerCase():"#document"}function je(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function ft(n){var a;return(a=(Vs(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function Vs(n){return Pr()?n instanceof Node||n instanceof je(n).Node:!1}function _e(n){return Pr()?n instanceof Element||n instanceof je(n).Element:!1}function Ct(n){return Pr()?n instanceof HTMLElement||n instanceof je(n).HTMLElement:!1}function Mo(n){return!Pr()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof je(n).ShadowRoot}function jr(n){const{overflow:a,overflowX:t,overflowY:e,display:r}=Fe(n);return/auto|scroll|overlay|hidden|clip/.test(a+e+t)&&r!=="inline"&&r!=="contents"}function sp(n){return/^(table|td|th)$/.test(un(n))}function Ir(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const cp=/transform|translate|scale|rotate|perspective|filter/,lp=/paint|layout|strict|content/,_t=n=>!!n&&n!=="none";let Xr;function ja(n){const a=_e(n)?Fe(n):n;return _t(a.transform)||_t(a.translate)||_t(a.scale)||_t(a.rotate)||_t(a.perspective)||!Ia()&&(_t(a.backdropFilter)||_t(a.filter))||cp.test(a.willChange||"")||lp.test(a.contain||"")}function dp(n){let a=Rt(n);for(;Ct(a)&&!$n(a);){if(ja(a))return a;if(Ir(a))return null;a=Rt(a)}return null}function Ia(){return Xr==null&&(Xr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xr}function $n(n){return/^(html|body|#document)$/.test(un(n))}function Fe(n){return je(n).getComputedStyle(n)}function Er(n){return _e(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Rt(n){if(un(n)==="html")return n;const a=n.assignedSlot||n.parentNode||Mo(n)&&n.host||ft(n);return Mo(a)?a.host:a}function Us(n){const a=Rt(n);return $n(a)?(n.ownerDocument||n).body:Ct(a)&&jr(a)?a:Us(a)}function Nn(n,a,t){var e;a===void 0&&(a=[]),t===void 0&&(t=!0);const r=Us(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=je(r);if(o){const c=xa(i);return a.concat(i,i.visualViewport||[],jr(r)?r:[],c&&t?Nn(c):[])}else return a.concat(r,Nn(r,[],t))}function xa(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Xs(n){const a=Fe(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 en(n){const a=Ea(n);if(!Ct(a))return ot(1);const t=a.getBoundingClientRect(),{width:e,height:r,$:o}=Xs(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 up=ot(0);function Gs(n){const a=je(n);return!Ia()||!a.visualViewport?up:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function pp(n,a,t){return a===void 0&&(a=!1),!!t&&a&&t===je(n)}function At(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=en(e)):i=en(n));const c=pp(o,t,e)?Gs(o):ot(0);let l=(r.left+c.x)/i.x,f=(r.top+c.y)/i.y,u=r.width/i.x,h=r.height/i.y;if(o&&e){const x=je(o),y=_e(e)?je(e):e;let b=x,w=xa(b);for(;w&&y!==b;){const k=en(w),p=w.getBoundingClientRect(),C=Fe(w),$=p.left+(w.clientLeft+parseFloat(C.paddingLeft))*k.x,E=p.top+(w.clientTop+parseFloat(C.paddingTop))*k.y;l*=k.x,f*=k.y,u*=k.x,h*=k.y,l+=$,f+=E,b=je(w),w=xa(b)}}return fr({width:u,height:h,x:l,y:f})}function Tr(n,a){const t=Er(n).scrollLeft;return a?a.left+t:At(ft(n)).left+t}function Js(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 fp(n){let{elements:a,rect:t,offsetParent:e,strategy:r}=n;const o=r==="fixed",i=ft(e),c=a?Ir(a.floating):!1;if(e===i||c&&o)return t;let l={scrollLeft:0,scrollTop:0},f=ot(1);const u=ot(0),h=Ct(e);if((h||!o)&&((un(e)!=="body"||jr(i))&&(l=Er(e)),h)){const y=At(e);f=en(e),u.x=y.x+e.clientLeft,u.y=y.y+e.clientTop}const x=i&&!h&&!o?Js(i,l):ot(0);return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-l.scrollLeft*f.x+u.x+x.x,y:t.y*f.y-l.scrollTop*f.y+u.y+x.y}}function hp(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function mp(n){const a=Er(n),t=n.ownerDocument.body,e=Et(n.scrollWidth,n.clientWidth,t.scrollWidth,t.clientWidth),r=Et(n.scrollHeight,n.clientHeight,t.scrollHeight,t.clientHeight);let o=-a.scrollLeft+Tr(n);const i=-a.scrollTop;return Fe(t).direction==="rtl"&&(o+=Et(n.clientWidth,t.clientWidth)-e),{width:e,height:r,x:o,y:i}}const gp=25;function xp(n,a,t){t===void 0&&(t="viewport");const e=t==="layoutViewport",r=je(n),o=ft(n),i=r.visualViewport;let c=o.clientWidth,l=o.clientHeight,f=0,u=0;if(i){const x=!Ia()||a==="fixed";e?x||(f=-i.offsetLeft,u=-i.offsetTop):(c=i.width,l=i.height,x&&(f=i.offsetLeft,u=i.offsetTop))}if(Tr(o)<=0){const x=o.ownerDocument,y=x.body,b=getComputedStyle(y),w=x.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,k=Math.abs(o.clientWidth-y.clientWidth-w),p=getComputedStyle(o).scrollbarGutter==="stable both-edges"?k/2:k;p<=gp&&(c-=p)}return{width:c,height:l,x:f,y:u}}function yp(n,a){const t=At(n,!0,a==="fixed"),e=t.top+n.clientTop,r=t.left+n.clientLeft,o=en(n),i=n.clientWidth*o.x,c=n.clientHeight*o.y,l=r*o.x,f=e*o.y;return{width:i,height:c,x:l,y:f}}function _o(n,a,t){let e;if(a==="viewport"||a==="layoutViewport")e=xp(n,t,a);else if(a==="document")e=mp(ft(n));else if(_e(a))e=yp(a,t);else{const r=Gs(n);e={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}return fr(e)}function bp(n,a){const t=a.get(n);if(t)return t;let e=Nn(n,[],!1).filter(c=>_e(c)&&un(c)!=="body"),r=null;const o=Fe(n).position==="fixed";let i=o?Rt(n):n;for(;_e(i)&&!$n(i);){const c=Fe(i),l=ja(i),f=r?r.position:o?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?e=e.filter(h=>h!==i):r=c,i=Rt(i)}return a.set(n,e),e}function vp(n){let{element:a,boundary:t,rootBoundary:e,strategy:r}=n;const i=[...t==="clippingAncestors"?Ir(a)?[]:bp(a,this._c):[].concat(t),e],c=_o(a,i[0],r);let l=c.top,f=c.right,u=c.bottom,h=c.left;for(let x=1;x<i.length;x++){const y=_o(a,i[x],r);l=Et(y.top,l),f=an(y.right,f),u=an(y.bottom,u),h=Et(y.left,h)}return{width:f-h,height:u-l,x:h,y:l}}function wp(n){const{width:a,height:t}=Xs(n);return{width:a,height:t}}function kp(n,a,t){const e=Ct(a),r=ft(a),o=t==="fixed",i=At(n,!0,o,a);let c={scrollLeft:0,scrollTop:0};const l=ot(0);if((e||!o)&&((un(a)!=="body"||jr(r))&&(c=Er(a)),e)){const x=At(a,!0,o,a);l.x=x.x+a.clientLeft,l.y=x.y+a.clientTop}!e&&r&&(l.x=Tr(r));const f=r&&!e&&!o?Js(r,c):ot(0),u=i.left+c.scrollLeft-l.x-f.x,h=i.top+c.scrollTop-l.y-f.y;return{x:u,y:h,width:i.width,height:i.height}}function Gr(n){return Fe(n).position==="static"}function Po(n,a){if(!Ct(n)||Fe(n).position==="fixed")return null;if(a)return a(n);let t=n.offsetParent;return ft(n)===t&&(t=t.ownerDocument.body),t}function Zs(n,a){const t=je(n);if(Ir(n))return t;if(!Ct(n)){let r=Rt(n);for(;r&&!$n(r);){if(_e(r)&&!Gr(r))return r;r=Rt(r)}return t}let e=Po(n,a);for(;e&&sp(e)&&Gr(e);)e=Po(e,a);return e&&$n(e)&&Gr(e)&&!ja(e)?t:e||dp(n)||t}const Dp=async function(n){const a=this.getOffsetParent||Zs,t=this.getDimensions,e=await t(n.floating);return{reference:kp(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:e.width,height:e.height}}};function Cp(n){return Fe(n).direction==="rtl"}const Sp={convertOffsetParentRelativeRectToViewportRelativeRect:fp,getDocumentElement:ft,getClippingRect:vp,getOffsetParent:Zs,getElementRects:Dp,getClientRects:hp,getDimensions:wp,getScale:en,isElement:_e,isRTL:Cp};function ec(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function Mp(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:y,top:b,width:w,height:k}=x;if(u||a(),!w||!k)return;const p=Un(b),C=Un(o.clientWidth-(y+w)),$=Un(o.clientHeight-(b+k)),E=Un(y),N={rootMargin:-p+"px "+-C+"px "+-$+"px "+-E+"px",threshold:Et(0,an(1,h))||1};let M=!0;function D(_){const j=_[0].intersectionRatio;if(!ec(x,n.getBoundingClientRect()))return c();if(j!==h){if(!M)return c();j?c(!1,j):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M=!1}try{e=new IntersectionObserver(D,{...N,root:o.ownerDocument})}catch{e=new IntersectionObserver(D,N)}e.observe(n)}const l=je(n),f=()=>c(t);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),i()}}function _p(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,f=Ea(n),u=r||o?[...f?Nn(f):[],...a?Nn(a):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",t),o&&p.addEventListener("resize",t)});const h=f&&c?Mp(f,t,o):null;let x=-1,y=null;i&&(y=new ResizeObserver(p=>{let[C]=p;C&&C.target===f&&y&&a&&(y.unobserve(a),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var $;($=y)==null||$.observe(a)})),t()}),f&&!l&&y.observe(f),a&&y.observe(a));let b,w=l?At(n):null;l&&k();function k(){const p=At(n);w&&!ec(w,p)&&t(),w=p,b=requestAnimationFrame(k)}return t(),()=>{var p;u.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h==null||h(),(p=y)==null||p.disconnect(),y=null,l&&cancelAnimationFrame(b)}}const Pp=ip,jp=rp,jo=np,Ip=(n,a,t)=>{const e=new Map,r=t??{},o={...Sp,...r.platform,_c:e};return tp(n,a,{...r,platform:o})};var Ep=typeof document<"u",Tp=function(){},rr=Ep?v.useLayoutEffect:Tp;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 tc(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Io(n,a){const t=tc(n);return Math.round(a*t)/t}function Jr(n){const a=v.useRef(n);return rr(()=>{a.current=n}),a}function $p(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:f}=n,[u,h]=v.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:!1}),[x,y]=v.useState(e);hr(x,e)||y(e);const[b,w]=v.useState(null),[k,p]=v.useState(null),C=v.useCallback(P=>{P!==N.current&&(N.current=P,w(P))},[]),$=v.useCallback(P=>{P!==M.current&&(M.current=P,p(P))},[]),E=o||b,R=i||k,N=v.useRef(null),M=v.useRef(null),D=v.useRef(u),_=l!=null,j=Jr(l),O=Jr(r),T=Jr(f),W=v.useCallback(()=>{if(!N.current||!M.current)return;const P={placement:a,strategy:t,middleware:x};O.current&&(P.platform=O.current),Ip(N.current,M.current,P).then(Z=>{const me={...Z,isPositioned:T.current!==!1};z.current&&!hr(D.current,me)&&(D.current=me,bl.flushSync(()=>{h(me)}))})},[x,a,t,O,T]);rr(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[f]);const z=v.useRef(!1);rr(()=>(z.current=!0,()=>{z.current=!1}),[]),rr(()=>{if(E&&(N.current=E),R&&(M.current=R),E&&R){if(j.current)return j.current(E,R,W);W()}},[E,R,W,j,_]);const U=v.useMemo(()=>({reference:N,floating:M,setReference:C,setFloating:$}),[C,$]),Y=v.useMemo(()=>({reference:E,floating:R}),[E,R]),K=v.useMemo(()=>{const P={position:t,left:0,top:0};if(!Y.floating)return P;const Z=Io(Y.floating,u.x),me=Io(Y.floating,u.y);return c?{...P,transform:"translate("+Z+"px, "+me+"px)",...tc(Y.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:Z,top:me}},[t,c,Y.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:W,refs:U,elements:Y,floatingStyles:K}),[u,W,U,Y,K])}const Np=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?jo({element:e.current,padding:r}).fn(t):{}:e?jo({element:e,padding:r}).fn(t):{}}}},Op=(n,a)=>{const t=Pp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Rp=(n,a)=>{const t=jp(n);return{name:t.name,fn:t.fn,options:[n,a]}},Ap=(n,a)=>{const t=Np(n);return{name:t.name,fn:t.fn,options:[n,a]}},nc=216n,Lp=(1n<<nc)-1n;function Fp(n){const a=typeof n=="bigint"?n:BigInt(n.trim());if(a<0n)throw new Error(`Invalid tokenId: ${String(n)}`);return{itemId:(a>>nc).toString(),issuedId:(a&Lp).toString()}}function Yp(n){if(!n)return null;try{return Fp(n).itemId}catch{return null}}const rc=["cancelled-listings"];function Wp(n,a){a&&n.setQueryData(rc,t=>t!=null&&t.includes(a)?t:[...t??[],a])}function Eo(n,a){var t;if(a)return(t=n.getQueryData(rc))!=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]},f=>f&&(c?null:To(f,t)));const l=e?["my-assets",e]:["my-assets"];n.setQueriesData({queryKey:l},f=>f!=null&&f.pages?{...f,pages:f.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)}})}:f),n.setQueriesData({queryKey:["secondary-sale-state"]},f=>{var h;if(!f)return f;const u={...f};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 Bp(n){return!(n.isMarket||n.forSale&&n.priceKnown||n.manage||n.soldOutWithResale||!n.stillResolving&&!n.resolvingTrade&&(n.isTokenRoute?!n.ownedAssetLoading:!n.deepLinkLoading))}const Hp="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==",zp="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=",qp=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
|
-
`,Kp=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
|
-
`,Qp=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
|
-
`,Vp=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
|
-
`,Up=m.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
gap: 12px;
|
|
45
|
-
`,Xp=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
|
-
`,Gp=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
|
-
`,Jp=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
|
-
`,Zp=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
|
-
`,ef=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
|
-
`,tf=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
|
-
`,nf=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
|
-
`,rf=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
|
-
`,af=m.img`
|
|
292
|
-
width: 13px;
|
|
293
|
-
height: 13px;
|
|
294
|
-
display: block;
|
|
295
|
-
`,of=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 sf=m.span`
|
|
344
|
-
font-family: ${d.font.sans};
|
|
345
|
-
font-size: 11px;
|
|
346
|
-
line-height: 1.35;
|
|
347
|
-
color: ${d.colors.muted};
|
|
348
|
-
`;function cf({item:n,priceCredits:a,priceCents:t,options:e,priceManaWei:r,balanceCredits:o,manaBalanceWei:i,onBuy:c,onClose:l,busy:f=!1,shortfall:u}){const h=e.find(j=>j.method==="credits")??null,x=e.find(j=>j.method==="mana")??null,y=e.find(j=>j.method==="combined")??null,[b,w]=v.useState(()=>h?new Set(["credits"]):y?new Set(["credits","mana"]):x?new Set(["mana"]):new Set),k=!!h||!!y,p=!!x||!!y;v.useEffect(()=>{w(j=>{const O=new Set(j);return O.has("credits")&&!k&&O.delete("credits"),O.has("mana")&&!p&&O.delete("mana"),O.size===j.size?j:O})},[k,p]);const C=b.has("credits"),$=b.has("mana"),E=C&&$?y?"combined":null:C?h?"credits":null:$&&x?"mana":null,R=bd(t,r),N=R!=null?g("buyModal.manaRate",{mana:R.toLocaleString("en",{maximumFractionDigits:2})}):null,M=E==="combined"&&y?y.creditsCents:(h==null?void 0:h.creditsCents)??t,D=E==="combined"&&y?y.manaWei:(x==null?void 0:x.manaWei)??r;function _(j){w(O=>{const T=new Set(O);return T.has(j)?T.delete(j):T.add(j),T})}return s.jsxs(qp,{children:[s.jsxs(Kp,{children:[s.jsx(Qp,{children:g("buyModal.choosePayment")}),s.jsx(Vp,{onClick:l,disabled:f,"aria-label":g("buyModal.close"),children:s.jsx(Q,{name:"close",className:"ico"})})]}),s.jsxs(Up,{children:[s.jsx(Xp,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(Gp,{children:[s.jsxs("div",{children:[s.jsx(Jp,{title:n.name,children:n.name||g("buyModal.itemFallback")}),n.creator?s.jsx(Zp,{children:s.jsx(Cl,{address:n.creator})}):null]}),s.jsxs(ef,{children:[s.jsx(Pe,{}),s.jsx("span",{children:Qe(a)})]})]})]}),s.jsxs(tf,{children:[s.jsxs($o,{type:"button","data-testid":"pay-with-credits","data-selected":C,"data-disabled":!k,disabled:f||!k,"aria-pressed":C,onClick:()=>_("credits"),children:[s.jsx(No,{children:s.jsx(Oo,{"data-checked":C,children:s.jsx(Q,{name:"check",className:"ico"})})}),s.jsxs(Ro,{children:[s.jsxs(Ao,{children:[s.jsx(Lo,{children:s.jsx(Fo,{src:Hp,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(M))})]})})]})]}),s.jsxs($o,{type:"button","data-testid":"pay-with-mana","data-selected":$,"data-disabled":!p,disabled:f||!p,"aria-pressed":$,onClick:()=>_("mana"),children:[s.jsx(No,{children:s.jsx(Oo,{"data-checked":$,children:s.jsx(Q,{name:"check",className:"ico"})})}),s.jsxs(Ro,{children:[s.jsxs(Ao,{children:[s.jsx(Lo,{children:s.jsx(Fo,{src:zp,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(af,{src:bo,alt:"","aria-hidden":!0}),s.jsx(Ho,{children:Kr(i)})]})]})]}),s.jsx(qo,{children:p?s.jsxs(s.Fragment,{children:[s.jsxs(zo,{children:[s.jsx(of,{src:bo,alt:"","aria-hidden":!0}),s.jsx("span",{children:Kr(D)})]}),N?s.jsx(nf,{"data-testid":"mana-rate-note",children:N}):null]}):s.jsx(sf,{"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(rf,{type:"button","data-testid":"confirm-payment",disabled:f||E===null,onClick:()=>E&&c(E),children:g("buyModal.buy")})]})}function ac(){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 lf({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 df(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 zt,gt;const{session:e}=Ot(),{data:r}=Ps(e),{data:o}=Sl(e),i=Wt(),c=Yt();async function l(L){var q;const V=(q=L.received)==null?void 0:q[0];if((V==null?void 0:V.assetType)!==Number(Ae.TradeAssetType.USD_PEGGED_MANA))try{return await i.fetchQuery({queryKey:["mana-rate",nn.chainId],queryFn:()=>jl(nn.chainId),staleTime:6e4})}catch{return}}const f=gu().packs.slice(0,xu),[u,h]=v.useState("loading"),[x,y]=v.useState(null),[b,w]=v.useState(""),[k,p]=v.useState(n.priceCredits),[C,$]=v.useState(null),[E,R]=v.useState(null),[N,M]=v.useState(0),[D,_]=v.useState(null),j=v.useRef(null),O=v.useRef(ac()),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"),y(g("buyModal.signInToCheckout"));return}const V=q=>{const re=q-((r==null?void 0:r.credits)??0),J=f.find(ye=>ye.credits>=re)??f[f.length-1];w(J.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,re)}),h("nofunds")};return(async()=>{try{const q=await Ml(n);if(!q)throw new Error("not for sale");if(js(q,e.address))throw new Error("You can't buy your own listing.");const re=yu(q,await l(q));if(!Number.isFinite(re)||re<=0)throw new Error("price unavailable");const J=lr(re);if(L)return;if(p(J),R(q),M(re),r!=null&&r.credits<J){V(J);return}try{const{credit:ye,maxCreditedValue:St,usdCents:Oe}=await ha(e.identity,re,q.id);if(L){Y([ye.id]);return}j.current=ye.id;const hn=lr(Oe);p(hn);const mn={trade:q,credit:ye,maxCreditedValue:St,usdCents:Oe,credits:hn};_(mn),t?U(mn):h("ready")}catch(ye){if(L)return;if(_u(ye)){V(J);return}throw ye}}catch(q){if(L)return;ue(rt(q)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Xe(q)}),h("error"),y(bt(q,g("buyModal.error.generic"),{sale:!0}))}})(),()=>{L=!0,j.current&&e&&(K([j.current]),j.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 V=!1;return _l(L).then(q=>{V||$(q)}).catch(q=>{}),()=>{V=!0}},[u,D,E,o,C]);const z=vd({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"),y(null);let V=!1,q;try{const re={trade:L.trade,buyer:e.address,signer:e.signer,credits:[L.credit],maxCreditedValue:L.maxCreditedValue,onBroadcast:({txHash:J})=>O.current.broadcast(L.credit.id,J),onReverted:({txHash:J})=>{J&&O.current.reverted(J)}};if(O.current.submitStarted(L.credit.id),Ys())try{q=await Hs(re),O.current.broadcast(L.credit.id,q),await zs(q),V=!0}catch(J){if(J instanceof qs)V=!0;else if(J instanceof Ks){if(J.reason==="relayer-unreachable")throw O.current.unobservable(L.credit.id),J;q=await dr(re)}else throw q&&O.current.reverted(q),J}else q=await dr(re)}catch(re){O.current.submitFinished(L.credit.id),rt(re)||Te(re,{flow:"buy",step:"submit",gasless:V}),Y([L.credit.id]),j.current=null,ue(rt(re)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(re)}),i.invalidateQueries({queryKey:["usd-balance"]}),y(bt(re,g("buyModal.error.generic"),{sale:!0})),h("error");return}O.current.submitFinished(L.credit.id),j.current=null;try{wd(i,n),ue("Shop Completed Purchase",{...Qr([n]),payment_type:"credits",no_crypto_step:V,transaction_hash:q??null})}catch(re){Te(re,{flow:"buy",step:"post_purchase"})}h("complete")}function Y(L){if(!e||L.length===0)return;const V=L.filter(q=>!O.current.mayBeConsumed(q));V.length!==0&&Is(e.identity,V).catch(()=>{})}function K(L){Y(L.filter(V=>!O.current.isInFlight(V)))}function P(){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 Z(){const L=(D==null?void 0:D.trade)??E;if(!(!e||!L)){j.current&&(Y([j.current]),j.current=null),h("processing"),y(null);try{const V=await su({trade:L,buyer:e.address,signer:e.signer});ue("Shop Completed Purchase",{...Qr([n]),payment_type:"mana",transaction_hash:V??null}),P(),h("complete")}catch(V){rt(V)||Te(V,{flow:"buy_mana",step:"submit"}),ue(rt(V)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(V)}),y(bt(V,g("buyModal.error.generic"),{sale:!0})),h("error")}}}async function me(){const L=(D==null?void 0:D.trade)??E,V=cu(z,"combined");if(!e||!L||!V)return;h("processing"),y(null),j.current&&(Y([j.current]),j.current=null);let q=null,re;try{const{credit:J}=await ha(e.identity,V.creditsCents,L.id);q=J.id,O.current.submitStarted(J.id),re=await lu({trade:L,buyer:e.address,signer:e.signer,credits:[J],manaGapWei:V.manaWei,onBroadcast:({txHash:ye})=>O.current.broadcast(J.id,ye),onReverted:({txHash:ye})=>{ye&&O.current.reverted(ye)}})}catch(J){q&&O.current.submitFinished(q),q&&Y([q]),rt(J)||Te(J,{flow:"buy_credits_and_mana",step:"submit"}),ue(rt(J)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Xe(J)}),i.invalidateQueries({queryKey:["usd-balance"]}),y(bt(J,g("buyModal.error.generic"),{sale:!0})),h("error");return}q&&O.current.submitFinished(q);try{P(),ue("Shop Completed Purchase",{...Qr([n]),payment_type:"credits_and_mana",transaction_hash:re??null})}catch(J){Te(J,{flow:"buy_credits_and_mana",step:"post_purchase"})}h("complete")}async function xe(){if(!(!b||!e)){try{sessionStorage.setItem(wo,JSON.stringify(n))}catch{}D&&Y([D.credit.id]),j.current=null,h("loading");try{const L=await bu(b,{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{}y(g("buyModal.error.creditsCheckout")),h("error")}}}const[We,Ce]=v.useState(null);function ve(L,V){const q=L==="mana"?ma(Il(V.contract),V.chainId).address:ma(Es.CreditsManager,V.chainId).address;return wu(V.chainId,q)}function ht(L){L==="mana"?Z():L==="combined"?me():U()}async function mt(L){const V=(D==null?void 0:D.trade)??E;if(L==="credits"||!V||!e){ht(L);return}const q=ve(L,V),re=await Ws(q,e.address).catch(()=>!0);if(vu(e.providerType,re)){Ce({auth:q,rail:L});return}ht(L)}const Ht=z.options.some(L=>L.method==="mana"||L.method==="combined"),Fr=u==="ready"&&(Ht||z.manaShortfall!=null)||u==="nofunds"&&Ht,fn=u==="processing",Wn=u==="complete"?g("buyModal.titleComplete"):u==="nofunds"?g("buyModal.titleNoFunds"):g("buyModal.titleBuy");return We&&e?s.jsx(Fs,{auth:We.auth,signer:e.signer,title:g(We.rail==="mana"?"authorizeStep.manaTitle":"authorizeStep.buyTitle"),name:g(We.rail==="mana"?"authorizeStep.manaName":"authorizeStep.buyName"),reason:g(We.rail==="mana"?"authorizeStep.manaReason":"authorizeStep.buyReason"),icon:s.jsx("img",{src:kd,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{rail:L}=We;Ce(null),ht(L)},onCancel:()=>Ce(null),onClose:()=>{Ce(null),a()}}):s.jsxs(Dd,{role:"dialog","aria-modal":"true","aria-label":g("buyModal.dialogAria",{name:n.name}),"data-testid":"buy-modal",children:[s.jsx(Cd,{onClick:fn?void 0:a,"aria-hidden":!0}),s.jsx(Sd,{"data-tall":u==="processing"||u==="loading"||void 0,children:Fr?s.jsx(cf,{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:fn,shortfall:z.manaShortfall}):s.jsxs(s.Fragment,{children:[s.jsxs(Md,{children:[s.jsxs(_d,{children:[s.jsx(Pd,{children:Wn}),!fn&&s.jsx(jd,{onClick:a,"aria-label":g("buyModal.close"),children:s.jsx(Id,{})})]}),s.jsxs(Ed,{children:[s.jsx(Td,{children:u==="nofunds"?g("buyModal.dclBalance"):g("buyModal.myCreditsBalance")}),s.jsx($d,{}),s.jsx(Nd,{children:Qe(W)})]})]}),u==="loading"&&s.jsx(Qt,{"data-processing":!0,children:s.jsx(Pu,{size:44})}),u==="error"&&s.jsxs(Qt,{children:[s.jsx(dt,{message:x}),s.jsx(Vn,{children:s.jsx(Vt,{"data-variant":"gradient",onClick:a,children:g("buyModal.close")})})]}),u==="nofunds"&&s.jsxs(Qt,{children:[s.jsxs(Od,{children:[s.jsx(Rd,{}),s.jsxs(Ad,{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(Ld,{options:[],totalCents:N,onPay:()=>{},shortfall:z.manaShortfall}):null,s.jsx(Fd,{"data-testid":"credit-packs",children:f.map(L=>{const V=L.credits,q=L.id===b;return s.jsxs(Yd,{"data-on":q||void 0,onClick:()=>w(L.id),children:[s.jsx(Wd,{}),s.jsx(Bd,{children:Qe(V)}),s.jsxs(Hd,{children:["($",L.usd.toFixed(2),")"]})]},L.id)})}),s.jsxs(zd,{children:[s.jsxs(qd,{children:[s.jsx(Kd,{}),s.jsx("span",{children:Qe(((zt=f.find(L=>L.id===b))==null?void 0:zt.credits)??0)})]}),s.jsxs(Qd,{children:["$",(((gt=f.find(L=>L.id===b))==null?void 0:gt.usd)??0).toFixed(2)]})]}),s.jsxs(Vn,{children:[s.jsx(Vt,{"data-variant":"outline",onClick:a,children:g("buyModal.cancel")}),s.jsx(Vt,{"data-variant":"gradient",onClick:()=>void xe(),children:g("buyModal.buy")})]})]}),u==="ready"&&s.jsxs(Qt,{children:[s.jsx(Ko,{item:n,priceCredits:T}),s.jsx(Vn,{children:s.jsx(Vt,{"data-variant":"gradient","data-full":!0,onClick:()=>void U(),children:g("buyModal.buy")})})]}),u==="processing"&&s.jsxs(Qt,{"data-processing":!0,children:[s.jsx(Vd,{src:Pl,alt:"",width:61,height:61}),s.jsx(Ud,{children:t?g("buyModal.completingPurchase"):g("buyModal.completingTransaction")}),s.jsx(Xd,{"aria-hidden":!0,children:s.jsx(Gd,{})})]}),u==="complete"&&s.jsxs(Qt,{children:[s.jsxs(Jd,{children:[s.jsx(lf,{}),s.jsxs(Zd,{children:[s.jsx("b",{children:g("getCredits.successTitle")})," ",g("buyModal.successBody")]})]}),s.jsxs(Vn,{children:[s.jsx(Vt,{"data-variant":"outline",onClick:()=>c("/items?tab=mine"),children:g("buyModal.myAssets")}),s.jsxs(Vt,{"data-variant":"ruby",onClick:a,children:[g("buyModal.tryInWorld"),s.jsx(df,{})]})]})]})]})})]})}function Ko({item:n,priceCredits:a}){return s.jsxs(eu,{children:[s.jsx(tu,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(nu,{children:[s.jsxs("div",{children:[s.jsx(ru,{title:n.name,children:n.name||g("buyModal.itemFallback")}),n.creator?s.jsx(au,{address:n.creator}):null]}),s.jsxs(ou,{children:[s.jsx(iu,{}),s.jsx("span",{children:Qe(a)})]})]})]})}function oc(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=oc(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=oc(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 Le(n,a){const t=B(n);return isNaN(a)?oe(n,NaN):(a&&t.setDate(t.getDate()+a),t)}function Ye(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 ic=6048e5,uf=864e5,$r=6e4,Nr=36e5,pf=1e3;function ff(n,a){return Ta(n,a*Nr)}let hf={};function Bt(){return hf}function ut(n,a){var c,l,f,u;const t=Bt(),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=(f=t.locale)==null?void 0:f.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 sn(n){return ut(n,{weekStartsOn:1})}function sc(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=sn(e),o=oe(n,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const i=sn(o);return a.getTime()>=r.getTime()?t+1:a.getTime()>=i.getTime()?t:t-1}function Lt(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 cn(n,a){const t=Lt(n),e=Lt(a),r=+t-mr(t),o=+e-mr(e);return Math.round((r-o)/uf)}function mf(n){const a=sc(n),t=oe(n,0);return t.setFullYear(a,0,4),t.setHours(0,0,0,0),sn(t)}function ba(n,a){return Ta(n,a*$r)}function $a(n,a){const t=a*3;return Ye(n,t)}function gf(n,a){return Ta(n,a*1e3)}function gr(n,a){const t=a*7;return Le(n,t)}function it(n,a){return Ye(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 xf(n,a){const t=Lt(n),e=Lt(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 Tt(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=Tt(t)-Tt(e);return r*4+o}function vr(n,a){const t=B(n),e=B(a);return t.getFullYear()-e.getFullYear()}function yf(n,a){const t=B(n),e=B(a),r=Uo(t,e),o=Math.abs(cn(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 cc(n){const a=B(n);return a.setHours(23,59,59,999),a}function lc(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 dc(n){const a=B(n);return a.setDate(1),a.setHours(0,0,0,0),a}function uc(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 bf(n,a){var c,l;const t=Bt(),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 vf={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"}},wf=(n,a,t)=>{let e;const r=vf[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 kf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Df={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Cf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sf={date:ea({formats:kf,defaultWidth:"full"}),time:ea({formats:Df,defaultWidth:"full"}),dateTime:ea({formats:Cf,defaultWidth:"full"})},Mf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_f=(n,a,t,e)=>Mf[n];function kn(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 Pf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},If={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"]},Ef={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"]},Tf={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"}},$f={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"}},Nf=(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"},Of={ordinalNumber:Nf,era:kn({values:Pf,defaultWidth:"wide"}),quarter:kn({values:jf,defaultWidth:"wide",argumentCallback:n=>n-1}),month:kn({values:If,defaultWidth:"wide"}),day:kn({values:Ef,defaultWidth:"wide"}),dayPeriod:kn({values:Tf,defaultWidth:"wide",formattingValues:$f,defaultFormattingWidth:"wide"})};function Dn(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)?Af(c,h=>h.test(i)):Rf(c,h=>h.test(i));let f;f=n.valueCallback?n.valueCallback(l):l,f=t.valueCallback?t.valueCallback(f):f;const u=a.slice(i.length);return{value:f,rest:u}}}function Rf(n,a){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&a(n[t]))return t}function Af(n,a){for(let t=0;t<n.length;t++)if(a(n[t]))return t}function Lf(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 Ff=/^(\d+)(th|st|nd|rd)?/i,Yf=/\d+/i,Wf={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},Bf={any:[/^b/i,/^(a|c)/i]},Hf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zf={any:[/1/i,/2/i,/3/i,/4/i]},qf={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},Kf={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]},Qf={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},Vf={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]},Uf={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},Xf={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}},Gf={ordinalNumber:Lf({matchPattern:Ff,parsePattern:Yf,valueCallback:n=>parseInt(n,10)}),era:Dn({matchPatterns:Wf,defaultMatchWidth:"wide",parsePatterns:Bf,defaultParseWidth:"any"}),quarter:Dn({matchPatterns:Hf,defaultMatchWidth:"wide",parsePatterns:zf,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Dn({matchPatterns:qf,defaultMatchWidth:"wide",parsePatterns:Kf,defaultParseWidth:"any"}),day:Dn({matchPatterns:Qf,defaultMatchWidth:"wide",parsePatterns:Vf,defaultParseWidth:"any"}),dayPeriod:Dn({matchPatterns:Uf,defaultMatchWidth:"any",parsePatterns:Xf,defaultParseWidth:"any"})},pc={code:"en-US",formatDistance:wf,formatLong:Sf,formatRelative:_f,localize:Of,match:Gf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Jf(n){const a=B(n);return cn(a,Or(a))+1}function Na(n){const a=B(n),t=+sn(a)-+mf(a);return Math.round(t/ic)+1}function Oa(n,a){var u,h,x,y;const t=B(n),e=t.getFullYear(),r=Bt(),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??((y=(x=r.locale)==null?void 0:x.options)==null?void 0:y.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 f=ut(l,a);return t.getTime()>=c.getTime()?e+1:t.getTime()>=f.getTime()?e:e-1}function Zf(n,a){var c,l,f,u;const t=Bt(),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=(f=t.locale)==null?void 0:f.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 fc(n,a){const t=B(n),e=+ut(t,a)-+Zf(t,a);return Math.round(e/ic)+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)}},Ut={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=sc(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=fc(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=Jf(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=Ut.noon:e===0?r=Ut.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=Ut.evening:e>=12?r=Ut.afternoon:e>=4?r=Ut.morning:r=Ut.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 Pt(e);case"XXXXX":case"XXX":default:return Pt(e,":")}},x:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"x":return Jo(e);case"xxxx":case"xx":return Pt(e);case"xxxxx":case"xxx":default:return Pt(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"+Pt(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"+Pt(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):Pt(n,a)}function Pt(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"})}},hc=(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"})}},eh=(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}}",hc(r,a))},wr={p:hc,P:eh},th=/^D+$/,nh=/^Y+$/,rh=["D","DD","YY","YYYY"];function mc(n){return th.test(n)}function gc(n){return nh.test(n)}function wa(n,a,t){const e=ah(n,a,t);if(console.warn(e),rh.includes(n))throw new RangeError(e)}function ah(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 oh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ih=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sh=/^'([^]*?)'?$/,ch=/''/g,lh=/[a-zA-Z]/;function ei(n,a,t){var u,h,x,y,b,w,k,p;const e=Bt(),r=(t==null?void 0:t.locale)??e.locale??pc,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??((y=(x=e.locale)==null?void 0:x.options)==null?void 0:y.firstWeekContainsDate)??1,i=(t==null?void 0:t.weekStartsOn)??((w=(b=t==null?void 0:t.locale)==null?void 0:b.options)==null?void 0:w.weekStartsOn)??e.weekStartsOn??((p=(k=e.locale)==null?void 0:k.options)==null?void 0:p.weekStartsOn)??0,c=B(n);if(!xr(c))throw new RangeError("Invalid time value");let l=a.match(ih).map(C=>{const $=C[0];if($==="p"||$==="P"){const E=wr[$];return E(C,r.formatLong)}return C}).join("").match(oh).map(C=>{if(C==="''")return{isToken:!1,value:"'"};const $=C[0];if($==="'")return{isToken:!1,value:dh(C)};if(Xo[$])return{isToken:!0,value:C};if($.match(lh))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 f={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return l.map(C=>{if(!C.isToken)return C.value;const $=C.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&gc($)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&mc($))&&wa($,a,String(n));const E=Xo[$[0]];return E(c,$,r.localize,f)}).join("")}function dh(n){const a=n.match(sh);return a?a[1].replace(ch,"'"):n}function ti(n){return B(n).getDate()}function uh(n){return B(n).getDay()}function ph(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 fh(){return Object.assign({},Bt())}function Je(n){return B(n).getHours()}function hh(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 Ft(n,a){const t=B(n),e=B(a);return+t<+e}function mh(n,a){const t=B(n),e=B(a);return+t==+e}function gh(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 xh=10;class xc{constructor(){H(this,"subPriority",0)}validate(a,t){return!0}}class yh extends xc{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 bh extends xc{constructor(){super(...arguments);H(this,"priority",xh);H(this,"subPriority",-1)}set(t,e){return e.timestampIsSet?t:oe(t,gh(t,Date))}}class ne{run(a,t,e,r){const o=this.parse(a,t,e,r);return o?{setter:new yh(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(a,t,e){return!0}}class vh extends ne{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*pf),rest:a.slice(t[0].length)}}function yc(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 bc(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 vc(n){return n%400===0||n%4===0&&n%100!==0}class wh extends ne{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=bc(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 kh extends ne{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=bc(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 Dh extends ne{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),sn(o)}}class Ch extends ne{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 Sh extends ne{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 Mh extends ne{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 _h extends ne{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 Ph extends ne{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 jh(n,a,t){const e=B(n),r=fc(e,t)-a;return e.setDate(e.getDate()-r*7),e}class Ih extends ne{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(jh(t,r,o),o)}}function Eh(n,a){const t=B(n),e=Na(t)-a;return t.setDate(t.getDate()-e*7),t}class Th extends ne{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 sn(Eh(t,r))}}const $h=[31,28,31,30,31,30,31,31,30,31,30,31],Nh=[31,29,31,30,31,30,31,31,30,31,30,31];class Oh extends ne{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=vc(r),i=t.getMonth();return o?e>=1&&e<=Nh[i]:e>=1&&e<=$h[i]}set(t,e,r){return t.setDate(r),t.setHours(0,0,0,0),t}}class Rh extends ne{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 vc(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,y,b;const e=Bt(),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??((b=(y=e.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,o=B(n),i=o.getDay(),l=(a%7+7)%7,f=7-r,u=a<0||a>6?a-(i+f)%7:(l+f)%7-(i+f)%7;return Le(o,u)}class Ah extends ne{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 Lh extends ne{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 Fh extends ne{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 Yh(n,a){const t=B(n),e=hh(t),r=a-e;return Le(t,r)}class Wh extends ne{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=Yh(t,r),t.setHours(0,0,0,0),t}}class Bh extends ne{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 Hh extends ne{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 zh extends ne{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 qh extends ne{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 Kh extends ne{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 Qh extends ne{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 Vh extends ne{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 Uh extends ne{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 Xh extends ne{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 Gh extends ne{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 Jh extends ne{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 Zh extends ne{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 em extends ne{constructor(){super(...arguments);H(this,"priority",40);H(this,"incompatibleTokens","*")}parse(t){return yc(t)}set(t,e,r){return[oe(t,r*1e3),{timestampIsSet:!0}]}}class tm extends ne{constructor(){super(...arguments);H(this,"priority",20);H(this,"incompatibleTokens","*")}parse(t){return yc(t)}set(t,e,r){return[oe(t,r),{timestampIsSet:!0}]}}const nm={G:new vh,y:new wh,Y:new kh,R:new Dh,u:new Ch,Q:new Sh,q:new Mh,M:new _h,L:new Ph,w:new Ih,I:new Th,d:new Oh,D:new Rh,E:new Ah,e:new Lh,c:new Fh,i:new Wh,a:new Bh,b:new Hh,B:new zh,h:new qh,H:new Kh,K:new Qh,k:new Vh,m:new Uh,s:new Xh,S:new Gh,X:new Jh,x:new Zh,t:new em,T:new tm},rm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,am=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,om=/^'([^]*?)'?$/,im=/''/g,sm=/\S/,cm=/[a-zA-Z]/;function ta(n,a,t,e){var w,k,p,C,$,E,R,N;const r=fh(),o=(e==null?void 0:e.locale)??r.locale??pc,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=(p=r.locale)==null?void 0:p.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=(R=r.locale)==null?void 0:R.options)==null?void 0:N.weekStartsOn)??0;if(a==="")return n===""?B(t):oe(t,NaN);const l={firstWeekContainsDate:i,weekStartsOn:c,locale:o},f=[new bh],u=a.match(am).map(M=>{const D=M[0];if(D in wr){const _=wr[D];return _(M,o.formatLong)}return M}).join("").match(rm),h=[];for(let M of u){!(e!=null&&e.useAdditionalWeekYearTokens)&&gc(M)&&wa(M,a,n),!(e!=null&&e.useAdditionalDayOfYearTokens)&&mc(M)&&wa(M,a,n);const D=M[0],_=nm[D];if(_){const{incompatibleTokens:j}=_;if(Array.isArray(j)){const T=h.find(W=>j.includes(W.token)||W.token===D);if(T)throw new RangeError(`The format string mustn't contain \`${T.fullToken}\` and \`${M}\` at the same time`)}else if(_.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);h.push({token:D,fullToken:M});const O=_.run(n,M,o.match,l);if(!O)return oe(t,NaN);f.push(O.setter),n=O.rest}else{if(D.match(cm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");if(M==="''"?M="'":D==="'"&&(M=lm(M)),n.indexOf(M)===0)n=n.slice(M.length);else return oe(t,NaN)}}if(n.length>0&&sm.test(n))return oe(t,NaN);const x=f.map(M=>M.priority).sort((M,D)=>D-M).filter((M,D,_)=>_.indexOf(M)===D).map(M=>f.filter(D=>D.priority===M).sort((D,_)=>_.subPriority-D.subPriority)).map(M=>M[0]);let y=B(t);if(isNaN(y.getTime()))return oe(t,NaN);const b={};for(const M of x){if(!M.validate(y,l))return oe(t,NaN);const D=M.set(y,b,l);Array.isArray(D)?(y=D[0],Object.assign(b,D[1])):y=D}return oe(t,y)}function lm(n){return n.match(om)[1].replace(im,"'")}function dm(n,a){const t=B(n),e=B(a);return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function um(n,a){const t=va(n),e=va(a);return+t==+e}function pm(n,a){const t=B(n),e=B(a);return t.getFullYear()===e.getFullYear()}function On(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 fm(n,a){return Le(n,-1)}function hm(n,a){const e=ym(n);let r;if(e.date){const l=bm(e.date,2);r=vm(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=wm(e.time),isNaN(i)))return new Date(NaN);if(e.timezone){if(c=km(e.timezone),isNaN(c))return new Date(NaN)}else{const l=new Date(o+i),f=new Date(0);return f.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),f.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),f}return new Date(o+i+c)}const Xn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,gm=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,xm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ym(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 bm(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 vm(n,a){if(a===null)return new Date(NaN);const t=n.match(mm);if(!t)return new Date(NaN);const e=!!t[4],r=Cn(t[1]),o=Cn(t[2])-1,i=Cn(t[3]),c=Cn(t[4]),l=Cn(t[5])-1;if(e)return _m(a,c,l)?Dm(a,c,l):new Date(NaN);{const f=new Date(0);return!Sm(a,o,i)||!Mm(a,r)?new Date(NaN):(f.setUTCFullYear(a,o,Math.max(r,i)),f)}}function Cn(n){return n?parseInt(n):1}function wm(n){const a=n.match(gm);if(!a)return NaN;const t=na(a[1]),e=na(a[2]),r=na(a[3]);return Pm(t,e,r)?t*Nr+e*$r+r*1e3:NaN}function na(n){return n&&parseFloat(n.replace(",","."))||0}function km(n){if(n==="Z")return 0;const a=n.match(xm);if(!a)return 0;const t=a[1]==="+"?-1:1,e=parseInt(a[2]),r=a[3]&&parseInt(a[3])||0;return jm(e,r)?t*(e*Nr+r*$r):NaN}function Dm(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 Cm=[31,null,31,30,31,30,31,31,30,31,30,31];function wc(n){return n%400===0||n%4===0&&n%100!==0}function Sm(n,a,t){return a>=0&&a<=11&&t>=1&&t<=(Cm[a]||(wc(n)?29:28))}function Mm(n,a){return a>=1&&a<=(wc(n)?366:365)}function _m(n,a,t){return a>=1&&a<=53&&t>=0&&t<=6}function Pm(n,a,t){return n===24?a===0&&t===0:t>=0&&t<60&&a>=0&&a<60&&n>=0&&n<25}function jm(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=ph(o);return t.setMonth(a,Math.min(r,i)),t}function Im(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 Jt(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 $t(n,a){return Ye(n,-a)}function kc(n,a){return $a(n,-1)}function ni(n,a){return gr(n,-1)}function ln(n,a){return it(n,-a)}var Em=typeof document<"u",Tm=function(){},Dr=Em?v.useLayoutEffect:Tm;const $m={..._s},Nm=$m.useInsertionEffect,Om=Nm||(n=>n());function Rm(n){const a=v.useRef(()=>{});return Om(()=>{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 Am={..._s};let ri=!1,Lm=0;const ai=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Lm++;function Fm(){const[n,a]=v.useState(()=>ri?ai():void 0);return Dr(()=>{n==null&&a(ai())},[]),v.useEffect(()=>{ri=!0},[]),n}const Ym=Am.useId,Dc=Ym||Fm,Wm=v.forwardRef(function(a,t){const{context:{placement:e,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:c=14,height:l=7,tipRadius:f=0,strokeWidth:u=0,staticOffset:h,stroke:x,d:y,style:{transform:b,...w}={},...k}=a,p=Dc(),[C,$]=v.useState(!1);if(Dr(()=>{if(!r)return;Fe(r).direction==="rtl"&&$(!0)},[r]),!r)return null;const[E,R]=e.split("-"),N=E==="top"||E==="bottom";let M=h;(N&&i!=null&&i.x||!N&&i!=null&&i.y)&&(M=null);const D=u*2,_=D/2,j=c/2*(f/-8+1),O=l/2*f/4,T=!!y,W=M&&R==="end"?"bottom":"top";let z=M&&R==="end"?"right":"left";M&&C&&(z=R==="end"?"left":"right");const U=(o==null?void 0:o.x)!=null?M||o.x:"",Y=(o==null?void 0:o.y)!=null?M||o.y:"",K=y||"M0,0"+(" H"+c)+(" L"+(c-j)+","+(l-O))+(" Q"+c/2+","+l+" "+j+","+(l-O))+" Z",P={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:[P,b].filter(Z=>!!Z).join(" "),...w},children:[D>0&&s.jsx("path",{clipPath:"url(#"+p+")",fill:"none",stroke:x,strokeWidth:D+(y?0:1),d:K}),s.jsx("path",{stroke:D&&!y?k.fill:"none",d:K}),s.jsx("clipPath",{id:p,children:s.jsx("rect",{x:-_,y:_*(T?-1:1),width:c+D,height:c})})]})});function Bm(){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 Hm=v.createContext(null),zm=v.createContext(null),qm=()=>{var n;return((n=v.useContext(Hm))==null?void 0:n.id)||null},Km=()=>v.useContext(zm);function Qm(n){const{open:a=!1,onOpenChange:t,elements:e}=n,r=Dc(),o=v.useRef({}),[i]=v.useState(()=>Bm()),c=qm()!=null,[l,f]=v.useState(e.reference),u=Rm((y,b,w)=>{o.current.openEvent=y?b:void 0,i.emit("openchange",{open:y,event:b,reason:w,nested:c}),t==null||t(y,b,w)}),h=v.useMemo(()=>({setPositionReference:f}),[]),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 Vm(n){var a,t;let{elements:e,...r}=n===void 0?{}:n;const{nodeId:o}=r,i=Qm({...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,[f,u]=v.useState(null),[h,x]=v.useState(null),b=(l==null?void 0:l.domReference)||f,w=v.useRef(null),k=Km();Dr(()=>{b&&(w.current=b)},[b]);const p=$p({...r,elements:{...l,...h&&{reference:h}}}),C=v.useCallback(M=>{const D=_e(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;x(D),p.refs.setReference(D)},[p.refs]),$=v.useCallback(M=>{(_e(M)||M===null)&&(w.current=M,u(M)),(_e(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!_e(M))&&p.refs.setReference(M)},[p.refs]),E=v.useMemo(()=>({...p.refs,setReference:$,setPositionReference:C,domReference:w}),[p.refs,$,C]),R=v.useMemo(()=>({...p.elements,domReference:b}),[p.elements,b]),N=v.useMemo(()=>({...p,...c,refs:E,elements:R,nodeId:o}),[p,E,R,o,c]);return Dr(()=>{c.dataRef.current.floatingContext=N;const M=k==null?void 0:k.nodesRef.current.find(D=>D.id===o);M&&(M.context=N)}),v.useMemo(()=>({...p,context:N,refs:E,elements:R}),[p,E,R,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 Um=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 S.createElement("div",{className:o,role:"dialog","aria-label":c,"aria-modal":"true"},i)},Xm=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=Xm(t,i);return S.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 Cc(){var n=typeof window<"u"?window:globalThis;return n}var Fn=12,Gm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;function ie(n){if(n==null)return new Date;var a=typeof n=="string"?hm(n):B(n);return at(a)?a:new Date}function ra(n,a,t,e,r){var o,i=null,c=Nt(t)||Nt(En()),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 f=((o=a.match(Gm))!==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,f.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)&&!Ft(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?Nt(t):void 0;return t&&!e&&console.warn('A locale object was not found for the provided string ["'.concat(t,'"].')),!e&&En()&&Nt(En())&&(e=Nt(En())),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 Jm(n,a,t){if(!n)return"";var e=$e(n,t),r=a?$e(a,t):"";return"".concat(e," - ").concat(r)}function Zm(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 eg(n){return Na(n)}function tg(n,a){return se(n,"ddd",a)}function sr(n){return Lt(n)}function kt(n,a,t){var e=Nt(a||En());return ut(n,{locale:e,weekStartsOn:t})}function lt(n){return dc(n)}function Pn(n){return Or(n)}function oi(n){return va(n)}function ii(){return Lt(ie())}function si(n){return cc(n)}function ng(n){return bf(n)}function rg(n){return lc(n)}function Ke(n,a){return n&&a?pm(n,a):!n&&!a}function Se(n,a){return n&&a?dm(n,a):!n&&!a}function Cr(n,a){return n&&a?um(n,a):!n&&!a}function ee(n,a){return n&&a?xf(n,a):!n&&!a}function It(n,a){return n&&a?mh(n,a):!n&&!a}function jn(n,a,t){var e,r=Lt(a),o=cc(t);try{e=On(n,{start:r,end:o})}catch{e=!1}return e}function En(){var n=Cc();return n.__localeId__}function Nt(n){if(typeof n=="string"){var a=Cc();return a.__localeData__?a.__localeData__[n]:void 0}else return n}function ag(n,a,t){return a(se(n,"EEEE",t))}function og(n,a){return se(n,"EEEEEE",a)}function ig(n,a){return se(n,"EEE",a)}function La(n,a){return se(Ee(ie(),n),"LLLL",a)}function Sc(n,a){return se(Ee(ie(),n),"LLL",a)}function sg(n,a){return se(Jt(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,f=t.filterDate;return Yn(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 On(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 On(n,{start:h,end:x})})||f&&!f(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 On(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 Mc(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates,c=t.filterDate;return Yn(n,{minDate:e?dc(e):void 0,maxDate:r?lc(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 cg(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.maxDate,o=t.excludeDates,i=t.includeDates;return Yn(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 Yn(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 Yn(l,{minDate:e?Or(e):void 0,maxDate:r?uc(r):void 0})||(o==null?void 0:o.some(function(f){return Ke(l,f instanceof Date?f:f.date)}))||i&&!i.some(function(f){return Ke(l,f)})||c&&!c(ie(l))||!1}function er(n,a,t,e){var r=G(n),o=Tt(n),i=G(a),c=Tt(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 Yn(n,a){var t,e=a===void 0?{}:a,r=e.minDate,o=e.maxDate;return(t=r&&cn(n,r)<0||o&&cn(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=!On(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=$t(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=Ye(n,1);return e&&yr(o,e)>0||r&&r.every(function(i){return yr(o,i)>0})||!1}function lg(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.includeDates,o=Or(n),i=kc(o);return e&&br(e,i)>0||r&&r.every(function(c){return br(c,i)>0})||!1}function dg(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.includeDates,o=uc(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=ln(n,1);return e&&vr(e,o)>0||r&&r.every(function(i){return vr(i,o)>0})||!1}function ug(n,a){var t=a===void 0?{}:a,e=t.minDate,r=t.yearItemNumber,o=r===void 0?Fn:r,i=Pn(ln(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 pg(n,a){var t=a===void 0?{}:a,e=t.maxDate,r=t.yearItemNumber,o=r===void 0?Fn:r,i=it(n,o),c=vt(i,o).startPeriod,l=e&&G(e);return l&&l<c||!1}function _c(n){var a=n.minDate,t=n.includeDates;if(t&&a){var e=t.filter(function(r){return cn(r,a)>=0});return Vo(e)}else return t?Vo(t):a}function Pc(n){var a=n.maxDate,t=n.includeDates;if(t&&a){var e=t.filter(function(r){return cn(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 f=Object.keys(i),u=(t=f[0])!==null&&t!==void 0?t:"",h=i[u];if(typeof u=="string"&&Array.isArray(h))for(var x=0,y=h.length;x<y;x++){var b=h[x];if(b){var c=se(b,"MM.dd.yyyy"),l=e.get(c)||[];l.includes(u)||(l.push(u),e.set(c,l))}}}}return e}function fg(n,a){return n.length!==a.length?!1:n.every(function(t,e){return t===a[e]})}function hg(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&&fg(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 mg(n,a,t,e,r){for(var o=r.length,i=[],c=0;c<o;c++){var l=n,f=r[c];f&&(l=ff(l,Je(f)),l=ba(l,Ze(f)),l=gf(l,ct(f)));var u=ba(n,(t+1)*e);Dt(l,a)&&Ft(l,u)&&f!=null&&i.push(f)}return i}function gi(n){return n<10?"0".concat(n):"".concat(n)}function vt(n,a){a===void 0&&(a=Fn);var t=Math.ceil(G(n)/a)*a,e=t-(a-1);return{startPeriod:e,endPeriod:t}}function gg(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 xg(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 Ft(t,e)}function jc(n){return n.key===F.Space}var yg=(function(n){be(a,n);function a(t){var e=n.call(this,t)||this;return e.inputRef=S.createRef(),e.onTimeChange=function(r){var o,i;e.setState({time:r});var c=e.props.date,l=c instanceof Date&&!isNaN(+c),f=l?c:new Date;if(r!=null&&r.includes(":")){var u=r.split(":"),h=u[0],x=u[1];f.setHours(Number(h)),f.setMinutes(Number(x))}(i=(o=e.props).onChange)===null||i===void 0||i.call(o,f)},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}):S.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:e.inputRef,onClick:function(){var f;(f=e.inputRef.current)===null||f===void 0||f.focus()},required:!0,value:r,onChange:function(f){e.onTimeChange(f.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 S.createElement("div",{className:"react-datepicker__input-time-container"},S.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),S.createElement("div",{className:"react-datepicker-time__input-container"},S.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},a})(v.Component),bg=(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:jn(r,o,i)},t.isInSelectingRange=function(){var e,r=t.props,o=r.day,i=r.selectsStart,c=r.selectsEnd,l=r.selectsRange,f=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||!f&&t.isDisabled()?!1:i&&h&&(Ft(x,h)||It(x,h))?jn(o,x,h):c&&u&&(Dt(x,u)||It(x,u))||l&&u&&!h&&(Dt(x,u)||It(x,u))?jn(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,f=(e=t.props.selectingDate)!==null&&e!==void 0?e:t.props.preSelection;return c||l?ee(o,f):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=uh(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--"+tg(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,f=t.isDisabled()||t.isExcluded()?l:i;return"".concat(f," ").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"),f=[];return i.has(l)&&f.push.apply(f,i.get(l).holidayNames),t.isExcluded()&&f.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})),f.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 S.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()!==""&&S.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),vg=(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 S.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),wg=(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,f=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){f=h;break}}typeof t.props.onWeekSelect=="function"&&t.props.onWeekSelect(f,r,o),t.props.showWeekPicker&&t.handleDayClick(f,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):eg(e)},t.isWeekDisabled=function(){for(var e=t.startOfWeek(),r=Le(e,6),o=new Date(e);o<=r;){if(!t.isDisabled(o))return!1;o=Le(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(S.createElement(vg,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=Le(e,c);return S.createElement(bg,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 S.createElement("div",{className:ke(t)},this.renderDays())},a})(v.Component),Sn,kg=6,tn={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},oa=(Sn={},Sn[tn.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},Sn[tn.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},Sn[tn.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},Sn),tr=1;function vi(n,a){return n?tn.FOUR_COLUMNS:a?tn.TWO_COLUMNS:tn.THREE_COLUMNS}var Dg=(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(Jt(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(Jt(o,e),c)},t.isInSelectingRangeMonth=function(e){var r,o=t.props,i=o.day,c=o.selectsStart,l=o.selectsEnd,f=o.selectsRange,u=o.startDate,h=o.endDate,x=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return!(c||l||f)||!x?!1:c&&h?Gn(x,h,e,i):l&&u||f&&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,f=Ee(i,e),u=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return l?Se(f,u):Se(f,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,f=o.selectsRange,u=Ee(i,e),h=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return l||f?Se(u,h):Se(u,c)},t.isInSelectingRangeQuarter=function(e){var r,o=t.props,i=o.day,c=o.selectsStart,l=o.selectsEnd,f=o.selectsRange,u=o.startDate,h=o.endDate,x=(r=t.props.selectingDate)!==null&&r!==void 0?r:t.props.preSelection;return!(c||l||f)||!x?!1:c&&h?er(x,h,e,i):l&&u||f&&u&&!h?er(u,x,e,i):!1},t.isWeekInMonth=function(e){var r=t.props.day,o=Le(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===Tt(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 Tt(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(b){return t.props.showWeekPicker?kt(b,t.props.locale,t.props.calendarStartDay):t.props.preSelection},f=function(b){return t.props.showWeekPicker?kt(b,t.props.locale,t.props.calendarStartDay):t.props.selected},u=t.props.selected?f(t.props.selected):void 0,h=t.props.preSelection?l(t.props.preSelection):void 0;e.push(S.createElement(wg,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>=kg,y=!r&&!t.isWeekInMonth(c);if(x||y)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,f=c.preSelection,u=c.setPreSelection,h=c.minDate,x=c.maxDate,y=c.showFourColumnMonthYearPicker,b=c.showTwoColumnMonthYearPicker;if(f){var w=vi(y,b),k=t.getVerticalOffset(w),p=(i=oa[w])===null||i===void 0?void 0:i.grid,C=function(M,D,_){var j,O,T=D,W=_;switch(M){case F.ArrowRight:T=Ye(D,tr),W=_===11?0:_+tr;break;case F.ArrowLeft:T=$t(D,tr),W=_===0?11:_-tr;break;case F.ArrowUp:T=$t(D,k),W=!((j=p==null?void 0:p[0])===null||j===void 0)&&j.includes(_)?_+12-k:_-k;break;case F.ArrowDown:T=Ye(D,k),W=!((O=p==null?void 0:p[p.length-1])===null||O===void 0)&&O.includes(_)?_-12+k:_+k;break}return{newCalculatedDate:T,newCalculatedMonth:W}},$=function(M,D,_){for(var j=40,O=M,T=!1,W=0,z=C(O,D,_),U=z.newCalculatedDate,Y=z.newCalculatedMonth;!T;){if(W>=j){U=D,Y=_;break}if(h&&U<h){O=F.ArrowRight;var K=C(O,U,Y);U=K.newCalculatedDate,Y=K.newCalculatedMonth}if(x&&U>x){O=F.ArrowLeft;var K=C(O,U,Y);U=K.newCalculatedDate,Y=K.newCalculatedMonth}if(cg(U,t.props)){var K=C(O,U,Y);U=K.newCalculatedDate,Y=K.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,f,o),R=E.newCalculatedDate,N=E.newCalculatedMonth;switch(r){case F.ArrowRight:case F.ArrowLeft:case F.ArrowUp:case F.ArrowDown:t.handleMonthNavigation(N,R);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=Jt(t.props.day,r);Jn(o,t.props)||t.handleDayClick(oi(o),e)},t.onQuarterMouseEnter=function(e){var r=Jt(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,kc(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var r,o=t.props,i=o.day,c=o.minDate,l=o.maxDate,f=o.excludeDates,u=o.includeDates,h=Ee(i,e);return{isDisabled:(r=(c||l||f||u)&&Mc(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,f=r.monthClassName,u=f?f(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=Tt(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,f=r.day,u=r.locale,h=Ee(f,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,f=r.minDate,u=r.maxDate,h=r.excludeDates,x=r.includeDates,y=r.filterDate,b=r.preSelection,w=r.disabledKeyboardNavigation,k=(f||u||h||x||y)&&Jn(Jt(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&&b&&t.isSelectedQuarter(o,e,b)&&!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,f=Sc(e,c),u=La(e,c);return i?i(e,f,u,l):o?u:f},t.getQuarterContent=function(e){var r,o=t.props,i=o.renderQuarterContent,c=o.locale,l=sg(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,f=(e=oa[vi(i,o)])===null||e===void 0?void 0:e.grid;return f==null?void 0:f.map(function(u,h){return S.createElement("div",{className:"react-datepicker__month-wrapper",key:h},u.map(function(x,y){return S.createElement("div",{ref:t.MONTH_REFS[x],key:y,onClick:function(b){t.onMonthClick(b,x)},onKeyDown:function(b){jc(b)&&(b.preventDefault(),b.key=F.Enter),t.onMonthKeyDown(b,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 S.createElement("div",{className:"react-datepicker__quarter-wrapper"},i.map(function(c,l){return S.createElement("div",{key:l,ref:t.QUARTER_REFS[l],role:"option",onClick:function(f){t.onQuarterClick(f,c)},onKeyDown:function(f){t.onQuarterKeyDown(f,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,f=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":f})},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 S.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),Cg=(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 S.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)?S.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 S.createElement(Rr,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),Sg=(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 S.createElement("option",{key:r,value:o},r)})},t.renderSelectMode=function(e){return S.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 S.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},S.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),S.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return S.createElement(Cg,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 Sc(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 S.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},r)},a})(v.Component);function Mg(n,a){for(var t=[],e=lt(n),r=lt(a);!Dt(e,r);)t.push(ie(e)),e=Ye(e,1);return t}var _g=(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 S.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?S.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:Mg(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 S.createElement(Rr,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),Pg=(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(S.createElement("option",{key:i,value:i},se(e,t.props.dateFormat,t.props.locale))),e=Ye(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return S.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 S.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},S.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),S.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return S.createElement(_g,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 S.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},a})(v.Component),jg=(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&&xg(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),f=t.props.injectTimes&&t.props.injectTimes.sort(function(k,p){return k.getTime()-p.getTime()}),u=60*gg(c),h=u/i,x=0;x<h;x++){var y=ba(l,x*i);if(r.push(y),f){var b=mg(l,y,x,i,f);r=r.concat(b)}}var w=r.reduce(function(k,p){return p.getTime()<=c.getTime()?p:k},r[0]);return r.map(function(k){return S.createElement("li",{key:k.valueOf(),onClick:t.handleClick.bind(t,k),className:t.liClasses(k),ref:function(p){k===w&&(t.centerLi=p)},onKeyDown:function(p){t.handleOnKeyDown(p,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?S.createElement(S.Fragment,null):S.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}},S.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 S.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(),S.createElement("div",{className:"react-datepicker__time"},S.createElement("div",{className:"react-datepicker__time-box"},S.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,Ig=(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,f,u=e.props,h=u.date,x=u.yearItemNumber;if(!(h===void 0||x===void 0)){var y=vt(h,x).startPeriod;e.isDisabled(o)||e.isExcluded(o)||((c=(i=e.props).setPreSelection)===null||c===void 0||c.call(i,o),r-y<0?e.updateFocusOnPaginate(x-(y-r)):r-y>=x?e.updateFocusOnPaginate(Math.abs(x-(r-y))):(f=(l=e.YEAR_REFS[r-y])===null||l===void 0?void 0:l.current)===null||f===void 0||f.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,f=o.startDate,u=o.endDate;return!(i||c||l)||!e.selectingDate()?!1:i&&u?Zn(r,e.selectingDate(),u):c&&f||l&&f&&!u?Zn(r,f,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,f=qe(ie(),r);return l?Ke(f,(o=e.selectingDate())!==null&&o!==void 0?o:null):Ke(f,c??null)},e.isSelectingRangeEnd=function(r){var o;if(!e.isInSelectingRange(r))return!1;var i=e.props,c=i.endDate,l=i.selectsEnd,f=i.selectsRange,u=qe(ie(),r);return l||f?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,f=o.includeDates,u=o.filterDate,h=Pn(qe(e.props.date,r)),x=(i||c||l||f||u)&&cr(r,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!ee(h,Pn(e.props.selected))&&ee(h,Pn(e.props.preSelection))&&!x}},e.onYearClick=function(r,o){var i=e.props.date;i!==void 0&&e.handleYearClick(Pn(qe(i,o)),r)},e.onYearKeyDown=function(r,o){var i,c,l=r.key,f=e.props,u=f.date,h=f.yearItemNumber,x=f.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,ln(e.props.preSelection,1));break;case F.ArrowUp:{if(u===void 0||h===void 0||e.props.preSelection==null)break;var y=vt(u,h).startPeriod,b=wi,w=o-b;if(w<y){var k=h%b;o>=y&&o<y+k?b=k:b+=k,w=o-b}e.handleYearNavigation(w,ln(e.props.preSelection,b));break}case F.ArrowDown:{if(u===void 0||h===void 0||e.props.preSelection==null)break;var p=vt(u,h).endPeriod,b=wi,w=o+b;if(w>p){var k=h%b;o<=p&&o>p-k?b=k:b+=k,w=o+b}e.handleYearNavigation(w,it(e.props.preSelection,b));break}}x&&x(r)},e.getYearClassNames=function(r){var o=e.props,i=o.date,c=o.minDate,l=o.maxDate,f=o.selected,u=o.excludeDates,h=o.includeDates,x=o.filterDate,y=o.yearClassName;return ke("react-datepicker__year-text","react-datepicker__year-".concat(r),i?y==null?void 0:y(qe(i,r)):void 0,{"react-datepicker__year-text--selected":f?r===G(f):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 f=vt(o,i),u=f.startPeriod,h=f.endPeriod,x=function(w){e.push(S.createElement("div",{ref:y.YEAR_REFS[w-u],onClick:function(k){t.onYearClick(k,w)},onKeyDown:function(k){jc(k)&&(k.preventDefault(),k.key=F.Enter),t.onYearKeyDown(k,w)},tabIndex:Number(y.getYearTabIndex(w)),className:y.getYearClassNames(w),onMouseEnter:y.props.usePointerEvent?void 0:function(k){return c(k,w)},onPointerEnter:y.props.usePointerEvent?function(k){return c(k,w)}:void 0,onMouseLeave:y.props.usePointerEvent?void 0:function(k){return l(k,w)},onPointerLeave:y.props.usePointerEvent?function(k){return l(k,w)}:void 0,key:w,"aria-current":y.isCurrentYear(w)?"date":void 0},y.getYearContent(w)))},y=this,b=u;b<=h;b++)x(b);return S.createElement("div",{className:"react-datepicker__year"},S.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 Eg(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 Tg=(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 S.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?S.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",h)}),f=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(S.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},S.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!f||!e.state.yearsList.find(function(h){return h===f}))&&l.push(S.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},S.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(f){return f+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:Eg(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 S.createElement(Rr,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},a})(v.Component),$g=(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(S.createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return S.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return S.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(r){return t.toggleDropdown(r)}},S.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),S.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return S.createElement(Tg,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 S.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},a})(v.Component),Ng=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Og=function(n){var a=(n.className||"").split(/\s+/);return Ng.some(function(t){return a.indexOf(t)>=0})},Rg=(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;Og(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=_c(e.props),f=Pc(e.props),u=ie(),h=c||i||o;return h||(l&&Ft(u,l)?l:f&&Dt(u,f)?f:u)},e.increaseMonth=function(){e.setState(function(r){var o=r.date;return{date:Ye(o,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(r){var o=r.date;return{date:$t(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=rg(r),c=yf(i,o),l=null,f=0;f<=c;f++){var u=Le(o,f);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(S.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=Le(o,c),f=e.formatWeekday(l,e.props.locale),u=e.props.weekDayClassName?e.props.weekDayClassName(l):void 0;return S.createElement("div",{key:c,"aria-label":se(l,"EEEE",e.props.locale),className:ke("react-datepicker__day-name",u)},f)}))},e.formatWeekday=function(r,o){return e.props.formatWeekDay?ag(r,e.props.formatWeekDay,o):e.props.useWeekdaysShort?ig(r,o):og(r,o)},e.decreaseYear=function(){e.setState(function(r){var o,i=r.date;return{date:ln(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,f=(o=e.props.monthSelectedIn)!==null&&o!==void 0?o:l,u=$t(e.state.date,f),h;switch(!0){case e.props.showMonthYearPicker:h=fi(e.state.date,e.props);break;case e.props.showYearPicker:h=ug(e.state.date,e.props);break;case e.props.showQuarterYearPicker:h=lg(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"],y=["react-datepicker__navigation","react-datepicker__navigation--previous"],b=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(b=e.decreaseYear),h&&e.props.showDisabledMonthNavigation&&(y.push("react-datepicker__navigation--previous--disabled"),b=void 0);var w=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,k=e.props,p=k.previousMonthButtonLabel,C=p===void 0?a.defaultProps.previousMonthButtonLabel:p,$=k.previousYearButtonLabel,E=$===void 0?a.defaultProps.previousYearButtonLabel:$,R=e.props,N=R.previousMonthAriaLabel,M=N===void 0?typeof C=="string"?C:"Previous Month":N,D=R.previousYearAriaLabel,_=D===void 0?typeof E=="string"?E:"Previous Year":D;return S.createElement("button",{type:"button",className:y.join(" "),onClick:b,onKeyDown:e.props.handleOnKeyDown,"aria-label":w?_:M},S.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=pg(e.state.date,e.props);break;case e.props.showQuarterYearPicker:o=dg(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 f=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,u=e.props,h=u.nextMonthButtonLabel,x=h===void 0?a.defaultProps.nextMonthButtonLabel:h,y=u.nextYearButtonLabel,b=y===void 0?a.defaultProps.nextYearButtonLabel:y,w=e.props,k=w.nextMonthAriaLabel,p=k===void 0?typeof x=="string"?x:"Next Month":k,C=w.nextYearAriaLabel,$=C===void 0?typeof b=="string"?b:"Next Year":C;return S.createElement("button",{type:"button",className:i.join(" "),onClick:l,onKeyDown:e.props.handleOnKeyDown,"aria-label":f?$:p},S.createElement("span",{className:c.join(" ")},f?b: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"),S.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 S.createElement($g,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 S.createElement(Sg,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 S.createElement(Pg,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 S.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 S.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(o),S.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)),S.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 f=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),y=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return S.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:f,nextMonthButtonDisabled:u,prevYearButtonDisabled:h,nextYearButtonDisabled:x})),y&&S.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,f=l===void 0?a.defaultProps.yearItemNumber:l,u=vt(o,f),h=u.startPeriod,x=u.endPeriod;return S.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,f=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?it(e.state.date,l):$t(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,y=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?it(f,x):Ye(f,x),b="month-".concat(h),w=h<c-1,k=h>0;i.push(S.createElement("div",{key:b,ref:function(p){e.monthContainer=p??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:y,i:h}),S.createElement(Dg,te({},a.defaultProps,e.props,{ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:y,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 S.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),S.createElement(Ig,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 S.createElement(jg,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 S.createElement(yg,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)),S.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&l)},e.renderChildren=function(){if(e.props.children)return S.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:Fn}},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||Um;return S.createElement(Rr,{onClickOutside:this.handleClickOutside,style:{display:"contents"},containerRef:this.containerRef,ignoreClass:this.props.outsideClickIgnoreClass},S.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),Ag=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"?S.createElement("i",{className:"".concat(o," ").concat(a," ").concat(e),"aria-hidden":"true",onClick:r}):S.isValidElement(a)?S.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)}}):S.createElement("svg",{className:"".concat(o," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:r},S.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"}))},Ic=(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 vl.createPortal(this.props.children,this.el)},a})(v.Component),Lg="[tabindex], a, button, input, select, textarea",Fg=function(n){return(n instanceof HTMLAnchorElement||!n.disabled)&&n.tabIndex!==-1},Ec=(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(Lg),1,-1).filter(Fg)},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)?S.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},S.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,S.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},a.defaultProps={enableTabLoop:!0},a})(v.Component);function Yg(n){var a=function(t){var e,r=typeof t.hidePopper=="boolean"?t.hidePopper:!0,o=v.useRef(null),i=Vm(te({open:!r,whileElementsMounted:_p,placement:t.popperPlacement,middleware:Ge([Rp({padding:15}),Op(10),Ap({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 S.createElement(n,te({},c))};return a}var Wg=(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,f=t.enableTabLoop,u=t.popperOnKeyDown,h=t.portalId,x=t.portalHost,y=t.popperProps,b=t.showArrow,w=void 0;if(!i){var k=ke("react-datepicker-popper",e);w=S.createElement(Ec,{enableTabLoop:f},S.createElement("div",{ref:y.refs.setFloating,style:y.floatingStyles,className:k,"data-placement":y.placement,onKeyDown:u},c,b&&S.createElement(Wm,{ref:y.arrowRef,context:y.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=S.createElement(Ic,{portalId:h,portalHost:x},w));var p=ke("react-datepicker-wrapper",r);return S.createElement(S.Fragment,null,S.createElement("div",{ref:y.refs.setReference,className:p},l),w)},a})(v.Component),Bg=Yg(Wg),ki="react-datepicker-ignore-onclickoutside";function Hg(n,a){return n&&a?Me(n)!==Me(a)||G(n)!==G(a):n!==a}var ia="Date input not valid.",zg=(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=_c(e.props),c=Pc(e.props),l=i&&Ft(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:qg});var f=e.props,u=f.dateFormat,h=u===void 0?a.defaultProps.dateFormat:u,x=f.strictParsing,y=x===void 0?a.defaultProps.strictParsing:x,b=f.selectsRange,w=f.startDate,k=f.endDate,p=(l==null?void 0:l.target)instanceof HTMLInputElement?l.target.value:"";if(b){var C=p.split("-",2).map(function(j){return j.trim()}),$=C[0],E=C[1],R=ra($??"",h,e.props.locale,y),N=ra(E??"",h,e.props.locale,y),M=(w==null?void 0:w.getTime())!==(R==null?void 0:R.getTime()),D=(k==null?void 0:k.getTime())!==(N==null?void 0:N.getTime());if(!M&&!D||R&&Ne(R,e.props)||N&&Ne(N,e.props))return;(o=(r=e.props).onChange)===null||o===void 0||o.call(r,[R,N],l)}else{var _=ra(p,h,e.props.locale,y,e.props.minDate);e.props.showTimeSelectOnly&&e.props.selected&&_&&!ee(_,e.props.selected)&&(_=Im(e.props.selected,{hours:Je(_),minutes:Ze(_),seconds:ct(_)})),(_||!p)&&e.setSelected(_,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,f=c.endDate;l&&!f&&(e.props.swapRange||!bi(r,l))&&e.setOpen(!1)}},e.setSelected=function(r,o,i,c){var l,f,u=r;if(e.props.showYearPicker){if(u!==null&&cr(G(u),e.props))return}else if(e.props.showMonthYearPicker){if(u!==null&&Mc(u,e.props))return}else if(u!==null&&Ne(u,e.props))return;var h=e.props,x=h.onChange,y=h.selectsRange,b=h.startDate,w=h.endDate,k=h.selectsMultiple,p=h.selectedDates,C=h.minTime,$=h.swapRange;if(!It(e.props.selected,u)||e.props.allowSameDay||y||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})),y){var E=!b&&!w,R=b&&!w,N=b&&w;E?x==null||x([u,null],o):R&&(u===null?x==null||x([null,null],o):bi(u,b)?$?x==null||x([u,b],o):x==null||x([u,null],o):x==null||x([b,u],o)),N&&(x==null||x([u,null],o))}else if(k){if(u!==null)if(!(p!=null&&p.length))x==null||x([u],o);else{var M=p.some(function(_){return ee(_,u)});if(M){var D=p.filter(function(_){return!ee(_,u)});x==null||x(D,o)}else x==null||x(Ge(Ge([],p,!0),[u],!1),o)}}else x==null||x(u,o);i||((f=(l=e.props).onSelect)===null||f===void 0||f.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=jn(r,e.props.minDate,e.props.maxDate);else if(o){var f=sr(e.props.minDate);c=Dt(r,f)||It(l,f)}else if(i){var u=si(e.props.maxDate);c=Ft(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,f,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"]',y=((l=e.calendar)===null||l===void 0?void 0:l.containerRef.current)instanceof Element&&e.calendar.containerRef.current.querySelector(x);y instanceof HTMLElement&&y.focus({preventScroll:!0});return}var b=ie(e.state.preSelection);h===F.Enter?(r.preventDefault(),r.target.blur(),e.inputOk()&&e.state.lastPreSelectChange===sa?(e.handleSelect(b,r),!e.props.shouldCloseOnSelect&&e.setPreSelection(b)):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=(f=e.props).onInputError)===null||u===void 0||u.call(f,{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,f,u,h=e.props,x=h.minDate,y=h.maxDate,b=h.disabledKeyboardNavigation,w=h.showWeekPicker,k=h.shouldCloseOnSelect,p=h.locale,C=h.calendarStartDay,$=h.adjustDateOnChange,E=h.inline;if((i=(o=e.props).onKeyDown)===null||i===void 0||i.call(o,r),!b){var R=r.key,N=r.shiftKey,M=ie(e.state.preSelection),D=function(U,Y){var K=Y;switch(U){case F.ArrowRight:K=w?gr(Y,1):Le(Y,1);break;case F.ArrowLeft:K=w?ni(Y):fm(Y);break;case F.ArrowUp:K=ni(Y);break;case F.ArrowDown:K=gr(Y,1);break;case F.PageUp:K=N?ln(Y,1):$t(Y,1);break;case F.PageDown:K=N?it(Y,1):Ye(Y,1);break;case F.Home:K=kt(Y,p,C);break;case F.End:K=ng(Y);break}return K},_=function(U,Y){for(var K=40,P=U,Z=!1,me=0,xe=D(U,Y);!Z;){if(me>=K){xe=Y;break}x&&xe<x&&(P=F.ArrowRight,xe=Ne(x,e.props)?D(P,xe):x),y&&xe>y&&(P=F.ArrowLeft,xe=Ne(y,e.props)?D(P,xe):y),Ne(xe,e.props)?((P===F.PageUp||P===F.Home)&&(P=F.ArrowRight),(P===F.PageDown||P===F.End)&&(P=F.ArrowLeft),xe=D(P,xe)):Z=!0,me++}return xe};if(R===F.Enter){r.preventDefault(),e.handleSelect(M,r),!k&&e.setPreSelection(M);return}else if(R===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 j=null;switch(R){case F.ArrowLeft:case F.ArrowRight:case F.ArrowUp:case F.ArrowDown:case F.PageUp:case F.PageDown:case F.Home:case F.End:j=_(R,M);break}if(!j){(u=(f=e.props).onInputError)===null||u===void 0||u.call(f,{code:1,msg:ia});return}if(r.preventDefault(),e.setState({lastPreSelectChange:sa}),$&&e.setSelected(j),e.setPreSelection(j),E){var O=Me(M),T=Me(j),W=G(M),z=G(j);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:S.createElement(Rg,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:hg(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,f=l?"PPPPp":"PPPP",u;return e.props.selectsRange?u="Selected start date: ".concat($e(e.props.startDate,{dateFormat:f,locale:c}),". ").concat(e.props.endDate?"End date: "+$e(e.props.endDate,{dateFormat:f,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:f,locale:c})),S.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||S.createElement("input",{type:"text"}),f=e.props.customInputRef||"ref",u=e.props,h=u.dateFormat,x=h===void 0?a.defaultProps.dateFormat:h,y=u.locale,b=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?Jm(e.props.startDate,e.props.endDate,{dateFormat:x,locale:y}):e.props.selectsMultiple?Zm((i=e.props.selectedDates)!==null&&i!==void 0?i:[],{dateFormat:x,locale:y}):$e(e.props.selected,{dateFormat:x,locale:y});return v.cloneElement(l,(o={},o[f]=function(w){e.input=w},o.value=b,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,f=r.endDate,u=r.clearButtonTitle,h=r.clearButtonClassName,x=h===void 0?"":h,y=r.ariaLabelClose,b=y===void 0?"Close":y,w=r.selectedDates;return o&&(c!=null||l!=null||f!=null||w!=null&&w.length)?S.createElement("button",{type:"button",className:ke("react-datepicker__close-icon",x,{"react-datepicker__close-icon--disabled":i}),disabled:i,"aria-label":b,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:Fn,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&&Hg(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."),S.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&S.createElement(Ag,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?S.createElement(Ec,{enableTabLoop:this.props.enableTabLoop},S.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=S.createElement(Ic,te({portalId:this.props.portalId},this.props),e)),S.createElement("div",null,this.renderInputContainer(),e)}return S.createElement(Bg,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),qg="input",sa="navigate";function Ar(n){return!!n&&!El(n.providerType)}function Kg(){const{data:n}=ge({queryKey:["feature-flag","proceeds-to-treasury"],queryFn:Tl,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
|
-
`,Qg=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
|
-
`,Vg=m.div`
|
|
418
|
-
display: flex;
|
|
419
|
-
align-items: center;
|
|
420
|
-
gap: 12px;
|
|
421
|
-
`,Ug=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
|
-
`,Xg=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
|
-
`,Gg=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
|
-
`,Jg=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
|
-
`,Zg=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
|
-
`,ji=m.span`
|
|
482
|
-
font-family: ${d.font.sans};
|
|
483
|
-
font-size: 12px;
|
|
484
|
-
color: ${d.colors.muted};
|
|
485
|
-
`,ex=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
|
-
`,tx=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
|
-
`,nx=m.span`
|
|
539
|
-
flex: none;
|
|
540
|
-
font-family: ${d.font.sans};
|
|
541
|
-
font-size: 10px;
|
|
542
|
-
color: ${d.colors.muted2};
|
|
543
|
-
`,rx=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
|
-
`,ax=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 ox=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
|
-
`,ix=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
|
-
`,sx=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
|
-
`,cx=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
|
-
`,lx=m.div`
|
|
707
|
-
display: flex;
|
|
708
|
-
gap: 12px;
|
|
709
|
-
|
|
710
|
-
${d.media.maxWidth("mobile")} {
|
|
711
|
-
flex-direction: column-reverse;
|
|
712
|
-
}
|
|
713
|
-
`,dx=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
|
-
`,ux=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
|
-
`,px=30;function Ii(n){const a=new Date;return a.setHours(0,0,0,0),a.setDate(a.getDate()+n),a}function fx({asset:n,session:a,creator:t,onListed:e,onClose:r}){const o=Wt(),i=Yt(),c=Kg(),{data:l}=ge({queryKey:["collection-meta",n.contractAddress],enabled:!t&&!!n.contractAddress,staleTime:5*6e4,queryFn:()=>$s(n.contractAddress)}),f=t||(l==null?void 0:l.creator),{data:u}=Sr(f),h=f?u!=null&&u.name?Mr(u.name):Ma(f):null,[x,y]=v.useState("10"),[b,w]=v.useState(()=>Ii(px)),[k,p]=v.useState(null),[C,$]=v.useState(!1),[E,R]=v.useState(null),[N,M]=v.useState("form"),D=Ar(a),_=Number(x),j=Number.isInteger(_)&&_>0,O=b?b.getTime():NaN,T=!!b&&O>Date.now(),W=Ii(1),z=j?`$${Zt(_).toFixed(2)}`:"$0";async function U(){if(p(null),!j){p(g("sellModal.errorWholeNumber"));return}if(!T){p(g("sellModal.invalidDate"));return}if(!D){$(!0);try{const P=vo(n.contractAddress,n.chainId),Z=await Ws(P,a.address);if($(!1),!Z){M("authorize");return}}catch{$(!1)}}await Y()}async function Y(){if(p(null),!j){p(g("sellModal.errorWholeNumber"));return}if(!T){p(g("sellModal.invalidDate"));return}$(!0);try{await ju({signer:a.signer,contractAddress:n.contractAddress,chainId:n.chainId});const P=await Iu({signer:a.signer,nft:{contractAddress:n.contractAddress,tokenId:n.tokenId,network:n.network,chainId:n.chainId},usdPrice:Zt(_),expiresAtMs:O}),Z=await Ts(P,a.identity);R(_),ue("Shop Listed Item",{item_id:n.itemId??n.tokenId??null,contract_address:n.contractAddress,price_credits:_,price_usd:Zt(_),listing_type:"secondary",is_primary:!1}),Rn.success(g("sellModal.toastOnSale",{name:n.name})),o.invalidateQueries({queryKey:["my-assets",a.address]}),e==null||e(_,Z==null?void 0:Z.id)}catch(P){Te(P,{flow:"list_secondary"}),ue("Shop Listing Failed",{listing_type:"secondary",error_code:Xe(P)}),p(bt(P,g("sellModal.errorGeneric")))}finally{$(!1)}}function K(){r(),i("/my-items")}return E!==null?s.jsx(Di,{onClick:r,role:"presentation",children:s.jsxs(Ci,{onClick:P=>P.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(Q,{name:"close",className:"ico"})})]}),s.jsxs(ix,{children:[s.jsx(sx,{"aria-hidden":!0,children:s.jsx(Q,{name:"check",className:"ico"})}),s.jsxs(cx,{children:[s.jsx("b",{children:g("sellModal.successOnSale")})," ",g("sellModal.successManage")]})]}),s.jsxs(lx,{children:[s.jsx(dx,{onClick:K,children:g("sellModal.myItems")}),s.jsx(ux,{onClick:r,children:g("getCredits.done")})]})]})}):N==="authorize"?s.jsx(Fs,{auth:vo(n.contractAddress,n.chainId),signer:a.signer,title:g("authorizeStep.sellTitle"),name:n.name,image:n.image,icon:s.jsx(Q,{name:"pen",className:"ico"}),reason:g("authorizeStep.sellReason",{name:n.name}),onAuthorized:()=>{M("form"),Y()},onCancel:()=>M("form"),onClose:r}):s.jsx(Di,{onClick:C?void 0:r,role:"presentation",children:s.jsxs(Ci,{"data-testid":"modal",onClick:P=>P.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(Q,{name:"close",className:"ico"})})]}),s.jsx(Qg,{children:g("sellModal.subtitle")}),s.jsxs(Vg,{children:[s.jsx(Ug,{children:n.image?s.jsx("img",{src:n.image,alt:""}):null}),s.jsxs(Xg,{children:[s.jsx(Gg,{children:n.name}),h?s.jsx(Jg,{children:g("sellModal.byCreator",{name:h})}):null]})]}),s.jsxs(Zg,{children:[s.jsxs(Pi,{children:[s.jsx(ji,{children:g("sellModal.priceShort")}),s.jsxs(ex,{"aria-invalid":x.length>0&&!j,children:[s.jsx(Pe,{className:"ccy"}),s.jsx(tx,{type:"number",min:"1",step:"1",inputMode:"numeric",value:x,onChange:P=>y(P.target.value),disabled:C,"aria-label":g("sellModal.priceLabel",{currency:"credits"})}),s.jsx(nx,{"aria-hidden":!0,children:z})]})]}),s.jsxs(Pi,{children:[s.jsx(ji,{children:g("sellModal.expirationLabel")}),s.jsx(rx,{"data-invalid":!!b&&!T,children:s.jsx(zg,{selected:b,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&&j?s.jsx(ox,{children:g("sellModal.proceedsCredits",{count:_})}):null,s.jsx(dt,{message:k}),s.jsx(ax,{onClick:()=>void U(),disabled:C||!j||!T,children:C?D?g("sellModal.puttingOnSale"):g("sellModal.confirmListing"):g("sellModal.putUpForSale")})]})})}const hx=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
|
-
`,mx=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
|
-
`,gx=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
|
-
`,xx=m.div`
|
|
789
|
-
display: flex;
|
|
790
|
-
align-items: center;
|
|
791
|
-
justify-content: space-between;
|
|
792
|
-
gap: 8px;
|
|
793
|
-
`,yx=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
|
-
`,bx=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
|
-
`,vx=m.div`
|
|
824
|
-
display: flex;
|
|
825
|
-
align-items: center;
|
|
826
|
-
gap: 12px;
|
|
827
|
-
`,wx=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
|
-
`,kx=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
|
-
`,Dx=m.label`
|
|
842
|
-
display: flex;
|
|
843
|
-
flex-direction: column;
|
|
844
|
-
gap: 6px;
|
|
845
|
-
`,Cx=m.span`
|
|
846
|
-
font-family: ${d.font.sans};
|
|
847
|
-
font-size: 12px;
|
|
848
|
-
color: ${d.colors.muted};
|
|
849
|
-
`,Sx=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
|
-
`,Mx=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
|
-
`,_x=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
|
-
`,Px=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
|
-
`,jx=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
|
-
`,Ix=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 Ex(n){return/^0x[a-fA-F0-9]{40}$/.test(n.trim())}function Tx({item:n,session:a,onClose:t,onTransferred:e}){const[r,o]=v.useState(""),[i,c]=v.useState(!1),[l,f]=v.useState(null),[u,h]=v.useState(!1),x=r.trim(),y=Ex(x),b=y&&x.toLowerCase()===a.address.toLowerCase(),w=x.length===0?null:y?b?g("transfer.selfAddress"):null:g("transfer.invalidAddress"),k=y&&!b&&!i;async function p(){if(k){f(null),c(!0);try{await pu({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),Rn.success(g("transfer.toastSuccess",{name:n.name})),e==null||e()}catch(C){rn(C)||Te(C,{flow:"transfer-item",tokenId:n.tokenId}),ue("Shop Transfer Failed",{error_code:Xe(C)}),f(rn(C)?g("getCredits.errorCanceled"):bt(C,g("transfer.errorGeneric")))}finally{c(!1)}}}return s.jsx(hx,{onClick:i?void 0:t,role:"presentation",children:s.jsxs(mx,{onClick:C=>C.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("transfer.title"),children:[s.jsx(gx,{children:s.jsxs(xx,{children:[s.jsx(yx,{children:g("transfer.title")}),s.jsx(bx,{onClick:t,disabled:i,"aria-label":g("sellModal.cancel"),children:s.jsx(Q,{name:"close",className:"ico"})})]})}),u?s.jsxs(s.Fragment,{children:[s.jsxs(Px,{children:[s.jsx(jx,{"aria-hidden":!0,children:s.jsx(Q,{name:"check",className:"ico"})}),s.jsx(Ix,{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(vx,{children:[n.thumbnail?s.jsx(wx,{src:n.thumbnail,alt:""}):null,s.jsx(kx,{children:n.name})]}),s.jsxs(Dx,{children:[s.jsx(Cx,{children:g("transfer.addressLabel")}),s.jsx(Sx,{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(Mx,{children:g("transfer.warning")}),s.jsx(dt,{message:l}),s.jsxs(Ei,{children:[s.jsx(_x,{onClick:t,disabled:i,children:g("sellModal.cancel")}),s.jsx(Ti,{onClick:()=>void p(),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
|
-
`,$x=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
|
-
`,Nx=m.div`
|
|
1043
|
-
display: flex;
|
|
1044
|
-
align-items: center;
|
|
1045
|
-
gap: 12px;
|
|
1046
|
-
`,Ox=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
|
-
`,Rx=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
|
-
`,Ax=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
|
-
`,Lx=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
|
-
`,Fx=m.label`
|
|
1094
|
-
display: flex;
|
|
1095
|
-
flex-direction: column;
|
|
1096
|
-
gap: 4px;
|
|
1097
|
-
`,Yx=m.span`
|
|
1098
|
-
font-family: ${d.font.sans};
|
|
1099
|
-
font-size: 12px;
|
|
1100
|
-
color: ${d.colors.muted};
|
|
1101
|
-
`,Wx=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
|
-
`,Bx=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
|
-
`,Hx=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
|
-
`,zx=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
|
-
`,qx=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
|
-
`,Kx=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
|
-
`,Qx=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
|
-
`,Vx=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
|
-
`,Ux=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
|
-
`,Xx=m.div`
|
|
1246
|
-
display: flex;
|
|
1247
|
-
gap: 12px;
|
|
1248
|
-
|
|
1249
|
-
${d.media.maxWidth("mobile")} {
|
|
1250
|
-
flex-direction: column-reverse;
|
|
1251
|
-
}
|
|
1252
|
-
`,Gx=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
|
-
`,Jx=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
|
-
`,Zx=1e3*60*60*24*182;function ey({item:n,session:a,onListed:t,onClose:e}){const r=Wt(),o=Yt(),[i,c]=v.useState("10"),[l,f]=v.useState(null),[u,h]=v.useState(null),[x,y]=v.useState(!1),[b,w]=v.useState(null),[k,p]=v.useState(null),C=nn.chainId,$=Ar(a),{data:E}=Sr(a.address),R=E!=null&&E.name?Mr(E.name):Ma(a.address),N=Number(i),M=Number.isInteger(N)&&N>0,D=M?`$${Zt(N).toFixed(2)}`:"$0";v.useEffect(()=>{let T=!1;return(async()=>{try{const W=await Eu({contractAddress:n.contractAddress,chainId:C});T||w(W)}catch{T||w(!1)}})(),()=>{T=!0}},[n.contractAddress,C]);async function _(){h(null);const T=Number(i);if(!Number.isInteger(T)||T<=0){h(g("primaryList.errorWholeNumber"));return}y(!0);try{b||(f(g("primaryList.statusEnabling")),await Tu({signer:a.signer,contractAddress:n.contractAddress,chainId:C}),w(!0)),f(g("primaryList.statusPublishing"));const W=await $u({signer:a.signer,item:{contractAddress:n.contractAddress,itemId:n.blockchainItemId,network:Ae.Network.MATIC,chainId:C},usdPrice:Zt(T),uses:n.remainingSupply,expiresAtMs:Date.now()+Zx});f(g("primaryList.statusFinishing")),await Ts(W,a.identity),f(null),p(T),ue("Shop Listed Item",{item_id:n.blockchainItemId,contract_address:n.contractAddress,price_credits:T,price_usd:Zt(T),listing_type:"primary",is_primary:!0}),Rn.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"))),f(null)}finally{y(!1)}}function j(){e(),o($l(n.contractAddress,n.blockchainItemId))}const O=b===null?g("primaryList.checking"):x?$?g("primaryList.publishing"):g("primaryList.confirmListing"):b===!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(Q,{name:"close",className:"ico"})})]}),s.jsxs(Kx,{children:[s.jsx(Qx,{"aria-hidden":!0,children:s.jsx(Q,{name:"check",className:"ico"})}),s.jsx(Vx,{children:s.jsx("b",{children:n.name})}),s.jsxs(Ux,{children:[g("primaryList.listedFor")," ",s.jsxs("strong",{children:[s.jsx(Pe,{className:"ccy-mark"})," ",k]})," ",g("primaryList.dotAvailable",{count:n.remainingSupply})]})]}),s.jsxs(Xx,{children:[s.jsx(Gx,{onClick:e,children:g("getCredits.done")}),s.jsx(Jx,{onClick:j,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(Q,{name:"close",className:"ico"})})]}),s.jsx($x,{children:g("primaryList.fromCollection",{collectionName:n.collectionName,count:n.remainingSupply})}),s.jsxs(Nx,{children:[s.jsx(Ox,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs(Rx,{children:[s.jsx(Ax,{children:n.name}),R?s.jsx(Lx,{children:g("primaryList.byCreator",{name:R})}):null]})]}),s.jsxs(Fx,{children:[s.jsx(Yx,{children:g("primaryList.priceShort")}),s.jsxs(Wx,{"aria-invalid":i.length>0&&!M,children:[s.jsx(Pe,{className:"ccy"}),s.jsx(Bx,{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(Hx,{"aria-hidden":!0,children:D})]})]}),s.jsx(ca,{children:g("primaryList.pricedInWhole",{currency:wt.name,currencySingular:wt.nameSingular})}),b===!1&&!x?s.jsx(ca,{children:$?g("primaryList.firstTimeManaged",{collectionName:n.collectionName}):g("primaryList.firstTimeConfirm",{collectionName:n.collectionName})}):b===!0&&!x?s.jsx(ca,{children:$?g("primaryList.readyManaged"):g("primaryList.readyConfirm")}):null,l?s.jsx(qx,{children:l}):null,s.jsx(dt,{message:u}),s.jsx(zx,{onClick:()=>void _(),disabled:x||b===null||!M,children:O})]})})}const Tc=["function issueTokens(address[] _beneficiaries, uint256[] _itemIds)"];function $c(n){return/^0x[a-fA-F0-9]{40}$/.test(n.trim())}function Nc(n){return n.reduce((a,t)=>a+Math.max(0,Math.floor(t.amount||0)),0)}function ty(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(!$c(r.address)||!Number.isInteger(r.amount)||r.amount<1)return!1;const e=Nc(t);return e>=1&&e<=a}function ny(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 ry(n){const{contractAddress:a,chainId:t,beneficiaries:e,itemIds:r,signer:o}=n,i={...ma(Es.ERC721CollectionV2,t),address:a},c=new Fu(Tc).encodeFunctionData("issueTokens",[e,r]),l=Cu(),f=Su(o.provider,l),u=await Au(f,l,c,i,{serverURL:Bs.relayerUrl});return await Mu(u,"the mint"),u}async function ay(n){const{signer:a,contractAddress:t,chainId:e,entries:r,itemId:o}=n,{beneficiaries:i,itemIds:c}=ny(r,o);if(i.length===0)throw new Error("No copies to issue");if(Bs.enabled)try{return await ry({contractAddress:t,chainId:e,beneficiaries:i,itemIds:c,signer:a})}catch(h){if(h instanceof Ou&&h.code===Ru.USER_DENIED||h instanceof ku)throw h;console.warn("[issue] gasless meta-tx failed, falling back to a direct tx:",h)}return await Du(a.provider,e),(await(await new Lu(t,Tc,a).issueTokens(i,c,Nu(e))).wait()).transactionHash}const oy=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
|
-
`,iy=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
|
-
`,sy=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
|
-
`,cy=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
|
-
`,ly=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
|
-
`,dy=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
|
-
`,uy=m.div`
|
|
1362
|
-
display: flex;
|
|
1363
|
-
align-items: center;
|
|
1364
|
-
gap: 12px;
|
|
1365
|
-
`,py=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
|
-
`,fy=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
|
-
`,hy=m.div`
|
|
1390
|
-
display: flex;
|
|
1391
|
-
flex-direction: column;
|
|
1392
|
-
gap: 10px;
|
|
1393
|
-
`,my=m.div`
|
|
1394
|
-
display: flex;
|
|
1395
|
-
align-items: flex-start;
|
|
1396
|
-
gap: 8px;
|
|
1397
|
-
`,gy=m.label`
|
|
1398
|
-
flex: 1 1 auto;
|
|
1399
|
-
min-width: 0;
|
|
1400
|
-
display: flex;
|
|
1401
|
-
flex-direction: column;
|
|
1402
|
-
gap: 4px;
|
|
1403
|
-
`,xy=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
|
-
`,yy=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
|
-
`,by=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
|
-
`,vy=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
|
-
`,wy=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 ky=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
|
-
`,Dy=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
|
-
`,Cy=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
|
-
`,Sy=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
|
-
`,My=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 _y(n){return n.map(a=>({address:a.address,amount:Number(a.amount)}))}function Py({item:n,session:a,onClose:t,onIssued:e}){const r=Wt(),[o,i]=v.useState([{address:"",amount:"1"}]),[c,l]=v.useState(!1),[f,u]=v.useState(null),[h,x]=v.useState(null),y=v.useRef(null),b=Ar(a),w=_y(o),k=Nc(w),p=ty(w,n.available),C=k>n.available;v.useEffect(()=>{var _;(_=y.current)==null||_.focus();function D(j){j.key==="Escape"&&!c&&t()}return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[c,t]);function $(D,_){i(j=>j.map((O,T)=>T===D?{...O,..._}:O))}function E(){i(D=>[...D,{address:"",amount:"1"}])}function R(D){i(_=>_.length<=1?_:_.filter((j,O)=>O!==D))}async function N(){if(!(!p||c)){u(null),l(!0);try{await ay({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),Rn.success(g("issue.toastSuccess",{count:k,name:n.name})),r.invalidateQueries({queryKey:["publishable-item"]}),r.invalidateQueries({queryKey:["publishable-items"]}),e==null||e()}catch(D){rn(D)||Te(D,{flow:"issue-item",itemId:n.itemId}),ue("Shop Issue Failed",{error_code:Xe(D)}),u(rn(D)?g("getCredits.errorCanceled"):bt(D,g("issue.errorGeneric")))}finally{l(!1)}}}const M=c?b?g("issue.issuing"):g("issue.confirm"):k>0?g("issue.issueCount",{count:k}):g("issue.issue");return s.jsx(oy,{onClick:c?void 0:t,role:"presentation",children:s.jsxs(iy,{ref:y,tabIndex:-1,"data-testid":"issue-modal",onClick:D=>D.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("issue.title"),children:[s.jsxs(sy,{children:[s.jsx(cy,{children:g("issue.title")}),s.jsx(ly,{onClick:t,disabled:c,"aria-label":g("sellModal.cancel"),children:s.jsx(Q,{name:"close",className:"ico"})})]}),h!==null?s.jsxs(s.Fragment,{children:[s.jsxs(Cy,{children:[s.jsx(Sy,{"aria-hidden":!0,children:s.jsx(Q,{name:"check",className:"ico"})}),s.jsx(My,{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(uy,{children:[s.jsx(py,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsx(fy,{children:n.name})]}),s.jsx(dy,{children:g("issue.subtitle")}),s.jsx(hy,{children:o.map((D,_)=>{const j=D.address.trim(),O=j.length>0&&!$c(j),T=Number(D.amount),W=D.amount.length>0&&(!Number.isInteger(T)||T<1);return s.jsxs(my,{children:[s.jsxs(gy,{children:[s.jsx(Li,{children:g("issue.addressLabel")}),s.jsx(Fi,{type:"text",spellCheck:!1,autoComplete:"off",placeholder:"0x…",value:D.address,onChange:z=>$(_,{address:z.target.value}),disabled:c,"aria-invalid":O,"aria-label":g("issue.addressLabel")}),O?s.jsx(ky,{children:g("issue.invalidAddress")}):null]}),s.jsxs(xy,{children:[s.jsx(Li,{children:g("issue.amountLabel")}),s.jsx(Fi,{type:"number",min:"1",step:"1",inputMode:"numeric",value:D.amount,onChange:z=>$(_,{amount:z.target.value}),disabled:c,"aria-invalid":W,"aria-label":g("issue.amountLabel")})]}),s.jsx(yy,{onClick:()=>R(_),disabled:c||o.length<=1,"aria-label":g("issue.removeRow"),children:s.jsx(Q,{name:"close",className:"ico"})})]},_)})}),s.jsxs(by,{onClick:E,disabled:c,children:[s.jsx(Q,{name:"plus",className:"ico"}),g("issue.addRow")]}),s.jsxs(vy,{over:C,"aria-live":"polite",children:[s.jsx("strong",{children:k})," / ",n.available," ",g("issue.itemsToIssue")]}),C?s.jsx(wy,{children:g("issue.overCap",{available:n.available})}):null,s.jsx(dt,{message:f}),s.jsxs(Yi,{children:[s.jsx(Dy,{onClick:t,disabled:c,children:g("sellModal.cancel")}),s.jsx(Wi,{onClick:()=>void N(),disabled:!p||c,children:M})]})]})]})})}const jy=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
|
-
`,Iy=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
|
-
`,Ey=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
|
-
`,Ty=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
|
-
`,$y=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
|
-
`,Ny=m.video`
|
|
1670
|
-
display: block;
|
|
1671
|
-
width: 100%;
|
|
1672
|
-
max-height: 70vh;
|
|
1673
|
-
border-radius: 12px;
|
|
1674
|
-
background: ${d.colors.blackBtn};
|
|
1675
|
-
`;function Oy({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(jy,{onClick:t,role:"presentation",children:s.jsxs(Iy,{ref:e,tabIndex:-1,onClick:r=>r.stopPropagation(),"data-testid":"modal",role:"dialog","aria-modal":"true","aria-label":g("itemDetail.showcaseTitle"),children:[s.jsxs(Ey,{children:[s.jsx(Ty,{children:a||g("itemDetail.showcaseTitle")}),s.jsx($y,{onClick:t,"aria-label":g("itemDetail.showcaseClose"),children:s.jsx(Q,{name:"close",size:18})})]}),s.jsx(Ny,{src:n,"data-testid":"showcase-video",controls:!0,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto"})]})})}const{colors:pt,radius:Ry}=d,Ay=m.div`
|
|
1676
|
-
position: fixed;
|
|
1677
|
-
inset: 0;
|
|
1678
|
-
z-index: 60;
|
|
1679
|
-
display: grid;
|
|
1680
|
-
place-items: center;
|
|
1681
|
-
padding: 20px;
|
|
1682
|
-
`,Ly=m.div`
|
|
1683
|
-
position: absolute;
|
|
1684
|
-
inset: 0;
|
|
1685
|
-
background: rgba(22, 21, 24, 0.45);
|
|
1686
|
-
`,Fy=m.div`
|
|
1687
|
-
position: relative;
|
|
1688
|
-
z-index: 1;
|
|
1689
|
-
width: 100%;
|
|
1690
|
-
max-width: 420px;
|
|
1691
|
-
background: ${pt.white};
|
|
1692
|
-
border-radius: ${Ry.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
|
-
`,Yy=m.div`
|
|
1697
|
-
display: flex;
|
|
1698
|
-
align-items: center;
|
|
1699
|
-
gap: 14px;
|
|
1700
|
-
margin-bottom: 18px;
|
|
1701
|
-
`,Wy=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
|
-
`,By=m.div`
|
|
1715
|
-
font-weight: 700;
|
|
1716
|
-
font-size: 16px;
|
|
1717
|
-
color: ${pt.text};
|
|
1718
|
-
margin-bottom: 6px;
|
|
1719
|
-
`,Hy=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
|
-
`,zy=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
|
-
`,qy=m.div`
|
|
1750
|
-
font-size: 13px;
|
|
1751
|
-
margin-bottom: 6px;
|
|
1752
|
-
`,Oc=dn`
|
|
1753
|
-
margin: 6px 0 0;
|
|
1754
|
-
font-size: 13px;
|
|
1755
|
-
`,Ki=m.p`
|
|
1756
|
-
${Oc};
|
|
1757
|
-
`,Ky=m(dt)`
|
|
1758
|
-
${Oc};
|
|
1759
|
-
`,Qy=m.div`
|
|
1760
|
-
display: flex;
|
|
1761
|
-
gap: 10px;
|
|
1762
|
-
margin-top: 18px;
|
|
1763
|
-
`,Qi=m(An)`
|
|
1764
|
-
flex: 1;
|
|
1765
|
-
`;function Vi(n){if(rn(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 Vy(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 Rc({listing:n,rate:a,onClose:t,onSold:e}){const{session:r}=Ot(),{data:o,isError:i}=Ps(r),c=Wt(),l=Yt(),[f,u]=v.useState("confirm"),[h,x]=v.useState(g("marketCheckout.lockingPrice")),[y,b]=v.useState(null),[w,k]=v.useState(null),p=v.useRef(null),C=v.useRef(ac()),$=lr(Vr(n.manaWei,a));v.useEffect(()=>{let j=!1;if(!r){u("error"),b(g("buyModal.signInToCheckout"));return}return(async()=>{try{const T=await Os(n.tradeId);if(!T)throw new Error("not found");if(js(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(j){N([z.id]);return}p.current=z.id,k({trade:T,credit:z,maxCreditedValue:U,usdCents:Y,credits:lr(Y)}),x("")}catch(T){if(j)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"),b(Vi(T))}})(),()=>{j=!0,p.current&&r&&(M([p.current]),p.current=null)}},[]);const E=!!w&&o!=null&&o.credits<w.credits;async function R(){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]),p.current=null,l("/credits");return}u("working"),b(null);let j=!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),Ys())try{O=await Hs(W),C.current.broadcast(w.credit.id,O),await zs(O),j=!0}catch(z){if(z instanceof qs)j=!0;else if(z instanceof Ks){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]),p.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"]}),b(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),p.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:j,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:[Vy(n)],txHash:O};l("/success",{state:T})}function N(j){if(!r||j.length===0)return;const O=j.filter(T=>!C.current.mayBeConsumed(T));O.length!==0&&Is(r.identity,O).catch(()=>{})}function M(j){N(j.filter(O=>!C.current.isInFlight(O)))}function D(){r&&w&&N([w.credit.id]),p.current=null,t()}const _=f==="working";return s.jsxs(Ay,{role:"dialog","aria-modal":"true","aria-label":g("buyModal.dialogAria",{name:n.name}),children:[s.jsx(Ly,{onClick:_?void 0:D,"aria-hidden":!0}),s.jsxs(Fy,{children:[s.jsxs(Yy,{children:[s.jsx(Wy,{children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:""}):null}),s.jsxs("div",{children:[s.jsx(By,{title:n.name,children:n.name||g("buyModal.itemFallback")}),s.jsx(Ns,{"data-variant":"rarity",children:n.rarity})]})]}),s.jsx(Hy,{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(zy,{"aria-hidden":!0,children:"≈"}),s.jsx(zi,{}),go($)]}),s.jsx(qi,{className:"muted",children:h||g("marketCheckout.lockingPrice")})]})}),r?s.jsxs(qy,{className:"muted",children:[g("marketCheckout.yourBalance")," ",s.jsx(Pe,{className:"ccy-mark"})," ",Nl(o,i)]}):null,E?s.jsx(Ki,{className:"muted",children:g("marketCheckout.needMore",{currency:wt.name})}):null,h&&f==="working"?s.jsx(Ki,{className:"muted",children:h}):null,s.jsx(Ky,{message:y}),s.jsxs(Qy,{children:[s.jsx(Qi,{variant:"ghost",onClick:D,disabled:_,children:g("buyModal.cancel")}),s.jsx(Qi,{variant:"purple",onClick:()=>void R(),disabled:_||!w,children:_?g("marketCheckout.buying"):E?g("nav.getCredits",{currency:wt.name}):g("marketCheckout.confirmPurchase")})]})]})]})}function Uy(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:()=>Ol(n,a,{first:e})});return{items:r??[],isFetched:o}}const{colors:ce,media:Ya}=d,Xy=Rl`
|
|
1766
|
-
to {
|
|
1767
|
-
transform: rotate(360deg);
|
|
1768
|
-
}
|
|
1769
|
-
`,Gy=m.div``,Jy=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: ${Xy} 0.8s linear infinite;
|
|
1776
|
-
|
|
1777
|
-
@media (prefers-reduced-motion: reduce) {
|
|
1778
|
-
animation-duration: 2.4s;
|
|
1779
|
-
}
|
|
1780
|
-
`,Zy=m.p``,eb=m.div``,Ui=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
|
-
`,Xi=m.span`
|
|
1823
|
-
${Ya.maxWidth("lg")} {
|
|
1824
|
-
display: none;
|
|
1825
|
-
}
|
|
1826
|
-
`,Gi=m(Q)`
|
|
1827
|
-
display: none;
|
|
1828
|
-
|
|
1829
|
-
${Ya.maxWidth("lg")} {
|
|
1830
|
-
display: block;
|
|
1831
|
-
}
|
|
1832
|
-
`,tb=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
|
-
`,Ji="shop-item-preview";function nb({item:n}){const a=Ot(D=>{var _;return(_=D.session)==null?void 0:_.address}),{data:t,isLoading:e}=Sr(a),r=a&&t?a:"default",o=n.category==="emote",[i,c]=v.useState("avatar"),l=!o&&i==="item",f=l||!e,u=Tn(D=>D.fittingOpen),{ref:h,active:x}=Wu(),y=f&&x&&!u,[b,w]=v.useState(!0);v.useEffect(()=>{w(!0)},[n.id,l]),v.useEffect(()=>{y&&w(!0)},[y]);const k=v.useRef(null);v.useEffect(()=>{if(y)return()=>{Bu(k.current),k.current=null}},[y]);const[p,C]=v.useState(Ae.PreviewRenderer.UNITY),$=p===Ae.PreviewRenderer.BABYLON,E=!!a&&!!t,R=E&&Al(n,Ll(t)),N=Fl(n)[0],M=E&&!R&&!o;return s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:h,"data-preview-viewport":!0,"aria-hidden":!0}),y?s.jsx(Yl,{id:Ji,contractAddress:n.contractAddress,tokenId:n.tokenId??void 0,itemId:n.tokenId?void 0:n.itemId??void 0,profile:l?void 0:R?r:"default",bodyShape:l||R?void 0:N,type:o?void 0:l?Ae.PreviewType.WEARABLE:Ae.PreviewType.AVATAR,emote:o||l?void 0:Ae.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:o?1.5:void 0,wheelStart:o?100:void 0,unity:!0,onRenderer:C,onLoad:()=>{var D;w(!1),k.current=((D=document.getElementById(Ji))==null?void 0:D.contentWindow)??null}}):null,!y||b?s.jsx(Gy,{"data-preview-loading":!0,"aria-busy":"true","aria-label":g("itemPreview.loading"),children:s.jsx(Jy,{"aria-hidden":!0})}):null,M&&!l?s.jsx(Zy,{"data-preview-note":!0,children:g("itemPreview.shownOnBody",{shape:Wl(N)})}):null,!$||!o?null:s.jsx(tb,{"data-preview-controls":!0,"data-testid":"emote-controls",children:s.jsx(Yu,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}),!$||o?null:s.jsxs(eb,{"data-preview-toggle":!0,role:"group","aria-label":g("itemPreview.previewMode"),children:[s.jsxs(Ui,{type:"button","data-active":i==="avatar"||void 0,"aria-pressed":i==="avatar","aria-label":g("itemPreview.onAvatar"),onClick:()=>c("avatar"),children:[s.jsx(Gi,{name:"view-avatar",size:18}),s.jsx(Xi,{children:g("itemPreview.onAvatar")})]}),s.jsxs(Ui,{type:"button","data-active":i==="item"||void 0,"aria-pressed":i==="item","aria-label":g("itemPreview.item"),onClick:()=>c("item"),children:[s.jsx(Gi,{name:"view-item",size:18}),s.jsx(Xi,{children:g("itemPreview.item")})]})]})]})}const rb=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
|
-
`,ab=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
|
-
`,ob=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
|
-
`,ib=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
|
-
`,sb=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
|
-
`,cb=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
|
-
`,lb=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
|
-
`,db=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
|
-
`,ub=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
|
-
`,pb=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
|
-
`,fb=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
|
-
`,Ac=`
|
|
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
|
-
`,hb=m.div`
|
|
2181
|
-
${Ac}
|
|
2182
|
-
`,mb=m.button`
|
|
2183
|
-
${Ac}
|
|
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
|
-
`,Zi=m.span`
|
|
2200
|
-
color: ${d.colors.muted};
|
|
2201
|
-
`,gb=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
|
-
`,xb=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
|
-
`,Lc=`
|
|
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
|
-
`,yb=m.button`
|
|
2276
|
-
${Lc}
|
|
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
|
-
`,es=m.button`
|
|
2289
|
-
${Lc}
|
|
2290
|
-
background: ${d.colors.accent};
|
|
2291
|
-
color: ${d.colors.softWhite};
|
|
2292
|
-
|
|
2293
|
-
&:hover:not(:disabled) {
|
|
2294
|
-
background: ${d.colors.accentHover};
|
|
2295
|
-
}
|
|
2296
|
-
`,bb=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
|
-
`,vb=m.div`
|
|
2310
|
-
flex: none;
|
|
2311
|
-
display: flex;
|
|
2312
|
-
align-items: center;
|
|
2313
|
-
justify-content: flex-end;
|
|
2314
|
-
gap: 8px;
|
|
2315
|
-
`,wb=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
|
-
`,ts=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
|
-
`,kb=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,Db=!1;function Cb(n){return/^0x[a-fA-F0-9]{40}$/.test(n)?`${n.slice(0,6)}…${n.slice(-4)}`:n}function Sb(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 Mb(n,a){var t;return(((t=n==null?void 0:n.trim())==null?void 0:t[0])||a.replace(/^0x/i,"")[0]||"?").toUpperCase()}function _b(n){return n%100>=11&&n%100<=13?"th":["th","st","nd","rd"][n%10]??"th"}function Pb(n,a){const t=new Date(n);return Number.isNaN(t.getTime())?"—":a==="en"?`${new Intl.DateTimeFormat("en",{month:"long"}).format(t)} ${t.getDate()}${_b(t.getDate())}, ${t.getFullYear()}`:new Intl.DateTimeFormat(a,{day:"numeric",month:"long",year:"numeric"}).format(t)}function jb(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 Ib({r:n,seller:a,issuedId:t,labels:e,locale:r,isOwn:o,isLegacy:i,inCart:c,fallbackImage:l,onAdd:f,onBuyNative:u,onBuyLegacy:h}){var R,N;const x=Yt(),{data:y}=Sr(a),b=(N=(R=y==null?void 0:y.avatar)==null?void 0:R.snapshots)==null?void 0:N.face256,[w,k]=v.useState(!1);v.useEffect(()=>k(!1),[b]);const p=!!b&&!w,C=a?y!=null&&y.name?Mr(y.name):Cb(a):void 0,$=p?s.jsx("img",{className:"owner-ava",src:b,alt:"",loading:"lazy",onError:()=>k(!0)}):a?s.jsx("span",{className:"owner-ava",style:{backgroundColor:Sb(a)},"aria-hidden":!0,children:Mb(y==null?void 0:y.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(mb,{type:"button",onClick:()=>x(`/items/creator/${a}`),children:E}):s.jsx(hb,{children:E})}),s.jsx("td",{"data-label":e.itemNumber,children:t?s.jsxs("span",{"data-testid":"resale-issued",children:["#",t]}):s.jsx(Zi,{children:"—"})}),s.jsx("td",{"data-label":e.expiration,children:n.saleEndsAt?Pb(n.saleEndsAt,r):s.jsx(Zi,{children:"—"})}),s.jsx("td",{"data-label":e.price,children:s.jsxs(gb,{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(xb,{"data-persistent":o?"true":void 0,children:o?s.jsx(bb,{"data-testid":"resale-own",children:g("resales.yourListing")}):i?s.jsx(es,{onClick:h,"aria-label":g("assetCard.buyNow"),"data-testid":"resale-buy",children:g("resales.buy")}):s.jsxs(s.Fragment,{children:[s.jsxs(yb,{onClick:f,disabled:c,"aria-label":c?g("assetCard.inCart"):g("assetCard.addToCart"),"data-testid":"resale-add",children:[s.jsx(Q,{name:"cart",className:"ico"}),s.jsx("span",{children:c?g("assetCard.inCart"):g("resales.add")})]}),s.jsx(es,{onClick:u,"aria-label":g("assetCard.buyNow"),"data-testid":"resale-buy",children:g("resales.buy")})]})})]})})]})}function Eb({item:n,onClose:a}){var K;const t=n.contractAddress,e=n.itemId,r=Wt(),o=Tn(P=>P.add),i=Tn(P=>P.items),{session:c}=Ot(),l=Bl(P=>P.locale),f=(K=c==null?void 0:c.address)==null?void 0:K.toLowerCase(),u=v.useRef(null),[h,x]=v.useState(null),[y,b]=v.useState(null),[w,k]=v.useState("cheapest"),[p,C]=v.useState(0),$=!!h||!!y;v.useEffect(()=>{var P;(P=u.current)==null||P.focus()},[]),v.useEffect(()=>{function P(me){me.key==="Escape"&&!$&&a()}window.addEventListener("keydown",P);const Z=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",P),document.body.style.overflow=Z}},[$,a]);const{data:E=[],isLoading:R}=ge({queryKey:["item-resales",t,e],enabled:!!t&&!!e,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>As(t,e)}),N=v.useMemo(()=>w==="cheapest"?E:[...E].sort((P,Z)=>Z.priceCredits-P.priceCredits),[E,w]),M=Math.max(1,Math.ceil(N.length/nr)),D=Math.min(p,M-1),_=N.slice(D*nr,D*nr+nr),j=_.filter(P=>!P.seller||!P.issuedId).map(P=>P.tokenId).filter(P=>!!P),{data:O={}}=ge({queryKey:["resale-token-info",t,j.join(",")],enabled:!!t&&j.length>0,staleTime:6e4,queryFn:()=>Hl(t,j)}),{data:T=[]}=ge({queryKey:["item-classic-orders",t,e],enabled:Db,queryFn:()=>zl(t,e)}),W=E.some(P=>P.source==="legacy"),{data:z}=Rs(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(rb,{onClick:$?void 0:a,role:"presentation",children:s.jsxs(ab,{ref:u,tabIndex:-1,onClick:P=>P.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":g("resales.modalTitle"),"data-testid":"resellers-modal",children:[s.jsxs(ob,{children:[s.jsx(ib,{children:g("resales.modalTitle")}),s.jsx(sb,{onClick:a,"aria-label":g("resales.close"),"data-testid":"resellers-close",children:s.jsx(Q,{name:"close"})})]}),s.jsxs(cb,{children:[s.jsxs(lb,{children:[s.jsx(db,{"data-testid":"resales-count",children:g("resales.count",{count:E.length})}),s.jsxs(ub,{children:[s.jsxs("select",{value:w,onChange:P=>{k(P.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(Q,{name:"chevron-down",className:"chev"})]})]}),R?null:N.length===0?s.jsx(kb,{"data-testid":"resales-empty",children:g("resales.empty")}):null,N.length>0?s.jsxs(s.Fragment,{children:[s.jsx(pb,{children:s.jsxs(fb,{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:_.map(P=>{const Z=P.source==="legacy",me=i.some(mt=>mt.id===P.id),xe=P.tokenId&&O[P.tokenId]||{},We=P.issuedId??xe.issuedId,Ce=P.seller??xe.seller,ve={...P,name:P.name||n.name,thumbnail:P.thumbnail||n.thumbnail,rarity:P.rarity||n.rarity,category:P.category||n.category,wearableCategory:P.wearableCategory??n.wearableCategory,gender:P.gender??n.gender},ht=!!Ce&&!!f&&Ce.toLowerCase()===f;return s.jsx(Ib,{r:ve,seller:Ce,issuedId:We,labels:Y,locale:l,isOwn:ht,isLegacy:Z,inCart:me,fallbackImage:ve.thumbnail,onAdd:()=>o(ve,"item_detail"),onBuyNative:()=>x(ve),onBuyLegacy:()=>b(jb(ve))},P.tradeId??P.id)})})]})}),M>1?s.jsxs(vb,{children:[s.jsx(ts,{"data-dir":"prev",onClick:()=>C(P=>Math.max(0,P-1)),disabled:D===0,"aria-label":g("resales.prevPage"),"data-testid":"resale-prev-page",children:s.jsx(Q,{name:"chevron-down"})}),s.jsx(wb,{"data-testid":"resale-page-label",children:g("resales.page",{page:D+1,total:M})}),s.jsx(ts,{onClick:()=>C(P=>Math.min(M-1,P+1)),disabled:D>=M-1,"aria-label":g("resales.nextPage"),"data-testid":"resale-next-page",children:s.jsx(Q,{name:"chevron-down"})})]}):null]}):null,null]})]})}),h?s.jsx(ya,{item:h,onClose:()=>{x(null),U()}}):null,y&&z?s.jsx(Rc,{listing:y,rate:z,onClose:()=>b(null),onSold:()=>{b(null),U()}}):null]})}function Wa(){return nn.shopServerUrl||null}function Fc(){return!!Wa()}async function Tb(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 Ls(o,{method:"GET",identity:t,metadata:{}});if(!i.ok)throw new Error(`getNotifyRequest ${i.status}`);return Nb(i,"getNotifyRequest")}async function $b(n,a){const t=Wa();if(!t)throw new Error("createNotifyRequest: no shop-server host configured");const e=`${t}/notify-requests`,r=await Ls(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()&&!Ob(o))throw new Error("createNotifyRequest: response was not JSON")}async function Nb(n,a){try{return await n.json()}catch{throw new Error(`${a}: response was not JSON`)}}function Ob(n){try{return JSON.parse(n),!0}catch{return!1}}const{colors:Re,radius:Yc}=d,Wc=dn`
|
|
2407
|
-
display: flex;
|
|
2408
|
-
flex-direction: column;
|
|
2409
|
-
gap: 8px;
|
|
2410
|
-
width: 100%;
|
|
2411
|
-
`,Rb=m.form`
|
|
2412
|
-
${Wc};
|
|
2413
|
-
`,ns=m.div`
|
|
2414
|
-
${Wc};
|
|
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
|
-
`,Ab=m.label`
|
|
2425
|
-
font-size: 14px;
|
|
2426
|
-
color: ${Re.text};
|
|
2427
|
-
`,Lb=m.div`
|
|
2428
|
-
display: flex;
|
|
2429
|
-
align-items: stretch;
|
|
2430
|
-
gap: 8px;
|
|
2431
|
-
`,Fb=m.input`
|
|
2432
|
-
flex: 1;
|
|
2433
|
-
min-width: 0;
|
|
2434
|
-
height: 42px;
|
|
2435
|
-
padding: 0 16px;
|
|
2436
|
-
border: 1px solid ${Re.muted};
|
|
2437
|
-
border-radius: ${Yc.btn};
|
|
2438
|
-
background: ${Re.white};
|
|
2439
|
-
font-size: 16px;
|
|
2440
|
-
color: ${Re.text};
|
|
2441
|
-
|
|
2442
|
-
&::placeholder {
|
|
2443
|
-
color: ${Re.muted2};
|
|
2444
|
-
}
|
|
2445
|
-
&:focus-visible {
|
|
2446
|
-
outline: none;
|
|
2447
|
-
border-color: ${Re.accent};
|
|
2448
|
-
box-shadow: 0 0 0 1px ${Re.accent};
|
|
2449
|
-
}
|
|
2450
|
-
`,rs=m.button`
|
|
2451
|
-
flex-shrink: 0;
|
|
2452
|
-
height: 42px;
|
|
2453
|
-
padding: 0 16px;
|
|
2454
|
-
border: 0;
|
|
2455
|
-
border-radius: ${Yc.btn};
|
|
2456
|
-
background: ${Re.accent};
|
|
2457
|
-
color: ${Re.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
|
-
`,Yb=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: ${Re.white};
|
|
2486
|
-
`,Wb=m.span`
|
|
2487
|
-
font-size: 16px;
|
|
2488
|
-
line-height: 1.5;
|
|
2489
|
-
color: ${Re.text2};
|
|
2490
|
-
`;function as(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim())}function Bb({item:n}){const a=Ot(k=>k.session),t=Ot(k=>k.signIn),[e,r]=v.useState(""),[o,i]=v.useState(!1),[c,l]=v.useState(!1),[f,u]=v.useState(null),h=Fc(),x=h&&!!a&&!!n.contractAddress&&!!n.itemId,{data:y}=ge({queryKey:["notify-request",n.contractAddress,n.itemId,a==null?void 0:a.address],enabled:x,queryFn:()=>Tb(n.contractAddress,n.itemId,a.identity)});v.useEffect(()=>{y!=null&&y.email&&r(k=>k||y.email)},[y==null?void 0:y.email]),v.useEffect(()=>{if(!a||!h)return;let k=!1;return ql().then(p=>{!k&&p&&r(C=>C||p)}),()=>{k=!0}},[h,a]);const b=c||!!(y!=null&&y.subscribed);async function w(k){if(k.preventDefault(),!(!a||!n.itemId||!as(e)||o)){i(!0),u(null);try{await $b({contractAddress:n.contractAddress,itemId:n.itemId,chainId:n.chainId,email:e.trim()},a.identity),l(!0)}catch(p){Te(p,{flow:"notify-me",contractAddress:n.contractAddress,itemId:n.itemId}),u(g("notifyMe.error"))}finally{i(!1)}}}return h?a?b?s.jsxs(ns,{"data-done":!0,"data-testid":"notify-subscribed",children:[s.jsx(Yb,{"aria-hidden":!0,children:s.jsx(Q,{name:"check",size:12})}),s.jsx(Wb,{children:g("notifyMe.subscribedBody")})]}):s.jsxs(Rb,{onSubmit:k=>void w(k),"data-testid":"notify",children:[s.jsx(Ab,{htmlFor:"notify-email",children:g("notifyMe.label")}),s.jsxs(Lb,{children:[s.jsx(Fb,{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(rs,{type:"submit",disabled:!as(e)||o,"data-testid":"notify-submit",children:o?g("notifyMe.working"):g("notifyMe.cta")})]}),s.jsx(dt,{message:f})]}):s.jsx(ns,{"data-testid":"notify",children:s.jsx(rs,{type:"button","data-full":!0,onClick:t,"data-testid":"notify-signin",children:g("notifyMe.signInCta")})}):null}const Bc="shop:recently-viewed",Hc=12;function Hb(){try{const n=localStorage.getItem(Bc);if(!n)return[];const a=JSON.parse(n);return Array.isArray(a)?a.slice(0,Hc):[]}catch{return[]}}function zb(n){if(n!=null&&n.id)try{const a=[n,...Hb().filter(t=>t.id!==n.id)].slice(0,Hc);localStorage.setItem(Bc,JSON.stringify(a))}catch{}}const qb=m(Kl)`
|
|
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 Kb({contractAddress:n,name:a,items:t,className:e}){const r=Yt();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(Ql,{as:"button","data-link":!0,className:e,"data-testid":"creator",onClick:l=>{l.stopPropagation(),r(`/collection/${n}`)},children:[o.length>0?s.jsxs(qb,{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,f)=>s.jsx("img",{src:l,alt:""},f))}),c.length>0?s.jsx("span",{"data-collage-row":!0,children:c.map((l,f)=>s.jsx("img",{src:l,alt:""},f))}):null]}):null,s.jsx(Vl,{"data-testid":"creator-name",children:Mr(a)})]})}const{colors:A,radius:pn,media:De,font:Qb}=d,os=m.div`
|
|
2517
|
-
max-width: 1721px;
|
|
2518
|
-
margin: 0 auto;
|
|
2519
|
-
|
|
2520
|
-
${De.maxWidth("lg")} {
|
|
2521
|
-
padding-bottom: 88px;
|
|
2522
|
-
}
|
|
2523
|
-
`,Vb=m.nav`
|
|
2524
|
-
display: flex;
|
|
2525
|
-
align-items: center;
|
|
2526
|
-
gap: 8px;
|
|
2527
|
-
font-size: 13px;
|
|
2528
|
-
color: ${A.muted};
|
|
2529
|
-
margin-bottom: 24px;
|
|
2530
|
-
`,Ub=m.button`
|
|
2531
|
-
background: none;
|
|
2532
|
-
border: 0;
|
|
2533
|
-
padding: 0;
|
|
2534
|
-
font: inherit;
|
|
2535
|
-
color: ${A.muted};
|
|
2536
|
-
|
|
2537
|
-
&:hover {
|
|
2538
|
-
color: ${A.text};
|
|
2539
|
-
}
|
|
2540
|
-
`,Xb=m.span`
|
|
2541
|
-
color: ${A.muted2};
|
|
2542
|
-
`,Gb=m.span`
|
|
2543
|
-
color: ${A.text};
|
|
2544
|
-
font-weight: 600;
|
|
2545
|
-
`,Jb=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
|
-
`,Zb=m.div`
|
|
2556
|
-
position: relative;
|
|
2557
|
-
aspect-ratio: 1045 / 752;
|
|
2558
|
-
border-radius: 16px;
|
|
2559
|
-
overflow: hidden;
|
|
2560
|
-
background: ${A.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 ${A.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 ${A.line};
|
|
2613
|
-
border-radius: ${pn.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: ${A.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: ${A.white};
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
`,ev=m.div``;m.span`
|
|
2693
|
-
position: absolute;
|
|
2694
|
-
inset: 0;
|
|
2695
|
-
width: 100%;
|
|
2696
|
-
height: 100%;
|
|
2697
|
-
border-radius: inherit;
|
|
2698
|
-
`;const tv=m.div`
|
|
2699
|
-
display: flex;
|
|
2700
|
-
flex-direction: column;
|
|
2701
|
-
gap: 0;
|
|
2702
|
-
`,nv=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
|
-
`,rv=m.h1`
|
|
2712
|
-
font-size: 28px;
|
|
2713
|
-
font-weight: 600;
|
|
2714
|
-
line-height: 34px;
|
|
2715
|
-
color: ${A.text2};
|
|
2716
|
-
|
|
2717
|
-
${De.maxWidth("lg")} {
|
|
2718
|
-
font-size: 20px;
|
|
2719
|
-
line-height: 24px;
|
|
2720
|
-
}
|
|
2721
|
-
`,is=m.button`
|
|
2722
|
-
flex: none;
|
|
2723
|
-
width: 40px;
|
|
2724
|
-
height: 40px;
|
|
2725
|
-
border-radius: 50%;
|
|
2726
|
-
border: 0;
|
|
2727
|
-
background: ${A.media};
|
|
2728
|
-
display: grid;
|
|
2729
|
-
place-items: center;
|
|
2730
|
-
color: ${A.text2};
|
|
2731
|
-
cursor: pointer;
|
|
2732
|
-
transition:
|
|
2733
|
-
color 0.12s ease,
|
|
2734
|
-
background 0.12s ease;
|
|
2735
|
-
|
|
2736
|
-
&:hover {
|
|
2737
|
-
background: ${A.line};
|
|
2738
|
-
}
|
|
2739
|
-
&[data-on] {
|
|
2740
|
-
color: ${A.dclRed};
|
|
2741
|
-
}
|
|
2742
|
-
|
|
2743
|
-
${De.maxWidth("lg")} {
|
|
2744
|
-
&[data-fav-title] {
|
|
2745
|
-
display: none;
|
|
2746
|
-
}
|
|
2747
|
-
}
|
|
2748
|
-
`,av=m.button`
|
|
2749
|
-
display: inline-flex;
|
|
2750
|
-
align-items: center;
|
|
2751
|
-
gap: 8px;
|
|
2752
|
-
padding: 8px 14px;
|
|
2753
|
-
border: 1px solid ${A.line};
|
|
2754
|
-
border-radius: ${pn.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: ${A.text};
|
|
2759
|
-
font-size: 13px;
|
|
2760
|
-
font-weight: 600;
|
|
2761
|
-
cursor: pointer;
|
|
2762
|
-
transition: background 0.12s ease;
|
|
2763
|
-
|
|
2764
|
-
&:hover {
|
|
2765
|
-
background: ${A.white};
|
|
2766
|
-
}
|
|
2767
|
-
&:focus-visible {
|
|
2768
|
-
outline: 2px solid ${A.accent};
|
|
2769
|
-
outline-offset: 2px;
|
|
2770
|
-
}
|
|
2771
|
-
`,Xt=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: ${A.muted};
|
|
2780
|
-
`,ov=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(Ns)`
|
|
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: ${A.chip};
|
|
2803
|
-
color: ${A.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
|
-
`,iv=m.div`
|
|
2819
|
-
display: flex;
|
|
2820
|
-
flex-direction: column;
|
|
2821
|
-
align-items: flex-start;
|
|
2822
|
-
gap: 8px;
|
|
2823
|
-
`,Ca=m(iv)`
|
|
2824
|
-
gap: 11px;
|
|
2825
|
-
`,ss=m.p`
|
|
2826
|
-
margin: 0;
|
|
2827
|
-
color: ${A.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
|
-
`,sv=m.button`
|
|
2840
|
-
font-size: 13px;
|
|
2841
|
-
align-self: flex-start;
|
|
2842
|
-
`,zc=dn`
|
|
2843
|
-
display: grid;
|
|
2844
|
-
grid-template-columns: 1fr 1fr;
|
|
2845
|
-
gap: 16px;
|
|
2846
|
-
`,qc=m.div`
|
|
2847
|
-
${zc};
|
|
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
|
-
`,Kc=m.div`
|
|
2862
|
-
${zc};
|
|
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
|
-
`,Qc=dn`
|
|
2879
|
-
&[data-testid='creator'] {
|
|
2880
|
-
color: ${A.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: ${A.accent};
|
|
2893
|
-
font-weight: 500;
|
|
2894
|
-
text-decoration: underline;
|
|
2895
|
-
}
|
|
2896
|
-
&[data-link]:hover [data-testid='creator-name'] {
|
|
2897
|
-
color: ${A.brandViolet};
|
|
2898
|
-
}
|
|
2899
|
-
`,cv=m(Ul)`
|
|
2900
|
-
${Qc}
|
|
2901
|
-
`,lv=m(Kb)`
|
|
2902
|
-
${Qc}
|
|
2903
|
-
`,Vc=m.hr`
|
|
2904
|
-
border: 0;
|
|
2905
|
-
border-top: 1px solid ${A.gray4};
|
|
2906
|
-
margin: 24px 0 0;
|
|
2907
|
-
width: 100%;
|
|
2908
|
-
|
|
2909
|
-
${De.maxWidth("lg")} {
|
|
2910
|
-
order: 4;
|
|
2911
|
-
margin-top: 20px;
|
|
2912
|
-
}
|
|
2913
|
-
`,dv=m.div`
|
|
2914
|
-
margin-top: 16px;
|
|
2915
|
-
|
|
2916
|
-
${De.maxWidth("lg")} {
|
|
2917
|
-
order: 5;
|
|
2918
|
-
margin-top: 16px;
|
|
2919
|
-
}
|
|
2920
|
-
`,uv=m.div`
|
|
2921
|
-
display: flex;
|
|
2922
|
-
align-items: flex-start;
|
|
2923
|
-
gap: 16px;
|
|
2924
|
-
width: 100%;
|
|
2925
|
-
`,pv=m.div`
|
|
2926
|
-
flex: 1 1 auto;
|
|
2927
|
-
min-width: 0;
|
|
2928
|
-
display: flex;
|
|
2929
|
-
flex-direction: column;
|
|
2930
|
-
gap: 8px;
|
|
2931
|
-
`,cs=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
|
-
`,ls=m.div`
|
|
2939
|
-
font-size: 18px;
|
|
2940
|
-
font-weight: 500;
|
|
2941
|
-
line-height: 1;
|
|
2942
|
-
color: ${A.text2};
|
|
2943
|
-
|
|
2944
|
-
&[data-out] {
|
|
2945
|
-
font-size: 14px;
|
|
2946
|
-
font-weight: 600;
|
|
2947
|
-
text-transform: uppercase;
|
|
2948
|
-
letter-spacing: 0.02em;
|
|
2949
|
-
color: ${A.muted1};
|
|
2950
|
-
}
|
|
2951
|
-
`,ds=m.div`
|
|
2952
|
-
font-size: 14px;
|
|
2953
|
-
font-weight: 600;
|
|
2954
|
-
text-transform: uppercase;
|
|
2955
|
-
letter-spacing: 0;
|
|
2956
|
-
color: ${A.muted1};
|
|
2957
|
-
`,Gt=m.div`
|
|
2958
|
-
display: flex;
|
|
2959
|
-
align-items: center;
|
|
2960
|
-
gap: 10px;
|
|
2961
|
-
font-weight: 700;
|
|
2962
|
-
color: ${A.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: ${A.text};
|
|
2972
|
-
}
|
|
2973
|
-
&[data-variant='sale'] {
|
|
2974
|
-
flex-wrap: wrap;
|
|
2975
|
-
gap: 10px 14px;
|
|
2976
|
-
color: ${A.dclRed};
|
|
2977
|
-
}
|
|
2978
|
-
`;m.span`
|
|
2979
|
-
display: flex;
|
|
2980
|
-
align-items: center;
|
|
2981
|
-
gap: 10px;
|
|
2982
|
-
font-weight: 700;
|
|
2983
|
-
color: ${A.dclRed};
|
|
2984
|
-
`;const Mn=m.span`
|
|
2985
|
-
font-size: 30px;
|
|
2986
|
-
line-height: 1;
|
|
2987
|
-
`,fv=m.span`
|
|
2988
|
-
display: inline-flex;
|
|
2989
|
-
color: ${A.muted2};
|
|
2990
|
-
cursor: help;
|
|
2991
|
-
|
|
2992
|
-
&:focus-visible {
|
|
2993
|
-
outline: 2px solid ${A.accent};
|
|
2994
|
-
outline-offset: 2px;
|
|
2995
|
-
border-radius: ${pn.chip};
|
|
2996
|
-
}
|
|
2997
|
-
`,hv=m.span`
|
|
2998
|
-
font-size: 24px;
|
|
2999
|
-
font-weight: 700;
|
|
3000
|
-
color: ${A.text};
|
|
3001
|
-
margin-right: -2px;
|
|
3002
|
-
`,mv=m.div`
|
|
3003
|
-
font-size: 13px;
|
|
3004
|
-
margin-top: 6px;
|
|
3005
|
-
`,gv=m.span`
|
|
3006
|
-
display: inline-flex;
|
|
3007
|
-
align-items: center;
|
|
3008
|
-
gap: 6px;
|
|
3009
|
-
color: ${A.muted};
|
|
3010
|
-
text-decoration: line-through;
|
|
3011
|
-
font-weight: 600;
|
|
3012
|
-
font-size: 20px;
|
|
3013
|
-
`,xv=m.span`
|
|
3014
|
-
display: inline-flex;
|
|
3015
|
-
align-items: center;
|
|
3016
|
-
background: ${A.dclRed};
|
|
3017
|
-
color: ${A.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
|
-
`,yv=m(Xl)`
|
|
3025
|
-
display: inline-flex;
|
|
3026
|
-
align-items: center;
|
|
3027
|
-
gap: 5px;
|
|
3028
|
-
background: ${A.rarityBg};
|
|
3029
|
-
color: ${A.accent};
|
|
3030
|
-
font-size: 13px;
|
|
3031
|
-
font-weight: 700;
|
|
3032
|
-
border-radius: 6px;
|
|
3033
|
-
padding: 4px 10px;
|
|
3034
|
-
white-space: nowrap;
|
|
3035
|
-
`,bv=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: ${A.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=dn`
|
|
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(An)`
|
|
3078
|
-
${Ba};
|
|
3079
|
-
|
|
3080
|
-
${De.maxWidth("lg")} {
|
|
3081
|
-
[data-dual] && {
|
|
3082
|
-
flex: 1 1 auto;
|
|
3083
|
-
width: auto;
|
|
3084
|
-
}
|
|
3085
|
-
}
|
|
3086
|
-
`,us=m(An)`
|
|
3087
|
-
${Ba};
|
|
3088
|
-
&& {
|
|
3089
|
-
background: ${A.blackBtn};
|
|
3090
|
-
color: ${A.softWhite};
|
|
3091
|
-
border: 0;
|
|
3092
|
-
|
|
3093
|
-
.ico {
|
|
3094
|
-
width: 20px;
|
|
3095
|
-
height: 20px;
|
|
3096
|
-
}
|
|
3097
|
-
}
|
|
3098
|
-
&&:hover:not(:disabled) {
|
|
3099
|
-
background: ${A.blackBtn};
|
|
3100
|
-
filter: brightness(1.35);
|
|
3101
|
-
}
|
|
3102
|
-
`,vv=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
|
-
`,ps=m(An)`
|
|
3121
|
-
${Ba};
|
|
3122
|
-
&& {
|
|
3123
|
-
background: transparent;
|
|
3124
|
-
border: 2px solid ${A.blackBtn};
|
|
3125
|
-
color: ${A.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
|
-
`,fs=m.button`
|
|
3141
|
-
width: 100%;
|
|
3142
|
-
height: 48px;
|
|
3143
|
-
display: flex;
|
|
3144
|
-
align-items: center;
|
|
3145
|
-
justify-content: center;
|
|
3146
|
-
gap: 8px;
|
|
3147
|
-
background: ${A.blackBtn};
|
|
3148
|
-
color: ${A.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: ${A.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
|
-
`,hs=m.span`
|
|
3178
|
-
${De.maxWidth("lg")} {
|
|
3179
|
-
[data-dual] & {
|
|
3180
|
-
display: none;
|
|
3181
|
-
}
|
|
3182
|
-
}
|
|
3183
|
-
`,wv=m.p`
|
|
3184
|
-
margin: 12px 0 0;
|
|
3185
|
-
font-size: 13px;
|
|
3186
|
-
color: ${A.muted};
|
|
3187
|
-
|
|
3188
|
-
& a {
|
|
3189
|
-
color: ${A.accent};
|
|
3190
|
-
font-weight: 600;
|
|
3191
|
-
}
|
|
3192
|
-
`,kv=m.p`
|
|
3193
|
-
margin: 4px 0 0;
|
|
3194
|
-
font-size: 13px;
|
|
3195
|
-
color: ${A.muted};
|
|
3196
|
-
|
|
3197
|
-
& a {
|
|
3198
|
-
color: ${A.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 Dv=m(An)`
|
|
3212
|
-
margin-top: 6px;
|
|
3213
|
-
`,Cv=m(Q)`
|
|
3214
|
-
opacity: 0.4;
|
|
3215
|
-
`,Sv=m.h1`
|
|
3216
|
-
font-size: 22px;
|
|
3217
|
-
`,Mv=m.div`
|
|
3218
|
-
display: flex;
|
|
3219
|
-
flex-direction: column;
|
|
3220
|
-
`,ms=m.span`
|
|
3221
|
-
display: block;
|
|
3222
|
-
height: 15px;
|
|
3223
|
-
width: 84px;
|
|
3224
|
-
border-radius: 4px;
|
|
3225
|
-
`,_v=m.div`
|
|
3226
|
-
display: flex;
|
|
3227
|
-
flex-direction: column;
|
|
3228
|
-
align-self: stretch;
|
|
3229
|
-
gap: 16px;
|
|
3230
|
-
padding: 8px 0;
|
|
3231
|
-
`,Pv=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: ${A.media};
|
|
3248
|
-
}
|
|
3249
|
-
&::after {
|
|
3250
|
-
width: 96px;
|
|
3251
|
-
height: 14px;
|
|
3252
|
-
border-radius: 6px;
|
|
3253
|
-
background: ${A.media};
|
|
3254
|
-
}
|
|
3255
|
-
`,jv=m.span`
|
|
3256
|
-
height: 34px;
|
|
3257
|
-
width: 70%;
|
|
3258
|
-
margin: 3px 0;
|
|
3259
|
-
border-radius: 8px;
|
|
3260
|
-
`,Iv=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
|
-
`,Ev=m.span`
|
|
3278
|
-
display: block;
|
|
3279
|
-
height: 30px;
|
|
3280
|
-
width: 40%;
|
|
3281
|
-
margin: 16px 0 13px;
|
|
3282
|
-
border-radius: 8px;
|
|
3283
|
-
`,Tv=m.span`
|
|
3284
|
-
display: block;
|
|
3285
|
-
height: 42px;
|
|
3286
|
-
width: 100%;
|
|
3287
|
-
border-radius: 8px;
|
|
3288
|
-
margin-top: 20px;
|
|
3289
|
-
`,_n=m(Pe)`
|
|
3290
|
-
width: 30px;
|
|
3291
|
-
height: 30px;
|
|
3292
|
-
color: ${A.text};
|
|
3293
|
-
|
|
3294
|
-
&[data-was] {
|
|
3295
|
-
width: 20px;
|
|
3296
|
-
height: 20px;
|
|
3297
|
-
color: ${A.muted};
|
|
3298
|
-
}
|
|
3299
|
-
`,fa=m(Pe)`
|
|
3300
|
-
width: 20px;
|
|
3301
|
-
height: 20px;
|
|
3302
|
-
`,$v=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: ${pn.btn};
|
|
3310
|
-
background: #f4e9ff;
|
|
3311
|
-
`,Nv=m.span`
|
|
3312
|
-
display: flex;
|
|
3313
|
-
align-items: center;
|
|
3314
|
-
gap: 8px;
|
|
3315
|
-
font-size: 14px;
|
|
3316
|
-
line-height: 14px;
|
|
3317
|
-
color: ${A.text};
|
|
3318
|
-
`,Ov=m(Q)`
|
|
3319
|
-
width: 20px;
|
|
3320
|
-
height: 20px;
|
|
3321
|
-
color: ${A.rarity};
|
|
3322
|
-
`,Rv=m(Q)`
|
|
3323
|
-
width: 24px;
|
|
3324
|
-
height: 24px;
|
|
3325
|
-
color: ${A.rarity};
|
|
3326
|
-
`,Av=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
|
-
`,Lv=m.span`
|
|
3338
|
-
display: flex;
|
|
3339
|
-
align-items: center;
|
|
3340
|
-
gap: 2px;
|
|
3341
|
-
font-size: 14px;
|
|
3342
|
-
font-weight: 600;
|
|
3343
|
-
color: ${A.muted};
|
|
3344
|
-
|
|
3345
|
-
& .ico {
|
|
3346
|
-
width: 20px;
|
|
3347
|
-
height: 20px;
|
|
3348
|
-
color: ${A.muted};
|
|
3349
|
-
}
|
|
3350
|
-
`,Fv=m.span`
|
|
3351
|
-
font-size: 16px;
|
|
3352
|
-
font-weight: 700;
|
|
3353
|
-
padding-left: 2px;
|
|
3354
|
-
`,gs=m.button`
|
|
3355
|
-
border: 0;
|
|
3356
|
-
background: none;
|
|
3357
|
-
padding: 0;
|
|
3358
|
-
cursor: pointer;
|
|
3359
|
-
font-family: ${Qb.sans};
|
|
3360
|
-
font-size: 13px;
|
|
3361
|
-
font-weight: 600;
|
|
3362
|
-
letter-spacing: 0.46px;
|
|
3363
|
-
text-transform: uppercase;
|
|
3364
|
-
text-decoration: underline;
|
|
3365
|
-
color: ${A.accent};
|
|
3366
|
-
|
|
3367
|
-
&:hover {
|
|
3368
|
-
color: ${A.accentHover};
|
|
3369
|
-
}
|
|
3370
|
-
&:focus-visible {
|
|
3371
|
-
outline: 2px solid ${A.accent};
|
|
3372
|
-
outline-offset: 2px;
|
|
3373
|
-
border-radius: ${pn.chip};
|
|
3374
|
-
}
|
|
3375
|
-
`,Yv=m.div`
|
|
3376
|
-
display: flex;
|
|
3377
|
-
flex-direction: column;
|
|
3378
|
-
gap: 16px;
|
|
3379
|
-
width: 100%;
|
|
3380
|
-
padding: 16px 0;
|
|
3381
|
-
`,xs=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: ${A.muted2};
|
|
3390
|
-
}
|
|
3391
|
-
`,ys=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: ${A.muted2};
|
|
3400
|
-
}
|
|
3401
|
-
[data-variant='resale'] & {
|
|
3402
|
-
color: ${A.text};
|
|
3403
|
-
}
|
|
3404
|
-
`,bs=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: ${A.muted2};
|
|
3414
|
-
}
|
|
3415
|
-
[data-variant='resale'] & .ico {
|
|
3416
|
-
width: 24px;
|
|
3417
|
-
height: 24px;
|
|
3418
|
-
color: ${A.rarity};
|
|
3419
|
-
}
|
|
3420
|
-
`,vs=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: ${A.text};
|
|
3430
|
-
}
|
|
3431
|
-
`,Wv=m.span`
|
|
3432
|
-
font-size: 14px;
|
|
3433
|
-
font-weight: 600;
|
|
3434
|
-
|
|
3435
|
-
[data-variant='original'] & {
|
|
3436
|
-
color: ${A.muted2};
|
|
3437
|
-
}
|
|
3438
|
-
`,Bv=m.span`
|
|
3439
|
-
font-size: 14px;
|
|
3440
|
-
font-weight: 600;
|
|
3441
|
-
color: ${A.text2};
|
|
3442
|
-
`,ws=m.span`
|
|
3443
|
-
display: inline-flex;
|
|
3444
|
-
width: 12px;
|
|
3445
|
-
height: 12px;
|
|
3446
|
-
color: ${A.muted2};
|
|
3447
|
-
`,Hv=m.div`
|
|
3448
|
-
display: flex;
|
|
3449
|
-
flex-direction: column;
|
|
3450
|
-
gap: 12px;
|
|
3451
|
-
width: 100%;
|
|
3452
|
-
`,zv=m.div`
|
|
3453
|
-
display: flex;
|
|
3454
|
-
justify-content: center;
|
|
3455
|
-
`,Lr=dn`
|
|
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
|
-
`,qv=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
|
-
`,Kv=m.span`
|
|
3472
|
-
${Lr};
|
|
3473
|
-
width: 120px;
|
|
3474
|
-
height: 30px;
|
|
3475
|
-
border-radius: ${pn.btn};
|
|
3476
|
-
margin-bottom: 4px;
|
|
3477
|
-
`,ks=m.span`
|
|
3478
|
-
${Lr};
|
|
3479
|
-
width: 100%;
|
|
3480
|
-
height: 48px;
|
|
3481
|
-
border-radius: 16px;
|
|
3482
|
-
`,Ds=m.div`
|
|
3483
|
-
display: flex;
|
|
3484
|
-
align-items: center;
|
|
3485
|
-
gap: 12px;
|
|
3486
|
-
`,Cs=m.span`
|
|
3487
|
-
${Lr};
|
|
3488
|
-
flex: none;
|
|
3489
|
-
width: 48px;
|
|
3490
|
-
height: 48px;
|
|
3491
|
-
border-radius: 50%;
|
|
3492
|
-
`,Ss=m.span`
|
|
3493
|
-
${Lr};
|
|
3494
|
-
width: 96px;
|
|
3495
|
-
height: 16px;
|
|
3496
|
-
border-radius: 6px;
|
|
3497
|
-
`;function Qv(n){return Object.values(Ae.Rarity).includes(n)}function Vv(n){return n==="male"?g("itemDetail.genderMale"):n==="female"?g("itemDetail.genderFemale"):n==="unisex"?g("itemDetail.genderUnisex"):null}function Ms(n){return n.wearableCategory?n.wearableCategory.replace(/_/g," "):n.category==="emote"?g("itemDetail.categoryEmote"):g("itemDetail.categoryWearable")}function ww(){var mo;const{contractAddress:n,itemId:a,tokenId:t}=wl(),e=!!t,r=a??Yp(t)??null,o=kl(),i=o.state,c=Yt(),l=!!(i!=null&&i.market),f=(i==null?void 0:i.marketPriceCredits)??null,u=Wt(),h=Tn(I=>I.add),x=Tn(I=>I.items),y=Gl(I=>I.toggle),{session:b,signIn:w}=Ot(),k=Ar(b),[p,C]=v.useState(()=>{if(i!=null&&i.item){const I={...i.item,tradeId:i.tradeId??i.item.tradeId};return e?{...I,tokenId:t,itemId:I.itemId??r}:{...I,tokenId:void 0,itemId:a??I.itemId}}return{id:`${n}-${t??a}`,name:"",creator:"",contractAddress:n??"",itemId:r,category:"wearable",rarity:"common",network:"MATIC",chainId:nn.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:t??void 0,tradeId:i==null?void 0:i.tradeId}}),[$,E]=v.useState(!1),[R,N]=v.useState(!!(i!=null&&i.resumeBuy));v.useEffect(()=>{i!=null&&i.resumeBuy&&E(!0)},[i==null?void 0:i.resumeBuy]);function M(){if(b){E(!0);return}l||uu({type:"item-buy",path:o.pathname}),w()}const D=v.useRef(!1);v.useEffect(()=>{if(!b||D.current)return;const I=du("item-buy");!I||I.path!==o.pathname||(D.current=!0,N(!0),E(!0))},[b]);const{data:_=[],isFetched:j}=ge({queryKey:["collection-items",p.contractAddress],enabled:!!p.contractAddress,queryFn:()=>dd(p.contractAddress,{first:20}).then(I=>I.items)}),O=p.available==null&&!p.tokenId,{data:T,isLoading:W}=ge({queryKey:["shop-item",p.contractAddress,r],enabled:!l&&!e&&!!p.contractAddress&&!!r&&(!(i!=null&&i.item)||O),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>ud(p.contractAddress,r)});v.useEffect(()=>{T&&C(I=>I.tradeId?I.available!=null&&I.wearableCategory?I:{...I,available:I.available??T.available,wearableCategory:I.wearableCategory??T.wearableCategory}:{...T})},[T]);const[z,U]=v.useState(!1),{data:Y=""}=ge({queryKey:["item-desc",p.contractAddress,p.itemId],enabled:!!p.contractAddress&&!!p.itemId,staleTime:5*6e4,queryFn:()=>pd(p.contractAddress,p.itemId)}),{data:K,isLoading:P}=ge({queryKey:["collection-meta",p.contractAddress],enabled:!!p.contractAddress,staleTime:5*6e4,queryFn:()=>$s(p.contractAddress)});v.useEffect(()=>{const I=(T==null?void 0:T.creator)||(K==null?void 0:K.creator);I&&C(de=>de.creator?de:{...de,creator:I})},[T,K]),v.useEffect(()=>{if(e||p.name||T||_.length===0)return;const I=r&&_.find(de=>de.itemId===r)||_.find(de=>de.contractAddress===p.contractAddress);I&&C(de=>({...I,tradeId:de.tradeId??I.tradeId}))},[_,T]);const Z=v.useMemo(()=>{const I=new Set,de=[];for(const Ie of _){if(Ie.id===p.id||p.itemId&&Ie.itemId===p.itemId||p.tokenId&&Ie.tokenId===p.tokenId)continue;const nt=`${Ie.contractAddress}-${Ie.itemId??Ie.tokenId??Ie.id}`;I.has(nt)||(I.add(nt),de.push(Ie))}return de},[_,p.id,p.itemId,p.tokenId]),me=j&&Z.length===0,{items:xe}=Uy(p.contractAddress,r,{enabled:me}),{data:We,isLoading:Ce}=ge({queryKey:["detail-trade",p.id,p.tradeId,p.contractAddress,p.itemId],enabled:!!p.contractAddress,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:async()=>{if(p.tradeId)return p.tradeId;if(!e&&p.itemId){const I=await fd(p.contractAddress,p.itemId);return(I==null?void 0:I.id)??null}return null}}),{data:ve}=ge({queryKey:["item-traits",p.contractAddress,r],enabled:!!p.contractAddress&&!!r,staleTime:5*6e4,retry:1,queryFn:()=>hd(p.contractAddress,r)}),ht=(ve==null?void 0:ve.isSmart)??p.isSmart,mt=(ve==null?void 0:ve.utility)??null,Ht=(ve==null?void 0:ve.urn)??null,{data:Fr}=ge({queryKey:["item-vrm",Ht],enabled:!!Ht&&p.category==="wearable",staleTime:30*6e4,retry:!1,queryFn:()=>md(Ht)}),[fn,Wn]=v.useState(!1),{data:zt}=ge({queryKey:["item-video",p.contractAddress,r],enabled:ht&&!!p.contractAddress&&!!r,staleTime:30*6e4,retry:!1,queryFn:()=>hu(p.contractAddress,r)}),gt=v.useMemo(()=>p.emoteLoop!==void 0?p:(r?_.find(de=>de.itemId===r):void 0)??p,[p,_,r]),L=Eo(u,p.tradeId)??Eo(u,We),V=p.acquisition==="store"&&(p.available??0)>0,q=!!L||V,re=Jl(),{data:J=[]}=ge({queryKey:["item-resales",p.contractAddress,p.itemId],enabled:re&&!l&&!!p.contractAddress&&!!p.itemId,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>As(p.contractAddress,p.itemId)}),ye=J.length>0?J[0].priceCredits:null,St=e&&p.tokenId?J.find(I=>I.tokenId===p.tokenId)??null:null,Oe=v.useMemo(()=>{const I=J[0];return I?{...I,name:I.name||p.name,thumbnail:I.thumbnail||p.thumbnail,rarity:I.rarity||p.rarity,category:I.category||p.category,wearableCategory:I.wearableCategory??p.wearableCategory,gender:I.gender??p.gender}:null},[J,p]),[hn,mn]=v.useState(null),[Uc,Yr]=v.useState(!1),gn=p.manaWei??null,{data:xn}=Rs(l||!!gn),qt=gn&&xn?Zl(gn,xn):null;v.useEffect(()=>{qt!=null&&C(I=>I.priceCredits===qt?I:{...I,priceCredits:qt})},[qt]);const Wr=v.useMemo(()=>{if(!l||!(i!=null&&i.item))return null;const I=i.item;return I.manaWei?{tradeId:I.tradeId??I.id,listingType:"primary",contractAddress:I.contractAddress,itemId:I.itemId??"",name:I.name,thumbnail:I.thumbnail,rarity:I.rarity,category:I.category,wearableCategory:I.wearableCategory??null,creator:I.creator,manaWei:I.manaWei,available:1,network:I.network,chainId:I.chainId,createdAt:0}:null},[l,i==null?void 0:i.item]),Xc=l&&f!=null&&!!xn&&!!Wr,Gc=ed({priceCredits:p.priceCredits,compareAtCredits:p.compareAtCredits,saleEndsAt:p.saleEndsAt}),yn=v.useMemo(()=>({...p,tradeId:L,id:L??p.id}),[p,L]),Br=x.some(I=>I.id===yn.id),Bn=!yn.tokenId,Jc=((mo=x.find(I=>I.id===yn.id))==null?void 0:mo.quantity)??0,Hr=Bn&&typeof p.available=="number"&&Jc>=p.available,{key:Ha,faved:xt}=td(p),za=v.useRef(null);v.useEffect(()=>{!p.name||Ce||za.current===p.id||(za.current=p.id,ue("Shop Viewed Item",{...nd(p),for_sale:q}),zb(p))},[p.id,p.name,Ce,q]);const Hn=`${n}/${t??a}`,qa=v.useRef(Hn);v.useEffect(()=>{if(qa.current!==Hn){if(qa.current=Hn,i!=null&&i.item){const I={...i.item,tradeId:i.tradeId??i.item.tradeId};C(e?{...I,tokenId:t,itemId:I.itemId??r}:{...I,tokenId:void 0,itemId:a??I.itemId})}typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}},[Hn]);function Zc(){!q||zr||Ce||!Bn&&Br||Hr||h(yn,"item_detail")}const zn=Qv(p.rarity)?p.rarity:Ae.Rarity.COMMON,Ka=Vv(p.gender),Qa=rd(p),Va=ad(p.gender),el=q&&Gc,tl=g("itemDetail.moreFromCollection"),nl=g("itemDetail.relatedItems"),zr=od(p,b==null?void 0:b.address),[rl,Ua]=v.useState(!1),[al,Xa]=v.useState(!1),[ol,Ga]=v.useState(!1),[il,Ja]=v.useState(!1),[bn,vn]=v.useState(null),[et,qn]=v.useState(null),[sl,Za]=v.useState(null),{data:X,isLoading:Kn}=ge({queryKey:["owned-token",p.contractAddress,p.tokenId,b==null?void 0:b.address],enabled:!l&&!!(b!=null&&b.address)&&!!p.contractAddress&&!!p.tokenId,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>b?gd(b.address,p.contractAddress,p.tokenId):null});v.useEffect(()=>{X&&C(I=>I.name?{...I,issuedId:I.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(()=>{St&&C(I=>I.priceCredits===St.priceCredits&&I.tradeId?I:{...I,priceCredits:St.priceCredits,tradeId:I.tradeId??St.tradeId})},[St]),v.useEffect(()=>{bn!=null&&X!=null&&X.isOnSale&&X.listingPrice===bn&&vn(null)},[X,bn]);const eo=!l&&!!p.contractAddress&&!!p.tokenId&&!p.name&&!T&&!Kn&&!X,{data:we,isFetched:cl}=ge({queryKey:["public-token",p.contractAddress,p.tokenId],enabled:eo,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,queryFn:()=>xd(p.contractAddress,p.tokenId)});v.useEffect(()=>{we&&C(I=>I.name?I.issuedId?I:{...I,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",p.contractAddress,p.itemId,b==null?void 0:b.address],enabled:zr&&!!b&&!!p.itemId,queryFn:async()=>b?(await mu(b.address,b.identity)).find(de=>de.contractAddress.toLowerCase()===p.contractAddress.toLowerCase()&&de.blockchainItemId===p.itemId)??null:null}),tt=e&&!!X,qr=!e&&zr,He=!l&&(qr||tt),to=bn!=null?!0:tt?!!(X!=null&&X.isOnSale):q,wn=tt?X==null?void 0:X.tradeId:L,no=tt?!!X:!!Be,ll=qr||tt&&re,ro=bn??(tt?(X==null?void 0:X.listingPrice)??0:0),{data:ao=0}=ge({queryKey:["owned-item-count",p.contractAddress,a,b==null?void 0:b.address],enabled:!e&&!l&&!!(b!=null&&b.address)&&!!p.contractAddress&&!!a,staleTime:3e4,queryFn:()=>b?yd(b.address,p.contractAddress,a):0});async function Mt(){await Promise.all([u.invalidateQueries({queryKey:["owned-token",p.contractAddress,p.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",p.contractAddress,p.itemId]}),u.invalidateQueries({queryKey:["item-resales",p.contractAddress,p.itemId]})])}async function oo(I={}){const de=I.own!==!1;if(!b||!wn)return!1;Za(null),de&&qn("remove");try{const Ie=await Os(wn);return await fu({trade:Ie,signer:b.signer}),I.silent||Rn.success(g("myAssets.removedFromSale",{name:p.name})),vn(null),Wp(u,wn),C(nt=>nt.tradeId===wn?{...nt,tradeId:void 0}:nt),Mt(),Zr(u,{address:b.address,contractAddress:p.contractAddress,tokenId:p.tokenId},{kind:"removed"}),!0}catch(Ie){const nt=rn(Ie);return nt||Te(Ie,{flow:"remove-listing",tradeId:wn}),Za(nt?g("getCredits.errorCanceled"):g("myAssets.removeListingError")),!1}finally{de&&qn(null)}}function io(){tt?Ua(!0):Xa(!0)}async function dl(){qn("update");try{await oo({silent:!0,own:!1})&&io()}finally{qn(null)}}function so(){Ua(!1),Xa(!1),Mt()}const co=q?Ce?g("itemDetail.checking"):Hr?g("itemDetail.maxInCart"):!Bn&&Br?g("assetCard.inCart"):g("assetCard.addToCart"):g("itemDetail.notForSale"),ul=typeof p.available=="number"&&p.available>0&&!p.tokenId&&!l,lo=!l&&!p.tokenId&&p.available===0,Kt=lo&&!He&&!!Oe,Qn=!!Oe&&x.some(I=>I.id===Oe.id),pl=!He&&q&&!l,fl=l||!He&&(q||Kt&&!!Oe||Fc()),hl=!p.name&&(!!T||!!X||!!we),uo=W||!!p.contractAddress&&!j||!p.name&&Kn||hl||eo&&!cl,po=!p.name&&!uo,ml=!!p.name&&Bp({isMarket:l,forSale:q,priceKnown:p.priceCredits>0&&(!gn||qt!=null)||He,stillResolving:uo||!!gn&&qt==null,manage:He,soldOutWithResale:Kt,resolvingTrade:Ce,isTokenRoute:e,ownedAssetLoading:Kn,deepLinkLoading:W}),fo=!p.creator&&(W||P||Kn),ho=!(K!=null&&K.name)&&P,gl=/^https?:\/\//i.test(p.thumbnail);return id(po?{title:g("seo.item.notFoundTitle"),noindex:!0}:p.name?{title:p.name,description:Y||g("seo.item.fallbackDescription",{name:p.name,rarity:p.rarity,category:Ms(p),creator:Ma(p.creator)}),image:gl?p.thumbnail:void 0,type:"product"}:{}),po?s.jsxs(os,{"data-notfound":!0,children:[s.jsx(Cv,{name:"cart"}),s.jsx(Sv,{children:g("itemDetail.notAvailableTitle")}),s.jsx("p",{className:"muted",children:g("itemDetail.notAvailableBody")}),s.jsx(Dv,{variant:"purple",onClick:()=>c("/items"),children:g("notFound.cta")})]}):s.jsxs(os,{children:[s.jsxs(Vb,{"aria-label":g("itemDetail.breadcrumbAria"),children:[s.jsx(Ub,{onClick:()=>c("/items"),children:g("nav.collectibles")}),s.jsx(Xb,{children:"/"}),s.jsx(Gb,{children:p.name||g("itemDetail.itemFallback")})]}),s.jsxs(Jb,{children:[s.jsxs(Zb,{"data-testid":"item-preview",children:[p.name?s.jsx(nb,{item:p}):s.jsx(ev,{"aria-busy":"true","aria-label":g("itemPreview.loading"),children:s.jsx("span",{className:"skeleton","aria-hidden":!0})}),Ha?s.jsx(is,{"data-fav-preview":!0,"data-on":xt||void 0,onClick:()=>y(p),"aria-pressed":xt,"aria-label":xt?g("assetCard.removeFromFavorites"):g("assetCard.addToFavorites"),children:s.jsx(Q,{name:xt?"heart-solid":"heart",size:18})}):null,zt?s.jsxs(av,{"data-play-showcase":!0,onClick:()=>Wn(!0),"data-testid":"play-showcase",children:[s.jsx(Q,{name:"play",size:18}),g("itemDetail.playShowcase")]}):null]}),s.jsx(tv,{"data-testid":"item-info",children:p.name?s.jsxs(s.Fragment,{children:[s.jsxs(nv,{children:[s.jsxs(rv,{children:[p.name,e&&p.issuedId?` #${p.issuedId}`:""]}),Ha?s.jsx(is,{"data-fav-title":!0,"data-on":xt||void 0,onClick:()=>y(p),"aria-pressed":xt,"aria-label":xt?g("assetCard.removeFromFavorites"):g("assetCard.addToFavorites"),children:s.jsx(Q,{name:xt?"heart-solid":"heart",size:18})}):null]}),s.jsxs(ov,{children:[s.jsx(ze,{"data-variant":"rarity",style:{background:ld(zn),color:cd(zn)},title:sd(p.rarity),children:p.rarity}),s.jsxs(ze,{children:[Qa?s.jsx(Q,{name:Qa,size:18,color:d.colors.text2}):null,Ms(p)]}),Ka?s.jsxs(ze,{children:[Va?s.jsx(Q,{name:Va,size:18,color:d.colors.text2}):null,Ka]}):null,!e&&p.issuedId?s.jsxs(ze,{"data-testid":"detail-issued",children:["#",p.issuedId]}):null,ht?s.jsxs(ze,{"data-testid":"detail-smart",children:[s.jsx(Q,{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(Q,{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(Q,{name:"sound",size:18,color:d.colors.text2}),g("itemDetail.emoteSound")]}):null,gt.emoteHasProps?s.jsxs(ze,{"data-testid":"detail-props",children:[s.jsx(Q,{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(Q,{name:"ban",size:16}),g("itemDetail.exportBlocked")]})}):null,mt?s.jsxs(ze,{"data-testid":"detail-utility-chip",children:[s.jsx(Q,{name:"utility",size:18,color:d.colors.text2}),g("itemDetail.utility")]}):null]}),Y||mt?s.jsxs(qc,{children:[Y?s.jsx(Sa,{children:s.jsxs(Ca,{children:[s.jsx(Xt,{children:g("itemDetail.description")}),s.jsx(ss,{"data-expanded":z||void 0,children:Y}),Y.length>140?s.jsx(sv,{className:"link",onClick:()=>U(I=>!I),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(Xt,{children:g("itemDetail.utility")}),s.jsx(ss,{"data-expanded":!0,children:mt})]})}):null]}):null,p.creator||K!=null&&K.name||fo||ho?s.jsxs(Kc,{children:[p.creator?s.jsxs(In,{children:[s.jsx(Xt,{children:g("itemDetail.creator")}),s.jsx(cv,{address:p.creator,linkToProfile:!0,hidePrefix:!0})]}):fo?s.jsxs(In,{children:[s.jsx(Xt,{children:g("itemDetail.creator")}),s.jsxs(Ds,{"aria-hidden":!0,"data-testid":"creator-loading",children:[s.jsx(Cs,{}),s.jsx(Ss,{})]})]}):null,K!=null&&K.name?s.jsxs(In,{"data-collection":!0,children:[s.jsx(Xt,{children:g("itemDetail.collection")}),s.jsx(lv,{contractAddress:p.contractAddress,name:K.name,items:_})]}):ho?s.jsxs(In,{"data-collection":!0,children:[s.jsx(Xt,{children:g("itemDetail.collection")}),s.jsxs(Ds,{"aria-hidden":!0,"data-testid":"collection-loading",children:[s.jsx(Cs,{}),s.jsx(Ss,{})]})]}):null]}):null,s.jsx(Vc,{}),ml?s.jsxs(qv,{"aria-hidden":!0,"data-testid":"sale-loading",children:[s.jsx(Kv,{}),s.jsx(ks,{}),s.jsx(ks,{})]}):s.jsxs(s.Fragment,{children:[re&&!He&&!l&&q&&!p.tokenId?s.jsxs($v,{"data-testid":"buy-from-creator",children:[s.jsxs(Nv,{children:[s.jsx(Ov,{name:"buy-from-creator"}),g("itemDetail.buyFromCreator")]}),s.jsx(Rv,{name:"check-rounded"})]}):null,Kt?s.jsxs(Yv,{"data-testid":"sold-out",children:[s.jsxs(xs,{"data-variant":"original",children:[s.jsxs(ys,{children:[g("itemDetail.originalPrice"),s.jsxs(bs,{children:[s.jsx(Pe,{className:"ico"}),s.jsx(vs,{children:p.priceCredits})]}),s.jsx(ws,{"aria-hidden":!0,children:s.jsx(Q,{name:"info",size:12})})]}),s.jsx(Wv,{"data-testid":"out-of-stock",children:g("itemDetail.soldOut")})]}),s.jsxs(xs,{"data-variant":"resale",children:[s.jsxs(ys,{children:[g("itemDetail.resalePrice"),s.jsxs(bs,{children:[s.jsx(Pe,{className:"ico"}),s.jsx(vs,{children:ye})]}),s.jsx(ws,{"aria-hidden":!0,children:s.jsx(Q,{name:"info",size:12})})]}),s.jsxs(Bv,{children:[g("itemDetail.stock")," ",J.length,"/",Ae.Rarity.getMaxSupply(zn).toLocaleString()]})]})]}):s.jsx(dv,{children:s.jsxs(uv,{children:[s.jsxs(pv,{children:[l||q?s.jsx(ds,{children:g("itemDetail.price")}):null,l?s.jsxs(s.Fragment,{children:[s.jsx(Gt,{"data-variant":"market","data-testid":"item-price",children:f==null?s.jsx(Mn,{children:"—"}):s.jsxs(s.Fragment,{children:[s.jsx(hv,{"aria-hidden":!0,children:"≈"}),s.jsx(_n,{}),s.jsx(Mn,{children:f})]})}),s.jsx(mv,{className:"muted",children:g("assetCard.marketPrice")})]}):q?el?s.jsxs(Gt,{"data-variant":"sale","data-testid":"item-price",children:[s.jsxs(Gt,{children:[s.jsx(_n,{}),s.jsx(Mn,{children:p.priceCredits})]}),s.jsxs(gv,{children:[s.jsx(_n,{"data-was":!0}),p.compareAtCredits]}),xo(p.compareAtCredits,p.priceCredits)>0?s.jsx(xv,{children:g("assetCard.saleWithDiscount",{pct:xo(p.compareAtCredits,p.priceCredits)})}):null,s.jsx(yv,{endsAt:p.saleEndsAt})]}):s.jsxs(Gt,{"data-testid":"item-price",children:[s.jsx(_n,{}),s.jsx(Mn,{children:p.priceCredits})]}):to&&ro?s.jsxs(Gt,{"data-testid":"item-price",children:[s.jsx(_n,{}),s.jsx(Mn,{children:ro})]}):He?null:s.jsxs(Gt,{"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(fv,{tabIndex:0,role:"img","aria-label":g("itemDetail.notForSaleHint"),children:s.jsx(Q,{name:"info",size:14})})})]})]}),ul?s.jsxs(cs,{children:[s.jsx(ds,{children:g("itemDetail.stock")}),s.jsxs(ls,{children:[(p.available??0).toLocaleString(),"/",Ae.Rarity.getMaxSupply(zn).toLocaleString()]})]}):lo?s.jsx(cs,{children:s.jsx(ls,{"data-out":!0,"data-testid":"out-of-stock",children:g("itemDetail.outOfStock")})}):null]})}),s.jsx(bv,{"data-buttons":fl||void 0,"data-dual":pl||void 0,children:l?s.jsxs(la,{variant:"purple",onClick:M,disabled:!Xc,children:[s.jsx("span",{children:g("assetCard.buyNow")}),f!=null?s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),f]}):null]}):He?s.jsxs(Hv,{"data-testid":"manage-actions",children:[s.jsx(dt,{message:sl}),to?s.jsxs(s.Fragment,{children:[s.jsxs(us,{onClick:()=>void dl(),disabled:et!==null||!no,children:[et!=="update"?s.jsx(Q,{name:"pen",className:"ico"}):null,s.jsx("span",{children:et==="update"?k?g("itemDetail.updateCanceling"):g("itemDetail.updateConfirmCancel"):g("itemDetail.manageUpdatePrice")})]}),s.jsx(ps,{onClick:()=>void oo(),disabled:et!==null,children:s.jsx("span",{children:et==="remove"?g("myAssets.removing"):g("itemDetail.manageRemove")})})]}):s.jsxs(s.Fragment,{children:[ll?s.jsx(us,{onClick:()=>{tt&&ue("Shop Started Listing",{listing_type:"secondary",item_id:p.itemId??p.tokenId??null}),io()},disabled:et!==null||!no,children:s.jsx("span",{children:g("itemDetail.manageList")})}):null,tt?s.jsx(ps,{onClick:()=>Ga(!0),disabled:et!==null,children:s.jsx("span",{children:g("itemDetail.manageTransfer")})}):null]}),qr&&Be?s.jsx(vv,{type:"button",onClick:()=>Ja(!0),disabled:et!==null,children:g("itemDetail.manageIssue")}):null,et==="update"?s.jsx(kv,{children:g("itemDetail.updateHelper")}):null,ye!=null?s.jsx(zv,{children:s.jsx(gs,{onClick:()=>Yr(!0),"data-testid":"view-resellers",children:g("itemDetail.viewAllResellers")})}):null]}):q?s.jsxs(s.Fragment,{children:[L?s.jsxs(la,{variant:"purple",onClick:M,disabled:Ce,children:[s.jsx("span",{children:g("assetCard.buyNow")}),s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),p.priceCredits]})]}):null,s.jsxs(fs,{onClick:Zc,disabled:Ce||(Bn?Hr:Br),"aria-label":co,children:[s.jsx(Q,{name:"cart-solid"}),s.jsx(hs,{children:co})]})]}):Kt&&Oe?s.jsxs(s.Fragment,{children:[s.jsxs(la,{variant:"purple",onClick:()=>b?mn(Oe):w(),children:[s.jsx("span",{children:g("assetCard.buyNow")}),s.jsxs(da,{"aria-hidden":!0,children:[s.jsx(fa,{}),Oe.priceCredits]})]}),s.jsxs(fs,{onClick:()=>{Qn||h(Oe,"item_detail")},disabled:Qn,"aria-label":Qn?g("assetCard.inCart"):g("assetCard.addToCart"),children:[s.jsx(Q,{name:"cart-solid"}),s.jsx(hs,{children:Qn?g("assetCard.inCart"):g("assetCard.addToCart")})]})]}):s.jsx(s.Fragment,{children:s.jsx(Bb,{item:p})})}),!He&&!l&&ye!=null?s.jsxs(Av,{"data-testid":"lowest-price","data-centered":Kt||void 0,children:[Kt?null:s.jsxs(Lv,{children:[g("itemDetail.lowestPrice"),s.jsx(Pe,{className:"ico"}),s.jsx(Fv,{children:ye})]}),s.jsx(gs,{onClick:()=>Yr(!0),"data-testid":"view-resellers",children:g("itemDetail.viewAllResellers")})]}):null,!He&&!l&&ao>0?s.jsxs(wv,{"data-testid":"you-own-note",children:[g("itemDetail.youOwnN",{count:ao})," ",s.jsx(Dl,{to:"/my-items",children:g("nav.myAssets")})]}):null]})]}):s.jsx(Uv,{})})]}),me?s.jsx(yo,{title:nl,items:xe}):s.jsx(yo,{title:tl,items:Z,onViewAll:p.contractAddress?()=>c(`/collection/${p.contractAddress}`):void 0}),$&&l&&Wr&&xn?s.jsx(Rc,{listing:Wr,rate:xn,onClose:()=>E(!1),onSold:()=>E(!1)}):$&&!l?s.jsx(ya,{item:yn,resume:R,onClose:()=>{E(!1),N(!1)}}):null,hn?s.jsx(ya,{item:hn,onClose:()=>{mn(null),Mt()}}):null,re&&Uc&&p.itemId?s.jsx(Eb,{item:p,onClose:()=>Yr(!1)}):null,rl&&X&&b?s.jsx(fx,{asset:X,session:b,creator:p.creator,onListed:(I,de)=>{vn(I),Mt(),Zr(u,{address:b.address,contractAddress:p.contractAddress,tokenId:p.tokenId},{kind:"listed",priceCredits:I,tradeId:de})},onClose:so}):null,ol&&b&&p.tokenId?s.jsx(Tx,{item:{contractAddress:p.contractAddress,chainId:p.chainId,tokenId:p.tokenId,name:p.name,thumbnail:p.thumbnail},session:b,onClose:()=>{Ga(!1),Mt()},onTransferred:()=>{vn(null),Mt(),Zr(u,{address:b.address,contractAddress:p.contractAddress,tokenId:p.tokenId},{kind:"gone"})}}):null,al&&Be&&b?s.jsx(ey,{item:Be,session:b,onListed:I=>vn(I),onClose:so}):null,il&&Be&&b?s.jsx(Py,{item:{contractAddress:Be.contractAddress,chainId:nn.chainId,itemId:Be.blockchainItemId,name:Be.name,thumbnail:Be.thumbnail,available:Be.remainingSupply},session:b,onClose:()=>{Ja(!1),Mt()}}):null,fn&&zt?s.jsx(Oy,{src:zt,itemName:p.name,onClose:()=>Wn(!1)}):null]})}function Uv(){return s.jsxs(Mv,{"aria-hidden":!0,children:[s.jsx(jv,{className:"skeleton"}),s.jsxs(Iv,{children:[s.jsx(ua,{className:"skeleton"}),s.jsx(ua,{className:"skeleton"}),s.jsx(ua,{className:"skeleton"})]}),s.jsx(qc,{children:[0,1].map(n=>s.jsx(Sa,{children:s.jsxs(Ca,{children:[s.jsx(ms,{className:"skeleton"}),s.jsxs(_v,{children:[s.jsx(pa,{className:"skeleton"}),s.jsx(pa,{className:"skeleton"}),s.jsx(pa,{className:"skeleton","data-short":!0})]})]})},n))}),s.jsx(Kc,{children:[0,1].map(n=>s.jsxs(In,{...n===1?{"data-collection":!0}:{},children:[s.jsx(ms,{className:"skeleton"}),s.jsx(Pv,{})]},n))}),s.jsx(Vc,{}),s.jsx(Ev,{className:"skeleton"}),s.jsx(Tv,{className:"skeleton"})]})}export{ww as ItemDetail,ww as default};
|