import{j as t,r as o,u as s}from"./react-B_SyE9nW.js";import{S as e,G as i,m as r,o as L,B as n,q as p,t as a,au as l,K as m,L as j,V as c,E as x,a0 as d,R as h}from"./index-DZUwtxGx.js";import{S as u}from"./Statistics-CEo2j--V.js";import{U as f}from"./Url-beKl714z.js";import{H as C,S as g}from"./HomeContext-D3p7Y1Q4.js";import{B as _,u as v,a as y}from"./BaseTopLayout-Cob_NTKR.js";import{a as I}from"./index-CvyYpVoK.js";import{u as w,c as S}from"./Switch-CJg6ZbXh.js";import{S as F}from"./Stack-DoSFsKl9.js";import"./history-CBi_mSPs.js";import"./sentry-B8t7llU8.js";import"./styled-components-D7wwngcN.js";import"./BtnChip-Bc0RNOqs.js";import"./ItemLoading-BNLaDPBj.js";import"./createSvgIcon-CIMqY4Tr.js";import"./Tooltip-DRNQAqjE.js";import"./index-CWdensOV.js";import"./Autocomplete-BYFrXsGE.js";import"./styles-NPQjSeKn.js";import"./GlobalStyles-ChIOIo71.js";import"./index-CWDV1uJF.js";import"./usePreviousProps-GIwTB3Ki.js";import"./ImageIco-BlzsN6Mn.js";import"./MessageIco-HDxV9mTI.js";import"./Grid-udheoJKh.js";import"./PublishContext-D-X4WmPL.js";import"./BusinessReviewStore-maKBU0x2.js";import"./CoreServices-CYUjAgk1.js";import"./ItemPict-udjX1q60.js";import"./PictureBox-D3P9Ve-o.js";import"./RatingReview-BNDTWc1V.js";import"./ActivityIco-B_eSm-ys.js";import"./Divider-CN-huuzW.js";import"./embla-carousel-react.esm-NewS-kch.js";import"./SearchMap-DukfTo2B.js";import"./BtnShadow-DLL9dmFX.js";import"./BackIco-_W8jQ2-F.js";import"./BtnRestart-DHW0873W.js";import"./BtnGeneric-BP-TFMeC.js";import"./SearchRating-XTt4OUDB.js";import"./FldText-DvJwQxLf.js";import"./FldRadioSort-BWk8nUiL.js";import"./BtnIconRounded-BqHApFaf.js";import"./DeliveryIco-FWxrF7D-.js";import"./DownIco-NS5bn8jr.js";import"./FldIngredients-DoiSWMU-.js";import"./FldCuisineType-BWMYCyvW.js";import"./BtnAccept-Cmr6Zjvp.js";import"./BtnCancel-Cl2pDVMN.js";import"./Checkbox-Cp_uUGdf.js";import"./SwitchBase-BOTCepRM.js";import"./listItemButtonClasses-DiYUuORB.js";import"./AccordionSummary-49QS79v4.js";import"./useSlot-CrT0rJbK.js";import"./FldRadio-Briag00c.js";import"./RatingReviewTitle-D7sAWrXm.js";import"./SubTitle-CAxFkKFL.js";import"./BusinessIco-C-atfQFp.js";import"./BtnSReply-B5iiXJiE.js";import"./EditIco-CdDkK-bv.js";import"./TrashIco-yFOlJMFx.js";import"./CircleCheckIco-qpWziKlm.js";import"./FacebookIco-B9Sm8M2W.js";import"./TwitterIco-3gZsBfOq.js";import"./NoFound-p01cP2rv.js";import"./NoFoundIco-DS7l-ToX.js";import"./PublishIco-CfVWSiWg.js";import"./PublishRedirect-D2zI98rx.js";import"./HelpMenu-DbitYQGc.js";import"./FAQIco-CvGcJKeA.js";import"./WarningIco-C8Y1UT2h.js";import"./ContactContext-HMCTuqcP.js";import"./NoOptionsText-Bwzs10on.js";import"./Address-1s83-VBo.js";import"./FldSwitch-pdGCLgOr.js";import"./PopperGoogle-UZOfXvS3.js";import"./NearIco-chG8zCNS.js";import"./GoogleIdentityStoreContext-DrIinQvI.js";import"./SearchIco-BuHYT0HQ.js";import"./BaseList-Cq90LUsk.js";import"./BusinessContext-intYJWuH.js";import"./AddBusinessModal-DeEXAbLa.js";import"./FldTextArea-BEQZlJSs.js";import"./FldTextSelect-CH_1AHG_.js";import"./FldAutocomplete-joomaIhB.js";function B(o){return t.jsxs(e,{...o,viewBox:"0 0 11 12",children:[t.jsx("path",{d:"M6.14596 6.91134C6.01661 7.06533 5.83797 7.15773 5.65318 7.17005C5.46838 7.18237 5.28359 7.11461 5.13575 6.98525L5.06183 6.91133L0.448121 1.52764L0.386522 1.4414L0.343402 1.37364L0.300284 1.28741L0.287964 1.25661L0.269484 1.19501L0.244846 1.09645L0.238685 1.04717L0.232526 0.991735L0.232526 0.942456L0.232526 0.887018L0.232526 0.83158L0.226366 0.794621L0.232526 0.739182L0.238685 0.689904L0.263325 0.591346L0.281804 0.529748L0.337243 0.412711L0.386522 0.332634L0.44196 0.258716L0.515878 0.184798L0.577476 0.135519L0.651395 0.0862403L0.676034 0.0739208L0.725313 0.0492807L0.80539 0.0184818L0.848509 0.0123225L0.891628 0.00616224L0.934746 2.93579e-06L0.977866 2.93956e-06L10.2176 3.74732e-06C10.8706 3.80441e-06 11.2155 0.887019 10.8213 1.45372L10.7597 1.5338L6.14596 6.91134Z",fill:"#FF4D4F"}),t.jsx("path",{d:"M0.244244 5.72775L0.244244 5.67231L0.250404 5.62303L0.256564 5.56759L0.262724 5.51832L0.287363 5.41976L0.305843 5.35816L0.361281 5.24112L0.410559 5.1672L0.465997 5.09329L0.539917 5.01937L0.601514 4.97009L0.675433 4.92081L0.700072 4.90849L0.74935 4.88385L0.829428 4.85305L0.872547 4.84073L0.921826 4.83457L0.964945 4.82841L1.00806 4.82841C1.39613 4.82841 1.75956 4.99473 2.01212 5.2904L4.71628 8.44424L4.80868 8.53663L4.82716 8.55511C5.06739 8.77071 5.36922 8.88158 5.67722 8.85695C5.98521 8.83231 6.26856 8.68447 6.47799 8.43808L9.18832 5.2904C9.44087 4.99473 9.8043 4.82841 10.1924 4.82841L10.2293 4.82841C10.8823 4.82841 11.2272 5.71543 10.833 6.28214L10.7714 6.35605L6.16384 11.7397C6.03449 11.8937 5.85585 11.9861 5.67106 11.9985C5.48626 12.0108 5.30147 11.9492 5.15363 11.8137L5.07971 11.7397L0.465997 6.35605L0.404399 6.26981L0.361281 6.20206L0.318162 6.11582L0.305843 6.08502L0.287363 6.02342L0.262724 5.92486L0.256564 5.87559L0.250404 5.82015L0.244244 5.77087L0.244244 5.72775Z",fill:"#FF4D4F"})]})}function k(o){return t.jsx(e,{...o,viewBox:"0 0 16 16",children:t.jsx("path",{d:"M3 6.18979H13M3 10.1898H13",stroke:"#FFBE38",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function M(o){return t.jsx(e,{...o,viewBox:"0 0 12 8",children:t.jsx("path",{d:"M5.3948 0.292922C5.54238 0.120746 5.73873 0.0173144 5.94701 0.00203324C6.15529 -0.0132479 6.3612 0.060671 6.52609 0.209922L6.60666 0.292922L11.7489 6.29292L11.82 6.38692L11.8663 6.46392L11.9126 6.55992L11.9272 6.59592L11.9503 6.66292L11.9777 6.77092L11.9863 6.82392L11.9949 6.88392L11.9983 6.94092L12 6.99992L11.9983 7.05892L11.994 7.11692L11.9863 7.17692L11.9777 7.22892L11.9503 7.33692L11.9272 7.40392L11.8672 7.53592L11.8115 7.62592L11.7489 7.70692L11.6683 7.78992L11.6023 7.84392L11.5201 7.89792L11.4892 7.91492L11.4318 7.94192L11.3392 7.97392L11.2938 7.98392L11.2424 7.99392L11.1935 7.99792L11.143 7.99992H0.858499C0.128302 7.99992 -0.25308 7.01392 0.187437 6.37692L0.252573 6.29292L5.3948 0.292922Z",fill:"#52C41A"})})}function T(o){return t.jsxs(e,{...o,viewBox:"0 0 11 12",children:[t.jsx("path",{d:"M4.85404 5.08866C4.98339 4.93467 5.16203 4.84227 5.34682 4.82995C5.53162 4.81763 5.71641 4.88539 5.86425 5.01475L5.93817 5.08866L10.5519 10.4724L10.6135 10.5586L10.6566 10.6264L10.6997 10.7126L10.712 10.7434L10.7305 10.805L10.7552 10.9035L10.7613 10.9528L10.7675 11.0083V11.0575V11.113V11.1684L10.7736 11.2054L10.7675 11.2608L10.7613 11.3101L10.7367 11.4087L10.7182 11.4703L10.6628 11.5873L10.6135 11.6674L10.558 11.7413L10.4841 11.8152L10.4225 11.8645L10.3486 11.9138L10.324 11.9261L10.2747 11.9507L10.1946 11.9815L10.1515 11.9877L10.1084 11.9938L10.0653 12H10.0221H0.782387C0.129445 12 -0.215506 11.113 0.178723 10.5463L0.240322 10.4662L4.85404 5.08866Z",fill:"#73D13D"}),t.jsx("path",{d:"M10.7558 6.27225V6.32769L10.7496 6.37697L10.7434 6.4324L10.7373 6.48168L10.7126 6.58024L10.6942 6.64184L10.6387 6.75888L10.5894 6.83279L10.534 6.90671L10.4601 6.98063L10.3985 7.02991L10.3246 7.07919L10.2999 7.09151L10.2507 7.11615L10.1706 7.14695L10.1275 7.15927L10.0782 7.16543L10.0351 7.17159H9.99194C9.60387 7.17159 9.24044 7.00527 8.98788 6.7096L6.28372 3.55576L6.19132 3.46337L6.17284 3.44489C5.93261 3.22929 5.63078 3.11841 5.32278 3.14305C5.01479 3.16769 4.73144 3.31553 4.52201 3.56192L1.81168 6.7096C1.55913 7.00527 1.1957 7.17159 0.807627 7.17159H0.770668C0.117726 7.17159 -0.227225 6.28457 0.167004 5.71786L0.228603 5.64395L4.83616 0.260253C4.96551 0.106257 5.14415 0.0138596 5.32894 0.00153996C5.51374 -0.0107797 5.69853 0.0508186 5.84637 0.186335L5.92029 0.260253L10.534 5.64395L10.5956 5.73018L10.6387 5.79794L10.6818 5.88418L10.6942 5.91498L10.7126 5.97658L10.7373 6.07513L10.7434 6.12441L10.7496 6.17985L10.7558 6.22913V6.27225Z",fill:"#73D13D"})]})}function R(o){return t.jsx(e,{...o,viewBox:"0 0 12 8",children:t.jsx("path",{d:"M6.6052 7.70708C6.45762 7.87925 6.26127 7.98269 6.05299 7.99797C5.84471 8.01325 5.6388 7.93933 5.47391 7.79008L5.39334 7.70708L0.251112 1.70708L0.179977 1.61308L0.133698 1.53608L0.0874172 1.44008L0.0728479 1.40408L0.0497089 1.33708L0.0222822 1.22908L0.0137135 1.17608L0.00514281 1.11608L0.00171531 1.05908L6.11947e-07 1.00008L0.00171532 0.941077L0.00599923 0.883077L0.0137135 0.823077L0.0222823 0.771077L0.049709 0.663077L0.072848 0.596076L0.132842 0.464076L0.188548 0.374076L0.251112 0.293077L0.331673 0.210077L0.397667 0.156077L0.479941 0.102077L0.510796 0.0850768L0.568217 0.0580763L0.660777 0.0260768L0.706199 0.0160765L0.757623 0.00607631L0.806473 0.0020766L0.857039 7.67503e-05L11.1415 7.76494e-05C11.8717 7.77132e-05 12.2531 0.986078 11.8126 1.62308L11.7474 1.70708L6.6052 7.70708Z",fill:"#FF4D4F"})})}const b=({monthly_rank:o,previous_monthly_rank:s,last_rank_change_dt:e})=>{const L=parseInt("24"),n=s?s-o:0;return i().diff(i(e),"h")<=L?t.jsx(t.Fragment,{children:n>0?1===n?t.jsx(r,{sx:{display:"flex","& .MuiSvgIcon-root":{width:"21px",height:"8px",mx:1}},children:t.jsx(M,{})}):t.jsxs(r,{sx:{display:"flex","& .MuiSvgIcon-root":{width:"11px",height:"12px",mx:"5px"}},children:[t.jsx(T,{}),t.jsx(I,{text:`${n}`,color:"green",margin:"0 5px 0 0"})]}):n<0?1===Math.abs(n)?t.jsx(r,{sx:{display:"flex","& .MuiSvgIcon-root":{width:"21px",height:"8px",mx:1}},children:t.jsx(R,{})}):t.jsxs(r,{sx:{display:"flex",alignItems:"center","& .MuiSvgIcon-root":{width:"11px",height:"12px",mx:"5px"}},children:[t.jsx(B,{}),t.jsx(I,{text:`${Math.abs(n)}`,color:"red",margin:"0 5px 0 0"})]}):s&&t.jsx(r,{sx:{display:"flex","& .MuiSvgIcon-root":{width:"20px",height:"16px",mx:1}},children:t.jsx(k,{})})}):t.jsx(t.Fragment,{})},A=L((function({following:s,username:e}){const[i,r]=o.useState(!1),{topStr:L}=o.useContext(C);return t.jsx(n,{onClick:t=>{t.stopPropagation(),L.onClickFollowState(s,e)},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),sx:{"&":{display:"none",width:"116px",bgcolor:p[s?"yellowLight":"red"],color:p[s?"red":"white"],borderRadius:1,height:"34px",fontSize:"12px",fontWeight:500,"@media(min-width:768px)":{display:"unset"}}},children:a(s?i?"unfollow":"following":"follow")})})),D=L((function({monthly_rank:s,previous_monthly_rank:e,ranking_activity_level:i,ranking_activity_level_str:L,last_rank_change_dt:n,num_of_reviews:p,num_of_images:d,profile_name:h,picture:C,username:g,foodie_level:v,foodie_level_str:y,index:I,following:w,city:S,points_month:B}){var k;const{route:M,alt:T}=o.useMemo((()=>({route:l(g),alt:a("alt.user",{city:S,profile_name:h})})),[g]),R=(null==(k=m.getUser)?void 0:k.is_staff)??!1;return t.jsxs(_,{dataTest:"enj-home-tops-ranking-usercard",src:C,title:h,order:String(Number(I)+1),isUser:!0,alt:T,levelIndicator:t.jsx(b,{monthly_rank:s,previous_monthly_rank:e,last_rank_change_dt:n}),onClick:()=>x.push(M),children:[t.jsx(f,{route:M}),t.jsxs(r,{sx:{width:"100%",display:"flex",flexFlow:"row nowrap",justifyContent:"space-between"},children:[t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsxs(F,{children:[j.isMobile?t.jsx(t.Fragment,{}):t.jsxs(r,{sx:{display:"flex",my:"5px",alignItems:"center","span.foodieLevel-span":{textWrap:"nowrap"}},children:[t.jsxs(c,{className:"foodieLevel-span",size:"mini",children:[a("foodieLevel"),":"]}),t.jsx(u,{onlyFoodieLevel:!0,foodie_level:v,foodie_level_str:y})]}),t.jsx(u,{images:d,messages:p,activity_level:i,activity_level_str:L,points_month:B,isStaff:R,forRanking:!0})]})}),t.jsx(A,{following:w,username:g})]})]},g)}));const P=L((function(){const{pathname:e}=s();let i,r;return e==d(h.TopBestFoodieMonth)?(i=g.TOP_BEST_FOODIE_MONTH,r="topBestFoodieMonth"):(i=g.TOP_ACTIVE_USER_CITY,r="topUser"),o.useLayoutEffect((()=>(w("route.top.best.month"),S)),[]),v(i,r),t.jsx(y,{Cmp:D})}));export{P as default};