import{u as _,g as m,b as a,d as e,e as r,a as i,f as v,o as c,i as y,T as g,j as V,p as w}from"./app-BJF24m-a.js";import{_ as l}from"./InputError-96UgAvVt.js";import{_ as n,a as d}from"./TextInput-O1sjt4fZ.js";import{P as x}from"./PrimaryButton-5AnCxPpY.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const P={class:"flex items-center gap-4"},k={key:0,class:"text-sm text-gray-600"},E={__name:"UpdatePasswordForm",setup(b){const u=w(null),p=w(null),s=_({current_password:"",password:"",password_confirmation:""}),f=()=>{s.put(route("password.update"),{preserveScroll:!0,onSuccess:()=>s.reset(),onError:()=>{s.errors.password&&(s.reset("password","password_confirmation"),u.value.focus()),s.errors.current_password&&(s.reset("current_password"),p.value.focus())}})};return(S,o)=>(c(),m("section",null,[o[4]||(o[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(f,["prevent"]),class:"mt-6 space-y-6"},[a("div",null,[e(n,{for:"current_password",value:"Current Password"}),e(d,{id:"current_password",ref_key:"currentPasswordInput",ref:p,modelValue:r(s).current_password,"onUpdate:modelValue":o[0]||(o[0]=t=>r(s).current_password=t),type:"password",class:"mt-1 block w-full",autocomplete:"current-password"},null,8,["modelValue"]),e(l,{message:r(s).errors.current_password,class:"mt-2"},null,8,["message"])]),a("div",null,[e(n,{for:"password",value:"New Password"}),e(d,{id:"password",ref_key:"passwordInput",ref:u,modelValue:r(s).password,"onUpdate:modelValue":o[1]||(o[1]=t=>r(s).password=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(l,{message:r(s).errors.password,class:"mt-2"},null,8,["message"])]),a("div",null,[e(n,{for:"password_confirmation",value:"Confirm Password"}),e(d,{id:"password_confirmation",modelValue:r(s).password_confirmation,"onUpdate:modelValue":o[2]||(o[2]=t=>r(s).password_confirmation=t),type:"password",class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),e(l,{message:r(s).errors.password_confirmation,class:"mt-2"},null,8,["message"])]),a("div",P,[e(x,{disabled:r(s).processing},{default:i(()=>[...o[3]||(o[3]=[v("Save",-1)])]),_:1},8,["disabled"]),e(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:i(()=>[r(s).recentlySuccessful?(c(),m("p",k," Saved. ")):y("",!0)]),_:1})])],32)]))}};export{E as default};
