import{d as v,T as y,g as i,b as a,a as r,u as o,w as c,q as g,f as V,y as w,o as f,e as x,h as P}from"./app-9d739f6f.js";import{a as l,b as d,_ as u}from"./TextInput.vue_vue_type_script_setup_true_lang-e3367886.js";import{P as b}from"./PrimaryButton-87170137.js";const k={class:"flex items-center gap-4"},S={key:0,class:"text-sm text-gray-600"},I=v({__name:"UpdatePasswordForm",setup(C){const p=w(null),m=w(null),s=y({current_password:"",password:"",password_confirmation:""}),_=()=>{s.put(route("password.update"),{preserveScroll:!0,onSuccess:()=>{s.reset()},onError:()=>{var n,e;s.errors.password&&(s.reset("password","password_confirmation"),(n=p.value)==null||n.focus()),s.errors.current_password&&(s.reset("current_password"),(e=m.value)==null||e.focus())}})};return(n,e)=>(f(),i("section",null,[e[4]||(e[4]=a("header",null,[a("h2",{class:"text-lg font-medium text-gray-900"},"Update Password"),a("p",{class:"mt-1 text-sm text-gray-600"}," Ensure your account is using a long, random password to stay secure. ")],-1)),a("form",{onSubmit:V(_,["prevent"]),class:"mt-6 space-y-6"},[a("div",null,[r(u,{for:"current_password",value:"Current Password"}),r(l,{id:"current_password",ref_key:"currentPasswordInput",ref:m,modelValue:o(s).current_password,"onUpdate:modelValue":e[0]||(e[0]=t=>o(s).current_password=t),type:"password",class:"mt-1 block w-full",autocomplete:"current-password"},null,8,["modelValue"]),r(d,{message:o(s).errors.current_password,class:"mt-2"},null,8,["message"])]),a("div",null,[r(u,{for:"password",value:"New Password"}),r(l,{id:"password",ref_key:"passwordInput",ref:p,modelValue:o(s).password,"onUpdate:modelValue":e[1]||(e[1]=t=>o(s).password=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),r(d,{message:o(s).errors.password,class:"mt-2"},null,8,["message"])]),a("div",null,[r(u,{for:"password_confirmation",value:"Confirm Password"}),r(l,{id:"password_confirmation",modelValue:o(s).password_confirmation,"onUpdate:modelValue":e[2]||(e[2]=t=>o(s).password_confirmation=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),r(d,{message:o(s).errors.password_confirmation,class:"mt-2"},null,8,["message"])]),a("div",k,[r(b,{disabled:o(s).processing},{default:c(()=>[...e[3]||(e[3]=[x("Save",-1)])]),_:1},8,["disabled"]),r(g,{"enter-active-class":"transition ease-in-out","enter-from-class":"opacity-0","leave-active-class":"transition ease-in-out","leave-to-class":"opacity-0"},{default:c(()=>[o(s).recentlySuccessful?(f(),i("p",S,"Saved.")):P("",!0)]),_:1})])],32)]))}});export{I as _};
