1import{u as h}from"./use-meta-CitfUvc6.js";import{f as g,i as y,j as P,k as l,m as o,l as a,q as i,B as b,A as k,Q as u,y as f,D as m,z as v,p as c,u as q,K as C}from"./index-DZz7VK_z.js";import{p as V}from"./validators-CSg1_fQ1.js";import{s as _}from"./sparklemouse-Cs9Kfkhs.js";import{Q as x}from"./QImg-B-JHm6ia.js";import{Q as $}from"./QPage-D4hek64o.js";import{_ as Q}from"./jade-waving-jDHqOYZK.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";const I={class:"row col-12 flex-center column",style:{width:"100%"}},R={class:"q-mb-lg q-mt-sm"},z={class:"row flex-center",style:{width:"100%"}},B={class:"col-12 space-y-4"},K={class:"row q-mt-lg"},M={class:"row flex items-center justify-center q-mt-md"},D={class:"text-grey-6"};function N(e,s,n,p,r,d){const w=g("router-link");return y(),P($,{class:"flex flex-center sparkle-mouse"},{default:l(()=>[o("div",I,[a(x,{src:Q,style:{width:"20%"}}),o("h1",null,i(e.$t("auth.resetPassword")),1),o("h3",R,i(e.$t("auth.resetPasswordSubtitle")),1),o("div",z,[a(b,{class:"col-xs-12 col-sm-6 col-md-4 col-lg-4",flat:""},{default:l(()=>[s[6]||(s[6]=o("div",{class:"flex flex-center q-mb-lg"},[o("div",{class:"login-bar"}),o("div",{class:"login-bar-middle"}),o("div",{class:"login-bar-after"})],-1)),a(k,null,{default:l(()=>[o("div",B,[a(u,{ref:"password",label:e.$t("auth.newPassword"),outlined:"","label-color":"black",type:r.isPwd?"password":"text","reactive-rules":!0,"lazy-rules":"",placeholder:e.$t("auth.passwordPlaceholder"),onKeyup:s[1]||(s[1]=f(t=>d.onSubmit(),["enter"])),name:"password",modelValue:r.password,"onUpdate:modelValue":s[2]||(s[2]=t=>r.password=t),hasicon:"",rules:[t=>p.passwordValidator(t)],"error-message":e.$t("auth.error.passwordRequired"),classInput:"h-[48px]"},{prepend:l(()=>[a(m,{name:"lock"})]),append:l(()=>[a(m,{class:"cursor-pointer",name:r.isPwd?"visibility_off":"visibility",onClick:s[0]||(s[0]=t=>r.isPwd=!r.isPwd)},null,8,["name"])]),_:1},8,["label","type","placeholder","modelValue","rules","error-message"]),a(u,{class:"q-mt-md",ref:"confirmPassword",label:e.$t("auth.confirmPassword"),outlined:"","label-color":"black",type:r.isConfirmPwd?"password":"text","reactive-rules":!0,"lazy-rules":"",placeholder:e.$t("auth.confirmPasswordPlaceholder"),onKeyup:s[4]||(s[4]=f(t=>d.onSubmit(),["enter"])),name:"confirmPassword",modelValue:r.confirmPassword,"onUpdate:modelValue":s[5]||(s[5]=t=>r.confirmPassword=t),hasicon:"",rules:[t=>d.confirmPasswordValidator(t)],"error-message":e.$t("auth.error.passwordMismatch"),classInput:"h-[48px]"},{prepend:l(()=>[a(m,{name:"lock"})]),append:l(()=>[a(m,{class:"cursor-pointer",name:r.isConfirmPwd?"visibility_off":"visibility",onClick:s[3]||(s[3]=t=>r.isConfirmPwd=!r.isConfirmPwd)},null,8,["name"])]),_:1},8,["label","type","placeholder","modelValue","rules","error-message"]),o("div",K,[a(v,{class:"col-12 btn btn-dark w-full text-center b-rad q-py-md text-weight-bolder",onClick:d.onSubmit,color:"black",loading:r.loading},{default:l(()=>[c(i(e.$t("auth.setPassword")),1)]),_:1},8,["onClick","loading"])])])]),_:1})]),_:1})]),o("div",M,[o("span",D,i(e.$t("auth.rememberPassword")),1),a(w,{class:"primary-underline text-weight-bolder q-ml-sm",to:"/login"},{default:l(()=>[c(i(e.$t("auth.signIn")),1)]),_:1})])])]),_:1})}const U={name:"ResetPassword",data(){return{password:"",confirmPassword:"",isPwd:!0,isConfirmPwd:!0,loading:!1}},methods:{confirmPasswordValidator(e){return!(!e||e!==this.password)},async validate(){return!!(this.$refs.password.validate()&&this.$refs.confirmPassword.validate())},async onSubmit(){if(await this.validate()){this.loading=!0;try{const e=this.$route.query.token;if(!e)throw new Error("Reset token is missing");let s={token:e,password:this.password};const{data:n}=await C.post("/api/auth/reset-password",s);if(n.success)this.$q.notify({type:"positive",message:n.message||"Password has been reset successfully"}),this.$router.push("/login");else throw new Error(n.error||"Failed to reset password")}catch(e){console.error("Reset password error:",e);let s="Failed to reset password";e.response?.data?.error?s=e.response.data.error:e.message&&(s=e.message),this.$q.notify({type:"negative",message:s})}finally{this.loading=!1}}}},setup(){const e=q(),p={link:[{rel:"canonical",href:`https://app.apromarketing.com${e.query.lang!="en"?e.fullPath:"/reset-password"}`},{rel:"alternate",href:"https://app.apromarketing.com/reset-password",hreflang:"en-US"},{rel:"alternate",href:"https://app.apromarketing.com/reset-password?lang=zh",hreflang:"zh-TW"},{rel:"alternate",href:"https://app.apromarketing.com/reset-password?lang=es",hreflang:"es-MX"},{rel:"alternate",href:"https://app.apromarketing.com/reset-password",hreflang:"x-default"}]};return h(p),{passwordValidator:V}},mounted(){_(),this.$route.query.token||(this.$q.notify({type:"warning",message:"Invalid reset link. Please request a new password reset."}),this.$router.push("/forgot-password"))},unmounted(){window.onmousemove=null,window.ontouchmove=null}},G=S(U,[["render",N],["__scopeId","data-v-6bc572b5"]]);export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.