import{u as w,p as h,c as p,e as x,a as t,w as k,d as f,v,t as c,g,f as _,r as a,h as S,o as b,k as V}from"./index-Bodg7xX-.js";import{_ as C}from"./AdminSidebar-C3W8DF6y.js";import"./bmmg-logo-CDMybbK7.js";const N={class:"min-h-screen bg-ink flex flex-col md:flex-row"},B={class:"flex-1 p-6 md:p-10 max-w-xl"},M={key:0,class:"text-sm text-wine-deep bg-wine/20 border border-wine/40 rounded-lg px-3 py-2 text-cream"},P={key:1,class:"text-sm text-spotify"},U={class:"flex items-center justify-between pt-2"},q=["disabled"],j={__name:"AdminProfile",setup(A){const d=w(),l=a(""),s=a(""),r=a(""),n=a(""),i=a(!1);h(()=>{var o,e;l.value=((o=d.admin)==null?void 0:o.name)||"",s.value=((e=d.admin)==null?void 0:e.email)||""});async function y(){var o,e;r.value="",n.value="",i.value=!0;try{await d.updateProfile({name:l.value,email:s.value}),n.value="Profile updated."}catch(u){r.value=((e=(o=u.response)==null?void 0:o.data)==null?void 0:e.message)||"Could not update your profile."}finally{i.value=!1}}return(o,e)=>{const u=S("router-link");return b(),p("div",N,[x(C),t("main",B,[e[5]||(e[5]=t("h1",{class:"font-display text-2xl text-cream mb-1"},"Your profile",-1)),e[6]||(e[6]=t("p",{class:"text-muted text-sm mb-8"},"Update your name and email.",-1)),t("form",{onSubmit:k(y,["prevent"]),class:"glass rounded-2xl p-6 space-y-4 shadow-soft"},[t("div",null,[e[2]||(e[2]=t("label",{class:"eyebrow block mb-2",for:"name"},"Name",-1)),f(t("input",{id:"name","onUpdate:modelValue":e[0]||(e[0]=m=>l.value=m),type:"text",required:"",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"},null,512),[[v,l.value]])]),t("div",null,[e[3]||(e[3]=t("label",{class:"eyebrow block mb-2",for:"email"},"Email",-1)),f(t("input",{id:"email","onUpdate:modelValue":e[1]||(e[1]=m=>s.value=m),type:"email",required:"",autocomplete:"email",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"},null,512),[[v,s.value]])]),r.value?(b(),p("p",M,c(r.value),1)):g("",!0),n.value?(b(),p("p",P,c(n.value),1)):g("",!0),t("div",U,[t("button",{type:"submit",disabled:i.value,class:"bg-gold hover:bg-gold-bright disabled:opacity-50 text-ink font-semibold rounded-lg px-5 py-2.5 transition-colors"},c(i.value?"Saving…":"Save changes"),9,q),x(u,{to:{name:"admin-change-password"},class:"text-sm text-muted hover:text-gold transition-colors"},{default:_(()=>[...e[4]||(e[4]=[V(" Change password ",-1)])]),_:1})])],32)])])}}};export{j as default};
