import{d as V,u as h,aw as y,Q as x,r as R,x as m,o as q,A as M,B as w,f as d,a as r,V as U,W as v,__tla as A}from"./index-92ad187a.js";import{u as j,__tla as k}from"./tagsView-53f4f52b.js";import{I as u,__tla as B}from"./InputPassword-03a6d8fb.js";import{c as E,__tla as F}from"./profile-0944b405.js";import{u as I,__tla as O}from"./useMessage-d9788660.js";let n,Q=Promise.all([(()=>{try{return A}catch{}})(),(()=>{try{return k}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return F}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{n=V({name:"ResetPwd",__name:"ResetPwd",setup(S,{expose:p}){const{push:W,replace:_}=h(),f=y(),c=j(),{t:s}=x(),P=I(),i=R(),e=m({oldPassword:"",newPassword:"",confirmPassword:""}),g=m({oldPassword:[{required:!0,message:s("profile.password.oldPwdMsg"),trigger:"blur"},{min:6,max:20,message:s("profile.password.pwdRules"),trigger:"blur"}],newPassword:[{required:!0,message:s("profile.password.newPwdMsg"),trigger:"blur"},{min:6,max:20,message:s("profile.password.pwdRules"),trigger:"blur"}],confirmPassword:[{required:!0,message:s("profile.password.cfPwdMsg"),trigger:"blur"},{required:!0,validator:(l,a,o)=>{e.newPassword!==a?o(new Error(s("profile.password.diffPwd"))):o()},trigger:"blur"}]});return p({reset:l=>{l&&l.resetFields()},submit:l=>{l&&l.validate(async a=>{a&&(await E(e.oldPassword,e.newPassword),P.success(s("common.updateSuccess")),await f.loginOut(),c.delAllViews(),_("/login?redirect=/index"))})},formRef:i}),(l,a)=>{const o=U,b=v;return q(),M(b,{ref_key:"formRef",ref:i,model:r(e),rules:r(g),"label-width":200},{default:w(()=>[d(o,{label:r(s)("profile.password.oldPassword"),prop:"oldPassword"},{default:w(()=>[d(r(u),{modelValue:r(e).oldPassword,"onUpdate:modelValue":a[0]||(a[0]=t=>r(e).oldPassword=t)},null,8,["modelValue"])]),_:1},8,["label"]),d(o,{label:r(s)("profile.password.newPassword"),prop:"newPassword"},{default:w(()=>[d(r(u),{modelValue:r(e).newPassword,"onUpdate:modelValue":a[1]||(a[1]=t=>r(e).newPassword=t),strength:""},null,8,["modelValue"])]),_:1},8,["label"]),d(o,{label:r(s)("profile.password.confirmPassword"),prop:"confirmPassword"},{default:w(()=>[d(r(u),{modelValue:r(e).confirmPassword,"onUpdate:modelValue":a[2]||(a[2]=t=>r(e).confirmPassword=t),strength:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])}}})});export{n as _,Q as __tla};
