PageSourceSearch

https://us.legacykeeper.app/assets/index-DUceEEI7.js

js legacykeeper.app collected 2026-10-06 18:09:11 UTC 4,779 bytes, 2 lines download raw bytes

1import{as as U,r as h,au as T,aH as R,av as F,_ as N,aw as A,ax as E,ay as C,j as e,az as D,A as I,o as w,aA as m,aB as u,aC as x,aD as f,I as y,aE as k,aI as _,ai as q,B,V as O,e as V,f as M,aJ as b,t as G,P as H,aG as z}from"./index-P6OegffF.js";import{E as J,D as Q}from"./data-region-DG8mKM28.js";import{L as K}from"./legal-links-CGbCXNSJ.js";import{s as W}from"./signUp-CkZAUXKj.js";import"./confirmSignUp-DdOv_CHU.js";function X({redirect:i,regionDetails:o}={}){const{t:s}=U(),[t,p]=h.useState(!1),[d,l]=h.useState(null),[j,c]=h.useState("signup"),[n,v]=h.useState(""),S=T({email:N().email({message:s("auth.errors.invalidEmail")}),firstName:N().min(1,{message:s("auth.errors.required")}),lastName:N().min(1,{message:s("auth.errors.required")}),dataRegion:F(["us","ca"]),isProfessional:R()}),P=A(o),r=E({resolver:C(S),reValidateMode:"onSubmit",defaultValues:{email:"",firstName:"",lastName:"",dataRegion:P,isProfessional:!1}});async function L(a){p(!0),l(null);try{const{nextStep:g}=await W({username:a.email,options:{userAttributes:{email:a.email,given_name:a.firstName,family_name:a.lastName,"custom:isProfessional":a.isProfessional.toString(),"custom:hasOnboarded":"false"},autoSignIn:{authFlowType:"USER_AUTH"}}});g.signUpStep==="CONFIRM_SIGN_UP"&&(v(a.email),c("verify"))}catch(g){l(g instanceof Error?g.message:"An error occurred during sign up")}finally{p(!1)}}return j==="verify"?e.jsx(J,{email:n,mode:"signup",onBack:()=>c("signup"),isLoading:t}):e.jsx(D,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(L),className:"space-y-6",children:[d&&e.jsx(I,{variant:"destructive",children:e.jsx(w,{children:d})}),e.jsx(m,{control:r.control,name:"dataRegion",render:({field:a})=>e.jsx(Q,{field:a,regionDetails:o,mode:"signup"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(m,{control:r.control,name:"firstName",render:({field:a})=>e.jsxs(u,{children:[e.jsx(x,{children:s("auth.signUp.firstNameLabel")}),e.jsx(f,{children:e.jsx(y,{id:"firstName",type:"text",placeholder:s("auth.signUp.firstNamePlaceholder"),required:!0,...a})})]})}),e.jsx(m,{control:r.control,name:"lastName",render:({field:a})=>e.jsxs(u,{children:[e.jsx(x,{children:s("auth.signUp.lastNameLabel")}),e.jsx(f,{children:e.jsx(y,{id:"lastName",type:"text",placeholder:s("auth.signUp.lastNamePlaceholder"),...a})})]})})]}),e.jsx(m,{control:r.control,name:"email",render:({field:a})=>e.jsxs(u,{children:[e.jsx(x,{children:s("auth.common.emailLabel")}),e.jsx(f,{children:e.jsx(y,{id:"email",type:"email",placeholder:s("auth.common.emailPlaceholder"),required:!0,...a})}),e.jsx(k,{})]})}),e.jsx(m,{control:r.control,name:"isProfessional",render:()=>e.jsxs(u,{children:[e.jsx(x,{children:s("auth.signUp.isProfessionalLabel")}),e.jsx(_,{children:s("auth.signUp.isProfessionalDescription")}),e.jsx(m,{control:r.control,name:"isProfessional",render:({field:a})=>e.jsxs(u,{className:"flex flex-row items-center gap-2",children:[e.jsx(f,{children:e.jsx(q,{id:"isProfessional",checked:a.value,onCheckedChange:a.onChange})}),e.jsx(x,{className:"text-sm font-normal",children:s("auth.signUp.isProfessionalLabel")})]})})]})}),e.jsx(B,{type:"submit",className:"w-full",disabled:t,children:s(t?"auth.common.loading":"auth.signUp.signUpButton")}),e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:[s("auth.signUp.existingAccountText")," ",e.jsx(O,{to:"/sign-in",search:i?{redirect:i}:{},className:"text-primary hover:underline underline-offset-4",children:s("auth.signUp.signInLink")})]}),e.jsx(K,{termsText:s("auth.common.termsText"),termsOfService:s("common.termsOfService"),privacyPolicy:s("common.privacyPolicy"),dataDeletionAgreement:s("common.dataDeletionAgreement"),andText:s("auth.common.and")})]})})}function ae(){const{isAuthenticated:i,isLoading:o}=V(),s=M(),t=b.useSearch(),{regionDetails:p}=b.useLoaderData(),{data:d,isLoading:l}=G.users.me.useQuery(void 0,{enabled:i});return h.useEffect(()=>{if(!o&&!l&&i){const j=d?.userType==="professional",c=t.redirect;let n;j?n="/sign-up/pro":c&&c!=="/sign-up/pro"?n=c:n="/personal/dashboard",s({to:n,search:n==="/sign-up/pro"?{redirect:void 0}:void 0})}},[i,o,l,d?.userType,s,t.redirect]),o||i&&l?e.jsx(H,{}):i?null:e.jsxs("div",{className:"grid min-h-svh lg:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-8 p-6 md:p-10 items-center justify-center",children:[e.jsx("div",{className:"",children:e.jsx(z,{width:"max-w-[300px] max-h-[300px]"})}),e.jsx("div",{className:"w-full max-w-xs",children:e.jsx(X,{redirect:t.redirect,regionDetail
1s:p})})]}),e.jsx("div",{className:"bg-sky-100 p-12 flex items-center justify-center",children:e.jsx("img",{src:"/images/login_illustration.svg",alt:"Illustration",className:"object-contain"})})]})}export{ae as component};
2//# sourceMappingURL=index-DUceEEI7.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.