import{_ as q}from"./DkDGCI7w.js";import{v as z,O as A,q as $,r as p,x as F,j as M,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 P,F as b,d as m,G as D}from"./Bh30i5oR.js";import{a as G}from"./DJivVT1h.js";import{u as H}from"./CBd1T9Qn.js";import{u as I}from"./BP8_MOlH.js";import"./65lde3ZN.js";import"./DlAUqK2U.js";import"./Hxx5iRvK.js";const O={class:"flex min-h-screen bg-white"},J={class:"w-full px-6 pt-10 2xl:pt-20"},K={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]=F(()=>I()),i=await i,f(),i),V=()=>{h.push("/login")},B=()=>{console.warn("Erro ao carregar logo")};return M(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}=G();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 N=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(D,null,[o(N),r("div",O,[r("div",J,[r("div",K,[r("img",{src:a(E),class:"max-h-16 w-auto pt-2",onError:B},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,P(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:V,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};
