PageSourceSearch

https://app.thehoopsgeek.com/dashboard/assets/_auth.dashboard.get_started._step-B3O2XStM.js

js thehoopsgeek.com collected 2026-09-24 22:47:29 UTC 10,575 bytes, 2 lines download raw bytes

1import{e0 as ce,en as ue,e7 as me,e9 as he,ek as pe,ea as fe,P as w,db as t,dc as o,c as E,h as ge,j as P,W as z,a8 as J}from"./index-CmSfgMPc.js";import{aP as xe,aZ as ye,b1 as c,e as s,m as A,p as X,aE as l,A as be,a4 as ve,ay as Z,g as _}from"./ui-u4xJzAJX.js";import{A as Se}from"./ArrowBack-DW5Rw6nZ.js";import{P as W}from"./Page-DJs2_DnW.js";import{c as Ie}from"./reduxUser-CESS5MOS.js";import{T as we}from"./TeamAvatar-B26t3vgX.js";import{U as ze}from"./UppyProfilePictureDashboard-2_D0YH4R.js";import"./media-UejkmJrh.js";import"./editor-WYCba1gG.js";import"./auth-CAQqEDmo.js";import"./redux-toolkit.modern-C_3cW4ZS.js";import"./createAvatar-CgGTnP9k.js";import"./Avatar-DXzv_PDd.js";import"./uppy_dashboard-DBRda8Tb.js";import"./debounce-EtspMjWp.js";import"./style.min-2_hb6s1z.js";import"./index-uQK8_yPD.js";import"./RateLimitedQueue-DF6JuYH4.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="2a7ab769-204a-4a54-b3ea-5de1a0356709",r._sentryDebugIdIdentifier="sentry-dbid-2a7ab769-204a-4a54-b3ea-5de1a0356709")}catch{}})();const _e=xe(ye.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})),ke=5e3,j=800,b=[{id:"organization",title:"Name your organization"},{id:"team",title:"Name your team and add a profile picture"},{id:"invite",title:"Add your first players"}];function Ce(r){const e=J.c(11),{currentStep:u}=r;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={display:"flex",gap:1,mb:2},e[0]=p):p=e[0];let m;e[1]!==u?(m=b.map((k,C)=>t(s,{sx:D=>({flex:1,height:4,borderRadius:2,transition:"background-color 0.2s ease",backgroundColor:C+1<=u?D.palette.primary.main:D.palette.primary.lighter})},k.id)),e[1]=u,e[2]=m):m=e[2];let n;e[3]!==m?(n=t(s,{sx:p,children:m}),e[3]=m,e[4]=n):n=e[4];let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g={color:"text.secondary"},e[5]=g):g=e[5];let h;e[6]!==u?(h=o(l,{variant:"body2",sx:g,children:["Step ",u," of ",b.length]}),e[6]=u,e[7]=h):h=e[7];let f;return e[8]!==n||e[9]!==h?(f=o(s,{children:[n,h]}),e[8]=n,e[9]=h,e[10]=f):f=e[10],f}function K(r){if(r==null||r===""||!/^[1-9]\d*$/.test(r))return null;const e=Number.parseInt(r,10);return e<1||e>b.length?null:e}function De(){var Y;const r=ce(),{enqueueSnackbar:e}=ue(),u=me(),{step:p}=he(),m=pe(),n=K(p),[g,h]=c.useState(""),[f,k]=c.useState(!1),[C,D]=c.useState(!1),[N,B]=c.useState(""),[Q,H]=c.useState(""),[U,ee]=c.useState(!1),[$,M]=c.useState(!1),[v,G]=c.useState(!1),[te,T]=c.useState(!1),S=fe({options:{refetchInterval:!1}}),F=Array.isArray((Y=S==null?void 0:S.data)==null?void 0:Y.data)?S.data.data:[],d=F.find(a=>(a==null?void 0:a.permission_name)==="EDIT_ORG"),i=F.find(a=>(a==null?void 0:a.permission_name)==="EDIT_TEAM"&&a.team_id);c.useEffect(()=>{i!=null&&i.team_id&&!m&&r(Ie(i.team_id))},[i==null?void 0:i.team_id,r,m]),c.useEffect(()=>{(async()=>{var I;if(!(!(d!=null&&d.organization_id)||C))try{const x=await z.get(`/organizations/${d.organization_id}`);h(((I=x==null?void 0:x.data)==null?void 0:I.name)||"")}catch{e("Could not load organization name",{variant:"error"})}finally{D(!0)}})()},[d==null?void 0:d.organization_id,C,e]),c.useEffect(()=>{(async()=>{var I,x;if(!(!(i!=null&&i.team_id)||U))try{const y=await z.get(`/teams/${i.team_id}`);B(((I=y==null?void 0:y.data)==null?void 0:I.name)||""),H(((x=y==null?void 0:y.data)==null?void 0:x.picture)||"")}catch{e("Could not load team details",{variant:"error"})}finally{ee(!0)}})()},[i==null?void 0:i.team_id,U,e]);const ae=!!(d!=null&&d.organization_id&&(i!=null&&i.team_id)),q=S.isLoading,L=!q&&!ae,{refetch:V}=S;if(c.useEffect(()=>{if(!L)return;const a=setInterval(()=>{V()},ke);return()=>clearInterval(a)},[L,V]),c.useEffect(()=>{K(p)===null&&u(`${w.welcomeOrganization}/1`,{replace:!0})},[p,u]),q)return t(W,{title:"Let's get started",children:t(s,{sx:{width:"100%",textAlign:"center",pt:"40vh"},children:t(A,{})})});if(L)return t(W,{title:"Let's get started",children:t(X,{maxWidth:!1,sx:{maxWidth:`${j}px !important`,mx:"auto",pt:1,pb:4},children:o(s,{sx:a=>({maxWidth:j,border:`1px solid ${a.palette.divider}`,borderRadius:2,backgroundColor:"background.paper",p:{xs:2.5,md:3.5}
1,boxShadow:"0 8px 24px rgba(15, 23, 42, 0.06)"}),children:[o(s,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:2},children:[t(l,{variant:"h4",children:"Getting things ready"}),t(A,{color:"info",size:20})]}),t(l,{variant:"body1",sx:{color:"text.secondary",mb:2},children:"Your organization and team are being created."}),t(be,{severity:"info",sx:{mb:2},children:"We check again every few seconds and will continue automatically."}),t(l,{variant:"body1",sx:{color:"text.secondary"},children:"Sometimes this can take a little longer. We will send you an email as soon as your account is ready."})]})})});if(n===null)return t(W,{title:"Let's get started",children:t(s,{sx:{width:"100%",textAlign:"center",pt:"40vh"},children:t(A,{})})});const ie=()=>{u(`${w.welcomeOrganization}/${n+1}`)},ne=()=>{u(`${w.welcomeOrganization}/${n-1}`)},R=g.trim(),O=N.trim(),re=async()=>{if(!R||!(d!=null&&d.organization_id))return!1;k(!0);try{return await z.put(`/organizations/${d.organization_id}`,{name:R}),!0}catch{return e("Could not save organization name",{variant:"error"}),!1}finally{k(!1)}},oe=async()=>{if(!O||!(i!=null&&i.team_id))return!1;M(!0);try{return await z.put(`/teams/${i.team_id}`,{name:O}),!0}catch{return e("Could not save team details",{variant:"error"}),!1}finally{M(!1)}},se=async a=>{if(i!=null&&i.team_id){G(!0);try{await z.put(`/teams/${i.team_id}`,{picture:a}),H(a),e("Team image updated",{variant:"success"})}catch{e("Could not update team image",{variant:"error"})}finally{G(!1),T(!1)}}},le=n===b.length,de=async()=>{n===1&&!await re()||n===2&&!await oe()||ie()};return t(W,{title:"Let's get started",children:t(X,{maxWidth:!1,sx:{maxWidth:`${j}px !important`,mx:"auto",pt:1,pb:4},children:o(s,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column"},children:[o(s,{sx:{mb:3},children:[t(l,{variant:"h3",sx:{mb:0},children:"Let's set up your account"}),t(l,{variant:"body1",sx:{color:"text.secondary"},children:"We created a new organization and team for you. Complete these 3 quick steps."})]}),o(ve,{elevation:0,sx:a=>({border:`1px solid ${a.palette.divider}`,borderRadius:2,backgroundColor:"background.paper",p:{xs:2.5,md:3.5},boxShadow:"0 8px 24px rgba(15, 23, 42, 0.06)"}),children:[t(Ce,{currentStep:n}),o(s,{sx:{pt:.5},children:[n===1&&o(E,{children:[t(l,{variant:"h5",sx:{mb:1},children:b[0].title}),t(s,{sx:{my:4,maxWidth:420},children:t(Z,{fullWidth:!0,size:"large",label:"Organization Name",value:g,onChange:a=>h(a.target.value)})})]}),n===2&&o(E,{children:[t(l,{variant:"h5",sx:{mb:1},children:b[1].title}),o(s,{sx:{my:2,maxWidth:720,display:"flex",flexDirection:"row",alignItems:"center",gap:2},children:[o(s,{sx:{flexShrink:0,width:96},children:[o(s,{role:"button",tabIndex:0,"aria-label":"Change team logo",onClick:()=>!v&&T(!0),onKeyDown:a=>{v||(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),T(!0))},sx:a=>({position:"relative",width:88,height:88,mx:"auto",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:`1px dashed ${a.palette.grey[50032]}`,cursor:v?"default":"pointer",opacity:v?.7:1,"&:hover .wizard-team-logo-overlay":{opacity:v?0:.72},"&:focus-visible":{outline:`2px solid ${a.palette.primary.main}`,outlineOffset:2}}),children:[t(we,{team:{name:N||"Team",picture:Q},sx:{width:72,height:72}}),o(s,{className:"wizard-team-logo-overlay",sx:a=>({position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"50%",color:"common.white",backgroundColor:"grey.900",opacity:0,transition:a.transitions.create("opacity",{easing:a.transitions.easing.easeInOut,duration:a.transitions.duration.shorter}),pointerEvents:"none"}),children:[t(ge,{icon:"ic:round-add-a-photo",sx:{width:22,height:22,mb:.25}}),t(l,{variant:"caption",sx:{px:.5,textAlign:"center",fontSize:10},children:"Update"})]})]}),t(l,{variant:"caption",sx:{display:"block",mt:1,color:"text.secondary",textAlign:"center"}})]}),t(Z,{fullWidth:!0,label:"Team Name",value:N,onChange:a=>B(a.target.value),sx:{flex:1,minWidth:0}})]})]}),n===3&&o(E,{children:[t(l,{variant:"h5",sx:{mb:1},children:b[2].title}),t(l,{variant:"body2",sx:{color:"text.secondary",mb:3},children:"Choose the option that fits your team best."}),o(s,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},alignItems:"stretch"},children:[o(s,{sx:a=>({display:"flex",flexDirection:"column",height:"100%",minHeight:0,border:`1px solid ${a.palette.divider}`,borderRadius:2,p:2,gap:2,backgroundColor:"rgba(0, 150, 136, 0.04)"}),children:[t(l,{variant:"subtitle1",sx:{fontWeight:700},children:"Add Team Members"}),t(l,{variant:"body2",sx:{color:"text.secondary",flex:1},children:"Add your coaches and players to the roster by name. You can send email invites or connect accounts later, whenever you're ready."}),t(_,{component:P,to:w.settings.teamRoster(i.team_id),variant:"contained",fullWidth:!0,sx:{boxShadow:0,"&:hover":{boxShadow:0}},children:"Go to Team Roster"})]}),o(s,{sx:a=>({display:"flex",flexDirection:"column",height:"100%",minHeight:0,border:`1px solid ${a.palette.divider}`,borderRadius:2,p:2,gap:2,backgroundColor:"rgba(0, 150, 136, 0.02)"}),children:[t(l,{variant:"subtitle1",sx:{fontWeight:700},children:"Create Reusable Invite Links"}),t(l,{variant:"body2",sx:{color:"text.secondary",flex:1},children:"Create one link and share it with your team. Best when inviting many players quickly."}),t(_,{component:P,to:`${w.settings.teamRoster(i.team_id)}?tab=links&modal=invite-link`,variant:"outlined",fullWidth:!0,sx:{boxShadow:0,"&:hover":{boxShadow:0}},children:"Create Reusable Invite Links"})]})]})]}),o(s,{sx:{display:"flex",justifyContent:"space-between",mt:4},children:[t(_,{startIcon:t(Se,{}),onClick:ne,disabled:n===1,children:"Back"}),le?t(_,{component:P,to:w.plays.plays,variant:"contained",children:"Finish"}):t(_,{onClick:de,variant:"contained",endIcon:n===1&&f||n===2&&$?null:t(_e,{}),disabled:n===1&&(!R||f)||n===2&&(!O||$||v),children:n===1&&f||n===2&&$?t(A,{size:18,color:"inherit"}):"Continue"})]})]})]}),t(ze,{onSuccess:se,teamId:i.team_id,refetch:()=>{},open:te,close:()=>T(!1)})]})})})}function Ve(){const r=J.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t(De,{}),r[0]=e):e=r[0],e}export{Ve as default};
2//# sourceMappingURL=_auth.dashboard.get_started._step-B3O2XStM.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.