import{r as o,_ as t,j as e,h as s,L as a}from"./react-B_SyE9nW.js";import{g as i,a as n,s as r,c as l,e as c,B as p,S as m,o as d,a0 as u,R as h,C as x,K as v,a1 as g,t as j,E as f,L as b}from"./index-CGGskqVP.js";import{E as w}from"./EnjotyNavIco-DjrEB4Jy.js";import{U as y}from"./Url-WxbjuA0C.js";import{A as N}from"./ActivityIco-Ch2xBUdN.js";import{P as S}from"./ProfileIco-CxdneNue.js";import{P as C}from"./PublishIco-BW4LnvBj.js";import{S as M}from"./SearchIco-DqMzHHb-.js";import{P as L}from"./PublishContext-DkfbFh3A.js";import{P as B}from"./PublishRedirect-m27otqo5.js";import{_ as R}from"./history-CBi_mSPs.js";import{B as P}from"./Badge-DLZG2uI4.js";import{P as k}from"./index-CdMAEzxT.js";import"./sentry-B8t7llU8.js";import"./styled-components-D7wwngcN.js";import"./BusinessReviewStore-DSM7ghAM.js";import"./CoreServices-Joz26jp9.js";import"./index-DYZN75Vv.js";import"./usePreviousProps-GIwTB3Ki.js";function A(o){return i("MuiBottomNavigation",o)}n("MuiBottomNavigation",["root"]);const I=["children","className","component","onChange","showLabels","value"],E=r("div",{name:"MuiBottomNavigation",slot:"Root",overridesResolver:(o,t)=>t.root})((({theme:o})=>({display:"flex",justifyContent:"center",height:56,backgroundColor:(o.vars||o).palette.background.paper}))),D=o.forwardRef((function(a,i){const n=l({props:a,name:"MuiBottomNavigation"}),{children:r,className:p,component:m="div",onChange:d,showLabels:u=!1,value:h}=n,x=t(n,I),v=R({},n,{component:m,showLabels:u}),g=(o=>{const{classes:t}=o;return c({root:["root"]},A,t)})(v);return e.jsx(E,R({as:m,className:s(g.root,p),ref:i,ownerState:v},x,{children:o.Children.map(r,((t,e)=>{if(!o.isValidElement(t))return null;const s=void 0===t.props.value?e:t.props.value;return o.cloneElement(t,{selected:s===h,showLabel:void 0!==t.props.showLabel?t.props.showLabel:u,value:s,onChange:d})}))}))}));function F(o){return i("MuiBottomNavigationAction",o)}const T=n("MuiBottomNavigationAction",["root","iconOnly","selected","label"]),z=["className","icon","label","onChange","onClick","selected","showLabel","value"],H=r(p,{name:"MuiBottomNavigationAction",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:e}=o;return[t.root,!e.showLabel&&!e.selected&&t.iconOnly]}})((({theme:o,ownerState:t})=>R({transition:o.transitions.create(["color","padding-top"],{duration:o.transitions.duration.short}),padding:"0px 12px",minWidth:80,maxWidth:168,color:(o.vars||o).palette.text.secondary,flexDirection:"column",flex:"1"},!t.showLabel&&!t.selected&&{paddingTop:14},!t.showLabel&&!t.selected&&!t.label&&{paddingTop:0},{[`&.${T.selected}`]:{color:(o.vars||o).palette.primary.main}}))),O=r("span",{name:"MuiBottomNavigationAction",slot:"Label",overridesResolver:(o,t)=>t.label})((({theme:o,ownerState:t})=>R({fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(12),opacity:1,transition:"font-size 0.2s, opacity 0.2s",transitionDelay:"0.1s"},!t.showLabel&&!t.selected&&{opacity:0,transitionDelay:"0s"},{[`&.${T.selected}`]:{fontSize:o.typography.pxToRem(14)}}))),U=o.forwardRef((function(o,a){const i=l({props:o,name:"MuiBottomNavigationAction"}),{className:n,icon:r,label:p,onChange:m,onClick:d,value:u}=i,h=t(i,z),x=i,v=(o=>{const{classes:t,showLabel:e,selected:s}=o;return c({root:["root",!e&&!s&&"iconOnly",s&&"selected"],label:["label",!e&&!s&&"iconOnly",s&&"selected"]},F,t)})(x);return e.jsxs(H,R({ref:a,className:s(v.root,n),focusRipple:!0,onClick:o=>{m&&m(o,u),d&&d(o)},ownerState:x},h,{children:[r,e.jsx(O,{className:v.label,ownerState:x,children:p})]}))}));function _(o){return e.jsx(m,{...o,children:e.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"})})}const V=d((function(){var t;const s=o.useContext(L),[a,i,n,r,l]=o.useMemo((()=>[String(u(h.Home)),String(u(h.Search)),String(u(h.Publish)),String(u(h.Activity)),String(u(h.MyProfile))]),[x.language]);return e.jsxs(D,{showLabels:!0,value:v.navigator,onChange:v.onChangeNavigator,className:"bottom-nav",children:[e.jsx(U,{"data-test":"enj-nav-button-home",value:g.HOME,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:a}),j("home")]}),icon:e.jsx(_,{}),onClick:()=>f.push(a)}),e.jsx(U,{"data-test":"enj-nav-button-explore",value:g.SEARCH,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:i}),j("explore")]}),icon:e.jsx(M,{}),onClick:()=>f.push(i)}),e.jsx(U,{"data-test":"enj-nav-button-publish",value:g.PUBLISH,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:n}),j("publish")]}),icon:e.jsx(C,{}),onClick:()=>{B(s)}}),e.jsx(U,{"data-test":"enj-nav-button-activity",value:g.ACTIVITY,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:r}),j("activity")]}),icon:e.jsx(N,{}),onClick:()=>f.push(r)}),e.jsx(U,{"data-test":"enj-nav-button-profile",value:g.PROFILE,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:l}),j("profile")]}),icon:e.jsx(P,{sx:{"& .MuiBadge-badge":{right:b.isDesktop?"6px !important":"2px !important",top:"1px !important"}},color:"warning",variant:"dot",invisible:!(null==(t=v.getUser)?void 0:t.has_pending_notifications),children:e.jsx(S,{})}),onClick:()=>f.push(l)})]})})),W=r(k)` & .MuiBottomNavigation-root { align-self: center; .MuiBottomNavigationAction { &-root, &-root.Mui-selected { padding: 5px 4px 4px; min-width: max-content; } &-label { font-size: 12px; &.Mui-selected { font-weight: bold; } } transition: all 300ms ease-in; } } `;const $=d((function(){const{isDesktop:t,sx:s}=o.useMemo((()=>{const o=b.isDesktop;let t={height:(o?82:66)+"px",overflow:"hidden",borderRadius:o?0:"24px 24px 0 0",position:"fixed",[o?"top":"bottom"]:0,left:0,right:0,visibility:v.showNavigator||o?"visible":"hidden",zIndex:5,"&.MuiPaper-root":{boxShadow:"0 3px 20px 0 rgba(0, 0, 0, 0.16)"},"& > a":{alignSelf:"center",width:"fit-content"}};return o&&(t={...t,display:"grid",gridTemplateColumns:"1fr 1fr",px:"138px","& .MuiBottomNavigationAction-root":{display:"flex",p:"5px 4px!important",flexDirection:"row","& .MuiSvgIcon-root":{mr:"5px"}}}),{isDesktop:o,sx:t}}),[b.isDesktop,v.showNavigator]);return!v.showNavigator||b.isMobile&&v.navigator===g.REGISTER?e.jsx(e.Fragment,{}):e.jsxs(W,{sx:s,elevation:4,className:"bottom-navbar-container",children:[t&&e.jsx(a,{href:u(h.Home),to:u(h.Home),"data-test":"enj-header-logo",children:e.jsx(w,{sx:{"&&.MuiSvgIcon-root":{height:"44px",width:"auto"}}})}),e.jsx(V,{})]})}));export{$ as default};