import{d as w,ae as a,x as h,p as n,l as r,j as u,dy as b,u as y,k as l,o as V,C as p}from"./index-Bjo-kBX5.js";import{u as C}from"./usePrefectApi-BiV7mqJz.js";import"./api-xofaoTi_.js";import"./mapper-Fr2XiNEs.js";const S={class:"flex items-center justify-center min-h-screen"},k={class:"w-full max-w-[400px] p-8 m-4 bg-surface-raised rounded-lg shadow-lg"},E=w({__name:"Unauthenticated",props:{redirect:{}},setup(d){const c=d,o=a(""),t=a(!1),s=a(""),i=y();C();const m=async()=>{if(!t.value){t.value=!0,s.value="";try{localStorage.setItem("prefect-password",btoa(o.value)),i.push(c.redirect||"/")}catch{localStorage.removeItem("prefect-password"),s.value="Invalid password"}finally{t.value=!1}}};return(f,e)=>{const v=l("p-heading"),_=l("p-text-input"),g=l("p-button");return V(),h("div",S,[n("div",k,[r(v,{tag:"h1",size:"lg",class:"mb-6 text-center text-default"},{default:u(()=>e[1]||(e[1]=[p(" Login ")])),_:1}),n("form",{onSubmit:b(m,["prevent"]),class:"flex flex-col gap-4"},[r(_,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=x=>o.value=x),type:"password",placeholder:"Enter password",error:s.value,autofocus:"",class:"w-full"},null,8,["modelValue","error"]),r(g,{type:"submit",loading:t.value,class:"w-full"},{default:u(()=>e[2]||(e[2]=[p(" Login ")])),_:1},8,["loading"])],32)])])}}});export{E as default};
//# sourceMappingURL=Unauthenticated-DtcIAes-.js.map
