import{Bt as e,Ct as t,F as n,G as r,H as i,L as a,N as o,Nt as s,Pt as c,T as l,Vt as u,X as d,bt as f,ft as p,mt as m,ot as h,tt as g,ut as _,vt as v,z as y}from"../chunks/xY0c-UfG.js";import{r as b}from"../chunks/Bym3iIKr.js";import"../chunks/xihTtKlq.js";import"../chunks/_zekciZc.js";import{i as x}from"../chunks/Ca8AGdcM.js";import{t as S}from"../chunks/Y1ENS0GB.js";import{t as C}from"../chunks/Cvnwo5OO.js";import{t as w}from"../chunks/DDbpVNi02.js";import"../chunks/BV3B8RXJ.js";var T=y(`<p class="error-msg svelte-g40i6i"> </p>`),E=y(`<div class="setup-page svelte-g40i6i"><div class="setup-card svelte-g40i6i"><div class="logo svelte-g40i6i"><img class="logo-mark svelte-g40i6i" src="/studiograph-logomark.svg" alt="" width="64" height="64"/> <span class="logo-text svelte-g40i6i"> </span></div> <p class="subtitle svelte-g40i6i">Create your admin account to get started.</p> <form class="svelte-g40i6i"><label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Name</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Email</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Password</span> <!> <span class="field-hint svelte-g40i6i">At least 8 characters</span></label> <!> <!></form></div></div>`);function D(y,D){c(D,!0);let O=t(()=>S.workspaceName||`Studiograph`),k=f(``),A=f(``),j=f(``),M=f(``),N=f(!1);async function P(e){e.preventDefault(),v(M,``),v(N,!0);try{await S.setup(d(k),d(A),d(j)||void 0),x.load(),b(`/`)}catch(e){v(M,e.message||`Setup failed`,!0)}finally{v(N,!1)}}var F=E();l(`g40i6i`,e=>{g(()=>{_.title=`Setup — ${d(O)??``}`})});var I=p(F),L=p(I),R=m(p(L),2),z=p(R,!0);u(R),u(L);var B=m(L,4),V=p(B);w(m(p(V),2),{type:`text`,placeholder:`Your name`,autocomplete:`name`,autofocus:!0,class:`field-input`,get value(){return d(j)},set value(e){v(j,e,!0)}}),u(V);var H=m(V,2);w(m(p(H),2),{type:`email`,required:!0,autocomplete:`email`,class:`field-input`,get value(){return d(k)},set value(e){v(k,e,!0)}}),u(H);var U=m(H,2);w(m(p(U),2),{type:`password`,required:!0,minlength:8,autocomplete:`new-password`,class:`field-input`,get value(){return d(A)},set value(e){v(A,e,!0)}}),e(2),u(U);var W=m(U,2),G=e=>{var t=T(),r=p(t,!0);u(t),h(()=>n(r,d(M))),a(e,t)};o(W,e=>{d(M)&&e(G)}),C(m(W,2),{variant:`accent`,type:`submit`,class:`submit-btn`,get disabled(){return d(N)},children:(t,n)=>{e(),a(t,i(`Create account`))},$$slots:{default:!0}}),u(B),u(I),u(F),h(()=>n(z,d(O))),r(`submit`,B,P),a(y,F),s()}export{D as component};