import{_ as y}from"./DWMhLzME.js";import{a as b}from"./DCp3GJQW.js";import{_ as h}from"./DKIXA6Zt.js";import{l as V,ab as C,ac as N,K as w,i as _,k as i,ah as a,U as p,N as f,f as s,aj as I,v as K,a5 as r,a0 as U,h as B,j as c}from"./D7LY3N47.js";import{_ as S}from"./DlAUqK2U.js";import"./DqW9UKXb.js";import"./DL7l9XXk.js";import"./CYtbVgsc.js";const T={class:"login-wrap"},E={class:"space-y-3"},R={key:0,class:"text-sm text-red-500"},u="aidev-ui-token",j=V({__name:"login",setup(q){const x=C(),m=N(),t=p(""),l=p("");w(()=>{const o=x.query.token,e=typeof o=="string"?o:"";if(e){localStorage.setItem(u,e),m.replace("/");return}const n=localStorage.getItem(u);n&&(t.value=n)});function d(){const o=t.value.trim();if(!o){l.value="Token is required";return}localStorage.setItem(u,o),m.replace("/")}return(o,e)=>{const n=y,g=b,k=h;return f(),_("div",T,[i(k,{class:"login-card"},{header:a(()=>[...e[1]||(e[1]=[s("h1",{class:"text-xl font-semibold"},"aidev login",-1),s("p",{class:"text-sm text-gray-500"},[c(" Paste the token printed by "),s("code",null,"aidev ui"),c(" in your terminal. ")],-1)])]),footer:a(()=>[i(g,{block:"",disabled:!r(t),onClick:d},{default:a(()=>[...e[2]||(e[2]=[c(" Continue ",-1)])]),_:1},8,["disabled"])]),default:a(()=>[s("div",E,[i(n,{modelValue:r(t),"onUpdate:modelValue":e[0]||(e[0]=v=>K(t)?t.value=v:null),placeholder:"32-byte hex token",autocomplete:"off",ui:{base:"font-mono"},onKeydown:I(d,["enter"])},null,8,["modelValue"]),r(l)?(f(),_("p",R,U(r(l)),1)):B("",!0)])]),_:1})])}}}),F=S(j,[["__scopeId","data-v-4199ecb4"]]);export{F as default};
