PageSourceSearch

https://repsshield.com/assets/RegisterPage-B85NkDfH.js

js repsshield.com collected 2026-09-24 14:18:16 UTC 11,963 bytes, 1 lines download raw bytes

1import{ai as W,n as J,aj as Y,ak as X,al as Z,j as e,P as ee,C as se,Q as F,am as I,R as _,B as y,ac as j,N as ae,L as p,K as g,an as G,ao as H,g as te,ap as re,aq as ie,ar as u}from"./index-Byg2HWAE.js";import{u as ne,r as n}from"./vendor-Qgthw7N1.js";const oe=ie({firstName:u().min(1,"First name is required"),lastName:u().min(1,"Last name is required"),email:u().min(1,"Email is required").email("Please enter a valid email address"),password:u().min(6,"Password must be at least 6 characters"),confirmPassword:u(),recaptchaToken:u().optional()}).refine(c=>c.password===c.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]});function de(){const[,c]=ne(),[N,q]=n.useState(!1),[P,M]=n.useState(!1),[E,d]=n.useState(""),[v,S]=n.useState(!1),[l,b]=n.useState(!1),[x,$]=n.useState(null),[A,z]=n.useState(null),[k,B]=n.useState(null),D="6LdyvaorAAAAACV4Fsr2EadWDEICggtxuL2gjdI6",{isLoaded:L,error:f,executeRecaptcha:O}=W({siteKey:D,action:"SIGNUP"}),{data:C,isLoading:K}=J({queryKey:["/api/auth/user"],retry:!1,enabled:!l});if(!K&&(C!=null&&C.isAuthenticated))return c("/dashboard"),null;n.useEffect(()=>{const s=new URLSearchParams(window.location.search),r=s.get("error"),i=s.get("plan"),t=s.get("annualPrice");i&&($(i),t&&z(t));const m=s.get("redirect");if(m&&B(m),r&&(d({google_not_configured:"Google sign-in is currently unavailable. Please use email registration or try again later.",google_failed:"Google sign-in failed. This may be due to configuration issues. Please try again or contact support.",google_no_user:"Unable to retrieve your Google account information. Please try again.",google_callback_error:"There was an error completing Google sign-in. Please try again.",google:"Google sign-in was unsuccessful. Please try again."}[r]||"Authentication failed. Please try again."),window.history.replaceState({},document.title,window.location.pathname)),s.get("login")==="success"){b(!0);const o=new URL(window.location.href);o.searchParams.delete("login"),window.history.replaceState({},document.title,o.pathname+o.search),setTimeout(k==="checkout"&&x?async()=>{try{const w=window.location.origin,T=await Y({priceType:x,successUrl:`${w}/?payment=success`,cancelUrl:`${w}/pricing?payment=cancelled`});T.checkoutUrl?window.location.href=T.checkoutUrl:T.upgraded?window.location.href="/dashboard?payment=success":window.location.href="/pricing?error=checkout_failed"}catch(w){console.error("Checkout redirect error:",w),window.location.href="/pricing?error=checkout_failed"}}:()=>{c("/dashboard")},100)}},[c]);const a=X({resolver:re(oe),defaultValues:{firstName:"",lastName:"",email:"",password:"",confirmPassword:"",recaptchaToken:""}});n.useEffect(()=>{const r=new URLSearchParams(window.location.search).get("email");if(r){a.setValue("email",r);const i=new URL(window.location.href);i.searchParams.delete("email"),window.history.replaceState({},document.title,i.toString())}},[a]);const V=async s=>{var r;S(!0),d("");try{const i=await O();if(!i){console.error("🚨 REGISTER: reCAPTCHA failed",{recaptchaError:f}),d(f||"reCAPTCHA verification failed. Please try again."),S(!1);return}const t=localStorage.getItem("referralCode"),m={firstName:s.firstName,lastName:s.lastName,email:s.email,password:s.password,confirmPassword:s.confirmPassword,recaptchaToken:i,...t&&{referralCode:t}},h=await fetch("/api/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),credentials:"include"});if(h.ok){const o=await h.json();o.success?(b(!0),(r=o.tokens)!=null&&r.accessToken&&localStorage.setItem("accessToken",o.tokens.accessToken),localStorage.removeItem("referralCode"),setTimeout(()=>{c("/dashboard")},100)):d(o.message||"Registration failed")}else{const o=await h.json();d(o.message||"Registration failed. Please try again.")}}catch{d("Network error. Please check your connection and try again.")}finally{S(!1)}},Q=s=>{{b(!0),d(""),sessionStorage.setItem("oauthFlowInitiated","true");const r=document.createElement("link");r.rel="preload",r.href="/",r.as="document",document.head.appendChild(r);const i=Date.now();sessionStorage.setItem("oauthStartTime",i.toString());const t=new URLSearchParams;x&&(t.append("plan",x),A&&t.append("annualPrice",A)),k&&t.append("redirect",k);const m="https://repsshield.com",h=t.toString()?`${m}/api/auth/${s}?${t.toString()}`:`${m}/api/auth/${s}`;window.location.href=h}};n.useEffect(()=>{const s=r=>{const i=new URLSearchParams(window.location.search);if(i.has("login")||i.has("error")){const t=new URL(window.location.href);t.searchParams.delete("login"),t.searchParams.delete("error"),window.history.replaceState({},document.title,t.pathname+t.search)}};
1return window.addEventListener("popstate",s),()=>{window.removeEventListener("popstate",s)}},[]);const{show:R,hide:U}=Z();return n.useEffect(()=>{if(l){const s=R({message:"Creating your account...",subMessage:"Please wait while we set up your professional dashboard"});return()=>U(s)}},[l,R,U]),l?null:e.jsx(ee,{hideHeader:!0,hideEmailIntake:!0,hideFooter:!0,children:e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"transparent"},children:e.jsx(se,{className:"w-full max-w-5xl shadow-lg border border-gray-200",children:e.jsxs("div",{className:"grid md:grid-cols-2 min-h-[600px]",children:[e.jsx("div",{className:"flex flex-col items-center justify-center p-8 md:p-12 bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/30 dark:to-indigo-950/30",children:e.jsxs("div",{className:"text-center space-y-6 max-w-sm",children:[e.jsxs("div",{className:"mascot-container",children:[e.jsx("img",{src:"/repsshield-logo-full.png",alt:"REPSShield",className:"bouncing-mascot"}),e.jsx("div",{className:"mascot-shadow"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-800 dark:text-white leading-tight",children:"Welcome to the first day of your new financial journey!"}),e.jsxs("p",{className:"text-lg text-gray-700 dark:text-gray-200 font-medium",children:["Start your ",e.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold",children:"14-day free trial"})," today"]})]}),e.jsx("div",{className:"pt-4",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:["Already signed up?"," ",e.jsx("a",{href:"/login",className:"text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 font-medium underline",children:"Login to your account"})]})})]})}),e.jsxs("div",{className:"p-8 md:p-12 flex flex-col justify-center",children:[E&&e.jsxs(F,{variant:"destructive",className:"mb-6",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx(_,{children:E})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"space-y-3",children:e.jsxs(y,{variant:"outline",className:"w-full",onClick:()=>Q("google"),disabled:v||l,children:[l?e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",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"}),e.jsx("path",{fill:"#FBBC05",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"}),e.jsx("path",{fill:"#EA4335",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"})]}),l?"Redirecting...":"Continue with Google"]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx(ae,{className:"w-full"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-white dark:bg-gray-950 px-2 text-gray-500",children:"Or continue with email"})})]}),e.jsxs("form",{onSubmit:a.handleSubmit(V),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(p,{htmlFor:"signup-firstname",className:"text-sm font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"First Name"}),e.jsx(g,{id:"signup-firstname",placeholder:"Enter your first name",...a.register("firstName"),className:"mt-1"}),a.formState.errors.firstName&&e.jsx("p",{className:"text-sm text-red-500 mt-1",children:a.formState.errors.firstName.message})]}),e.jsxs("div",{children:[e.jsx(p,{htmlFor:"signup-lastname",className:"text-sm font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"Last Name"}),e.jsx(g,{id:"signup-lastname",placeholder:"Enter your last name",...a.register("lastName"),className:"mt-1"}),a.formState.errors.lastName&&e.jsx("p",{className:"text-sm text-red-500 mt-1",children:a.formState.errors.lastName.message})]})]}),e.jsxs("div",{children:[e.jsx(p,{htmlFor:"signup-email",className:"text-sm font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"Email Address"}),e.jsx(g,{id:"signup-email",type:"email",placeholder:"Enter your email address",autoComplete:"email",...a.register("email"),className:"mt-1"}),a.formState.errors.email&&e.jsx("p",{className:"text-sm text-red-500 mt-1",children:a.formState.errors.email.message})]}),e.jsxs("div",{children:[e.jsx(p,{htmlFor:"signup-password",className:"text-sm font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"Password"}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx(g,{id:"signup-password",type:N?"text":"password",placeholder:"Create a password",...a.register("password")}),e.jsx(y,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>q(!N),children:N?e.jsx(G,{className:"h-4 w-4"}):e.jsx(H,{className:"h-4 w-4"})})]}),a.formState.errors.password&&e.jsx("p",{className:"text-sm text-red-500 mt-1",children:a.formState.errors.password.message})]}),e.jsxs("div",{children:[e.jsx(p,{htmlFor:"signup-confirm-password",className:"text-sm font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"Confirm Password"}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx(g,{id:"signup-confirm-password",type:P?"text":"password",placeholder:"Confirm your password",...a.register("confirmPassword")}),e.jsx(y,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>M(!P),children:P?e.jsx(G,{className:"h-4 w-4"}):e.jsx(H,{className:"h-4 w-4"})})]}),a.formState.errors.confirmPassword&&e.jsx("p",{className:"text-sm text-red-500 mt-1",children:a.formState.errors.confirmPassword.message})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 py-2",children:[f&&e.jsxs(F,{variant:"destructive",className:"mb-2",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsxs(_,{children:["reCAPTCHA Error: ",f]})]}),L?e.jsxs("div",{className:"flex items-center space-x-2 text-green-600",children:[e.jsx(te,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:"Protected by reCAPTCHA"})]}):e.jsxs("div",{className:"flex items-center space-x-2 text-gray-400",children:[e.jsx(j,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Loading security verification..."})]})]}),e.jsx(y,{type:"submit",className:"w-full bg-yellow-400 hover:bg-yellow-500 text-black font-medium py-3 mt-6",disabled:v||l||!L,children:v?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating Account..."]}):l?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}),"Redirecting..."]}):"GET STARTED"}),e.jsx("p",{className:"text-xs text-center text-gray-500 mt-4",children:"No credit card required. Cancel anytime."})]})]})]})]})})})})}export{de 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.