PageSourceSearch

https://club.touchtight.com/assets/SignUpSimplified-8cLJYZYP.js

js touchtight.com collected 2026-09-24 13:36:01 UTC 9,398 bytes, 1 lines download raw bytes

1import{a as g,j as e}from"./react-vendor-DJtAp8P_.js";import{c as Q,d as Y,u as Z}from"./index.esm-M6qXUo6E.js";import{f as X,h as ee,g as te,j as ae,E as re,u as se,T as ne,bN as oe,bZ as O,eP as ie,eQ as le,ep as ce,c0 as de,c1 as z,bI as ue,ac as pe,N as me,$ as k}from"./index-D7JOLfRZ.js";import"./swiper-react-BdHqbMUq.js";import{T as F}from"./Search-DtNbnsKK.js";import{B as he}from"./Button-C12sdXE_.js";import"./query-C7Xvvnmk.js";import{bN as xe}from"./mutation-CBAS9dQ5.js";import"./dayjs-CeefjyDY.js";import"./moment-Bj79pgB5.js";import{O as ge}from"./OAuthButtons-DkemprrG.js";import"./SessionPlannerMobile-btstsT3g.js";import{T as fe}from"./TouchTightHeader-DeIP1zMU.js";import{u as we,I as ye,r as be}from"./useOAuthSignupCompletion-B_BWXT9V.js";import{g as Se}from"./useBetterAuth-D-O8sKpv.js";import{T as je}from"./TrailSlider-vtkY_jWA.js";import{u as Ce,z as o,E as w,T as m,c5 as A,w as De}from"./mui-DM4FB6Od.js";import{n as Pe}from"./apollo-WxVwhmyD.js";import"./_baseClone-CI_UATaE.js";import"./_baseAssignValue-DA5RZPFC.js";import"./cloneDeep-DBd8ERDR.js";import"./mui-styles-Cs1eTw1A.js";import"./babel-helpers-GYAhpWPp.js";import"./imageOptimization-zUL1CBPb.js";import"./Modal-BMf2ZRZ1.js";import"./lodash-CKgJFN-2.js";import"./merge-BSbDH-s2.js";import"./isArrayLikeObject-BWZNxdtJ.js";import"./map-DazS0jXn.js";import"./browser-CbB-A17s.js";import"./hello-pangea-dnd-V9uYMV7h.js";import"./some-DWTvIxlZ.js";import"./_baseIndexOf-DqPIyCu4.js";import"./values-KC-0YRfW.js";import"./index-DCj5Y0Ve.js";import"./_baseDifference-DAp4QVb4.js";import"./_arrayIncludes-Ck-iFXGO.js";import"./omit-BVrVjzv1.js";import"./index-DH6i3Hvs.js";import"./mui-x-YwRs-dk2.js";import"./s3FileHandler-C17YuASz.js";import"./_baseUniq-CmchZ_xr.js";import"./compact-DZdspzxW.js";import"./Apple-CWQbj0rv.js";import"./LogoDark-BynYVOdd.js";import"./compass-O0N19w0X.js";import"./auth-CD706yVH.js";try{let a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},y=new a.Error().stack;y&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[y]="ade950a9-6451-4e7c-843b-4b4fc38efeb6",a._sentryDebugIdIdentifier="sentry-dbid-ade950a9-6451-4e7c-843b-4b4fc38efeb6")}catch{}const f={container:{flexDirection:{xs:"row",md:"row"},minHeight:"100vh"},button:{height:"55px"},heading:{fontSize:{xs:"24px",md:"32px"},lineHeight:{xs:"32px",md:"48px"},color:"text.primary",fontWeight:700}},bt=()=>{var _,N;const{t:a}=X("auth"),y=ee(),D=te(),b=ae(),B=re(),l=se(t=>t.register),[v]=ne(),{handleSignUpWithMetadata:M,loading:W}=Se(),{data:i,isPending:T}=oe(),{oauthProcessing:L}=we(),[R]=Pe(xe),[H,P]=g.useState(!1),[E,q]=g.useState(!1),[S,K]=g.useState(null),U=Ce(t=>t.breakpoints.down("md")),V=g.useMemo(()=>{var t,n,s;if(T||!(i!=null&&i.user)||(t=i==null?void 0:i.user)!=null&&t.club_id)return!1;try{const x=sessionStorage.getItem(O);if(!x)return!1;const u=JSON.parse(x);return(u==null?void 0:u.flow)==="signUpWithSocial"&&!!((s=(n=u==null?void 0:u.registerData)==null?void 0:n.plan)!=null&&s.planId)}catch{return!1}},[T,(_=i==null?void 0:i.user)==null?void 0:_.id,(N=i==null?void 0:i.user)==null?void 0:N.club_id]),j=new URLSearchParams(D.search).get("plan"),h=j&&ie(j);let C=null,c=null,p=null,d=null;h&&(C=le(j),c=C.planId,p=C.userCount,d=C.duration);const $=Q({email:Y().trim().required(a("emailRequired")).email(a("emailInvalid")),password:Y().required(a("passwordRequired")).matches(ce,a("passwordComplexity"))}),r=Z({initialValues:{email:"",password:""},validationSchema:$,onSubmit:async t=>{const n={clubName:"Club Name",seasonStartDate:new Date().getTime(),seasonEndDate:new Date().setFullYear(new Date().getFullYear()+1),primaryColor:"#292F4C",contrastColor:"#637381",flow:"getStarted"},s=await M({name:t.email.trim().split("@")[0],email:t.email.trim(),password:t.password,metadata:n});de({event:"register"}),s.success&&s.data&&(q(!0),K(s.data.id),b(z({email:t.email.trim(),password:t.password,userId:s.data.id})),b(ue(s.data)),s.data.clubDetails&&b(pe(s.data.clubDetails)))}});g.useEffect(()=>{if(!E||!S)return;(async()=>{var n;try{if(B.capture(me.DUGOUT_ADDED_CLUB,{customData:{email:r.values.email,userId:S,clubName:"Club Name",seasonStartDate:k(new Date().getTime(),"DD/MM/YYYY"),seasonEndDate:k(new Date().setFullYear(new Date().getFullYear()+1),"DD/MM/YYYY"),active:!0,createdAt:k(null,"DD/MM/YYYY"),planName:h&&c?c==="1"?"Starter":((n=l
1==null?void 0:l.plan)==null?void 0:n.title)||"Unknown":"Starter",planDuration:h&&d?d==="yearly"?"Annual":"Monthly":"Unknown",signupFlow:(l==null?void 0:l.flow)||"getStarted",lifetimeValue:0,totalPayments:0,teamAdded:"N",playersAdded:"N"}}),h&&c&&p&&d){P(!0);const s=await R({variables:{planId:parseInt(c),duration:d==="yearly"?"year":"month",userCount:parseInt(p),userId:S}}),{success:x,data:u,message:J}=s.data.createCheckoutSession;x&&u?be(u.url):(v({msg:J||"Failed to create checkout session",variant:"error"}),P(!1))}else y("/pricing")}catch(s){console.error("Checkout error:",s),v({msg:"An error occurred. Please try again.",variant:"error"}),P(!1)}})()},[E,S,h,c,p,d]),g.useEffect(()=>{const n=new URLSearchParams(window.location.search).get("join_club_token");(l==null?void 0:l.flow)===""&&!n&&b(z({flow:"getStarted"}))},[l]);const G=t=>{const x={returnPath:`${D.pathname}${D.search}`,flow:"signUpWithSocial",provider:t,registerData:{flow:"getStarted",plan:h&&c&&p&&d?{id:c,planId:c,userCount:p,duration:d,subscriptionCode:j}:{},duration:d||"",userCount:p!=null?String(p):"",email:"",password:""}};sessionStorage.setItem(O,JSON.stringify(x))},I=W||H||L||V;return e.jsxs(o,{container:!0,sx:f.container,children:[e.jsx(ye,{}),e.jsx(o,{size:{md:6,lg:7},children:e.jsx(o,{container:!0,px:{xs:3,md:12},py:{xs:3,md:3},gap:{xs:2,md:3},height:"100%",children:e.jsxs(w,{height:"100%",width:"100%",children:[e.jsx(fe,{}),e.jsx(o,{container:!0,width:{xs:"100%",sm:"445px"},height:"100%",children:e.jsx(o,{container:!0,flex:1,direction:"column",justifyContent:"center",children:e.jsxs(o,{container:!0,direction:"column",gap:{xs:2.5,md:3},children:[e.jsx(w,{sx:{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:1,mb:1},children:(h?[{label:a("stepChoosePlan"),completed:!0},{label:a("stepCreateAccount"),active:!0},{label:a("stepPayment"),upcoming:!0}]:[{label:a("stepCreateAccount"),active:!0},{label:a("stepChoosePlan"),upcoming:!0},{label:a("stepPayment"),upcoming:!0}]).map((t,n)=>e.jsxs(w,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(w,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(m,{sx:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:600,backgroundColor:t.active?"primary.main":t.completed?"success.main":"action.disabledBackground",color:t.active||t.completed?"common.white":"text.disabled"},children:t.completed?"✓":n+1}),e.jsx(m,{fontSize:{xs:"11px",sm:"12px"},fontWeight:t.active?600:400,color:t.active?"text.primary":"text.disabled",children:t.label})]}),n<2&&e.jsx(w,{sx:{display:{xs:"none",sm:"block"},width:24,height:1,backgroundColor:"divider"}})]},t.label))}),e.jsxs(o,{container:!0,gap:.5,justifyContent:{xs:"center",md:"flex-start"},children:[e.jsx(m,{sx:{...f.heading,textAlign:{xs:"center",md:"left"},width:"100%"},children:a("welcomeTitle")}),e.jsx(m,{fontSize:{xs:"12px",sm:"13px",md:"14px"},color:"text.secondary",fontWeight:600,textAlign:{xs:"center",md:"left"},sx:{whiteSpace:{xs:"normal",sm:"nowrap"}},children:a("welcomeSubtitle")})]}),e.jsx(o,{container:!0,justifyContent:{xs:"center",md:"flex-start"},alignItems:"center",children:e.jsxs(m,{fontSize:"13px",color:"text.secondary",children:[a("alreadyHaveAccount")," ",e.jsx(A,{href:"/login",sx:f.linkText,children:a("logIn")})]})}),e.jsx(o,{container:!0,direction:"column",children:e.jsx(ge,{variant:"signup",disabled:I,onBeforeOAuth:G,size:12})}),e.jsx(o,{children:e.jsx(De,{sx:{my:1},children:e.jsx(m,{fontSize:"14px",color:"textSecondary",children:a("or")})})}),e.jsx(o,{size:12,children:e.jsx(F,{name:"email",label:a("email"),autoFocus:!0,value:r.values.email,error:r.touched.email&&!!r.errors.email,helperText:r.touched.email&&r.errors.email,handleChange:r.handleChange,InputProps:{onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),r.submitForm())}}})}),e.jsx(o,{size:12,children:e.jsx(F,{name:"password",label:a("password"),type:"password",autoComplete:"new-password",value:r.values.password,error:r.touched.password&&!!r.errors.password,helperText:r.touched.password&&r.errors.password,handleChange:r.handleChange,InputProps:{onKeyDown:t=>
1{t.key==="Enter"&&(t.preventDefault(),r.submitForm())}}})}),e.jsx(he,{type:"submit",text:a(I?"creatingAccount":"getStartedButton"),onClick:r.handleSubmit,disabled:I,fullWidth:!0,customStyles:f.button}),e.jsx(m,{fontSize:"12px",color:"text.disabled",textAlign:"center",children:a("trustedByCoaches")}),e.jsxs(m,{fontSize:{xs:"10px",md:"12px"},lineHeight:"18px",textAlign:"center",sx:{whiteSpace:{xs:"normal",sm:"nowrap"}},children:[a("byProceedingYouAgree")," ",e.jsx(A,{href:"/terms-and-conditions",target:"_blank",sx:f.linkText,children:a("termsOfService")})," ",a("andConjunction")," ",e.jsx(A,{href:"/privacy-policy",target:"_blank",sx:f.linkText,children:a("privacyPolicy")}),"."]})]})})})]})})}),!U&&e.jsx(o,{size:{md:6,lg:5},width:"100vw",justifyContent:"flex-end",children:e.jsx(je,{isMobile:U})})]})};export{bt 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.