import{j as i,r as e}from"./react-B_SyE9nW.js";import{S as t,o as s,j as o,G as n,B as r,N as a,n as l,i as c,F as h,y as x,V as p,R as d,ar as m,w as u}from"./index-Flm6m8Wj.js";import{a as j}from"./FldRadio-CJdXMDqh.js";import{B as g}from"./BtnShadow-BEdKMB6u.js";import{C as f}from"./CircleCheckIco-BFSVh3im.js";import{F as C}from"./FAQIco-CFhJMNDH.js";import{M as v}from"./MessageIco-DcDXaapk.js";import{P as y}from"./ProfileIco-DxJkB7_v.js";import{W as b}from"./WebsiteIco-DoKgU0Vj.js";import{C as k}from"./ContactContext-CY5nd8oL.js";import{U as M}from"./ItemLoading-wir9MCjq.js";import{F as H}from"./FooterLang-xP5yjbIH.js";import{U as w,P as I}from"./PasswordChange-BqL-yAqe.js";import{D as z}from"./Divider-CSB2hYD2.js";import{V as S}from"./HelpMenu-BEoO04r9.js";import{a as A}from"./index-C6Ujt1Uk.js";import{H as L}from"./HelpComponent-GsnVYv5S.js";import{D as B}from"./DownloadIco-nTzAGNa4.js";import{r as V}from"./useAutoUpdateServiceWorker-Dp29f3sQ.js";import{U as P}from"./UpdateIco-STv3MvbT.js";import{B as R}from"./Badge-CCxj2pVR.js";import{M as D,G as F}from"./styles-BKX5ijFq.js";import{M as O}from"./DownIco-uXp5N5Ip.js";import{L as U}from"./Link-CWS9S-dL.js";function T(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M9.9 2h4.2l-.8 7.9 6.6-4.6L22 8.7 14.5 12l7.5 3.3-2.1 3.5-6.6-4.6.8 7.9H9.9l.8-7.9-6.6 4.6L2 15.3 9.5 12 2 8.7l2.1-3.5 6.6 4.6L9.9 2z"})})}function W(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M6 2a2 2 0 0 0-1.99 2L4 20a2 2 0 0 0 1.99 2H18a2 2 0 0 0 2-2V8.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83A1.97 1.97 0 0 0 13.17 2H6zm7 6V3.5L18.5 9H14a1 1 0 0 1-1-1z"})})}function N(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M22 12.2a10.08 10.08 0 0 0-8.7-10.1c-1.9-.3-4.3.2-5.9 1.1A10 10 0 0 0 2 12.6c.1 2.2.9 4.4 2.3 6L3.7 22l3.4-1.2c1.3.7 2.9 1.1 4.4 1.2 3.2.2 6-.9 7.9-3.1.1-.1.2-.3.2-.3.2-.6 0-1.2-.5-1.5-.1-.1-.2-.1-.3-.1s-.4.1-.6.2c-.5.3-1 .5-1.5.7-2.2.8-4.5.9-6.7.5l-4.4-3.7c.8-.4 1.7.2 1.7.2l1.3.9L7 13.6c1.1-.2 1.7.8 1.7.8l1.5 1.7-1.1-2.2c1.2.1 1.7 1.2 1.7 1.2l.8 1.5 4.2-1.5-3.1-.2c-1.4 0-1.9-.9-1.9-.9h9.9c.7 0 1.1-.3 1.1-.9.2-.7.2-.7.2-.9zM5.3 12c0-3.6 2.7-6.5 6.1-6.8-.1-.1-.2-.3-.2-.4 0-.4.3-.7.7-.7.4 0 .7.3.7.7 0 .2-.1.3-.2.4 3.4.3 6.1 3.2 6.1 6.8H5.3z"})})}function E(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M19.1 10.8h-1V7.9C18.1 4.7 15.4 2 12 2S5.9 4.7 5.9 7.9v2.8h-1c-1.1 0-1.9.8-1.9 1.9v7.5A2 2 0 0 0 4.9 22H19c1.1 0 1.9-.8 1.9-1.9v-7.5c.1-1-.8-1.8-1.8-1.8zm-4.2 0H9.1V7.9c0-1.6 1.3-2.8 2.9-2.8s2.9 1.3 2.9 2.8v2.9z"})})}function _(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"m12 11 2.9-2.9-1.5-1.6-5.5 5.6 5.5 5.6 1.5-1.6-2.8-2.9h9.3v5.3c0 1.9-1.5 3.4-3.3 3.4H5.9a3.4 3.4 0 0 1-3.3-3.4V5.4C2.6 3.5 4.1 2 5.9 2H18c1.8 0 3.3 1.5 3.3 3.4V11H12z"})})}function q(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M8.8 20.5H5.2A3.2 3.2 0 0 1 2 17.3V6.7c0-1.8 1.4-3.2 3.2-3.2h3.6c1.8 0 3.2 1.4 3.2 3.2v4H7.3c-.3 0-.5.2-.5.5v1.4c0 .3.2.5.5.5H12v4c0 2-1.5 3.4-3.2 3.4zm6.3-3.9.9.9c.2.2.5.2.8 0l5.1-5.2c.2-.2.2-.6 0-.8l-5.1-5.2c-.2-.2-.5-.2-.8 0l-.9.9c-.2.2-.2.6 0 .8l2.7 2.7H12v2.4h5.7l-2.6 2.7c-.2.3-.2.6 0 .8z"})})}function G(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M24 14.5c-.3 1.5-.9 2.9-1.7 4.2-1-.8-2.4-.7-3.3.2-.9.9-1 2.4-.2 3.4-1.2.8-2.6 1.4-4.1 1.7a2.6 2.6 0 0 0-2.5-2.2c-1.3 0-2.4 1-2.5 2.3-1.5-.3-2.9-.9-4.2-1.7.8-1 .7-2.4-.2-3.4-.9-.9-2.4-1-3.4-.2C1 17.6.4 16.2 0 14.7a2.5 2.5 0 0 0 0-5c.3-1.5.9-2.9 1.7-4.2 1 .8 2.5.8 3.4-.2.9-.9 1-2.4.2-3.4C6.5 1 7.9.4 9.4.1a2.5 2.5 0 0 0 5 0c1.6.3 3 .9 4.2 1.7-.8 1-.7 2.5.2 3.4.9.9 2.4 1 3.4.2.9 1.2 1.4 2.6 1.8 4.1-1.3.1-2.2 1.2-2.2 2.5-.1 1.3.9 2.4 2.2 2.5zM12 7.1c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5z"})})}function J(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M16 4.9v2.7h3.2l-5.7 5.7L9.2 9 .5 17.1l1.8 2 6.8-6.3 4.4 4.4 7.3-7.3v2.6h2.7V4.9H16z"})})}const K=s((function(){const t=e.useContext(M);return i.jsx(w.Provider,{value:t.getResetStr,children:i.jsx(I,{title:"changePass"})})})),Q={width:"100%",my:"10px"};const X=s((function(){return i.jsx(z,{sx:Q})}));function Z(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M12 22.3a2 2 0 0 0 2.1-2.1H9.9c0 1.1.9 2.1 2.1 2.1zm6.3-6.2V11c0-3.1-1.7-5.7-4.7-6.5v-.7c0-.8-.7-1.5-1.6-1.5s-1.6.7-1.6 1.5v.7c-3 .7-4.7 3.3-4.7 6.5v5.1l-1.4 1.3a1 1 0 0 0 0 1.5c.2.2.5.3.7.3h14c.6 0 1-.5 1-1a1 1 0 0 0-.3-.7l-1.4-1.4z"})})}function Y(e){return i.jsx(t,{...e,children:i.jsx("path",{d:"M22 9V7h-2v2h-2v2h2v2h2v-2h2V9zM8 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 1c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4zm4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95zm4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17z"})})}const $={height:"90px",bgcolor:o.red,borderRadius:"0 0 28px 28px",display:"flex",justifyContent:"center",alignItems:"center",px:"15px","& .MuiSvgIcon-root":{color:o.white},"@media(min-width:768px)":{height:"78px"},"@media(min-width:1366px)":{borderRadius:0}},ii={position:"relative",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%","@media(min-width:768px)":{maxWidth:n.isDesktop?"745px":"608px",mx:n.isDesktop?"unset":"auto"},"@media(min-width:1366px)":{marginInline:"315px"},top:0};const ei=s((function(){var t;const{onClickContactUs:s}=e.useContext(k),w=e.useContext(M),[I,z]=e.useState(null),[Q,ei]=e.useState(!1),ti=Boolean(I),si=()=>z(null);e.useEffect((()=>{(async()=>{var i;const e=null==(i=await navigator.serviceWorker.getRegistration("/"))?void 0:i.waiting;ei(Boolean(e))})()}),[ti]);const oi=e.useMemo((()=>ti?"true":void 0),[ti]);return i.jsxs(r,{sx:$,children:[i.jsxs(r,{sx:{...ii,...n.isMobile?{}:{pr:"28px"}},children:[i.jsx(r,{sx:{position:"absolute",left:0},children:i.jsx(j,{onClick:w.onClickBackProfileNav})}),i.jsx(a,{color:"white",size:"small",weight:500,"data-test":"enj-profile-title",children:l(w.getTitle)}),i.jsxs(r,{sx:{".MuiAutocomplete-paper":{width:"max-content"},position:"absolute",right:0,display:"flex",gap:"5px",alignItems:"center","& .enj-footer-lang":{mr:"15px",position:"unset",maxWidth:"54px","& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{p:"4px"},".MuiSvgIcon-root":{mx:0,width:"auto",height:"20px"},".MuiAutocomplete-endAdornment":{display:"none"},".MuiAutocomplete-inputRoot .MuiAutocomplete-input":{minWidth:0},".MuiInputBase-root":{minWidth:"54px",fontSize:c.mini,bgcolor:o.black36},"fieldset.MuiOutlinedInput-notchedOutline":{border:"none"}}},children:[n.isTablet?i.jsx(H,{forceOnTable:!1}):i.jsx(i.Fragment,{}),i.jsx(L,{title:"profile",sx:{visibility:w.showSettings?"visible":"hidden","@media(min-width:1366px)":{"&&.MuiButtonBase-root":{right:0}}}}),h.isAuth&&i.jsx(g,{sx:{visibility:w.showSettings?"visible":"hidden","& .MuiSvgIcon-root":{height:"28px !important"}},onClick:()=>x.push(String(p(d.Notifications))),children:i.jsx(R,{color:"warning",variant:"dot",invisible:!(null==(t=h.getUser)?void 0:t.has_pending_notifications),sx:{"& .MuiBadge-dot":{top:"2px",right:"5px"}},children:i.jsx(Z,{})})}),i.jsx(g,{id:"enj-btn-profile-menu-id",onClick:n.isMobile?w.onClickConfiguration:i=>z(i.currentTarget),"aria-controls":"enj-btn-profile-icon-menu","aria-haspopup":"true","aria-expanded":oi,sx:{visibility:w.showSettings?"visible":"hidden","@media(min-width:1366px)":{"&&.MuiButtonBase-root":{right:0}}},children:i.jsx(G,{})})]}),n.isMobile?i.jsx(i.Fragment,{}):i.jsx(i.Fragment,{children:i.jsxs(D,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},id:"enj-btn-profile-icon-menu",MenuListProps:{"aria-labelledby":"enj-btn-profile-menu-id"},anchorEl:I,open:ti,onClose:()=>si(),TransitionComponent:F,style:{marginLeft:"28px",marginTop:"2px"},sx:{"& .MuiPaper-root":{borderRadius:"18px",p:"5px 16px"},"& .MuiSvgIcon-root":{marginRight:"12px"},"& li.MuiButtonBase-root":{fontSize:c.micro,px:0}},children:[h.isAuth?[i.jsxs(O,{onClick:()=>{si(),w.onClickAccountConfig()},style:{minHeight:28,color:o.gray},children:[i.jsx(y,{})," ",l("accountConfig")]},"accountConfig"),i.jsxs(O,{onClick:()=>{si(),w.onClickUserStats()},style:{minHeight:28,color:o.gray},children:[i.jsx(J,{})," ",l("userStats")]},"userStats"),i.jsxs(O,{onClick:()=>{si(),w.onClickUserNotification()},style:{minHeight:28,color:o.gray},children:[i.jsx(Z,{})," ",l("notifications"),i.jsx(r,{sx:{width:"45px",height:"15px",textAlign:"center",bgcolor:o.yellow,borderRadius:"4px",ml:"5px"},children:i.jsx(A,{color:"black",text:l("new"),weight:500,align:"center",size:"mini",lineHeight:1.3})})]},"notifications"),i.jsxs(O,{onClick:()=>{si(),w.onClickInviteFriends()},style:{minHeight:28,color:o.gray},children:[i.jsx(Y,{})," ",l("inviteFriends"),i.jsx(r,{sx:{width:"45px",height:"15px",textAlign:"center",bgcolor:o.yellow,borderRadius:"4px",ml:"5px"},children:i.jsx(A,{color:"black",text:l("new"),weight:500,align:"center",size:"mini",lineHeight:1.3})})]},"inviteFriends"),h.isVerified?null:i.jsxs(O,{onClick:()=>{si(),h.onResendEmailVerification()},style:{minHeight:28,color:o.gray},children:[i.jsx(f,{})," ",l("accountVerification")]},"accountVerification"),i.jsxs(O,{onClick:()=>{si(),w.onClickChangePass()},style:{minHeight:28,color:o.gray},children:[i.jsx(T,{})," ",l("changePass")]},"changePass"),i.jsx(X,{},"SettingsDivider")]:null,i.jsxs(O,{onClick:()=>x.push(l("route.faq")),style:{minHeight:28,color:o.gray},children:[i.jsx(C,{})," ",l("faq")]}),i.jsx(U,{target:"_blank",href:"https://blog.enjoty.com",sx:{cursor:"pointer"},underline:"none",color:o.gray,children:i.jsxs(O,{onClick:si,style:{minHeight:28,color:o.gray},children:[i.jsx(b,{})," ",l("blog")]})}),i.jsxs(O,{onClick:()=>x.push(l("route.about")),style:{minHeight:28,color:o.gray},children:[i.jsx(N,{})," ",l("aboutEnjoty")]}),i.jsxs(O,{onClick:()=>{si(),s()},style:{minHeight:28,color:o.gray},children:[i.jsx(v,{})," ",l("contactUs")]}),i.jsx(X,{}),!h.checkInstalledApp&&(m.beforeInstall||h.isSafariOnAppleDevice)&&i.jsxs(O,{onClick:async()=>{if(h.isSafariOnAppleDevice)u("PWA_INSTALLATION"),si();else{if(!m.beforeInstall)return;if(m.beforeInstall){m.beforeInstall.prompt();"accepted"===(await m.beforeInstall.userChoice).outcome&&(si(),m.cleanMethod())}}},style:{minHeight:28,color:o.gray},children:[i.jsx(B,{})," ",l("installApp")]}),Q&&i.jsxs(O,{onClick:V,sx:{minHeight:28,color:o.gray,mt:1},children:[i.jsx(P,{})," ",l("updatePage")]}),(Q||!h.checkInstalledApp&&(m.beforeInstall||h.isSafariOnAppleDevice))&&i.jsx(X,{}),i.jsxs(O,{onClick:()=>x.push(l("route.terms")),style:{minHeight:28,color:o.gray},children:[i.jsx(W,{})," ",l("termsConditions")]}),i.jsxs(O,{onClick:()=>x.push(l("route.privacy")),style:{minHeight:28,color:o.gray},children:[i.jsx(E,{})," ",l("privacyPolicy")]}),i.jsxs(O,{onClick:()=>x.push(l("route.bases")),style:{minHeight:28,color:o.gray},children:[i.jsx(W,{})," ",l("contestBases")]}),i.jsx(X,{}),h.isAuth?i.jsxs(O,{onClick:()=>{si(),w.onClickLogout()},style:{minHeight:28,color:o.gray},children:[i.jsx(q,{})," ",l("logout")]}):i.jsxs(O,{onClick:()=>{si(),w.onClickLogin()},style:{minHeight:28,color:o.gray},children:[i.jsx(_,{})," ",l("startSession")]}),i.jsx(X,{}),i.jsx(S,{})]})})]}),i.jsx(K,{})]})}));export{J as A,K as C,W as D,N as E,E as L,ei as M,Z as N,X as S,$ as a,Y as b,T as c,q as d,_ as e,ii as s};