import{d as P,A as f,g as Q,o as q,w as d,e as s,u as t,h as $,b as n,j as k,m as x,i as u,T as C,K as N,N as I}from"./app-KXUNt_n9.js";import{q as _}from"./index-Z7dItZLR.js";import{_ as l}from"./InputError.vue_vue_type_script_setup_true_lang-DniwR9eG.js";import{_ as T}from"./AppLayout.vue_vue_type_script_setup_true_lang-BA0fi5xR.js";import{_ as S,a as B}from"./Layout.vue_vue_type_script_setup_true_lang-CE0KfyI0.js";import{e as U}from"./index-CTpRNI-n.js";import{_ as V}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-M23wUS8o.js";import{_ as m}from"./Input.vue_vue_type_script_setup_true_lang-C985hTdX.js";import{_ as p}from"./Label.vue_vue_type_script_setup_true_lang-DMkOfPu9.js";import"./useForwardExpose-B0NY7lip.js";import"./VisuallyHidden-OJAPlYzx.js";import"./RovingFocusGroup-DKdqcDpA.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./createLucideIcon-CFEmdjHu.js";import"./index-C0lT1AXe.js";import"./index-KOXzqeVR.js";const r=e=>({url:r.url(e),method:"get"});r.definition={methods:["get","head"],url:"/settings/password"};r.url=e=>r.definition.url+_(e);r.get=e=>({url:r.url(e),method:"get"});r.head=e=>({url:r.url(e),method:"head"});const c=e=>({action:r.url(e),method:"get"});c.get=e=>({action:r.url(e),method:"get"});c.head=e=>({action:r.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...e?.query??e?.mergeQuery??{}}}),method:"get"});r.form=c;const o=e=>({url:o.url(e),method:"put"});o.definition={methods:["put"],url:"/settings/password"};o.url=e=>o.definition.url+_(e);o.put=e=>({url:o.url(e),method:"put"});const w=e=>({action:o.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PUT",...e?.query??e?.mergeQuery??{}}}),method:"post"});w.put=e=>({action:o.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PUT",...e?.query??e?.mergeQuery??{}}}),method:"post"});o.form=w;const A={edit:r,update:o},D={class:"space-y-6"},E={class:"grid gap-2"},F={class:"grid gap-2"},j={class:"grid gap-2"},H={class:"flex items-center gap-4"},K={class:"text-sm text-neutral-600"},de=P({__name:"Password",setup(e){const g=[{title:"Password settings",href:U().url}],h=f(null),y=f(null);return(z,a)=>(q(),Q(T,{breadcrumbs:g},{default:d(()=>[s(t($),{title:"Password settings"}),s(S,null,{default:d(()=>[n("div",D,[s(B,{title:"Update password",description:"Ensure your account is using a long, random password to stay secure"}),s(t(k),x(t(A).update.form(),{options:{preserveScroll:!0},"reset-on-success":"","reset-on-error":["password","password_confirmation","current_password"],class:"space-y-6"}),{default:d(({errors:i,processing:v,recentlySuccessful:b})=>[n("div",E,[s(t(p),{for:"current_password"},{default:d(()=>[...a[0]||(a[0]=[u("Current password",-1)])]),_:1}),s(t(m),{id:"current_password",ref_key:"currentPasswordInput",ref:y,name:"current_password",type:"password",class:"mt-1 block w-full",autocomplete:"current-password",placeholder:"Current password"},null,512),s(l,{message:i.current_password},null,8,["message"])]),n("div",F,[s(t(p),{for:"password"},{default:d(()=>[...a[1]||(a[1]=[u("New password",-1)])]),_:1}),s(t(m),{id:"password",ref_key:"passwordInput",ref:h,name:"password",type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"New password"},null,512),s(l,{message:i.password},null,8,["message"])]),n("div",j,[s(t(p),{for:"password_confirmation"},{default:d(()=>[...a[2]||(a[2]=[u("Confirm password",-1)])]),_:1}),s(t(m),{id:"password_confirmation",name:"password_confirmation",type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"Confirm password"}),s(l,{message:i.password_confirmation},null,8,["message"])]),n("div",H,[s(t(V),{disabled:v,"data-test":"update-password-button"},{default:d(()=>[...a[3]||(a[3]=[u("Save password",-1)])]),_:1},8,["disabled"]),s(C,{"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:d(()=>[N(n("p",K,"Saved.",512),[[I,b]])]),_:2},1024)])]),_:1},16)])]),_:1})]),_:1}))}});export{de as default};
