PageSourceSearch

https://salesgeneration.ai/assets/Login-CcZKFPoX.js

js salesgeneration.ai collected 2026-10-05 12:59:07 UTC 4,285 bytes, 2 lines download raw bytes

1import{q as y,r,j as e,N as w,s as f,C as k,a as S,v as u,w as C,x as E,y as L,I as T,z as I,B as A,M as D,D as W}from"./index-BuTGMnCr.js";function _(i){const l=i.indexOf("@");if(l<0)return"invalid";const o=i.slice(l+1).toLowerCase().trim();if(!o)return"invalid";try{return btoa(o).replace(/=+$/,"")}catch{return"invalid"}}const q=()=>{const{signIn:i,session:l,isLoading:o}=y(),[a,b]=r.useState(""),[c,m]=r.useState(!1),[x,h]=r.useState(null),[g,n]=r.useState(null),[d,p]=r.useState(null);if(l){let t=null;try{t=window.localStorage.getItem("portal_next"),window.localStorage.removeItem("portal_next")}catch{}const s=t&&t.startsWith("/")&&!t.startsWith("//")?t:null;return e.jsx(w,{to:s??"/dashboard",replace:!0})}if(o)return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-sg-ink px-4 py-16",children:e.jsx(f,{className:"h-5 w-5 animate-spin text-white/50","aria-hidden":!0})});const j=async t=>{if(t.preventDefault(),!(!a||c)){if(u&&!d){n("Please complete the verification challenge.");return}m(!0),n(null);try{W.capture("signup_started",{email_domain:_(a.trim())})}catch{}try{const s=await i(a.trim(),d??void 0);if(!s.ok){n(s.error??"Couldn't send the link. Try again.");return}h(a.trim())}catch(s){const N=s instanceof Error?s.message:"Unknown error";n(N)}finally{m(!1)}}},v=()=>{h(null),n(null)};return e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-sg-ink px-4 py-16",children:[e.jsx("div",{"aria-hidden":"true",className:"absolute inset-0",style:{background:"radial-gradient(900px 500px at 78% -10%, rgba(0,129,255,0.18), transparent 60%), radial-gradient(600px 300px at 12% 108%, rgba(0,129,255,0.08), transparent 60%)"}}),e.jsxs("div",{className:"relative flex w-full max-w-md flex-col items-center",children:[e.jsx("img",{src:"/salesgen-horizontal-white.svg",alt:"SalesGeneration.ai",className:"mb-8 h-8 w-auto"}),e.jsx(k,{className:"w-full rounded-[22px] border-0 bg-white shadow-2xl",children:e.jsx(S,{className:"p-8",children:x?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-2 text-center",children:[e.jsx("span",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-sg-blue-light",children:e.jsx(D,{className:"h-5 w-5 text-sg-blue","aria-hidden":!0})}),e.jsx("h1",{className:"font-poppins text-lg font-bold text-sg-dark",children:"Check your email"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a link to ",x,". Click it to sign in."]}),e.jsx("button",{type:"button",onClick:v,className:"mt-2 text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:"Send another"})]}):e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{className:"inline-flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-sg-blue",children:[e.jsx("span",{className:"inline-block w-[18px] h-[1.5px] rounded bg-sg-blue","aria-hidden":"true"}),"Client portal"]}),e.jsx("h1",{className:"font-poppins text-[22px] font-bold tracking-tight text-sg-dark",children:"Sign in to your portal"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your email and we'll send a magic link."})]}),g&&e.jsx(C,{variant:"destructive",children:e.jsxs(E,{children:["We couldn't send the link. ",g]})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(L,{htmlFor:"login-email",children:"Email"}),e.jsx(T,{id:"login-email",type:"email",autoComplete:"email",autoFocus:!0,required:!0,placeholder:"[email protected]",value:a,onChange:t=>b(t.target.value),disabled:c})]}),u&&e.jsx(I,{onVerify:t=>{p(t),n(null)},onExpire:()=>p(null)}),e.jsx(A,{type:"submit",className:"w-full rounded-xl bg-sg-blue py-6 text-base font-semibold text-white hover:bg-sg-blue-dark",disabled:c||!a||u&&!d,children:c?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":!0}),"Sending link…"]}):"Send magic link"}),e.jsx("p",{className:"pt-2 text-center text-xs text-muted-foreground",children:"Need access? Contact your account manager."})]})})})]})]})};export{q as default};
2//# sourceMappingURL=Login-CcZKFPoX.js.map

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.