PageSourceSearch

https://gradethread.com/assets/login-DUkMdGFc.js

js gradethread.com collected 2026-10-10 01:46:08 UTC 6,783 bytes, 1 lines download raw bytes

1import{n as q,q as K,k as a,j as e,L as y}from"./vendor-react-CowE5YCj.js";import{a as D,d as U,e as V,s as Y}from"./auth-CcWyxVus.js";import{S as $}from"./auth-identity-CIZ3whGj.js";import{c as J,a as Q,A as X}from"./auth-error-DrjZhUfo.js";import{c as Z,a as ee,t as se,R as k}from"./return-to-XehW0nDU.js";import{t as ae,x as re,y as te,v as ie,u as ne,g as x,w as oe,cd as I,c1 as g,ck as le,bW as de}from"./index-BwzqfZRD.js";import{T as ce,c as me}from"./password-policy-D_P3zMQ2.js";import{I as ue}from"./input-CLuxJVgs.js";import{P as pe,v as he}from"./validation-Chn9XLXp.js";import{L as f}from"./label-CGppZHlV.js";import{C as xe}from"./checkbox-1oSJhKQj.js";import{S as T}from"./separator-CjAYCDR8.js";import{F}from"./form-feedback-pkrNDt8r.js";import{t as R}from"./toast-error-BDOwNR3J.js";import{S as ge}from"./seo-Bc6Qy8zj.js";import"./vendor-query-VEVGS95H.js";import"./vendor-supabase-Baxrk5fR.js";import"./eye-off-Z5q9PGX6.js";import"./eye-CycfWzsj.js";import"./index-clxdtWr2.js";import"./check-D88AcPnj.js";import"./index-RUkvxMya.js";import"./index-BbR4OEL_.js";import"./index-B0e7tBq0.js";import"./index-CBNLYksV.js";import"./index-Da-lsaRy.js";import"./circle-alert-O2pEuqlX.js";import"./friendly-error-BmcA0avy.js";function De(){const A=q(),[c]=K(),j=c.get("invite"),o=Z(c.get("next")),[m,_]=a.useState(c.get("email")??""),[u,G]=a.useState(""),[n,v]=a.useState(!1),[w,S]=a.useState(null),[r,l]=a.useState(null),[t,p]=a.useState({}),[b,h]=a.useState(null),[L,M]=a.useState(0),[d,P]=a.useState(!0);async function W(s){s.preventDefault(),S(null);const i={email:he(m),password:u?void 0:"Password is required"};if(p(i),i.email||i.password){document.getElementById(i.email?"email":"password")?.focus();return}if(me&&!b){I.error("Please complete the verification challenge.");return}v(!0);try{g(d),await U(m,u,b??void 0),A(j?`/accept-invite?token=${j}`:o??se()??"/dashboard")}catch(H){const E=J(H),C=E==="rate_limit"?Q:E==="network"?X:$;S(C),I.error(C),h(null),M(O=>O+1)}finally{v(!1)}}function N(){o?le(k,o,"session"):de(k,"session")}async function z(){if(!(r||n)){l("google");try{g(d),N(),await V()}catch(s){R(s,"Failed to sign in with Google"),l(null)}}}async function B(){if(!(r||n)){l("apple");try{g(d),N(),await Y()}catch(s){R(s,"Failed to sign in with Apple"),l(null)}}}return e.jsxs(ae,{children:[e.jsx(ge,{title:"Sign in",description:"Sign in to GradeThread to grade garments, manage your inventory and publish listings."}),e.jsxs(re,{className:"text-center",children:[e.jsx(te,{className:"text-2xl",children:"Welcome back"}),e.jsx(ie,{children:"Sign in to your GradeThread account"})]}),e.jsxs(ne,{children:[e.jsxs("form",{onSubmit:W,className:"space-y-4",noValidate:!0,children:[w&&e.jsx("div",{role:"alert",className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:w}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"email",children:"Email"}),e.jsx(ue,{id:"email",type:"email",autoComplete:"email",placeholder:"[email protected]",value:m,onChange:s=>{_(s.target.value),t.email&&p(i=>({...i,email:void 0}))},required:!0,"aria-invalid":!!t.email,"aria-describedby":t.email?"email-error":void 0}),e.jsx(F,{id:"email-error",children:t.email})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(f,{htmlFor:"password",children:"Password"}),e.jsx(y,{to:"/auth/reset-password",className:"text-xs text-brand-red-text hover:underline",children:"Forgot password?"})]}),e.jsx(pe,{id:"password",autoComplete:"current-password",value:u,onChange:s=>{G(s.target.value),t.password&&p(i=>({...i,password:void 0}))},required:!0,"aria-invalid":!!t.password,"aria-describedby":t.password?"password-error":void 0}),e.jsx(F,{id:"password-error",children:t.password})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{id:"keep-signed-in",checked:d,onCheckedChange:s=>P(s===!0),disabled:n||r!==null}),e.jsxs(f,{htmlFor:"keep-signed-in",className:"text-sm font-normal text-muted-foreground",children:["Keep me signed in"," ",e.jsx("span",{className:"text-xs",children:"(uncheck on a shared device)"})]})]}),e.jsx(ce,{onVerify:h,onExpire:()=>h(null),resetSignal:L}),e.jsx(x,{type:"submit",className:"w-full",disabled:n||r!==null,children:n?"Signing in...":"Sign in"})]}),e.jsxs("div",{className:"my-4 flex items-center gap-3",children:[e.jsx(T,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx(T,{className:"flex-1"})]}),e.jsx(x,{variant:"outline",className:"w-full",onClick:z,disabled:n||r!==null,children:r==="google"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Redirecting…"]}):e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]})}),D&&e.jsx(x,{variant:"outline",className:"mt-3 w-full",onClick:B,disabled:n||r!==null,children:r==="apple"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"Redirecting…"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M17.05 12.04c-.03-2.6 2.13-3.85 2.22-3.91-1.21-1.77-3.1-2.01-3.77-2.04-1.6-.16-3.13.94-3.94.94-.81 0-2.07-.92-3.4-.9-1.75.03-3.36 1.02-4.26 2.58-1.82 3.16-.47 7.83 1.3 10.39.86 1.25 1.89 2.66 3.24 2.61 1.3-.05 1.79-.84 3.36-.84 1.57 0 2.01.84 3.39.81 1.4-.02 2.29-1.28 3.15-2.54.99-1.46 1.4-2.87 1.42-2.94-.03-.01-2.72-1.04-2.75-4.13-.03-2.58 2.11-3.81 2.21-3.88zM14.5 4.41c.72-.87 1.2-2.08 1.07-3.29-1.03.04-2.28.69-3.02 1.56-.66.77-1.24 2-1.09 3.18 1.15.09 2.32-.58 3.04-1.45z"})}),"Continue with Apple"]})})]}),e.jsx(oe,{className:"justify-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Don't have an account?"," ",e.jsx(y,{to:ee("/signup",o),className:"font-medium text-brand-red-text hover:underline",children:"Sign up"})]})})]})}export{De as LoginPage};

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.