import{_ as j}from"./Cx_OC0SQ.js";import{A as z,P,y as $,r as p,B as q,j as F,C as s,c as w,o as d,b as o,a as r,p as a,w as t,x as k,t as H,H as b,d as _,F as M}from"./UpFGpe05.js";import{a as D}from"./B2llNqhU.js";import{u as I}from"./CBd1T9Qn.js";import{u as G}from"./DsXiT_L-.js";import"./DChqHtgW.js";import"./DlAUqK2U.js";import"./zbMs9D6X.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=P(),h=$(),m=x.params.code||x.query.code,n=p(!0),c=p(!1),u=p("Aguarde, verificando as informações..."),{handlePasswordRecoveryError:C}=I(),{logoSrc:B}=([i,f]=q(()=>G()),i=await i,f(),i),E=()=>{h.push("/login")},V=()=>{console.warn("Erro ao carregar logo")};return F(async()=>{if(!m){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:m,login:m},{resetPasswordConfirm:e}=D();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=j,R=s("v-card-title"),S=s("v-progress-circular"),A=s("v-card-text"),g=s("v-icon"),y=s("v-btn"),L=s("v-card-actions"),T=s("v-card");return d(),w(M,null,[o(N),r("div",J,[r("div",K,[r("div",O,[r("img",{src:a(B),class:"max-h-16 w-auto pt-2",onError:V},null,40,Q)]),o(T,{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(A,{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,H(a(u)),1)]),_:1}),o(L,{class:"justify-center pb-6"},{default:t(()=>[a(c)&&!a(n)?(d(),b(y,{key:0,color:"#273499",variant:"elevated",size:"large",onClick:E,class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[2]||(e[2]=[_("mdi-lock")])),_:1,__:[2]}),e[3]||(e[3]=_(" 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]=[_("mdi-arrow-left")])),_:1,__:[4]}),e[5]||(e[5]=_(" Voltar ao Login "))]),_:1,__:[5]})):k("",!0)]),_:1})]),_:1})])])],64)}}};export{ce as default};
