import{H as _,r as d,o as v,e as g,h as t,f as l,A as r,aI as h,E as n,O as b,i as m,V as f,$ as x,a5 as y,aV as k}from"./index.737529e8.1750111005555.js";const V={class:"w-100 h-screen d-flex justify-center align-center"},w={class:"text-center"},j=t("h2",{class:"mb-4 text-primary text-h3"},"Descadastrar email",-1),q={class:"mb-8"},A=t("br",null,null,-1),B={class:"d-flex flex-md-row flex-column gap-3 align-center justify-center"},$={__name:"unsub-emails-vagas",setup(C){const{setAlert:i}=k(),a=_();console.log(a.currentRoute.value.query);const o=d(a.currentRoute.value.query.mail);o.value||a.push("/");const u=d(!1),p=async()=>{var c,e;if(!o.value){a.push("/");return}try{if(!await x("/vagas/unsubscribe-email-vagas",{method:"PUT",body:{email:o.value}}))return;i("Email descadastrado com sucesso!","success","tabler-check",5e3)}catch(s){i(((e=(c=s==null?void 0:s.response)==null?void 0:c._data)==null?void 0:e.message)||"Ocorreu um erro ao descadastrar o email. Tente novamente!","error","tabler-alert-triangle",5e3)}finally{u.value=!1}};return(c,e)=>(v(),g("div",V,[t("div",w,[l(h,{src:r(y),width:"100px",class:"mb-4 mx-auto cursor-pointer",cover:"",onClick:e[0]||(e[0]=s=>r(a).push("/"))},null,8,["src"]),j,t("p",q,[n("Você tem certeza que deseja descadastrar o seu email "),t("strong",null,b(r(o)),1),A,n(" e parar de receber notificações de candidaturas de vagas que você esteja cadastrado no AkkiPerto?")]),t("div",B,[l(f,{onClick:p,loading:r(u),color:"error",variant:"outlined"},{default:m(()=>[n("Descadastrar")]),_:1},8,["loading"]),l(f,{onClick:e[1]||(e[1]=s=>r(a).push("/")),color:"primary"},{default:m(()=>[n("Não")]),_:1})])])]))}};export{$ as default};
