import{u as g,c as p,e as y,a as s,w as h,d as c,v as m,t as w,g as v,r as t,o as b}from"./index-Bodg7xX-.js";import{_ as k}from"./AdminSidebar-C3W8DF6y.js";import"./bmmg-logo-CDMybbK7.js";const C={class:"min-h-screen bg-ink flex flex-col md:flex-row"},N={class:"flex-1 p-6 md:p-10 max-w-xl"},P={key:0,class:"text-sm text-wine-deep bg-wine/20 border border-wine/40 rounded-lg px-3 py-2 text-cream"},V={key:1,class:"text-sm text-spotify"},S=["disabled"],A={__name:"AdminChangePassword",setup(_){const f=g(),l=t(""),r=t(""),d=t(""),a=t(""),n=t(""),u=t(!1);async function x(){var i,e;if(a.value="",n.value="",r.value.length<8){a.value="New password must be at least 8 characters.";return}if(r.value!==d.value){a.value="New passwords don't match.";return}u.value=!0;try{await f.changePassword(l.value,r.value),n.value="Password updated.",l.value="",r.value="",d.value=""}catch(o){a.value=((e=(i=o.response)==null?void 0:i.data)==null?void 0:e.message)||"Could not change your password."}finally{u.value=!1}}return(i,e)=>(b(),p("div",C,[y(k),s("main",N,[e[6]||(e[6]=s("h1",{class:"font-display text-2xl text-cream mb-1"},"Change password",-1)),e[7]||(e[7]=s("p",{class:"text-muted text-sm mb-8"},"Choose something you haven't used before.",-1)),s("form",{onSubmit:h(x,["prevent"]),class:"glass rounded-2xl p-6 space-y-4 shadow-soft"},[s("div",null,[e[3]||(e[3]=s("label",{class:"eyebrow block mb-2",for:"current-password"},"Current password",-1)),c(s("input",{id:"current-password","onUpdate:modelValue":e[0]||(e[0]=o=>l.value=o),type:"password",required:"",autocomplete:"current-password",class:"w-full bg-black/30 border border-hairline rounded-lg px-4 py-2.5 text-cream placeholder:text-muted/60 focus:border-gold/50 outline-none transition-colors",placeholder:"••••••••"},null,512),[[m,l.value]])]),s("div",null,[e[4]||(e[4]=s("label",{class:"eyebrow block mb-2",for:"new-password"},"New password",-1)),c(s("input",{id:"new-password","onUpdate:modelValue":e[1]||(e[1]=o=>r.value=o),type:"password",required:"",autocomplete:"new-password",class:"w-full bg-black/30 border border-hairline rounded-lg px-4 py-2.5 text-cream placeholder:text-muted/60 focus:border-gold/50 outline-none transition-colors",placeholder:"••••••••"},null,512),[[m,r.value]])]),s("div",null,[e[5]||(e[5]=s("label",{class:"eyebrow block mb-2",for:"confirm-password"},"Confirm new password",-1)),c(s("input",{id:"confirm-password","onUpdate:modelValue":e[2]||(e[2]=o=>d.value=o),type:"password",required:"",autocomplete:"new-password",class:"w-full bg-black/30 border border-hairline rounded-lg px-4 py-2.5 text-cream placeholder:text-muted/60 focus:border-gold/50 outline-none transition-colors",placeholder:"••••••••"},null,512),[[m,d.value]])]),a.value?(b(),p("p",P,w(a.value),1)):v("",!0),n.value?(b(),p("p",V,w(n.value),1)):v("",!0),s("button",{type:"submit",disabled:u.value,class:"w-full bg-gold hover:bg-gold-bright disabled:opacity-50 text-ink font-semibold rounded-lg py-2.5 transition-colors"},w(u.value?"Saving…":"Update password"),9,S)],32)])]))}};export{A as default};
