import{T as g}from"./Input-b786da58.js";import{T as v}from"./Label-fda955a2.js";import{L as b}from"./LoadingButton-1a262643.js";import{T}from"./InputError-8d3cfe49.js";import{T as V}from"./FormSection-07a3c25c.js";import{T as h}from"./ActionMessage-e7228db2.js";import{_ as S,r as t,o as P,d as y,e as a,h as l,t as p,a as u,g as o}from"./app-32ed258c.js";import"./SectionTitle-8b846035.js";const B={components:{TecLabel:v,TecInput:g,TecButton:b,TecInputError:T,TecFormSection:V,TecActionMessage:h},data(){return{form:this.$inertia.form({current_password:"",password:"",password_confirmation:""})}},methods:{updatePassword(){this.form.put(route("user-password.update"),{errorBag:"updatePassword",preserveScroll:!0,onSuccess:()=>this.form.reset(),onError:()=>{this.form.errors.password&&(this.form.reset("password","password_confirmation"),this.$refs.password.focus()),this.form.errors.current_password&&(this.form.reset("current_password"),this.$refs.current_password.focus())}})}}},k={class:"col-span-6 sm:col-span-4"},U={class:"col-span-6 sm:col-span-4"},C={class:"col-span-6 sm:col-span-4"};function N(r,e,E,L,s,i){const m=t("tec-label"),c=t("tec-input"),d=t("tec-input-error"),f=t("tec-action-message"),w=t("tec-button"),_=t("tec-form-section");return P(),y(_,{onSubmitted:i.updatePassword},{title:a(()=>[l(p(r.$t("Update Password")),1)]),description:a(()=>[l(p(r.$t("Ensure your account is using a long, random password to stay secure.")),1)]),form:a(()=>[u("div",k,[o(m,{for:"current_password",value:r.$t("Current Password")},null,8,["value"]),o(c,{type:"password",id:"current_password",ref:"current_password",class:"mt-1 block w-full",modelValue:s.form.current_password,"onUpdate:modelValue":e[0]||(e[0]=n=>s.form.current_password=n),autocomplete:"current-password"},null,8,["modelValue"]),o(d,{message:s.form.errors.current_password,class:"mt-2"},null,8,["message"])]),u("div",U,[o(m,{for:"password",value:r.$t("New Password")},null,8,["value"]),o(c,{id:"password",ref:"password",type:"password",modelValue:s.form.password,"onUpdate:modelValue":e[1]||(e[1]=n=>s.form.password=n),class:"mt-1 block w-full",autocomplete:"new-password"},null,8,["modelValue"]),o(d,{message:s.form.errors.password,class:"mt-2"},null,8,["message"])]),u("div",C,[o(m,{for:"password_confirmation",value:r.$t("Confirm Password")},null,8,["value"]),o(c,{type:"password",class:"mt-1 block w-full",id:"password_confirmation",autocomplete:"new-password",modelValue:s.form.password_confirmation,"onUpdate:modelValue":e[2]||(e[2]=n=>s.form.password_confirmation=n)},null,8,["modelValue"]),o(d,{message:s.form.errors.password_confirmation,class:"mt-2"},null,8,["message"])])]),actions:a(()=>[o(f,{on:s.form.recentlySuccessful&&!r.$page.props.flash.error,class:"mr-3"},{default:a(()=>[l(p(r.$t("Saved.")),1)]),_:1},8,["on"]),o(w,{loading:s.form.processing,disabled:s.form.processing},{default:a(()=>[l(p(r.$t("Save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["onSubmitted"])}const z=S(B,[["render",N]]);export{z as default};
