import{r as a,j as e}from"./markdown-9_JKOUHQ.js";import{B as g}from"./button-D8qrc3hb.js";import{u as f,I as i}from"./input-Dyxe5hqI.js";import{u as j}from"./index-Z_QI94Zg.js";import"./createLucideIcon-CsWFljth.js";import"./mermaid-C0IQv4mH.js";function I(){const{t:s}=f(),c=j(t=>t.login),[r,m]=a.useState(""),[o,h]=a.useState(""),[n,l]=a.useState(""),[u,d]=a.useState(!1),x=async t=>{t.preventDefault(),l(""),d(!0);try{await c(r,o)}catch(p){l(p.message||s("auth.loginFailed"))}finally{d(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:s("app.title")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("auth.signInPrompt")})]}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"username",className:"text-sm font-medium text-foreground",children:s("auth.username")}),e.jsx(i,{id:"username",type:"text",value:r,onChange:t=>m(t.target.value),placeholder:s("auth.usernamePlaceholder"),autoFocus:!0,required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"password",className:"text-sm font-medium text-foreground",children:s("auth.password")}),e.jsx(i,{id:"password",type:"password",value:o,onChange:t=>h(t.target.value),placeholder:s("auth.passwordPlaceholder"),required:!0})]}),n&&e.jsx("p",{className:"text-sm text-destructive",children:n}),e.jsx(g,{type:"submit",className:"w-full",disabled:u||!r||!o,children:s(u?"auth.signingIn":"auth.signIn")})]})]})})}export{I as LoginPage};
