import{r as d,S as f,j as s}from"./app-BZJf8lgN.js";import{I as t}from"./InputError-DE3wWovO.js";import{I as l}from"./InputLabel-Dd3VnoK3.js";import{P as h}from"./PrimaryButton-DZfTvxkJ.js";import"./TextInput-BR_8t0R7.js";import{I as n}from"./inputtext.esm-B1lZn37a.js";import{z as j}from"./transition-CxU0V_cz.js";import"./button.esm-D_cwsnQR.js";import"./hooks.esm-UVLztt_0.js";function I({className:i=""}){const c=d.useRef();d.useRef();const{data:e,setData:a,errors:o,put:m,reset:p,processing:u,recentlySuccessful:w}=f({current_password:"",password:"",password_confirmation:""}),x=r=>{r.preventDefault(),m(route("password.update"),{preserveScroll:!0,onSuccess:()=>p()})};return s.jsxs("section",{className:i,children:[s.jsxs("header",{children:[s.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Update Password"}),s.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Ensure your account is using a long, random password to stay secure."})]}),s.jsxs("form",{onSubmit:x,className:"mt-4 space-y-6",children:[s.jsxs("div",{className:"mb-3",children:[s.jsx("label",{htmlFor:"current_password",className:"block text-900 font-medium mb-2",children:"Current Password"}),s.jsx(n,{id:"current_password",type:"password",placeholder:"Current Password",className:"w-full",value:e.current_password,onChange:r=>a("current_password",r.target.value)}),s.jsx(t,{message:o.current_password})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx(l,{htmlFor:"password",value:"New Password"}),s.jsx(n,{id:"password",ref:c,type:"password",placeholder:"Password",className:"w-full",value:e.password,onChange:r=>a("password",r.target.value)}),s.jsx(t,{message:o.password})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx(l,{htmlFor:"password_confirmation",value:"Confirm Password"}),s.jsx(n,{id:"password_confirmation",type:"password",placeholder:"Confirm Password",className:"w-full",value:e.password_confirmation,onChange:r=>a("password_confirmation",r.target.value)}),s.jsx(t,{message:o.password_confirmation})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(h,{disabled:u,children:"Save"}),s.jsx(j,{show:w,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:s.jsx("p",{className:"text-sm text-gray-600",children:"Saved."})})]})]})]})}export{I as default};
//# sourceMappingURL=UpdatePasswordForm-C5hbesa4.js.map
