import{_,a as f,k as b,r as l,o as P,c as h,w as i,d as t,f as d,t as v,s as S,e as R,j as g,l as p}from"./index-0c00d6f8.js";import{c as E,a as c,d as B}from"./index.esm-17a8dbbe.js";const L={class:"grid md:grid-cols-2 gap-2"},$={class:"flex items-center justify-end"},O=["disabled"],T={__name:"Password",setup(x){const r=f(),w=E({oPassword:c().required(r.t("ERRORS.oPassword")),password:c().required(r.t("ERRORS.newPassword")),cPassword:c().when("password",(s,e)=>s?e.required(r.t("ERRORS.confirmNewPassword")).oneOf([B("password")],r.t("ERRORS.notEqualPasswords")):e)}),n=b(!1);function u(s,e){const a=new FormData;a.append("_method","put"),a.append("current_password",s.oPassword),a.append("password",s.password),g({method:"POST",url:"profile/update",data:a}).then(o=>{p.success(o.data.message),n.value=!1,e.resetForm()}).catch(o=>{n.value=!1,p.error(o.response.data.message)})}return(s,e)=>{const a=l("base-password"),o=l("VeeForm"),m=l("base-card1");return P(),h(m,{title:s.$t("TITLES.Account Information")},{default:i(()=>[t(o,{onClick:e[0]||(e[0]=S(()=>{},["stop"])),as:"div",onSubmit:u,"validation-schema":R(w)},{default:i(()=>[d("form",null,[d("div",L,[t(a,{id:"oPassword",name:"oPassword",placeholder:s.$t("LABELS.oPassword"),label:"oPassword"},null,8,["placeholder"]),e[1]||(e[1]=d("div",null,null,-1)),t(a,{id:"password",name:"password",placeholder:s.$t("LABELS.newPassword"),label:"newPassword"},null,8,["placeholder"]),t(a,{id:"cPassword",name:"cPassword",placeholder:s.$t("LABELS.cNewPassword"),label:"cNewPassword"},null,8,["placeholder"])]),d("div",$,[d("button",{type:"submit",class:"h-[57px] bg-main !text-white w-full lg:w-[165px] rounded-[10px] disabled:opacity-60 disabled:cursor-not-allowed",disabled:n.value},v(s.$t("BUTTONS.save")),9,O)])])]),_:1},8,["validation-schema"])]),_:1},8,["title"])}}},N=_(T,[["__scopeId","data-v-27bb1737"]]);export{N as default};
