import{r as i,d as h,o as l,c,a as s,l as m,v as u,t as _,e as n,w as b,f as g,g as p,i as w}from"./app-91dba96b.js";import{i as y}from"./index-0653e21c.js";import"./appFunction-1b5b1f43.js";const x={class:"form-group row mt-3 mb-3"},k=s("label",{for:"current_password",class:"col-sm-2 col-form-label"},[p("Old Password "),s("span",{class:"text-danger"},"*")],-1),V={class:"col-sm-10"},P={key:0,class:"text-danger"},B={class:"form-group row row mt-3 mb-3"},C=s("label",{for:"password",class:"col-sm-2 col-form-label"},[p("New Password "),s("span",{class:"text-danger"},"*")],-1),N={class:"col-sm-10"},U={key:0,class:"text-danger"},D={class:"form-group row row mt-3 mb-3"},M=s("label",{for:"confirm_password",class:"col-sm-2 col-form-label"},[p("Confirm Password "),s("span",{class:"text-danger"},"*")],-1),T={class:"col-sm-10"},E={key:0,class:"text-danger"},O={class:"form-group row row mt-3 mb-3"},S={class:"offset-sm-2 col-sm-10"},j=["disabled"],G={__name:"changePassword",setup(q){const d=i(!1),o=i({}),a=i({}),f=()=>{d.value=!0,o.value={},y.post("password-change",a.value).then(e=>{w.success(e.data.message),a.value={}}).catch(({response:e})=>{(e==null?void 0:e.status)===422?o.value=e.data.errors:w.error(e.data.message)}).finally(()=>d.value=!1)};return(e,r)=>{const v=h("app-button-loader");return l(),c("form",null,[s("div",x,[k,s("div",V,[m(s("input",{type:"password",class:"form-control current_password","onUpdate:modelValue":r[0]||(r[0]=t=>a.value.current_password=t),id:"current_password",placeholder:"********"},null,512),[[u,a.value.current_password]]),o.value.current_password?(l(),c("small",P,_(o.value.current_password[0]),1)):n("",!0)])]),s("div",B,[C,s("div",N,[m(s("input",{type:"password",class:"form-control new_password","onUpdate:modelValue":r[1]||(r[1]=t=>a.value.password=t),id:"password",placeholder:"********"},null,512),[[u,a.value.password]]),o.value.password?(l(),c("small",U,_(o.value.password[0]),1)):n("",!0)])]),s("div",D,[M,s("div",T,[m(s("input",{type:"password",class:"form-control password_confirmation",id:"confirm_password","onUpdate:modelValue":r[2]||(r[2]=t=>a.value.confirm_password=t),name:"confirm_password",placeholder:"********"},null,512),[[u,a.value.confirm_password]]),o.value.confirm_password?(l(),c("small",E,_(o.value.confirm_password[0]),1)):n("",!0)])]),s("div",O,[s("div",S,[s("button",{type:"button",class:"btn btn-primary",disabled:d.value,onClick:b(f,["prevent"])},[d.value?(l(),g(v,{key:0})):n("",!0),p(" Update ")],8,j)])])])}}};export{G as default};
