import{C as e,D as t,E as n,F as r,H as i,S as a,T as o,Y as s,b as c,et as l,g as u,i as d,o as f,q as p}from"./app-gZlh9fBQ.js";import{n as m,t as h}from"./TextInput-DkRHEr5u.js";import{t as g}from"./InputLabel-iIPIbrqJ.js";import{t as _}from"./PrimaryButton-CBlZPyfn.js";var v={class:`flex items-center gap-4`},y={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},b=t({__name:`UpdatePasswordForm`,setup(t){let l=p(null),b=p(null),x=d({current_password:``,password:``,password_confirmation:``}),S=()=>{x.put(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{x.reset()},onError:()=>{x.errors.password&&(x.reset(`password`,`password_confirmation`),l.value?.focus()),x.errors.current_password&&(x.reset(`current_password`),b.value?.focus())}})};return(t,d)=>(r(),e(`section`,null,[d[4]||=c(`header`,null,[c(`h2`,{class:`text-lg font-medium text-gray-900 dark:text-gray-100`},` Update Password `),c(`p`,{class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},` Ensure your account is using a long, random password to stay secure. `)],-1),c(`form`,{onSubmit:u(S,[`prevent`]),class:`mt-6 space-y-6`},[c(`div`,null,[n(g,{for:`current_password`,value:`Current Password`}),n(h,{id:`current_password`,ref_key:`currentPasswordInput`,ref:b,modelValue:s(x).current_password,"onUpdate:modelValue":d[0]||=e=>s(x).current_password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`current-password`},null,8,[`modelValue`]),n(m,{message:s(x).errors.current_password,class:`mt-2`},null,8,[`message`])]),c(`div`,null,[n(g,{for:`password`,value:`New Password`}),n(h,{id:`password`,ref_key:`passwordInput`,ref:l,modelValue:s(x).password,"onUpdate:modelValue":d[1]||=e=>s(x).password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),n(m,{message:s(x).errors.password,class:`mt-2`},null,8,[`message`])]),c(`div`,null,[n(g,{for:`password_confirmation`,value:`Confirm Password`}),n(h,{id:`password_confirmation`,modelValue:s(x).password_confirmation,"onUpdate:modelValue":d[2]||=e=>s(x).password_confirmation=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),n(m,{message:s(x).errors.password_confirmation,class:`mt-2`},null,8,[`message`])]),c(`div`,v,[n(_,{disabled:s(x).processing},{default:i(()=>[...d[3]||=[o(`Save`,-1)]]),_:1},8,[`disabled`]),n(f,{"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(()=>[s(x).recentlySuccessful?(r(),e(`p`,y,` Saved. `)):a(``,!0)]),_:1})])],32)]))}}),x=l({default:()=>S}),S=b;export{x as n,S as t};