1import{r as l,j as e,L as N}from"./vendor-react-CxPMMIsh.js";import{$ as y,s as h,u as d}from"./index-CCrgG9IM.js";import{B as m}from"./button-BMKHWBF3.js";import{L as p,I as x}from"./label-Bd7ioGWa.js";import{a as g,m as f}from"./auth-errors-iBGudzib.js";import{u as k}from"./vendor-i18n-JarRYShB.js";import{E,a as I}from"./vendor-icons-CRqowDKK.js";import"./vendor-query-CDOFNuNk.js";import"./vendor-posthog-D7lzUwA9.js";import"./vendor-helmet-BddiuCch.js";import"./vendor-supabase-oA5cwLJd.js";import"./vendor-radix-DXT-P5oj.js";import"./vendor-utils-CbK4XRml.js";function G(){const{t:s}=k(),[n,b]=l.useState(""),[c,j]=l.useState(""),[r,o]=l.useState(!1),[i,w]=l.useState(!1),v=async t=>{t.preventDefault(),o(!0);try{const{error:a}=await h.auth.signInWithPassword({email:n,password:c});if(a)throw a;d.success(s("auth.loginSuccess"))}catch(a){d.error(s(g(f(a,{context:"login"}))))}finally{o(!1)}},u=async t=>{o(!0);try{const{error:a}=await h.auth.signInWithOAuth({provider:t,options:{redirectTo:`${window.location.origin}/auth/callback`}});if(a)throw a}catch(a){d.error(s(g(f(a,{context:"oauth"}))))}finally{o(!1)}};return e.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:[e.jsx(y,{}),e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/kept-logo-dark.png",alt:"Kept",className:"h-16 w-auto mx-auto mb-2 block dark:hidden"}),e.jsx("img",{src:"/kept-logo-light.png",alt:"Kept",className:"h-16 w-auto mx-auto mb-2 hidden dark:block"}),e.jsx("p",{className:"text-foreground/60",children:"clip it. keep it. remember it."})]}),e.jsxs("div",{className:"bg-card rounded-lg p-8 border border-border",children:[e.jsxs("form",{onSubmit:v,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(p,{htmlFor:"email",children:s("auth.email")}),e.jsx(x,{id:"email",type:"email",placeholder:"[email protected]",value:n,onChange:t=>b(t.target.value),disabled:r,className:"mt-2"})]}),e.jsxs("div",{children:[e.jsx(p,{htmlFor:"password",children:s("auth.password")}),e.jsxs("div",{className:"relative mt-2",children:[e.jsx(x,{id:"password",type:i?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:c,onChange:t=>j(t.target.value),disabled:r}),e.jsx("button",{type:"button",onClick:()=>w(!i),className:"absolute right-3 top-1/2 -translate-y-1/2 text-foreground/60 hover:text-foreground","aria-label":s(i?"auth.hidePassword":"auth.showPassword"),children:i?e.jsx(E,{className:"w-4 h-4"}):e.jsx(I,{className:"w-4 h-4"})})]})]}),e.jsx(m,{type:"submit",className:"w-full",disabled:r||!n||!c,children:s(r?"auth.signingIn":"auth.signIn")})]}),e.jsxs("div",{className:"my-6 relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-2 bg-card text-foreground/60",children:s("auth.or")})})]}),e.jsx(m,{type:"button",variant:"outline",className:"w-full mb-3",onClick:()=>u("google"),disabled:r,children:s("auth.signInWithGoogle")}),e.jsx(m,{type:"button",variant:"outline",className:"w-full",onClick:()=>u("apple"),disabled:r,children:s("auth.signInWithApple")}),e.jsxs("div",{className:"mt-6 text-center text-sm text-foreground/60",children:[s("auth.noAccount")," ",e.jsx(N,{to:"/auth/signup",className:"text-primary hover:underline",children:s("auth.signUp")})]})]})]})]})}export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.