import{_ as q}from"./Xa2LHM0g.js";import{v as z,N as A,q as $,r as p,x as D,j as I,y as s,c as w,o as d,b as o,a as r,m as a,w as t,l as k,t as M,D as b,d as m,I as P}from"./B9WsArp0.js";import{a as F}from"./DzddAmpd.js";import{u as H}from"./CBd1T9Qn.js";import{u as G}from"./DYBvU1z2.js";import"./Dv0GRYVD.js";import"./DlAUqK2U.js";import"./yCyRkt3X.js";const J={class:"flex min-h-screen bg-white"},K={class:"w-full px-6 pt-10 2xl:pt-20"},O={class:"flex items-center justify-center pb-12 pt-4"},Q=["src"],U={key:0,class:"py-4"},W={class:"text-gray-600"},ce={__name:"[code]",async setup(X){let i,f;const v=z(),x=A(),h=$(),_=x.params.code||x.query.code,n=p(!0),c=p(!1),u=p("Aguarde, verificando as informações..."),{handlePasswordRecoveryError:C}=H(),{logoSrc:E}=([i,f]=D(()=>G()),i=await i,f(),i),N=()=>{h.push("/login")},V=()=>{console.warn("Erro ao carregar logo")};return I(async()=>{if(!_){u.value="Link de confirmação inválido. Verifique o link recebido por email.",n.value=!1,c.value=!1;return}try{const l={nome:_,login:_},{resetPasswordConfirm:e}=F();await e(l),c.value=!0,u.value="Recuperação de senha foi executada com sucesso.",v.success("Recuperação confirmada com sucesso.",{timeout:3e3})}catch(l){c.value=!1;const e=C(l,v);u.value=`${e} Tente acessar o link novamente ou solicite uma nova recuperação de senha.`}finally{n.value=!1}}),(l,e)=>{const B=q,R=s("v-card-title"),S=s("v-progress-circular"),L=s("v-card-text"),g=s("v-icon"),y=s("v-btn"),T=s("v-card-actions"),j=s("v-card");return d(),w(P,null,[o(B),r("div",J,[r("div",K,[r("div",O,[r("img",{src:a(E),class:"max-h-16 w-auto pt-2",onError:V},null,40,Q)]),o(j,{class:"mx-auto max-w-md",elevation:"0"},{default:t(()=>[o(R,{class:"text-center"},{default:t(()=>e[1]||(e[1]=[r("h2",{class:"text-2xl font-bold",style:{color:"var(--primary)"}},"Confirmação",-1)])),_:1,__:[1]}),o(L,{class:"text-center"},{default:t(()=>[a(n)?(d(),w("div",U,[o(S,{indeterminate:"",color:"primary",size:"48",class:"mb-4"})])):k("",!0),r("p",W,M(a(u)),1)]),_:1}),o(T,{class:"justify-center pb-6"},{default:t(()=>[a(c)&&!a(n)?(d(),b(y,{key:0,color:"#273499",variant:"elevated",size:"large",onClick:N,class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[2]||(e[2]=[m("mdi-lock")])),_:1,__:[2]}),e[3]||(e[3]=m(" Acessar "))]),_:1,__:[3]})):!a(n)&&!a(c)?(d(),b(y,{key:1,color:"secondary",variant:"outlined",size:"large",onClick:e[0]||(e[0]=Y=>l.$router.push("/login")),class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[4]||(e[4]=[m("mdi-arrow-left")])),_:1,__:[4]}),e[5]||(e[5]=m(" Voltar ao Login "))]),_:1,__:[5]})):k("",!0)]),_:1})]),_:1})])])],64)}}};export{ce as default};
