import{_ as S}from"./65lde3ZN.js";import{_ as b}from"./DlAUqK2U.js";import{c as u,o as l,a as e,g as M,s as A,E as p,x as E,r as L,b as m,w as g,m as n,F as P,d as w,t as I,l as R,a5 as V,n as U,P as f}from"./Bh30i5oR.js";import{u as z}from"./BP8_MOlH.js";const D={name:"MaterialSymbolsPersonRounded"},O={xmlns:"http://www.w3.org/2000/svg",width:"25px",height:"25px",viewBox:"0 0 24 24"};function j(h,r,d,v,_,c){return l(),u("svg",O,r[0]||(r[0]=[e("path",{fill:"currentColor",d:"M12 12q-1.65 0-2.825-1.175T8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12m-8 6v-.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2v.8q0 .825-.587 1.413T18 20H6q-.825 0-1.412-.587T4 18"},null,-1)]))}const F=b(D,[["render",j]]),H={class:"flex h-full items-center justify-between 2xl:px-28"},G={class:"flex items-center"},J=["src"],K={class:"flex items-center gap-20 text-xs font-medium text-white md:pr-6 md:text-lg"},Q={key:1,class:"relative"},W={style:{color:"var(--primary)"}},X={key:0,class:"absolute right-0 z-50 mt-2 w-40 rounded-lg bg-white py-2 shadow-lg"},Y={__name:"NavBar",async setup(h){var x;let r,d;const{$externalConf:v}=M(),_=((x=v.siglaEmpresa)==null?void 0:x.trim())||"",{data:c,...i}=A(),k=p(()=>i&&i.status&&i.status.value==="authenticated"),C=p(()=>{var o;return((o=c.value)==null?void 0:o.refId)||""}),{logoSrc:T}=([r,d]=E(()=>z()),r=await r,d(),r),$=p(()=>{var o,t;return((t=(o=c.value)==null?void 0:o.nomeUsuario)==null?void 0:t.split(" ")[0])||""}),a=L(!1),N=async()=>{a.value=!1;try{await i.signOut({redirect:!1}),await f("/")}catch(o){o.message.includes("external URL")&&await f(logoutUrl,{external:!0})}},q=()=>{a.value=!1,f(`/user-profile/${C.value}`)};return window.addEventListener("click",o=>{const t=document.querySelector(".relative");t&&!t.contains(o.target)&&(a.value=!1)}),(o,t)=>{const y=S,B=F;return l(),u("div",{class:"h-20 w-full px-5 shadow-lg md:px-11",style:U({background:n(_)==="SRCBN"?"var(--primary)":"linear-gradient(to right, var(--primary), var(--primary-shade))"})},[e("div",H,[e("div",G,[m(y,{to:"/",class:"block"},{default:g(()=>[e("img",{src:n(T),class:"max-h-16 w-auto cursor-pointer pt-2"},null,8,J)]),_:1})]),e("div",K,[n(k)?(l(),u("div",Q,[e("button",{onClick:t[0]||(t[0]=s=>a.value=!n(a)),class:"group flex flex-row rounded-lg bg-white px-3 py-2 font-bold ease-in-out hover:underline hover:underline-offset-8"},[e("p",W,[t[6]||(t[6]=w(" Olá, ")),e("b",null,I(n($)),1),t[7]||(t[7]=w("! "))]),m(B,{class:"ml-2",style:{color:"var(--primary)"}})]),m(V,{name:"fade"},{default:g(()=>[n(a)?(l(),u("div",X,[e("button",{onClick:N,class:"bold block w-full py-2 pr-6 text-right",onMouseover:t[1]||(t[1]=s=>s.target.style.backgroundColor="rgba(var(--primary-rgb), 0.1)"),onMouseleave:t[2]||(t[2]=s=>s.target.style.backgroundColor=""),style:{color:"var(--primary)"}}," Sair ",32),e("button",{onClick:q,class:"bold block w-full py-2 pr-6 text-right",onMouseover:t[3]||(t[3]=s=>s.target.style.backgroundColor="rgba(var(--primary-rgb), 0.1)"),onMouseleave:t[4]||(t[4]=s=>s.target.style.backgroundColor=""),style:{color:"var(--primary)"}}," Perfil ",32)])):R("",!0)]),_:1})])):(l(),P(y,{key:0,to:"/login"},{default:g(()=>t[5]||(t[5]=[e("p",{class:"group relative rounded-lg bg-white px-3 py-2 font-bold hover:underline hover:underline-offset-8",style:{color:"var(--primary)"}}," Acesse ou Cadastre-se ➜ ",-1)])),_:1,__:[5]}))])])],4)}}},st=b(Y,[["__scopeId","data-v-ee0d5114"]]);export{st as _};
