1import{a8 as B,e4 as _e,dQ as ke,dW as at,el as $e,eb as st,e7 as Se,dR as Le,e0 as je,ek as Me,db as i,F,aT as et,dc as P,b5 as yn,W as Ce,P as A,de as rt,c as de,dV as Bt,ea as Nt,en as lt,j as Te,h as be,g as Oe,ec as ct,e6 as _n,dL as xn,e as De,H as me,ee as dt,dP as Sn,k as tt,N as ce,I as xe,R as Wt,cQ as vn,ef as wn,dg as Tn,a1 as In,ck as xt,aG as kn,aI as St,av as vt,aK as Cn,aB as En,ar as An,cB as Rn,bH as Pn,bU as On,bM as wt,al as Dn,ak as Hn,er as $n,dU as Ln,e2 as Mn,cH as Bn,bS as Nn,bG as Wn,aJ as zn,cC as Un,bN as Fn,aQ as Gn,bC as Kn,aY as qn,cE as Yn,aq as jn,q as Vn,d as Qn,em as Xn,o as Tt}from"./index-CmSfgMPc.js";import{b1 as M,e as L,aE as J,aH as pe,aj as re,g as ge,aD as We,b3 as ye,a8 as H,aP as Zn,aZ as Jn,a0 as we,v as He,m as ei,U as Ie,B as zt,X as Ve,d as ti,bd as ni,aC as ii,b as Ut,_ as oi,Y as Ft,Z as Gt,T as Kt,o as qt,a5 as ai,N as Yt,bf as si,w as It,p as ri,bb as li,A as ci,a4 as di,ah as ui}from"./ui-u4xJzAJX.js";import{u as jt}from"./useCollapseDrawer-DFJmlba0.js";import{c as Qe}from"./cssStyles-BNU5EK4d.js";import{c as Xe}from"./reduxUser-CESS5MOS.js";import{P as Vt}from"./PlaygroundSelect-C4Zms5eu.js";import{M as Qt}from"./MyAvatar-cR1nsHSO.js";import{c as Ke}from"./createAvatar-CgGTnP9k.js";import{A as Xt}from"./Avatar-DXzv_PDd.js";import{u as Zt,d as fi}from"./useIsPayingUserV2-1ea6Mwe4.js";import{u as pi}from"./useOrganizationDetails-BCi1Z1Ht.js";import{M as ut}from"./MenuPopover-BhhsVT9r.js";import{h as hi,e as mi,c as gi,u as bi,E as kt,a as yi,f as _i,i as xi,b as Si}from"./usePushNotifications-D3olkhYz.js";import{i as Jt,a as vi,t as wi,q as Ti,n as Ii}from"./typingStore-wCLXpn1r.js";import{u as ki}from"./useSetSelectedTeam-BNFgK-Wv.js";import{S as Ct}from"./Scrollbar-Cgp18_Bb.js";import{L as ft}from"./Label-CRbSig1w.js";import{b as en}from"./index-CN7p4I9l.js";import{u as Ci}from"./useDashboards-iUqOc-5S.js";import{u as Ei}from"./useTeamHubBadges-B2z18W-M.js";import{R as Ai}from"./reportsMeta-Bb5tLx_a.js";import{a as Ri}from"./conversationDraft-CtDzc5OA.js";import{L as Pi}from"./LoadingScreen-VbDC0Azj.js";import{u as Oi}from"./useSafeAreaInset-BvbIwqWm.js";import{u as Di}from"./UserMetaContext-BTaeNtT8.js";import{f as Hi}from"./fetch-DBwU5uzv.js";import"./media-UejkmJrh.js";import"./editor-WYCba1gG.js";import"./auth-CAQqEDmo.js";import"./redux-toolkit.modern-C_3cW4ZS.js";import"./TeamAvatar-B26t3vgX.js";import"./useInfiniteQuery-c1UMEWoN.js";import"./simplebar-react.esm-BEXqbx-c.js";import"./index-DTVaLiQt.js";import"./ScrollRootContext-D4rEBX8N.js";import"./useTeamTasks-8Pgjmlp6.js";import"./taskUtils-DL2c9PTH.js";import"./eventUtils-2hToJwnU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e806ae4d-e6ac-4d64-a550-d1d5ffadb12b",t._sentryDebugIdIdentifier="sentry-dbid-e806ae4d-e6ac-4d64-a550-d1d5ffadb12b")}catch{}})();function $i(t){const e=B.c(3),[n,a]=M.useState(!1),o=t;let l,s;return e[0]!==o?(l=()=>(window.onscroll=()=>{window.pageYOffset>o?a(!0):a(!1)},Li),s=[o],e[0]=o,e[1]=l,e[2]=s):(l=e[1],s=e[2]),M.useEffect(l,s),n}function Li(){window.onscroll=null}const Mi=ye("div")(({theme:t})=>({padding:t.spacing(2,2),borderRadius:t.shape.borderRadius,backgroundColor:t.palette.grey[50012],transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter}),"&:hover":{backgroundColor:t.palette.grey[50024]}})),tn=[A.plays.plays,A.plays.playbooks,A.rotations.rotations,A.uploads.videos,A.uploads.images,A.uploads.audio,A.user.account,A.practices.practicePlans,A.practices.drills];nt.propTypes={isCollapse:H.bool};function nt(t){var ne,le,ae,z,he;const e=B.c(66),{isCollapse:n}=t,a=M.useRef(null),[o,l]=M.useState(!1),s=_e(),{user:r,dbData:c}=ke(),d=r==null?void 0:r.db_user_id,f=Zt(),{goToStandardCheckout:u}=at(),b=$e(Bi),h=f.status==="NO"&&f.type==="FREE_USER"&&b===null&&!n;let p;e[0]!==d?(p=[d,"playCount"],e[0]=d,e[1]=p):p=e[1];const m=!!d&&h;let y;e[2]!==d?(y=async()=>{const{data:se}=await Ce.get(`/user/${d}/play_count`);return{data:se}},e[2]=d,e[3]=y):y=e[3];let v;e[4]!==p||e[5]!==m||e[6]!==y?(v={queryKey:p,enabled:m,queryFn:y},e[4]=p,e[5]=m,e[6]=y,e[7]=v):v=e[7];const w=st(v),C=Number((le=(ne=w.data)==null?void 0:ne.data)==null?void 0:le.count);let k;e[8]!==C?(k=Number.isFinite(C)?Math.min(Math.max(C,0),5):0,e[8]=C,e[9]=k):k=e[9];const _=k,g=Se(),S=Le();let T;e[10]!==((ae=S==null?void 0:S.data)==null?void 0:ae.data)?(T=((z=S==null?void 0:S.data)==null?void 0:z.data)??[],e[10
1]=(he=S==null?void 0:S.data)==null?void 0:he.data,e[11]=T):T=e[11];const I=T,E=je(),x=Me();let R;e[12]!==I.length?(R=()=>{I.length>0&&l(!0)},e[12]=I.length,e[13]=R):R=e[13];const $=n&&I.length>0?"visible":"hidden";let O;e[14]!==n?(O=n&&{bgcolor:"transparent"},e[14]=n,e[15]=O):O=e[15];let D;e[16]!==$||e[17]!==O?(D={overflow:$,...O},e[16]=$,e[17]=O,e[18]=D):D=e[18];const K=n?2:1,q=I.length>0&&"pointer";let N;e[19]!==K||e[20]!==q?(N={mx:-2,pl:2,pr:K,cursor:q,display:"flex",alignItems:"center",minWidth:0,boxSizing:"border-box"},e[19]=K,e[20]=q,e[21]=N):N=e[21];let W;e[22]===Symbol.for("react.memo_cache_sentinel")?(W={position:"relative",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},e[22]=W):W=e[22];let G;e[23]!==x?(G=x?i(Xt,{sx:{width:40,height:40,flexShrink:0},src:x.picture,alt:x==null?void 0:x.name,color:x!=null&&x.picture?"default":Ke(x.name).color,children:Ke(x.name).name}):i(Qt,{sx:{flexShrink:0}}),e[23]=x,e[24]=G):G=e[24];let Q;e[25]!==n||e[26]!==I.length?(Q=n&&I.length>0&&i(L,{sx:{position:"absolute",right:-12,bottom:-3,display:"inline-flex",color:"text.secondary",lineHeight:1,pointerEvents:"none"},children:i(F,{icon:et,style:{fontSize:16}})}),e[25]=n,e[26]=I.length,e[27]=Q):Q=e[27];let ee;e[28]!==G||e[29]!==Q?(ee=P(L,{sx:W,children:[G,Q]}),e[28]=G,e[29]=Q,e[30]=ee):ee=e[30];let j;e[31]!==(c==null?void 0:c.name)||e[32]!==n||e[33]!==x?(j=!n&&P(L,{sx:{ml:1.5,minWidth:0,flex:1,overflow:"hidden"},children:[i(J,{variant:"subtitle2",noWrap:!0,children:x?x.name:c==null?void 0:c.name}),i(J,{variant:"body2",noWrap:!0,sx:{color:"text.secondary"},children:x?x.role_name:"My Library"})]}),e[31]=c==null?void 0:c.name,e[32]=n,e[33]=x,e[34]=j):j=e[34];let te;e[35]!==n||e[36]!==I.length?(te=!n&&I.length>0&&i(L,{sx:{ml:1,flexShrink:0,display:"inline-flex",color:"text.secondary"},children:i(F,{icon:et,style:{fontSize:16}})}),e[35]=n,e[36]=I.length,e[37]=te):te=e[37];let U;e[38]!==N||e[39]!==ee||e[40]!==j||e[41]!==te?(U=P(L,{id:"team_select",ref:a,sx:N,children:[ee,j,te]}),e[38]=N,e[39]=ee,e[40]=j,e[41]=te,e[42]=U):U=e[42];let ie;e[43]!==u||e[44]!==_||e[45]!==w.isSuccess||e[46]!==h?(ie=h&&P(L,{sx:{minWidth:200,borderTop:"1px solid",pt:2,mt:2,borderColor:"grey.300"},children:[P(L,{sx:{display:"flex",alignItems:"center",mb:1},children:[P(L,{sx:{mr:1,width:100,borderRadius:1,overflow:"hidden",display:"flex",height:18,border:1,borderColor:"grey.400",background:"white"},children:[i(L,{sx:se=>({bgcolor:_<5?pe(se.palette.success.main,.7):pe(se.palette.error.main,.7),flex:_})}),i(L,{sx:{flex:5-_}})]}),P(J,{variant:"subtitle2",sx:{fontSize:13},children:[w.isSuccess?_:"â"," of 5 plays"]})]}),P(re,{direction:"row",sx:{alignItems:"center"},children:[i(ge,{onClick:se=>{se.stopPropagation(),se.preventDefault(),u({purchaseIntent:"first_purchase"})},size:"small",sx:{boxShadow:0,border:1},variant:"contained",color:"light",children:"Upgrade Account"}),i(We,{enterDelay:200,placement:"top",arrow:!0,title:"Upgrade to a Pro Subscription to create more than 5 plays.",children:i(F,{style:{fontSize:20,cursor:"pointer",marginLeft:5},icon:yn})})]})]}),e[43]=u,e[44]=_,e[45]=w.isSuccess,e[46]=h,e[47]=ie):ie=e[47];let X;e[48]!==D||e[49]!==U||e[50]!==ie||e[51]!==R?(X=P(Mi,{onClick:R,sx:D,children:[U,ie]}),e[48]=D,e[49]=U,e[50]=ie,e[51]=R,e[52]=X):X=e[52];let oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{l(!1)},e[53]=oe):oe=e[53];let Z;e[54]!==E||e[55]!==s.pathname||e[56]!==g?(Z=se=>{l(!1),E(Xe(se?se.team_id:null)),tn.includes(s.pathname)?g(s.pathname):g(rt(se?se.team_id:null))},e[54]=E,e[55]=s.pathname,e[56]=g,e[57]=Z):Z=e[57];const fe=x==null?void 0:x.team_id;let Y;e[58]!==o||e[59]!==Z||e[60]!==fe||e[61]!==r?(Y=i(Vt,{anchorRef:a,onClose:oe,onSelect:Z,selectedTeamId:fe,open:o,user:r}),e[58]=o,e[59]=Z,e[60]=fe,e[61]=r,e[62]=Y):Y=e[62];let V;return e[63]!==X||e[64]!==Y?(V=P(de,{children:[X,Y]}),e[63]=X,e[64]=Y,e[65]=V):V=e[65],V}function Bi(t){var e;return(e=t==null?void 0:t.reduxUser)==null?void 0:e.selectedTeamId}function Ni(){const t=B.c(2),e=M.useRef(!0);let n,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>()=>{e.current=!1},a=[],t[0]=n,t[1]=a):(n=t[0],a=t[1]),M.useEffect(n,a),e}const Wi=Zn(Jn.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"})),zi=[{label:"Account",linkTo:A.user.account+"?tab=account"},{label:"Subscription",linkTo:A.user.account+"?tab=subscriptions"},{label:"Billing",linkTo:A.user.account+"?tab=billing"},{label:"PDF Downloads",linkTo:`${A.user.account}?tab=downloads`}],Ui=t=>{if(t==null)return[];const e=A.settings.organization(t);return[{label:"Organization Settings",linkTo:e},{label:"Coach Seats",linkTo:`${e}?tab=Coach%20Seats`},{label:"Teams",linkTo:`${e}?tab=Teams`},{label:"Subscription",linkTo:`${e}?tab=Subscription`},{label:"Billing",linkTo:`${e}?tab=Billing`}]},Fi=t=>{const e=B.c(27),{name:n,picture:a,fallback:o,headerRef:l,onClick:s}=t,r=n||o,c=typeof s=="function";let d;e[0]!==c?(d=c&&{cursor:"pointer",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},e[0]=c,e[1]=d):d=e[1];let f;e[2]!==d?(f={px:1,pt:1,pb:.5,minWidth:0,...d},e[2]=d,e[3]=f):f=e[3];let u;e[4]!==r||e[5]!==a?(u=a?"default":Ke(r).color,e[4]=r,e[5]=a,e[6]=u):u=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={width:20,height:20,fontSize:10,borderRadius:.75},e[7]=b):b=e[7];let h;e[8]!==r?(h=Ke(r),e[8]=r,e[9]=h):h=e[9];let p;e[10]!==r||e[11]!==a||e[12]!==u||e[13]!==h.name?(p=i(Xt,{variant:"rounded",src:a,alt:r,color:u,sx:b,children:h.name}),e[10]=r,e[11]=a,e[12]=u,e[13]=h.name,e[14]=p):p=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m={color:"text.secondary",fontWeight:600,minWidth:0,flex:1},e[15]=m):m=e[15];let y;e[16]!==r?(y=i(J,{variant:"caption",noWrap:!0,sx:m,children:r}),e[16]=r,e[17]=y):y=e[17];let v;e[18]!==c?(v=c&&i(be,{icon:"eva:chevron-down-outline",width:16,height:16,sx:{color:"text.secondary",flexShrink:0}}),e[18]=c,e[19]=v):v=e[19];let w;return e[20]!==l||e[21]!==s||e[22]!==f||e[23]!==p||e[24]!==y||e[25]!==v?(w=P(re,{ref:l,direction:"row",spacing:1,alignItems:"center",onClick:s,sx:f,children:[p,y,v]}),e[20]=l,e[21]=s,e[22]=f,e[23]=p,e[24]=y,e[25]=v,e[26]=w):w=e[26],w},Et=t=>{const e=B.c(13),{name:n,picture:a,fallback:o,headerRef:l,onHeaderClick:s,children:r}=t;
1let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={bgcolor:"grey.100",borderRadius:1.5,mt:1,pb:1},e[0]=c):c=e[0];let d;e[1]!==o||e[2]!==l||e[3]!==n||e[4]!==s||e[5]!==a?(d=i(Fi,{name:n,picture:a,fallback:o,headerRef:l,onClick:s}),e[1]=o,e[2]=l,e[3]=n,e[4]=s,e[5]=a,e[6]=d):d=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={px:.5},e[7]=f):f=e[7];let u;e[8]!==r?(u=i(re,{sx:f,children:r}),e[8]=r,e[9]=u):u=e[9];let b;return e[10]!==d||e[11]!==u?(b=P(L,{sx:c,children:[d,u]}),e[10]=d,e[11]=u,e[12]=b):b=e[12],b};function Gi(){var mt,gt,bt,yt,_t;const t=B.c(72),{user:e,logout:n}=ke(),a=Me(),o=$e(Vi),l=((gt=(mt=Le())==null?void 0:mt.data)==null?void 0:gt.data)??[],s=a??l.find(ue=>ue.team_id===o)??l.find(Yi),{checkPermissions:r}=Bt(),c=!!s&&!!r({teamId:s.team_id,permissions:["EDIT_TEAM"]}),d=Nt(),u=(Array.isArray((bt=d==null?void 0:d.data)==null?void 0:bt.data)?d.data.data:[]).find(qi),b=u==null?void 0:u.organization_id,h=Ui(b),p=pi({organizationId:b}),m=(_t=(yt=p==null?void 0:p.data)==null?void 0:yt.data)==null?void 0:_t.name,y=je(),v=Se(),w=_e(),C=M.useRef(null),[k,_]=M.useState(!1);let g;t[0]!==y||t[1]!==w.pathname||t[2]!==v||t[3]!==_?(g=ue=>{_(!1),y(Xe(ue?ue.team_id:null)),tn.includes(w.pathname)?v(w.pathname):v(rt(ue?ue.team_id:null))},t[0]=y,t[1]=w.pathname,t[2]=v,t[3]=_,t[4]=g):g=t[4];const S=g,T=Ni(),{enqueueSnackbar:I}=lt(),[E,x]=M.useState(null);let R;t[5]===Symbol.for("react.memo_cache_sentinel")?(R=ue=>{x(ue.currentTarget)},t[5]=R):R=t[5];const $=R;let O;t[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{x(null)},t[6]=O):O=t[6];const D=O;let K;t[7]!==I||t[8]!==D||t[9]!==T||t[10]!==n?(K=async()=>{try{await n(),T.current&&D()}catch(ue){console.error(ue),I("Unable to logout!",{variant:"error"})}},t[7]=I,t[8]=D,t[9]=T,t[10]=n,t[11]=K):K=t[11];const q=K;let N;t[12]!==E?(N=E&&{"&:before":{zIndex:1,content:"''",width:"100%",height:"100%",borderRadius:"50%",position:"absolute",bgcolor:Ki}},t[12]=E,t[13]=N):N=t[13];let W;t[14]!==N?(W={p:0,...N},t[14]=N,t[15]=W):W=t[15];let G;t[16]===Symbol.for("react.memo_cache_sentinel")?(G=i(Qt,{}),t[16]=G):G=t[16];let Q;t[17]!==E?(Q=!E&&i(be,{sx:{color:"#000",border:"2px solid #fff",borderRadius:12.5,backgroundColor:"#ddd",position:"absolute",bottom:-4,right:-4},icon:"eva:chevron-down-outline",width:20,height:20}),t[17]=E,t[18]=Q):Q=t[18];let ee;t[19]!==W||t[20]!==Q?(ee=P(Oe,{onClick:$,sx:W,children:[G,Q]}),t[19]=W,t[20]=Q,t[21]=ee):ee=t[21];const j=ut,te=!!E;let U;t[22]===Symbol.for("react.memo_cache_sentinel")?(U={width:280,mt:1.5,ml:.75,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75}},t[22]=U):U=t[22];let ie;t[23]===Symbol.for("react.memo_cache_sentinel")?(ie={my:1,px:1},t[23]=ie):ie=t[23];const X=e==null?void 0:e.displayName;let oe;t[24]!==X?(oe=i(J,{variant:"subtitle2",noWrap:!0,children:X}),t[24]=X,t[25]=oe):oe=t[25];let Z;t[26]===Symbol.for("react.memo_cache_sentinel")?(Z={color:"text.secondary"},t[26]=Z):Z=t[26];const fe=e==null?void 0:e.email;let Y;t[27]!==fe?(Y=i(J,{variant:"body2",sx:Z,noWrap:!0,children:fe}),t[27]=fe,t[28]=Y):Y=t[28];let V;t[29]!==oe||t[30]!==Y?(V=P(L,{sx:ie,children:[oe,Y]}),t[29]=oe,t[30]=Y,t[31]=V):V=t[31];let ne;t[32]===Symbol.for("react.memo_cache_sentinel")?(ne=i(He,{}),t[32]=ne):ne=t[32];let le;t[33]===Symbol.for("react.memo_cache_sentinel")?(le={py:.5},t[33]=le):le=t[33];let ae;t[34]!==D?(ae=zi.map(ue=>i(we,{to:ue.linkTo,component:Te,onClick:D,children:ue.label},ue.label)),t[34]=D,t[35]=ae):ae=t[35];let z;t[36]!==ae?(z=i(re,{sx:le,children:ae}),t[36]=ae,t[37]=z):z=t[37];let he;t[38]!==D||t[39]!==c||t[40]!==s||t[41]!==_?(he=s&&P(Et,{name:s.name,picture:s.picture,fallback:"Team",headerRef:C,onHeaderClick:()=>_(!0),children:[c&&i(we,{to:A.settings.team(s.team_id),component:Te,onClick:D,children:"Team Settings"}),c&&i(we,{to:A.settings.teamFeatures(s.team_id),component:Te,onClick:D,children:"Team Features"}),i(we,{to:A.settings.teamRoster(s.team_id),component:Te,onClick:D,children:"Roster"}),i(we,{to:A.settings.teamNotifications(s.team_id),component:Te,onClick:D,children:"Notifications"})]}),t[38]=D,t[39]=c,t[40]=s,t[41]=_,t[42]=he):he=t[42];const se=h.length>0&&i(Et,{name:m,fallback:"Organization",children:h.map(ue=>i(we,{to:ue.linkTo,component:Te,onClick:D,children:ue.label},ue.label))});let ve;t[43]===Symbol.for("react.memo_cache_sentinel")?(ve=i(He,{sx:{mt:1}}),t[43]=ve):ve=t[43];let ze;t[44]===Symbol.for("react.memo_cache_sentinel")?(ze={my:1,color:"error.main"},t[44]=ze):ze=t[44];let Ue;t[45]===Symbol.for("react.memo_cache_sentinel")?(Ue=i(Wi,{sx:{mr:1,fontSize:18}}),t[45]=Ue):Ue=t[45];let Ee;t[46]!==q?(Ee=P(we,{onClick:q,sx:ze,children:[Ue," Logout"]}),t[46]=q,t[47]=Ee):Ee=t[47];let Ae;t[48]!==j||t[49]!==D||t[50]!==E||t[51]!==U||t[52]!==V||t[53]!==ne||t[54]!==z||t[55]!==he||t[56]!==se||t[57]!==Ee||t[58]!==te?(Ae=P(j,{open:te,anchorEl:E,onClose:D,sx:U,children:[V,ne,z,he,se,ve,Ee]}),t[48]=j,t[49]=D,t[50]=E,t[51]=U,t[52]=V,t[53]=ne,t[54]=z,t[55]=he,t[56]=se,t[57]=Ee,t[58]=te,t[59]=Ae):Ae=t[59];let Re;t[60]!==_?(Re=()=>_(!1),t[60]=_,t[61]=Re):Re=t[61];const Ze=a==null?void 0:a.team_id;let Pe;t[62]!==S||t[63]!==Re||t[64]!==Ze||t[65]!==k||t[66]!==e?(Pe=i(Vt,{anchorRef:C,open:k,onClose:Re,onSelect:S,selectedTeamId:Ze,user:e}),t[62]=S,t[63]=Re,t[64]=Ze,t[65]=k,t[66]=e,t[67]=Pe):Pe=t[67];let Fe;return t[68]!==Ae||t[69]!==Pe||t[70]!==ee?(Fe=P(de,{children:[ee,Ae,Pe]}),t[68]=Ae,t[69]=Pe,t[70]=ee,t[71]=Fe):Fe=t[71],Fe}function Ki(t){return pe(t.palette.grey[900],.3)}function qi(t){return["EDIT_ORG"].includes(t.permission_name)}function Yi(t){var e;return(e=t.permissions)==null?void 0:e.some(ji)}function ji(t){return t.permission_name==="VIEW_PLAY"}function Vi(t){return t==null?void 0:t.reduxUser.lastTeamId}function Qi(t){if(!t)return"";const e=new Date(`${String(t).replace(" ","T")}Z`).getTime();if(Number.isNaN(e))return"";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return"just now";const a=Math.floor(n/60);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);if(o<24)return`${o}h ago`;const l=Math.floor(o/24);return l<7?`${l}d ago`:`${Math.floor(l/7)}w ago`}function Xi(t){const e=t.data??{};let n=null;return e.event_id?n=`${A.calendar}?event=${e.event_id}`:e.task_id?n=e.team_id?A.tasks:A.root:e.roster_prompt&&e.team_id&&(n=A.settings.teamRoster(e.team_id)),n?e.team_id?`${A.notificationRedirect}?team=${e.team_id}&to=${encodeURIComponent(n)}`:n:null}const Zi={event:{icon:"eva:calendar-fill",color:"primary"},reminder:{icon:"eva:clock-fill",color:"warning"},reminder_fyi:{icon:"eva:clock-fill",color:"warning"},message:{icon:"eva:message-circle-fill",color:"info"},task:{icon:"fa6-solid:list-check",color:"secondary"},roster:{icon:"eva:people-fill",color:"success"},attendance:{icon:"eva:person-remove-fill",color:"warning"}};function Ji(t){const e=B.c(9),{category:n}=t;let a;e[0]!==n?(a=Zi[n]??{icon:"eva:bell-fill",color:"primary"},e[0]=n,e[1]=a):a=e[1];const{icon:o,color:l}=a;let s;e[2]!==l?(s=d=>({width:40,height:40,mr:1.5,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:d.palette[l].main,bgcolor:pe(d.palette[l].main,.12)}),e[2]=l,e[3]=s):s=e[3];let r;e[4]!==o?(r=i(be,{icon:o,width:20,height:20}),e[4]=o,e[5]=r):r=e[5];let c;return e[6]!==s||e[7]!==r?(c=i(L,{sx:s,children:r}),e[6]=s,e[7]=r,e[8]=c):c=e[8],c}function eo(t){var I,E,x;const e=B.c(44),{item:n,onClick:a,rsvpMutation:o,rsvpEnabled:l}=t,s=l===void 0?!0:l;let r;e[0]!==n||e[1]!==a?(r=()=>a(n),e[0]=n,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==n.read_at?(c=!n.read_at&&{bgcolor:no,"&:hover":{bgcolor:to}},e[3]=n.read_at,e[4]=c):c=e[4];let d;e[5]!==c?(d={py:1.5,pl:1.5,pr:2.5,alignItems:"flex-start",cursor:"pointer",...c},e[5]=c,e[6]=d):d=e[6];let f;e[7]!==n.category?(f=i(Ji,{category:n.category}),e[7]=n.category,e[8]=f):f=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u={flexGrow:1,minWidth:0},e[9]=u):u=e[9];let b;
1e[10]===Symbol.for("react.memo_cache_sentinel")?(b={minWidth:0},e[10]=b):b=e[10];const h=n.read_at?500:600;let p;e[11]!==h?(p={fontWeight:h,flexGrow:1,minWidth:0},e[11]=h,e[12]=p):p=e[12];let m;e[13]!==n.title||e[14]!==p?(m=i(J,{variant:"subtitle2",noWrap:!0,sx:p,children:n.title}),e[13]=n.title,e[14]=p,e[15]=m):m=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"text.disabled",flexShrink:0,whiteSpace:"nowrap"},e[16]=y):y=e[16];let v;e[17]!==n.created_at?(v=Qi(n.created_at),e[17]=n.created_at,e[18]=v):v=e[18];let w;e[19]!==v?(w=i(J,{variant:"caption",sx:y,children:v}),e[19]=v,e[20]=w):w=e[20];let C;e[21]!==m||e[22]!==w?(C=P(re,{direction:"row",alignItems:"center",spacing:1,sx:b,children:[m,w]}),e[21]=m,e[22]=w,e[23]=C):C=e[23];let k;e[24]!==n.body?(k=n.body&&i(J,{variant:"body2",sx:{color:"text.secondary",mt:.25,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:n.body}),e[24]=n.body,e[25]=k):k=e[25];let _;e[26]!==n.data||e[27]!==n.notification_id||e[28]!==n.read_at||e[29]!==s||e[30]!==o?(_=!n.read_at&&s&&((I=n.data)==null?void 0:I.rsvp_prompt)&&((E=n.data)==null?void 0:E.team_id)&&((x=n.data)==null?void 0:x.event_id)&&i(re,{direction:"row",spacing:1,sx:{mt:1},children:["yes","no"].map(R=>i(ge,{size:"small",variant:"outlined",color:R==="yes"?"success":"error",disabled:o.isPending,sx:{borderRadius:999,minWidth:64,boxShadow:"none"},onClick:$=>{$.stopPropagation(),o.mutate({teamId:n.data.team_id,eventId:n.data.event_id,rsvp:R,notificationId:n.notification_id})},children:R==="yes"?"Yes":"No"},R))}),e[26]=n.data,e[27]=n.notification_id,e[28]=n.read_at,e[29]=s,e[30]=o,e[31]=_):_=e[31];let g;e[32]!==C||e[33]!==k||e[34]!==_?(g=P(L,{sx:u,children:[C,k,_]}),e[32]=C,e[33]=k,e[34]=_,e[35]=g):g=e[35];let S;e[36]!==n.read_at?(S=!n.read_at&&i(L,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"primary.main",mt:.75,ml:1,flexShrink:0}}),e[36]=n.read_at,e[37]=S):S=e[37];let T;return e[38]!==g||e[39]!==S||e[40]!==r||e[41]!==d||e[42]!==f?(T=P(Ve,{c
1omponent:"div",onClick:r,sx:d,children:[f,g,S]}),e[38]=g,e[39]=S,e[40]=r,e[41]=d,e[42]=f,e[43]=T):T=e[43],T}function to(t){return pe(t.palette.primary.main,.16)}function no(t){return pe(t.palette.primary.main,.08)}function io(){var ee;const t=B.c(69),e=Se(),[n,a]=M.useState(null),o=Me(),{data:l}=hi(),s=l===void 0?0:l,r=!!n;let c;t[0]!==r?(c={enabled:r},t[0]=r,t[1]=c):c=t[1];const{data:d,isPending:f,hasNextPage:u,fetchNextPage:b,isFetchingNextPage:h}=mi(c),p=gi(),m=bi(),{enqueueSnackbar:y}=lt(),v=ct(),{data:w}=Le();let C;t[2]!==(w==null?void 0:w.data)?(C=j=>{const te=((w==null?void 0:w.data)??[]).find(U=>U.team_id===j);return te?xn(te,"rsvp"):!0},t[2]=w==null?void 0:w.data,t[3]=C):C=t[3];const k=C;let _;t[4]!==y||t[5]!==p||t[6]!==v?(_=(j,te)=>{const{teamId:U,eventId:ie,rsvp:X,notificationId:oe}=te;y(X==="yes"?"Marked as going":"Marked as not going",{variant:"success"}),p.mutate([oe]),v.invalidateQueries({queryKey:["team_events",U]}),v.invalidateQueries({queryKey:["team_event",U,ie]})},t[4]=y,t[5]=p,t[6]=v,t[7]=_):_=t[7];let g;t[8]!==y?(g=j=>{y(De.printError(j),{variant:"error"})},t[8]=y,t[9]=g):g=t[9];let S;t[10]!==_||t[11]!==g?(S={mutationFn:lo,onSuccess:_,onError:g},t[10]=_,t[11]=g,t[12]=S):S=t[12];const T=_n(S);let I,E,x,R,$,O,D,K,q,N;if(t[13]!==(d==null?void 0:d.pages)||t[14]!==b||t[15]!==u||t[16]!==h||t[17]!==f||t[18]!==m||t[19]!==p||t[20]!==e||t[21]!==n||t[22]!==k||t[23]!==T||t[24]!==s){const j=((ee=d==null?void 0:d.pages)==null?void 0:ee.flatMap(ro))??[],te=[["New",j.filter(so)],["Earlier",j.filter(ao)]];let U;t[35]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>a(ae.currentTarget),t[35]=U):U=t[35];const ie=U;let X;t[36]===Symbol.for("react.memo_cache_sentinel")?(X=()=>a(null),t[36]=X):X=t[36],E=X;const oe=ae=>{ae.read_at||p.mutate([ae.notification_id]),E();const z=Xi(ae);z&&e(z)},Z=n?"primary":"default";let fe;t[37]===Symbol.for("react.memo_cache_sentinel")?(fe=i(be,{icon:"eva:bell-fill",width:22,height:22}),t[37]=fe):fe=t[37];let Y;t[38]!==s?(Y=i(zt,{badgeContent:s,color:"error",max:9,children:fe}),t[38]=s,t[39]=Y):Y=t[39],t[40]!==Z||t[41]!==Y?(D=i(Oe,{color:Z,onClick:ie,sx:oo,children:Y}),t[40]=Z,t[41]=Y,t[42]=D):D=t[42],I=ut,K=!!n,q=n,N=E,t[43]===Symbol.for("react.memo_cache_sentinel")?(x={width:360,p:0,mt:1.5,ml:.75},t[43]=x):x=t[43];let V,ne;t[44]===Symbol.for("react.memo_cache_sentinel")?(V={py:2,px:2.5},ne=i(J,{variant:"subtitle1",children:"Notifications"}),t[44]=V,t[45]=ne):(V=t[44],ne=t[45]);let le;t[46]!==m||t[47]!==s?(le=s>0&&i(ge,{size:"small",onClick:()=>m.mutate(),disabled:m.isPending,children:"Mark all as read"}),t[46]=m,t[47]=s,t[48]=le):le=t[48],t[49]!==le?(R=P(re,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:V,children:[ne,le]}),t[49]=le,t[50]=R):R=t[50],t[51]===Symbol.for("react.memo_cache_sentinel")?($=i(He,{}),t[51]=$):$=t[51],O=f?i(L,{sx:{textAlign:"center",py:5},children:i(ei,{size:24})}):j.length===0?i(L,{sx:{textAlign:"center",py:5,px:2.5},children:i(J,{variant:"body2",sx:{color:"text.secondary"},children:"You're all caught up."})}):P(Ie,{disablePadding:!0,sx:{maxHeight:360,overflowY:"auto"},children:[te.map(ae=>{const[z,he]=ae;return he.length>0&&P(M.Fragment,{children:[i(J,{variant:"overline",sx:{display:"block",pl:1.5,pr:2.5,pt:1.5,pb:.5,color:"text.secondary"},children:z}),he.map(se=>{var ve;return i(eo,{item:se,onClick:oe,rsvpMutation:T,rsvpEnabled:k((ve=se.data)==null?void 0:ve.team_id)},se.notification_id)})]},z)}),u&&i(L,{sx:{px:2.5,py:1},children:i(ge,{fullWidth:!0,size:"small",color:"inherit",disabled:h,onClick:()=>b(),children:h?"Loading":"Load more"})})]}),t[13]=d==null?void 0:d.pages,t[14]=b,t[15]=u,t[16]=h,t[17]=f,t[18]=m,t[19]=p,t[20]=e,t[21]=n,t[22]=k,t[23]=T,t[24]=s,t[25]=I,t[26]=E,t[27]=x,t[28]=R,t[29]=$,t[30]=O,t[31]=D,t[32]=K,t[33]=q,t[34]=N}else I=t[25],E=t[26],x=t[27],R=t[28],$=t[29],O=t[30],D=t[31],K=t[32],q=t[33],N=t[34];let W;t[52]!==E||t[53]!==e||t[54]!==o?(W=o&&P(de,{children:[i(He,{}),i(L,{sx:{p:1},children:i(ge,{fullWidth:!0,size:"small",color:"inherit",onClick:()=>{E(),e(A.settings.teamNotifications(o.team_id))},children:"Notification settings"})})]}),t[52]=E,t[53]=e,t[54]=o,t[55]=W):W=t[55];let G;t[56]!==I||t[57]!==x||t[58]!==R||t[59]!==$||t[60]!==O||t[61]!==W||t[62]!==K||t[63]!==q||t[64]!==N?(G=P(I,{open:K,anch
1orEl:q,onClose:N,sx:x,children:[R,$,O,W]}),t[56]=I,t[57]=x,t[58]=R,t[59]=$,t[60]=O,t[61]=W,t[62]=K,t[63]=q,t[64]=N,t[65]=G):G=t[65];let Q;return t[66]!==D||t[67]!==G?(Q=P(de,{children:[D,G]}),t[66]=D,t[67]=G,t[68]=Q):Q=t[68],Q}function oo(t){return{background:t.palette.grey[50012],width:40,height:40}}function ao(t){return t.read_at}function so(t){return!t.read_at}function ro(t){return(t==null?void 0:t.items)??[]}function lo(t){const{teamId:e,eventId:n,rsvp:a}=t;return Ce.put(`/teams/${e}/events/${n}/rsvp`,{rsvp:a})}function co(){const t=B.c(36),e=Se(),n=ki(),a=$e(po),[o,l]=M.useState(null),{data:s}=Jt();let r;t[0]!==s?(r=s===void 0?[]:s,t[0]=s,t[1]=r):r=t[1];const c=r;let d;t[2]!==c?(d=c.reduce(fo,0),t[2]=c,t[3]=d):d=t[3];const f=d;let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=()=>l(null),t[4]=u):u=t[4];const b=u;let h;t[5]!==e||t[6]!==n?(h=O=>{b(),n(O.team_id),e(`${A.messages}?conversation=${O.conversation_id}`)},t[5]=e,t[6]=n,t[7]=h):h=t[7];const p=h,m=o?"primary":"default";let y;t[8]===Symbol.for("react.memo_cache_sentinel")?(y=O=>l(O.currentTarget),t[8]=y):y=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v=i(be,{icon:"eva:message-circle-fill",width:22,height:22}),t[9]=v):v=t[9];let w;t[10]!==f?(w=i(zt,{badgeContent:f,color:"error",max:9,children:v}),t[10]=f,t[11]=w):w=t[11];let C;t[12]!==m||t[13]!==w?(C=i(Oe,{color:m,onClick:y,sx:uo,children:w}),t[12]=m,t[13]=w,t[14]=C):C=t[14];const k=!!o;let _;t[15]===Symbol.for("react.memo_cache_sentinel")?(_={width:360,p:0,mt:1.5,ml:.75},t[15]=_):_=t[15];let g,S;t[16]===Symbol.for("react.memo_cache_sentinel")?(g=i(re,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{py:2,px:2.5},children:i(J,{variant:"subtitle1",children:"Messages"})}),S=i(He,{}),t[16]=g,t[17]=S):(g=t[16],S=t[17]);let T;t[18]!==c||t[19]!==p?(T=c.length===0?i(L,{sx:{textAlign:"center",py:5,px:2.5},children:i(J,{variant:"body2",sx:{color:"text.secondary"},children:"Chats with your teams appear here."})}):i(Ie,{disablePadding:!0,sx:{maxHeight:360,overflowY:"auto"},children:c.map(O=>{const D=O.unread_count>0;return P(Ve,{onClick:()=>p(O),sx:{py:1.5,px:2.5},children:[i(ti,{src:O.picture||void 0,sx:{width:36,height:36,mr:1.5},children:(O.title||"?").charAt(0)}),P(L,{sx:{flexGrow:1,minWidth:0},children:[i(J,{variant:"subtitle2",noWrap:!0,sx:{fontWeight:D?700:400},children:O.title}),i(J,{variant:"body2",noWrap:!0,sx:{color:D?"text.primary":"text.secondary"},children:vi(O)})]}),P(re,{alignItems:"flex-end",sx:{ml:1,flexShrink:0},children:[O.last_message&&i(J,{variant:"caption",sx:{color:"text.disabled"},children:wi(O.last_message.created_at)}),D&&i(L,{sx:{mt:.5,minWidth:18,height:18,px:.5,borderRadius:9,bgcolor:"error.main",color:"error.contrastText",typography:"caption",display:"flex",alignItems:"center",justifyContent:"center"},children:Math.min(O.unread_count,99)})]})]},O.conversation_id)})}),t[18]=c,t[19]=p,t[20]=T):T=t[20];let I;t[21]===Symbol.for("react.memo_cache_sentinel")?(I=i(He,{}),t[21]=I):I=t[21];let E;t[22]===Symbol.for("react.memo_cache_sentinel")?(E={p:1},t[22]=E):E=t[22];let x;t[23]!==c[0]||t[24]!==e||t[25]!==a||t[26]!==n?(x=i(L,{sx:E,children:i(ge,{fullWidth:!0,size:"small",color:"inherit",onClick:()=>{var O;b(),!a&&((O=c[0])!=null&&O.team_id)&&n(c[0].team_id),e(A.messages)},children:"Open Messages"})}),t[23]=c[0],t[24]=e,t[25]=a,t[26]=n,t[27]=x):x=t[27];let R;t[28]!==o||t[29]!==k||t[30]!==T||t[31]!==x?(R=P(ut,{open:k,anchorEl:o,onClose:b,sx:_,children:[g,S,T,I,x]}),t[28]=o,t[29]=k,t[30]=T,t[31]=x,t[32]=R):R=t[32];let $;return t[33]!==R||t[34]!==C?($=P(de,{children:[C,R]}),t[33]=R,t[34]=C,t[35]=$):$=t[35],$}function uo(t){return{background:t.palette.grey[50012],width:40,height:40}}function fo(t,e){return t+(e.unread_count??0)}function po(t){return t==null?void 0:t.reduxUser.selectedTeamId}const ho=ye(Ut,{shouldForwardProp:t=>t!=="isCollapse"&&t!=="isOffset"&&t!=="verticalLayout"})(({isCollapse:t,isOffset:e,verticalLayout:n,theme:a})=>({...Qe(a).bgBlur(),boxShadow:"none",height:`calc(${me.MOBILE_HEIGHT}px + var(--thg-safe-top, 0px))`,zIndex:a.zIndex.appBar+1,transition:a.transitions.create(["width","height","transform"],{duration:a.transitions.duration.shorter}),[a.breakpoints.up("lg")]:{height:`calc(${me.DASHBOARD_DESKTOP_HEIGHT}px + var(--thg-safe-top, 0px))`,width:`calc(100% - ${ce.DASHBOARD_WIDTH+1}px)`,...t&&{width:`calc(100% - ${ce.DASHBOARD_COLLAPSE_WIDTH}px)`},...e&&{height:`calc(${me.DASHBOARD_DESKTOP_OFFSET_HEIGHT}px + var(--thg-safe-top, 0px))`},...n&&{width:"100%",height:`calc(${me.DASHBOARD_DESKTOP_OFFSET_HEIGHT}px + var(--thg-safe-top, 0px))`,backgroundColor:a.palette.background.default}}}));it.propTypes={onOpenSidebar:H.func,isCollapse:H.bool,verticalLayout:H.bool};function it(t){var G;const e=B.c(38),{onOpenSidebar:n,isCollapse:a,verticalLayout:o}=t,l=a===void 0?!1:a,s=o===void 0?!1:o,{pathname:r}
1=_e(),c=/^\/dashboard\/(play|drill|playbook|rotation|practice-plan|practice)\/[^/]+\/?$/.test(r);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={threshold:80},e[0]=d):d=e[0];const f=ni(d),u=c&&!s&&f,b=$i(me.DASHBOARD_DESKTOP_HEIGHT)&&!s,h=dt("up","lg"),m=(((G=Le().data)==null?void 0:G.data)??[]).length>0,y=Sn("messaging"),v=u?"translateY(calc(-100% + var(--thg-safe-top, 0px)))":"translateY(0)";let w,C,k;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={transform:"translateY(0)"},C={opacity:1},k={transition:"none"},e[1]=w,e[2]=C,e[3]=k):(w=e[1],C=e[2],k=e[3]);let _;e[4]!==v?(_={transform:v,"&:focus-within":w,"&:focus-within #dashboard-header":C,"@media (prefers-reduced-motion: reduce)":k},e[4]=v,e[5]=_):_=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g={lg:5},e[6]=g):g=e[6];const S=u?0:1;let T;e[7]!==S?(T={minHeight:"100% !important",px:g,opacity:S,transition:bo},e[7]=S,e[8]=T):T=e[8];let I;e[9]!==h||e[10]!==s?(I=h&&s&&i(tt,{sx:{mr:2.5}}),e[9]=h,e[10]=s,e[11]=I):I=e[11];let E;e[12]!==h||e[13]!==n?(E=!h&&i(Oe,{onClick:n,sx:{mr:1,color:"text.primary"},children:i(be,{icon:"eva:menu-2-fill"})}),e[12]=h,e[13]=n,e[14]=E):E=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=i(L,{sx:{flexGrow:1}}),e[15]=x):x=e[15];let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={xs:1,sm:1.5},e[16]=R):R=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=i(We,{title:"Help",placement:"bottom",children:i(Oe,{onClick:go,sx:mo,children:i(be,{icon:"eva:question-mark-circle-outline",width:25,height:25})})}),e[17]=$):$=e[17];let O;e[18]!==y||e[19]!==m?(O=m&&y&&i(co,{}),e[18]=y,e[19]=m,e[20]=O):O=e[20];let D;e[21]!==m?(D=m&&i(io,{}),e[21]=m,e[22]=D):D=e[22];let K;e[23]===Symbol.for("react.memo_cache_sentinel")?(K=i(Gi,{}),e[23]=K):K=e[23];let q;e[24]!==O||e[25]!==D?(q=P(re,{direction:"row",alignItems:"center",spacing:R,children:[$,O,D,K]}),e[24]=O,e[25]=D,e[26]=q):q=e[26];let N;e[27]!==T||e[28]!==I||e[29]!==E||e[30]!==q?(N=P(ii,{id:"dashboard-header",sx:T,children:[I,E,x,q]}),e[27]=T,e[28]=I,e[29]=E,e[30]=q,e[31]=N):N=e[31];let W;return e[32]!==l||e[33]!==b||e[34]!==N||e[35]!==_||e[36]!==s?(W=i(ho,{isCollapse:l,isOffset:b,verticalLayout:s,sx:_,children:N}),e[32]=l,e[33]=b,e[34]=N,e[35]=_,e[36]=s,e[37]=W):W=e[37],W}function mo(t){return{background:t.palette.grey[50012],width:40,height:40}}function go(){try{window.HelpWidget("open")}catch{console.log("HelpWidget not found")}}function bo(t){return t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}const nn=ye(Ve,{shouldForwardProp:t=>t!=="active"})(({active:t,depth:e,theme:n})=>({position:"relative",textTransform:"capitalize",paddingLeft:n.spacing(2),paddingRight:n.spacing(1.5),color:n.palette.text.secondary,borderRadius:n.shape.borderRadius,height:ce.DASHBOARD_ITEM_ROOT_HEIGHT,[n.breakpoints.up("lg")]:{height:ce.DASHBOARD_ITEM_DESKTOP_ROOT_HEIGHT},overflow:"hidden",minWidth:0,...t&&{color:n.palette.primary.main,backgroundColor:pe(n.palette.primary.main,n.palette.action.selectedOpacity)},...t&&e!==1&&{color:n.palette.text.primary,backgroundColor:"transparent"},...e&&{...e>1&&{height:ce.DASHBOARD_ITEM_SUB_HEIGHT,[n.breakpoints.up("lg")]:{height:ce.DASHBOARD_ITEM_DESKTOP_SUB_HEIGHT}},...e>2&&{paddingLeft:n.spacing(e)}}})),on=ye(Gt,{shouldForwardProp:t=>t!=="isCollapse"})(({isCollapse:t,theme:e})=>({transition:e.transitions.create(["width","opacity"],{duration:e.transitions.duration.shorter}),...t?{width:0,opacity:0}:{flex:"1 1 auto",minWidth:0,overflow:"hidden"}})),qe=ye(Ft)({width:xe.NAVBAR_ITEM,height:xe.NAVBAR_ITEM,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{width:"100%",height:"100%"}}),an=ye(oi)(({theme:t})=>({...t.typography.overline,borderRadius:t.shape.borderRadius,paddingTop:t.spacing(.5),paddingLeft:t.spacing(2),paddingBottom:t.spacing(.5),color:t.palette.text.primary,transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter}),...Qe(t).bgBlur(),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));Ge.propTypes={active:H.bool,open:H.bool,isCollapse:H.bool,depth:H.number,item:H.shape({children:H.array,icon:H.any,info:H.any,path:H.string,title:H.string,collapsedTitle:H.string,disabled:H.bool,caption:H.str
1ing,roles:H.arrayOf(H.string)})};function Ge(t){const e=B.c(33);let n,a,o,l,s,r;e[0]!==t?({item:l,depth:a,active:n,open:s,isCollapse:o,...r}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=o,e[4]=l,e[5]=s,e[6]=r):(n=e[1],a=e[2],o=e[3],l=e[4],s=e[5],r=e[6]);const{title:c,collapsedTitle:d,icon:f,info:u,children:b,disabled:h,caption:p,roles:m,permission:y,endIcon:v}=l,w=o&&a===1,C=n?"page":void 0,k=w?c:void 0,_=w?_o:void 0;let g;e[7]!==n||e[8]!==p||e[9]!==b||e[10]!==d||e[11]!==a||e[12]!==v||e[13]!==f||e[14]!==u||e[15]!==o||e[16]!==w||e[17]!==s||e[18]!==c?(g=w?P(de,{children:[f&&i(qe,{sx:{minWidth:"unset",mr:0,mb:.25,color:"inherit"},children:f}),i(L,{component:"span",sx:yo,children:d??c})]}):P(de,{children:[f&&i(qe,{children:f}),a!==1&&i(sn,{active:n&&a!==1}),i(on,{isCollapse:o,sx:u?{flex:"0 1 auto"}:void 0,primary:c,secondary:p&&i(We,{title:p,placement:"top-start",children:i("span",{children:p})}),primaryTypographyProps:{noWrap:!0,variant:n?"subtitle2":"body2"},secondaryTypographyProps:{noWrap:!0,variant:"caption"}}),v&&!o&&i(ft,{sx:{ml:1,px:1.5},variant:"ghost",color:"default",children:v}),!o&&P(de,{children:[u&&i(L,{component:"span",sx:{lineHeight:0,ml:1},children:u}),!!b&&i(be,{icon:s?"eva:arrow-ios-downward-fill":"eva:arrow-ios-forward-fill",sx:{width:16,height:16,ml:1,flexShrink:0}})]})]}),e[7]=n,e[8]=p,e[9]=b,e[10]=d,e[11]=a,e[12]=v,e[13]=f,e[14]=u,e[15]=o,e[16]=w,e[17]=s,e[18]=c,e[19]=g):g=e[19];let S;e[20]!==n||e[21]!==a||e[22]!==h||e[23]!==r||e[24]!==C||e[25]!==k||e[26]!==_||e[27]!==g?(S=i(nn,{depth:a,active:n,disabled:h,"aria-current":C,"aria-label":k,sx:_,...r,children:g}),e[20]=n,e[21]=a,e[22]=h,e[23]=r,e[24]=C,e[25]=k,e[26]=_,e[27]=g,e[28]=S):S=e[28];const T=S;let I;return e[29]!==y||e[30]!==T||e[31]!==m?(I=i(Wt,{roles:m,permission:y,children:T}),e[29]=y,e[30]=T,e[31]=m,e[32]=I):I=e[32],I}function yo(t){const e=vn(t);return{fontSize:"10px",lineHeight:1.2,textAlign:"center",color:"inherit",alignSelf:"center",width:e,maxWidth:e,boxSizing:"border-box",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,wordBreak:"break-word"}}function _o(t){return{flexDirection:"column",justifyContent:"center",alignItems:"center",height:"auto",minHeight:ce.DASHBOARD_ITEM_ROOT_HEIGHT+22,py:.75,px:.5,paddingLeft:t.spacing(ce.COLLAPSED_ITEM_PADDING_X),paddingRight:t.spacing(ce.COLLAPSED_ITEM_PADDING_X)}}sn.propTypes={active:H.bool};function sn(t){const e=B.c(4),{active:n}=t;let a;e[0]!==n?(a=n&&{transform:"scale(2)",bgcolor:"primary.main"},e[0]=n,e[1]=a):a=e[1];let o;return e[2]!==a?(o=i(qe,{children:i(L,{component:"span",sx:{width:4,height:4,borderRadius:"50%",bgcolor:"text.disabled",transition:xo,...a}})}),e[2]=a,e[3]=o):o=e[3],o}function xo(t){return t.transitions.create("transform",{duration:t.transitions.duration.shorter})}
1Be.propTypes={data:H.object,depth:H.number,hasChildren:H.bool,isCollapse:H.bool};function Be(t){const e=B.c(25),{data:n,depth:a,hasChildren:o,isCollapse:l}=t,s=l===void 0?!1:l,{pathname:r,search:c}=_e();let d;e[0]!==n.matchPaths||e[1]!==n.path||e[2]!==r?(d=Ne(n.path,r,n.matchPaths),e[0]=n.matchPaths,e[1]=n.path,e[2]=r,e[3]=d):d=e[3];const f=d,[u,b]=M.useState(f);let h;e[4]!==u?(h=()=>{b(!u)},e[4]=u,e[5]=h):h=e[5];const p=h;let m;e[6]!==f||e[7]!==n||e[8]!==a||e[9]!==p||e[10]!==o||e[11]!==s||e[12]!==u||e[13]!==r||e[14]!==c?(m=un(n.path)?i(Kt,{href:n.path,target:"_blank",rel:"noopener",underline:"none",children:i(Ge,{item:n,depth:a,open:u,active:f,isCollapse:s})}):o?i(Ge,{item:n,depth:a,open:u,active:f,isCollapse:s,onClick:p}):i(Te,{to:n.path,state:n.passReturnTo?{returnTo:r+c}:void 0,style:{textDecoration:"none",color:"inherit"},children:i(Ge,{item:n,depth:a,open:u,active:f,isCollapse:s})}),e[6]=f,e[7]=n,e[8]=a,e[9]=p,e[10]=o,e[11]=s,e[12]=u,e[13]=r,e[14]=c,e[15]=m):m=e[15];let y;e[16]!==n.children||e[17]!==a||e[18]!==o||e[19]!==s||e[20]!==u?(y=!s&&o&&i(qt,{in:u,unmountOnExit:!0,children:i(Ie,{component:"div",disablePadding:!0,children:i(rn,{data:n.children,depth:a})})}),e[16]=n.children,e[17]=a,e[18]=o,e[19]=s,e[20]=u,e[21]=y):y=e[21];let v;return e[22]!==m||e[23]!==y?(v=P(de,{children:[m,y]}),e[22]=m,e[23]=y,e[24]=v):v=e[24],v}rn.propTypes={data:H.array,depth:H.number};function rn(t){const e=B.c(7),{data:n,depth:a}=t;let o;if(e[0]!==n||e[1]!==a){let s;e[3]!==a?(s=r=>i(Be,{data:r,depth:a+1,hasChildren:!!r.children},r.title+r.path),e[3]=a,e[4]=s):s=e[4],o=n.map(s),e[0]=n,e[1]=a,e[2]=o}else o=e[2];let l;return e[5]!==o?(l=i(de,{children:o}),e[5]=o,e[6]=l):l=e[6],l}ln.propTypes={isCollapse:H.bool,navConfig:H.array};function ln(t){const e=B.c(21);let n,a,o;e[0]!==t?({navConfig:a,isCollapse:n,...o}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=o):(n=e[1],a=e[2],o=e[3]);const l=wn();let s,r,c;if(e[4]!==l||e[5]!==n||e[6]!==a||e[7]!==o){let f;e[11]!==l?(f=p=>l(p),e[11]=l,e[12]=f):f=e[12];let u;e[13]!==l?(u=p=>({...p,items:p.items.filter(m=>l({permission:p.permission,guardCheckFunction:m.guardCheckFunction}))}),e[13]=l,e[14]=u):u=e[14];const b=a.filter(f).map(u).filter(So);s=L,r=o;let h;e[15]!==n?(h=p=>P(Ie,{disablePadding:!0,sx:{px:n?ce.COLLAPSED_LIST_PADDING_X:2,minWidth:0,...!n&&{mt:2}},children:[!n&&i(an,{children:p.subheader}),p.items.map(m=>i(Be,{data:m,depth:1,hasChildren:!!m.children,isCollapse:n},m.title+m.path))]},p.subheader),e[15]=n,e[16]=h):h=e[16],c=b.map(h),e[4]=l,e[5]=n,e[6]=a,e[7]=o,e[8]=s,e[9]=r,e[10]=c}else s=e[8],r=e[9],c=e[10];let d;return e[17]!==s||e[18]!==r||e[19]!==c?(d=i(s,{...r,children:c}),e[17]=s,e[18]=r,e[19]=c,e[20]=d):d=e[20],d}function So(t){return t.items.length>0}const vo=ye(Ve,{shouldForwardProp:t=>t!=="active"&&t!=="open"})(({active:t,depth:e,open:n,theme:a})=>{const o=a.palette.mode==="light",l={color:a.palette.grey[800],backgroundColor:a.palette.common.white,boxShadow:`-2px 4px 6px 0 ${pe(o?a.palette.grey[500]:a.palette.common.black,.16)}`},s={boxShadow:"none",color:a.palette.primary.main,backgroundColor:pe(a.palette.primary.main,a.palette.action.selectedOpacity)},r={color:a.palette.text.primary,backgroundColor:a.palette.action.hover,boxShadow:`inset 0 0 1px 1px ${a.palette.divider}`};return{textTransform:"capitalize",margin:a.spacing(0,.5),padding:a.spacing(0,1),color:a.palette.text.secondary,borderRadius:a.shape.borderRadius,height:ce.DASHBOARD_ITEM_HORIZONTAL_HEIGHT,"&:hover":r,...t&&{...l,"&:hover":{...l}},...t&&e!==1&&{...s,"&:hover":{...s}},...e&&{...e>1&&{width:"100%",margin:0,paddingRight:0,paddingLeft:a.spacing(1)}},...n&&!t&&r}}),wo=ye(ai)(({theme:t})=>({pointerEvents:"none","& .MuiPopover-paper":{width:160,pointerEvents:"auto",padding:t.spacing(1),marginTop:t.spacing(.5),boxShadow:t.customShadows.dropdown,borderRadius:Number(t.shape.borderRadius)*1.5,...Qe(t).bgBlur()}})),Ye=M.forwardRef((t,e)=>{const n=B.c(38);let a,o,l,s,r;n[0]!==t?({item:l,depth:o,active:a,open:s,...r}=t,n[0]=t,n[1]=a,n[2]=o,n[3]=l,n[4]=s,n[5]=r):(a=n[1],o=n[2],l=n[3],s=n[4],r=n[5]);const{title:c,icon:d,info:f,children:u,disabled:b,caption:h,roles:p,permission:m,guardCheckFunction:y}=l,v=a?"page":void 0;let w;n[6]!==d?(w=d&&i(Ft,{sx:{mr:1,flexShrink:0,width:xe.NAVBAR_ITEM_HORIZONTAL,height:xe.NAVBAR_ITEM_HORIZONTAL},children:d}),n[6]=d,n[7]=w):w=n[7];const C=a?"subtitle2":"body2";let k;n[8]!==C?(k={primary:{noWrap:!0,variant:C}},n[8]=C,n[9]=k):k=n[9];let _;n[10]!==k||n[11]!==c?(_=i(Gt,{primary:c,slotProps:k}),n[10]=k,n[11]=c,n[12]=_):_=n[12];let g;n[13]!==h?(g=h&&i(We,{title:h,arrow:!0,children:i(L,{component:"span",sx:{ml:.5,lineHeight:0},children:i(be,{icon:"eva:info-outline",sx:{width:xe.NAVBAR_ITEM_HORIZONTAL/-4,height:xe.NAVBAR_ITEM_HORIZONTAL/-4}})})}),n[13]=h,n[14]=g):g=n[14];let S;n[15]!==f?(S=f&&i(L,{component:"span",sx:{ml:1,lineHeight:0},children:f}),n[15]=f,n[16]=S):S=n[16];let T;n[17]!==u||n[18]!==o?(T=!!u&&i(be,{icon:o>1?"eva:chevron-right-fill":"eva:chevron-down-fill",sx:{ml:.5,flexShrink:0,width:xe.NAVBAR_ITEM_HORIZONTAL,height:xe.NAVBAR_ITEM_HORIZONTAL}}),n[17]=u,n[18]=o,n[19]=T):T=n[19];let I;n[20]!==a||n[21]!==o||n[22]!==b||n[23]!==s||n[24]!==r||n[25]!==e||n[26]!==v||n[27]!==w||n[28]!==_||n[29]!==g||n[30]!==S||n[31]!==T?(I=P(vo,{ref:e,open:s,depth:o,active:a,disabled:b,"aria-current":v,...r,children:[w,_,g,S,T]}),n[20]=a,n[21]=o,n[22]=b,n[23]=s,n[24]=r,n[25]=e,n[26]=v,n[27]=w,n[28]=_,n[29]=g,n[30]=S,n[31]=T,n[32]=I):I=n[32];const E=I;let x;return n[33]!==y||n[34]!==m||n[35]!==E||n[36]!==p?(x=i(Wt,{permission:m,roles:p,guardCheckFunction:y,children:E}),n[33]=y,n[34]=m,n[35]=E,n[36]=p,n[37]=x):x=n[37],x});Ye.displayName="NavItem";Ye.propTypes={active:H.bool,open:H.bool,depth:H.number,item:H.shape({children:H.array,icon:H.any,info:H.any,caption:H.str
1ing,path:H.string,title:H.string,disabled:H.bool,roles:H.arrayOf(H.string)})};pt.propTypes={data:H.object,depth:H.number,hasChildren:H.bool};function pt({data:t,depth:e,hasChildren:n}){const a=M.useRef(null),o=Se(),{pathname:l,search:s}=_e(),r=Ne(t.path,l,t.matchPaths),[c,d]=M.useState(!1);M.useEffect(()=>{c&&u()},[l]);const f=()=>{d(!0)},u=()=>{d(!1)},b=()=>{n||o(t.path,t.passReturnTo?{state:{returnTo:l+s}}:void 0)};return P(de,{children:[un(t.path)?i(Kt,{href:t.path,target:"_blank",rel:"noopener",underline:"none",children:i(Ye,{item:t,depth:e,open:c,active:r})}):i(Ye,{item:t,depth:e,open:c,active:r,ref:a,onClick:b,onMouseEnter:f,onMouseLeave:u}),n&&i(wo,{open:c,anchorEl:a.current,anchorOrigin:e===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:e===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},PaperProps:{onMouseEnter:f,onMouseLeave:u},children:i(cn,{data:t.children,depth:e})})]})}cn.propTypes={data:H.array,depth:H.number};function cn(t){const e=B.c(7),{data:n,depth:a}=t;let o;if(e[0]!==n||e[1]!==a){let s;e[3]!==a?(s=r=>i(pt,{data:r,depth:a+1,hasChildren:!!r.children},r.title+r.path),e[3]=a,e[4]=s):s=e[4],o=n.map(s),e[0]=n,e[1]=a,e[2]=o}else o=e[2];let l;return e[5]!==o?(l=i(de,{children:o}),e[5]=o,e[6]=l):l=e[6],l}const To={msOverflowStyle:"none",scrollbarWidth:"none",overflowY:"scroll","&::-webkit-scrollbar":{display:"none"}};dn.propTypes={navConfig:H.array};function dn(t){const e=B.c(6),{navConfig:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={bgcolor:"background.neutral",borderRadius:1,px:.5},e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={...To,py:1},e[1]=o):o=e[1];let l;e[2]!==n?(l=n.map(Io),e[2]=n,e[3]=l):l=e[3];let s;return e[4]!==l?(s=i(re,{direction:"row",justifyContent:"center",sx:a,children:i(re,{direction:"row",sx:o,children:l})}),e[4]=l,e[5]=s):s=e[5],s}function Io(t){return i(re,{direction:"row",flexShrink:0,children:t.items.map(ko)},t.subheader)}function ko(t){return i(pt,{data:t,depth:1,hasChildren:!!t.children},t.title+t.path)}const Co=M.memo(dn);function un(t){return t.includes("http")}function Ne(t,e,n){return[t,...n||[]].some(o=>o&&!!Tn({path:o,end:!1},e))}const fn=[{subheader:"plays",items:[{guardCheckFunction:(t,e,n)=>!t||n("player_plays"),title:"Plays",path:A.plays.plays,matchPaths:[A.plays.play(":id"),A.plays.playFromJson,A.plays.importFastDraw],icon:i(F,{icon:xt})},{guardCheckFunction:(t,e,n)=>!t||n("player_playbooks"),title:"Playbooks",path:A.plays.playbooks,matchPaths:[A.plays.playbook(":id")],icon:i(F,{icon:kn})},{guardCheckFunction:t=>!t,endIcon:i(F,{style:{fontSize:12},width:22,height:22,icon:vt}),title:"Play Library",path:"https://www.thehoopsgeek.com/basketball-plays/",icon:i(F,{icon:St})}]},{subheader:"Practice Planning",items:[{guardCheckFunction:(t,e,n)=>!t||n("player_drills"),title:"Drills",path:A.practices.drills,matchPaths:[A.drills.drill(":id")],icon:i(F,{icon:xt})},{guardCheckFunction:(t,e,n)=>!t||n("player_practice_plans"),title:"Practice Plans",path:A.practices.practicePlans,matchPaths:[A.practices.practicePlan(":id")],icon:i(F,{icon:Cn})},{guardCheckFunction:t=>!t,endIcon:i(F,{style:{fontSize:12},width:22,height:22,icon:vt}),title:"Drill Library",path:"https://www.thehoopsgeek.com/basketball-drills/",icon:i(F,{icon:St})}]},{subheader:"Rotations",items:[{guardCheckFunction:(t,e,n)=>!t||n("player_rotations"),title:"Rotations",path:A.rotations.rotations,matchPaths:[A.rotations.rotation(":id")],icon:i(F,{icon:En})},{guardCheckFunction:In,title:"Sub Manager",path:A.rotations.substitutionManager,passReturnTo:!0,icon:i(F,{icon:An})}]},{subheader:"Uploads",showStorageSpace:!0,guardCheckFunction:(t,e,n)=>!t||n("player_uploads"),items:[{title:"Videos",path:A.uploads.videos,icon:i(F,{icon:Rn})},{title:"Images",path:A.uploads.images,icon:i(F,{icon:Pn})},{title:"Audio",path:A.uploads.audio,icon:i(F,{icon:On})}]},{subheader:"Admin",guardCheckFunction:(t,e)=>e({permissions:["EDIT_LIBRARY"]}),items:[{title:"Plays",path:A.admin.library,icon:i(F,{icon:wt})},{title:"Drills",path:A.admin.drillLibrary,icon:i(F,{icon:wt})}]}];pn.propTypes={collapseClick:H.bool,onToggleCollapse:H.func,sx:H.object};function pn(t){const e=B.c(14),{onToggleCollapse:n,collapseClick:a,sx:o}=t,l=a?"Expand menu":"Collapse menu";let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={p:.5,width:28,height:28,color:"text.secondary",bgcolor:"background.paper",border:Ao,boxShadow:Eo},e[0]=s):s=e[0];const r=a?Dn:Hn;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={fontSize:13},e[1]=c):c=e[1];let d;e[2]!==r?(d=i(F,{icon:r,style:c}
1),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==l||e[5]!==n||e[6]!==d?(f=i(Oe,{onClick:n,"aria-label":l,sx:s,children:d}),e[4]=l,e[5]=n,e[6]=d,e[7]=f):f=e[7];let u;e[8]!==l||e[9]!==f?(u=i(We,{title:l,placement:"right",children:f}),e[8]=l,e[9]=f,e[10]=u):u=e[10];let b;return e[11]!==o||e[12]!==u?(b=i(L,{sx:o,children:u}),e[11]=o,e[12]=u,e[13]=b):b=e[13],b}function Eo(t){return t.customShadows.z8}function Ao(t){return`1px solid ${t.palette.divider}`}async function Ro(t){return(await Ce.get(`/user/${t}/storage`)).data}async function Po(t){return(await Ce.get(`/teams/${t}/storage`)).data}function Oo(t){const e=B.c(10),{db_user_id:n,selectedTeamId:a}=t;let o,l;e[0]!==n||e[1]!==a?(o=[n,"storage",a],l=async()=>{let f;return a?f=await Po(a):f=await Ro(n),f},e[0]=n,e[1]=a,e[2]=o,e[3]=l):(o=e[2],l=e[3]);const s=!!(a||n);let r;e[4]!==o||e[5]!==l||e[6]!==s?(r={queryKey:o,queryFn:l,enabled:s},e[4]=o,e[5]=l,e[6]=s,e[7]=r):r=e[7];const c=st(r);let d;return e[8]!==c?(d={...c},e[8]=c,e[9]=d):d=e[9],d}const At=(t,e=1)=>t<1e3*1024?`${(t/1024).toFixed(e)} KB`:t<1e3*1024*1024?`${(t/1024/1024).toFixed(e)} MB`:`${(t/1024/1024/1024).toFixed(e)} GB`;function Do(t){const e=B.c(28),{isCollapse:n}=t,a=n===void 0?!1:n,o=Me(),{user:l}=ke(),{goToStandardCheckout:s}=at(),r=Zt(),c=l==null?void 0:l.db_user_id,d=o==null?void 0:o.team_id;let f;e[0]!==c||e[1]!==d?(f={db_user_id:c,selectedTeamId:d},e[0]=c,e[1]=d,e[2]=f):f=e[2];const{data:u,isLoading:b}=Oo(f);if(r.status==="YES"||b||!u)return null;const h=Math.min(u.total_storage/u.max_storage*100,100),p=h>80,m=h>=100;if(!p&&!m||a)return null;let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=i(L,{sx:{fontSize:14,fontWeight:600,mb:1},children:"Used Storage Space"}),e[3]=y):y=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v={display:"flex",alignItems:"center"},e[4]=v):v=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w={mr:1,mt:0,flex:1,borderRadius:1,overflow:"hidden",display:"flex",height:18,border:1,borderColor:"grey.400",background:"white"},e[5]=w):w=e[5];let C;e[6]!==p||e[7]!==m||e[8]!==h?(C=i(L,{sx:w,children:i(L,{sx:x=>({bgcolor:m?pe(x==null?void 0:x.palette.error.main,.7):p?pe(x==null?void 0:x.palette.warning.main,.7):pe(x==null?void 0:x.palette.success.main,.7),width:`${h}%`,minWidth:h>0?"2px":"0px"})})}),e[6]=p,e[7]=m,e[8]=h,e[9]=C):C=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:12,fontWeight:500},e[10]=k):k=e[10];let _;e[11]!==u.total_storage?(_=At(u.total_storage,1),e[11]=u.total_storage,e[12]=_):_=e[12];let g;e[13]!==u.max_storage?(g=At(u.max_storage,0),e[13]=u.max_storage,e[14]=g):g=e[14];let S;e[15]!==_||e[16]!==g?(S=P("span",{style:k,children:[_," of"," ",g]}),e[15]=_,e[16]=g,e[17]=S):S=e[17];let T;e[18]!==S||e[19]!==C?(T=P(L,{sx:v,children:[C,S]}),e[18]=S,e[19]=C,e[20]=T):T=e[20];let I;e[21]!==s||e[22]!==p||e[23]!==(o==null?void 0:o.team_id)?(I=p&&!(o!=null&&o.team_id)&&i(L,{sx:{mt:2},children:i(ge,{onClick:x=>{x.stopPropagation(),x.preventDefault(),s({purchaseIntent:"first_purchase"})},size:"small",sx:{boxShadow:0},variant:"contained",color:"primary",children:"Upgrade Account"})}),e[21]=s,e[22]=p,e[23]=o==null?void 0:o.team_id,e[24]=I):I=e[24];let E;return e[25]!==T||e[26]!==I?(E=P(L,{sx:Ho,children:[y,T,I]}),e[25]=T,e[26]=I,e[27]=E):E=e[27],E}function Ho(t){return{p:1.5,borderRadius:1,backgroundColor:t.palette.grey[5008]}}const $o="dashboard_nav_reports_list_expanded",Lo="dashboard_nav_boards_list_expanded",Mo={title:"Home",path:A.home,icon:i(F,{icon:Wn})},Bo={title:"Tasks",path:A.tasks,icon:i(F,{icon:Fn}),feature:"tasks"},No={title:"Calendar",path:A.calendar,feature:"player_calendar",icon:i(F,{icon:zn})},Wo={title:"Practices",path:A.practiceList,matchPaths:[A.practiceEvent(":eventId")],feature:"player_calendar",icon:i(F,{icon:Un})},zo={title:"Reports",path:A.reports.reports,icon:i(F,{icon:Gn}),staffOnly:!0},Rt={title:"Dashboards",collapsedTitle:"Boards",path:A.boards.boards,matchPaths:[A.boards.board(":id")],icon:i(F,{icon:Kn})};function Pt(t,e="default"){if(t)return i(ft,{color:e,children:t>9?"9+":t})}ht.propTypes={item:H.object.isRequired,subItems:H.array.isRequired,storageKey:H.string.isRequired};function ht(t){const e=B.c(33),{item:n,subItems:a,storageKey:o}=t,l=Se(),{pathname:s}=_e(),r=Ne(n.path,s);let c;e[0]!==n.matchPaths||e[1]!==n.path||e[2]!==s||e[3]!==a?(c=Ne(n.path,s,n.matchPaths)||a.some(g=>Ne(g.path,s,g.matchPaths)),e[0]=n.matchPaths,e[1]=n.path,e[2]=s,e[3]=a,e[4]=c):c=e[4];const d=c,[f,u]=en(o,d),b=r?"page":void 0;let h;e[5]!==n.path||e[6]!==l?(h=()=>l(n.path),e[5]=n.path,e[6]=l,e[7]=h):h=e[7];let p;e[8]!==n.icon?(p=i(qe,{children:n.icon}),e[8]=n.icon,e[9]=p):p=e[9];const m=d?"subtitle2":"body2";let y;e[10]!==m?(y={noWrap:!0,variant:m},e[10]=m,e[11]=y):y=e[11];let v;e[12]!==n.title||e[13]!==y?(v=i(on,{primary:n.title,primaryTypographyProps:y}
1),e[12]=n.title,e[13]=y,e[14]=v):v=e[14];let w;e[15]!==n.title||e[16]!==f||e[17]!==u||e[18]!==a.length?(w=a.length>0&&i(Yt,{"aria-label":`${f?"Collapse":"Expand"} ${n.title}`,onClick:g=>{g.stopPropagation(),u(Fo)},sx:{flexShrink:0,color:"inherit",borderRadius:1,height:{xs:36,lg:30},width:{xs:44,lg:40},mr:-.5},children:i(F,{icon:f?qn:et,style:{fontSize:16}})}),e[15]=n.title,e[16]=f,e[17]=u,e[18]=a.length,e[19]=w):w=e[19];let C;e[20]!==d||e[21]!==b||e[22]!==h||e[23]!==p||e[24]!==v||e[25]!==w?(C=P(nn,{depth:1,active:d,"aria-current":b,onClick:h,children:[p,v,w]}),e[20]=d,e[21]=b,e[22]=h,e[23]=p,e[24]=v,e[25]=w,e[26]=C):C=e[26];let k;e[27]!==f||e[28]!==a?(k=a.length>0&&i(qt,{in:f,unmountOnExit:!0,children:i(Ie,{component:"div",disablePadding:!0,children:a.map(Uo)})}),e[27]=f,e[28]=a,e[29]=k):k=e[29];let _;return e[30]!==k||e[31]!==C?(_=P(de,{children:[C,k]}),e[30]=k,e[31]=C,e[32]=_):_=e[32],_}function Uo(t){return i(Be,{data:t,depth:2,hasChildren:!1},t.path)}function Fo(t){return!t}hn.propTypes={isCollapse:H.bool};function hn(t){const e=B.c(30),{isCollapse:n}=t,a=n===void 0?!1:n,o=Me(),l=o==null?void 0:o.team_id;let s;e[0]!==l?(s={selectedTeamId:l},e[0]=l,e[1]=s):s=e[1];const{dashboards:r}=Ci(s),c=$n((o==null?void 0:o.team_id)??null),d=Ln((o==null?void 0:o.team_id)??null),f=Mn((o==null?void 0:o.team_id)??null),u=Ei((o==null?void 0:o.team_id)??null);let b;e[2]!==c?(b=Bn(c,"messaging"),e[2]=c,e[3]=b):b=e[3];const h=b;let p;e[4]!==h?(p={enabled:h},e[4]=h,e[5]=p):p=e[5];const m=Ti((o==null?void 0:o.team_id)??null,p);let y;e[6]!==h?(y={enabled:h},e[6]=h,e[7]=y):y=e[7];const{data:v}=Jt(y),C=(v===void 0?[]:v).find(R=>R.team_id===(o==null?void 0:o.team_id)&&R.type==="team"),k=C?`${A.messages}?conversation=${C.conversation_id}`:A.messages;let _;if(e[8]!==d||e[9]!==f||e[10]!==m||e[11]!==u||e[12]!==o||e[13]!==k){const R={title:"Team Chat",feature:"messaging",path:k,matchPaths:[A.messages],icon:i(F,{icon:Nn}),info:Pt(m,"error")},$={...Bo,info:Pt(u)},O={...zo,subItems:Ai.filter(D=>!D.feature||d(D.feature)).map(Yo),storageKey:$o};_=o?[Mo,No,Wo,$,R,O].filter(D=>(!D.feature||d(D.feature))&&(!D.staffOnly||f)):[],e[8]=d,e[9]=f,e[10]=m,e[11]=u,e[12]=o,e[13]=k,e[14]=_}else _=e[14];const g=_;if(a){let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R={px:ce.COLLAPSED_LIST_PADDING_X,minWidth:0},e[15]=R):R=e[15];let $;return e[16]!==g?($=i(Ie,{disablePadding:!0,sx:R,children:[...g,Rt].map(qo)}),e[16]=g,e[17]=$):$=e[17],$}let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S={px:2,minWidth:0},e[18]=S):S=e[18];let T;e[19]!==f||e[20]!==o||e[21]!==g?(T=o&&P(de,{children:[P(an,{sx:{display:"flex",alignItems:"center",pr:0},children:["Team Hub",f&&i(ft,{variant:"ghost",color:"default",sx:{ml:"auto",px:1.5},children:"BETA"})]}),g.map(Ko)]}),e[19]=f,e[20]=o,e[21]=g,e[22]=T):T=e[22];let I;e[23]!==r?(I=r.map(Go),e[23]=r,e[24]=I):I=e[24];let E;e[25]!==I?(E=i(ht,{item:Rt,subItems:I,storageKey:Lo}),e[25]=I,e[26]=E):E=e[26];let x;return e[27]!==T||e[28]!==E?(x=i(de,{children:P(Ie,{disablePadding:!0,sx:S,children:[T,E]})}),e[27]=T,e[28]=E,e[29]=x):x=e[29],x}function Go(t){return{title:t.title,path:A.boards.board(t.dashboard_id)}}function Ko(t){return t.subItems?i(ht,{item:t,subItems:t.subItems,storageKey:t.storageKey},t.path):i(Be,{data:t,depth:1,hasChildren:!1},t.path)}function qo(t){return i(Be,{data:t,depth:1,hasChildren:!1,isCollapse:!0},t.path)}function Yo(t){return{title:t.title,path:t.path}}const jo={title:"Run your team in one place",description:"Get a shared library, free player accounts, team calendar, tasks, and chat.",cta:"Upgrade to Team",dismissible:!0,target:{purchaseIntent:"first_purchase",tier:"team"}};function Vo({entitlements:t,permissionsReady:e,selectedTeamId:n}){return!e||!t||n===void 0||n!==null||t.hasTeamStaffMembership||t.hasOrganizationAdminRole?null:t.hasActivePersonalPro?jo:null}const Qo="sidebarDismissedTeamUpgradeUserIds";mn.propTypes={isCollapse:H.bool};function mn(t){var O;const e=B.c(28),{isCollapse:n}=t,a=n===void 0?!1:n,{goToStandardCheckout:o}=at(),{user:l}=ke(),s=l==null?void 0:l.db_user_id,r=$e(Jo),c=Nt(),d=Array.isArray((O=c.data)==null?void 0:O.data)?c.data.data:[],f=fi(d),u=s==null?null:String(s);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[h,p]=en(Qo,b),m=Vo({entitlements:f,permissionsReady:c.isSuccess,selectedTeamId:r}),y=!!(m!=null&&m.dismissible)&&Array.isArray(h)&&h.includes(u);if(a||!m||y)return null;let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={px:2,pb:2,pt:.5},e[1]=v):v=e[1];let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=i(L,{"aria-hidden":"true",sx:Xo}),e[2]=w):w=e[2];let C;e[3]!==p||e[4]!==u||e[5]!==m.dismissible?(C=m.dismissible&&i(Yt,{size:"small","aria-label":"Dismiss Upgrade to Team offer",onClick:()=>{u&&p(D=>[...new Set([...Array.isArray(D)?D:[],u])])},sx:{position:"absolute",zIndex:2,top:4,right:4,width:28,height:28,color:"text.secondary"},children:i(F,{icon:Yn,style:{fontSize:12}})}),e[3]=p,e[4]=u,e[5]=m.dismissible,e[6]=C):C=e[6];const k=m.dismissible?3:0;let _;e[7]!==k?(_={mb:.5,pr:k,lineHeight:1.35},e[7]=k,e[8]=_):_=e[8];let g;e[9]!==_||e[10]!==m.title?(g=i(J,{variant:"subtitle2",sx:_,children:m.title}),e[9]=_,e[10]=m.title,e[11]=g):g=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S={display:"block",mb:1.5,color:"text.secondary",lineHeight:1.5},e[12]=S):S=e[12];let T;e[13]!==m.description?(T=i(J,{variant:"caption",sx:S,children:m.description}),e[13]=m.description,e[14]=T):T=e[14];let I;e[15]!==o||e[16]!==m.target?(I=()=>o(m.target),e[15]=o,e[16]=m.target,e[17]=I):I=e[17];let E,x;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=i(F,{icon:jn,style:{fontSize:14}}),x={boxShadow:"none",fontWeight:700,minHeight:36},e[18]=E,e[19]=x):(E=e[18],x=e[19]);let R;e[20]!==I||e[21]!==m.cta?(R=i(ge,{fullWidth:!0,variant:"contained",color:"primary",size:"small",onClick:I,endIcon:E,sx:x,children:m.cta}),e[20]=I,e[21]=m.cta,e[22]=R):R=e[22];let $;return e[23]!==T||e[24]!==R||e[25]!==C||e[26]!==g?($=i(L,{sx:v,children:P(L,{sx:Zo,children:[w,C,g,T,R]})}),e[23]=T,e[24]=R,e[25]=C,e[26]=g,e[27]=$):$=e[27],$}function Xo(t){return{position:"absolute",zIndex:-1,top:-44,right:-40,width:104,height:104,border:`12px solid ${pe(t.palette.primary.main,.05)}`,borderRadius:"50%"}}function Zo(t){return{position:"relative",isolation:"isolate",overflow:"hidden",p:1.5,border:"1px solid",borderColor:pe(t.palette.primary.main,.32),borderRadius:2,backgroundColor:pe(t.palette.primary.main,.08)}}function Jo(t){var e;return(e=t==null?void 0:t.reduxUser)==null?void 0:e.selectedTeamId}const ea=ye("div")(({theme:t})=>({[t.breakpoints.up("lg")]:{flexShrink:0,transition:t.transitions.create("width",{duration:t.transitions.duration.shorter})}}));ot.propTypes={isOpenSidebar:H.bool,onCloseSidebar:H.func};function ot({isOpenSidebar:t,onCloseSidebar:e}){const n=si(),{pathname:a}=_e(),o=dt("up","lg"),{isCollapse:l,collapseClick:s,collapseHover:r,onToggleCollapse:c}=jt();M.useEffect(()=>{t&&e()},[a]);
1const d={height:1,"& .simplebar-content":{height:1,display:"flex",flexDirection:"column"}},f=P(de,{children:[i(hn,{isCollapse:l&&o}),i(ln,{navConfig:fn,isCollapse:l}),i(L,{sx:{px:2,py:2},children:i(Do,{isCollapse:l})}),i(L,{sx:{flexGrow:1}}),i(mn,{isCollapse:l})]}),u=P(Ct,{sx:d,children:[P(re,{spacing:3,sx:{pt:3,pb:3,px:2,flexShrink:0},children:[i(re,{direction:"row",alignItems:"center",justifyContent:"flex-start",children:i(tt,{to:A.root,small:!0})}),i(nt,{isCollapse:l})]}),f]}),b=P(L,{sx:{height:1,display:"flex",flexDirection:"column",position:"relative"},children:[i(pn,{onToggleCollapse:c,collapseClick:s,sx:h=>({position:"absolute",right:0,top:`calc(${h.spacing(2)} + 20px)`,zIndex:2,display:"inline-flex",transform:"translate(50%, -50%)"})}),P(re,{spacing:2,sx:{pt:2,pb:2.5,px:2,flexShrink:0,minWidth:0,width:1,boxSizing:"border-box",...l&&{alignItems:"center"}},children:[i(L,{sx:{alignSelf:"stretch",display:"flex",alignItems:"center",justifyContent:"flex-start",minHeight:40},children:i(tt,{to:A.root,small:!0})}),i(nt,{isCollapse:l})]}),i(Ct,{sx:{...d,flex:1,minHeight:0},children:f})]});return P(ea,{sx:{width:{lg:l?ce.DASHBOARD_COLLAPSE_WIDTH:ce.DASHBOARD_WIDTH},...s&&{position:"absolute"}},children:[!o&&i(It,{open:t,onClose:e,slotProps:{paper:{sx:{width:ce.DASHBOARD_WIDTH}}},children:u}),o&&i(It,{open:!0,variant:"persistent",slotProps:{paper:{sx:{width:ce.DASHBOARD_WIDTH,borderRightStyle:"dashed",bgcolor:"background.default",overflow:"visible",transition:h=>h.transitions.create("width",{duration:h.transitions.duration.standard}),...l&&{width:ce.DASHBOARD_COLLAPSE_WIDTH},...r&&{...Qe(n).bgBlur(),boxShadow:h=>h.customShadows.z24}}}},children:b})]})}const ta=ye(Ut)(({theme:t})=>({transition:t.transitions.create("top",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.shorter}),width:"100%",position:"fixed",zIndex:t.zIndex.appBar,padding:t.spacing(1,0),boxShadow:t.customShadows.z8,top:`calc(${me.DASHBOARD_DESKTOP_OFFSET_HEIGHT}px + var(--thg-safe-top, 0px))`,backgroundColor:t.palette.background.default}));function na(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i(ta,{children:i(ri,{maxWidth:!1,children:i(Co,{navConfig:fn})})}),t[0]=e):e=t[0],e}const ia=M.memo(na);function gn(){const t=_e(),e=li(oa),n=t.pathname.includes(A.plays.play(""))||t.pathname.includes(A.drills.drill(""))||t.pathname.includes(A.practices.practicePlan(""))||t.pathname.includes(A.practiceEvent(""))||t.pathname.includes(A.plays.playbook(""))||t.pathname.includes(A.rotations.rotation("")),a=new URLSearchParams(t.search),o=a.get("folder_id"),l=o!=null&&o!==""&&o!=="root",s=t.pathname.includes(A.messages)&&(!!Number(a.get("conversation"))||Ri(a));return!((n||l||s)&&e)}function oa(t){return t.breakpoints.down("md")}function aa(t){const e=B.c(8),{enabled:n}=t,{user:a}=ke();let o;e[0]!==a.db_user_id?(o=[a.db_user_id,"default_library"],e[0]=a.db_user_id,e[1]=o):o=e[1];const l=!!n&&!!a.db_user_id;let s;e[2]!==a.db_user_id?(s=async()=>{const{data:c}=await Ce.get(`/user/${a.db_user_id}/default_library`,{timeout:8e3});return c},e[2]=a.db_user_id,e[3]=s):s=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==s?(r={queryKey:o,enabled:l,staleTime:1/0,gcTime:1/0,retry:!1,queryFn:s},e[4]=o,e[5]=l,e[6]=s,e[7]=r):r=e[7],st(r)}function sa(){const t=B.c(16),e=je(),n=Se(),a=_e(),l=$e(ra)===void 0;let s;t[0]!==l?(s={enabled:l},t[0]=l,t[1]=s):s=t[1];const{data:r,isError:c,isSuccess:d}=aa(s);let f;t[2]!==(r==null?void 0:r.team_id)||t[3]!==e||t[4]!==d||t[5]!==a.pathname||t[6]!==n||t[7]!==l?(f=()=>{if(!l||!d)return;const b=(r==null?void 0:r.team_id)??null;e(Xe(b)),b&&a.pathname===Vn&&n(rt(b),{replace:!0})},t[2]=r==null?void 0:r.team_id,t[3]=e,t[4]=d,t[5]=a.pathname,t[6]=n,t[7]=l,t[8]=f):f=t[8];let u;return t[9]!==r||t[10]!==e||t[11]!==d||t[12]!==a.pathname||t[13]!==n||t[14]!==l?(u=[l,d,r,e,n,a.pathname],t[9]=r,t[10]=e,t[11]=d,t[12]=a.pathname,t[13]=n,t[14]=l,t[15]=u):u=t[15],M.useEffect(f,u),l&&!c}function ra(t){return t==null?void 0:t.reduxUser.selectedTeamId}function Ot(){const t=B.c(3),e=Se();let n,a;return t[0]!==e?(n=()=>{if(!De.isExpo())return;const o=s=>{let r;try{r=JSON.parse(s.data)}catch{return}if(!(!r||!r.type)){if(r.type==="PUSH_TOKEN"&&r.token)Ce.post("/push/subscriptions",{platform:"expo",token:r.token,device_label:r.platform?`Expo (${r.platform})`:"Expo"}).then(()=>{try{window.localStorage.setItem(yi,r.token)}catch{}}).catch(la);else if(r.type==="PUSH_NAVIGATE"&&r.url)e(r.url);else if(r.type==="PUSH_PERMISSION"&&r.status==="denied")try{window.localStorage.removeItem(kt)}catch{}}};window.addEventListener("message",o);let l=!1;try{l=window.localStorage.getItem(kt)==="true"}catch{}return l&&De.sendMessageToWebview({type:"PUSH_REGISTER"}),()=>window.removeEventListener("message",o)},a=[e],t[0]=e,t[1]=n,t[2]=a):(n=t[1],a=t[2]),M.useEffect(n,a),null}function la(t){return console.error("Expo push register failed",t)}function ca(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function Dt(){const t=B.c(11),{user:e}
1=ke(),n=Me(),{checkPermissions:a}=Bt(),o=ct();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=new Set,t[0]=l):l=t[0];const s=M.useRef(l),r=n==null?void 0:n.team_id,c=!!n&&n.timezone==null;let d;t[1]!==a||t[2]!==r?(d=r&&a({teamId:r,permissions:["EDIT_TEAM"]}),t[1]=a,t[2]=r,t[3]=d):d=t[3];const f=!!d,u=e==null?void 0:e.db_user_id;let b,h;return t[4]!==f||t[5]!==o||t[6]!==r||t[7]!==c||t[8]!==u?(b=()=>{const p=ca();!r||!c||!f||!p||s.current.has(r)||(s.current.add(r),Ce.put(`/teams/${r}/timezone_backfill`,{timezone:p}).then(()=>{o.invalidateQueries({queryKey:["team_details"]}),o.invalidateQueries({queryKey:[u,"available_teams"]})}).catch(da))},h=[r,c,f,u,o],t[4]=f,t[5]=o,t[6]=r,t[7]=c,t[8]=u,t[9]=b,t[10]=h):(b=t[9],h=t[10]),M.useEffect(b,h),null}function da(){}function Ht(){var h;const t=B.c(11),e=je(),n=$e(ua),a=Le(),{isSuccess:o,dataUpdatedAt:l}=a,s=(h=a.data)==null?void 0:h.data;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Date.now(),t[0]=r):r=t[0];const c=M.useRef(r);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{c.current=Date.now()},t[1]=d):d=t[1];let f;t[2]!==n?(f=[n],t[2]=n,t[3]=f):f=t[3],M.useEffect(d,f);let u,b;return t[4]!==l||t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==s?(u=()=>{!n||!o||l<=c.current||(s??[]).some(p=>p.team_id===n)||e(Xe(null))},b=[n,o,l,s,e],t[4]=l,t[5]=e,t[6]=o,t[7]=n,t[8]=s,t[9]=u,t[10]=b):(u=t[9],b=t[10]),M.useEffect(u,b),null}function ua(t){return t==null?void 0:t.reduxUser.selectedTeamId}const $t="push_prompt_v1",bn="pushPromptShownCount",fa=3;function pa({capable:t,configured:e,checked:n,enabled:a,permission:o,teamsLoaded:l,teamCount:s,metaLoading:r,promptMeta:c,shownCount:d,suppressedRoute:f}){if(!t||!e||!n||a||o==="denied"||o==="unsupported"||!l||s<1||r)return!1;const u=c==null?void 0:c.status;return!(u==="dismissed"||u==="blocked"||d>=fa||f)}const ha=1800;function ma(){var t;try{return De.isExpo()?((t=window==null?void 0:window.thg_nativeCapabilities)==null?void 0:t.push)===!0:Si()}catch{return!1}}function ga(){try{const t=Number(window.localStorage.getItem(bn));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function ba(t){try{window.localStorage.setItem(bn,String(t+1))}catch{}}function Lt(){var ae;const t=B.c(49),{permission:e,enabled:n,checked:a,loading:o,error:l,enable:s}=_i(),{getUserMetaValue:r,setUserMeta:c,userMetaLoading:d}=Di(),f=Le(),u=_e(),b=gn(),h=Oi(),{enqueueSnackbar:p}=lt(),[m]=M.useState(ma),[y]=M.useState(ga),[v,w]=M.useState(xa),[C,k]=M.useState(!1),[_,g]=M.use
1State(!1),S=M.useRef(!1),T=(ae=f.data)==null?void 0:ae.data;let I,E;if(t[0]!==m||t[1]!==a||t[2]!==n||t[3]!==r||t[4]!==u.pathname||t[5]!==e||t[6]!==b||t[7]!==y||t[8]!==T||t[9]!==d){const z=r($t);I=u.pathname.startsWith(A.invite)||u.pathname.startsWith(A.welcomeOrganization)||!b,E=pa({capable:m,configured:!0,checked:a,enabled:n,permission:e,teamsLoaded:Array.isArray(T),teamCount:(T==null?void 0:T.length)??0,metaLoading:d,promptMeta:z,shownCount:y,suppressedRoute:I}),t[0]=m,t[1]=a,t[2]=n,t[3]=r,t[4]=u.pathname,t[5]=e,t[6]=b,t[7]=y,t[8]=T,t[9]=d,t[10]=I,t[11]=E}else I=t[10],E=t[11];const x=E,R=x&&v===!0;let $,O;t[12]!==v||t[13]!==x?($=()=>{if(v!==null||!x)return;let z=!0;return xi().then(he=>{z&&w(he)}),()=>{z=!1}},O=[v,x],t[12]=v,t[13]=x,t[14]=$,t[15]=O):($=t[14],O=t[15]),M.useEffect($,O);let D,K;t[16]!==R||t[17]!==y?(D=()=>{if(S.current||!R)return;const z=setTimeout(()=>{S.current=!0,ba(y),k(!0)},ha);return()=>clearTimeout(z)},K=[R,y],t[16]=R,t[17]=y,t[18]=D,t[19]=K):(D=t[18],K=t[19]),M.useEffect(D,K);const q=C&&!I;let N;t[20]!==c?(N=z=>{c($t,{status:z,at:new Date().toISOString()}).catch(_a)},t[20]=c,t[21]=N):N=t[21];const W=N;let G;t[22]!==W?(G=()=>{W("dismissed"),k(!1)},t[22]=W,t[23]=G):G=t[23];const Q=G;let ee;t[24]!==s||t[25]!==p||t[26]!==W?(ee=async()=>{const z=await s();z!=null&&z.ok?(W("enabled"),k(!1),p("Notifications enabled.")):z!=null&&z.denied&&(W("blocked"),g(!0))},t[24]=s,t[25]=p,t[26]=W,t[27]=ee):ee=t[27];const j=ee,te=`calc(16px + ${h.bottom})`;let U;t[28]!==te?(U={xs:te,sm:24},t[28]=te,t[29]=U):U=t[29];let ie,X,oe;t[30]===Symbol.for("react.memo_cache_sentinel")?(ie={xs:16,sm:24},X={xs:16,sm:"auto"},oe={sm:380},t[30]=ie,t[31]=X,t[32]=oe):(ie=t[30],X=t[31],oe=t[32]);let Z;t[33]!==U?(Z={position:"fixed",zIndex:ya,bottom:U,right:ie,left:X,width:oe,maxWidth:"calc(100vw - 32px)",p:2.5,borderRadius:2},t[33]=U,t[34]=Z):Z=t[34];let fe;t[35]===Symbol.for("react.memo_cache_sentinel")?(fe={width:40,height:40,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,bgcolor:"primary.lighter",color:"primary.main"},t[35]=fe):fe=t[35];let Y;t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=P(re,{direction:"row",spacing:1.5,alignItems:"center",children:[i(L,{sx:fe,children:i(be,{icon:"eva:bell-fill",sx:{width:22,height:22}})}),i(J,{variant:"subtitle1",children:"Stay in the loop"})]}),t[36]=Y):Y=t[36];let V;t[37]!==_||t[38]!==l||t[39]!==Q||t[40]!==j||t[41]!==o?(V=P(re,{spacing:2,children:[Y,_?P(de,{children:[P(J,{variant:"body2",sx:{color:"text.secondary"},children:["Notifications are blocked for this app. Turn them on in your"," ",De.isExpo()?"device":"browser"," settings."]}),i(re,{direction:"row",justifyContent:"flex-end",children:i(ge,{color:"inherit",onClick:()=>k(!1),children:"Close"})})]}):P(de,{children:[i(J,{variant:"body2",sx:{color:"text.secondary"},children:"Get practice reminders, schedule changes and messages from all your teams on this device."}),l?i(ci,{severity:"error",children:l}):null,P(re,{direction:"row",spacing:1,justifyContent:"flex-end",children:[i(ge,{color:"inherit",onClick:Q,children:"Not now"}),i(ge,{variant:"contained",onClick:j,loading:o,sx:{boxShadow:0},children:"Enable notifications"})]})]})]}),t[37]=_,t[38]=l,t[39]=Q,t[40]=j,t[41]=o,t[42]=V):V=t[42];let ne;t[43]!==Z||t[44]!==V?(ne=i(di,{role:"dialog","aria-label":"Enable notifications",elevation:8,sx:Z,children:V}
1),t[43]=Z,t[44]=V,t[45]=ne):ne=t[45];let le;return t[46]!==q||t[47]!==ne?(le=i(ui,{direction:"up",in:q,mountOnEnter:!0,unmountOnExit:!0,children:ne}),t[46]=q,t[47]=ne,t[48]=le):le=t[48],le}function ya(t){return t.zIndex.snackbar}function _a(){}function xa(){return De.isExpo()?!0:null}const Sa=6e4,va=15e3,Je=2e3,wa=6e4,Ta={task:[["team-tasks"]],event:[["team_events"],["team_event"]],reminder:[["team_events"],["team_event"]],reminder_fyi:[["team_events"],["team_event"]],rsvp:[["team_events"],["team_event"],["team_attendance_overview"]]};function Ia(){const t=B.c(5),e=ct(),{getToken:n}=ke(),a=M.useRef(n);let o;t[0]!==n?(o=()=>{a.current=n},t[0]=n,t[1]=o):o=t[1],M.useEffect(o);let l,s;t[2]!==e?(l=()=>{let r=!1,c=null,d=null,f=null,u=Je,b=Date.now(),h=!1,p=!1;const m=(g,S)=>{const T=S==="media"||S==="poll";T||e.invalidateQueries({queryKey:["messaging","conversations"]}),g&&(S!=="read"&&e.invalidateQueries({queryKey:["messaging","messages",g]}),T||e.invalidateQueries({queryKey:["messaging","receipts",g]}))},y=()=>{f&&clearInterval(f),f=null,c&&c.abort(),c=null},v=()=>{if(r||d||p)return;h=!0;const g=.7+Math.random()*.6,S=u*g;u=Math.min(u*2,wa),d=setTimeout(k,S)},w=Ca,C=g=>{b=Date.now();e:switch(g.event){case"hello":{u=Je,h&&(h=!1,e.invalidateQueries({queryKey:["messaging"]}),e.invalidateQueries({queryKey:["notifications"]}));break e}case"messaging":{const S=w(g.data);m(S.conversation_id,S.reason);break e}case"notifications":{e.invalidateQueries({queryKey:["notifications"]});const S=w(g.data);for(const T of Ta[S.category]??[])e.invalidateQueries({queryKey:S.team_id!=null?[...T,S.team_id]:T});break e}case"typing":{Ii(w(g.data));break e}}};async function k(){if(d=null,r||p)return;p=!0,y();let g;try{g=await a.current()}catch{p=!1,v();return}if(r||!g){p=!1,r||v();return}const S=new AbortController;c=S,p=!1,b=Date.now(),f=setInterval(()=>{Date.now()-b>Sa&&(y(),v())},va),Hi(`${Qn}/events/stream`,{method:"GET",headers:{Accept:"text/event-stream",Authorization:`Bearer ${g}`},signal:S.signal,openWhenHidden:!0,async onopen(T){var I;if(!T.ok||!((I=T.headers.get("content-type"))!=null&&I.includes("text/event-stream")))throw new Error(`Event stream rejected: ${T.status}`)},onmessage:C,onclose(){throw new Error("Event stream closed by server")},onerror(T){throw T}}).catch(ka).then(()=>{r||c!==S||(y(),v())})}const _=()=>{document.visibilityState!=="visible"||c||r||p||(d&&(clearTimeout(d),d=null),u=Je,k())};return document.addEventListener("visibilitychange",_),k(),()=>{r=!0,document.removeEventListener("visibilitychange",_),d&&clearTimeout(d),y()}},s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),M.useEffect(l,s)}function ka(){}function Ca(t){try{return JSON.parse(t)}catch{return{}}}function Mt(){return Ia(),null}const Ea=ye("main",{shouldForwardProp:t=>t!=="collapseClick"})(({collapseClick:t,theme:e})=>({flexGrow:1,paddingTop:`calc(${me.MOBILE_HEIGHT}px + var(--thg-safe-top, 0px))`,paddingBottom:me.MOBILE_HEIGHT+24,[e.breakpoints.up("lg")]:{paddingLeft:16,paddingRight:16,paddingTop:`calc(${me.DASHBOARD_DESKTOP_HEIGHT+24}px + var(--thg-safe-top, 0px))`,paddingBottom:me.DASHBOARD_DESKTOP_HEIGHT+24,width:`calc(100% - ${ce.DASHBOARD_WIDTH}px)`,transition:e.transitions.create("margin-left",{duration:e.transitions.duration.shorter}),...t&&{marginLeft:ce.DASHBOARD_COLLAPSE_WIDTH}}}));function Aa(){const t=B.c(35),{collapseClick:e,isCollapse:n}=jt(),{themeLayout:a}=Xn(),o=dt("up","lg"),[l,s]=M.useState(!1),r=a==="vertical",c=gn();if(sa()){let g;return t[0]===Symbol.for("react.memo_cache_sentinel")?(g=i(Pi,{}),t[0]=g):g=t[0],g}if(r){let g,S,T,I,E;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=i(Ot,{}),S=i(Dt,{}),T=i(Ht,{}),I=i(Lt,{}),E=i(Mt,{}),t[1]=g,t[2]=S,t[3]=T,t[4]=I,t[5]=E):(g=t[1],S=t[2],T=t[3],I=t[4],E=t[5]);let x;t[6]!==c||t[7]!==r?(x=c&&i(it,{onOpenSidebar:()=>s(!0),verticalLayout:r}),t[6]=c,t[7]=r,t[8]=x):x=t[8];let R;t[9]!==o||t[10]!==l?(R=o?i(ia,{}):i(ot,{isOpenSidebar:l,onCloseSidebar:()=>s(!1)}),t[9]=o,t[10]=l,t[11]=R):R=t[11];let $;t[12]===Symbol.for("react.memo_cache_sentinel")?($=i(L,{component:"main",sx:{px:{lg:2},pt:{xs:`calc(${me.MOBILE_HEIGHT+24}px + var(--thg-safe-top, 0px))`,lg:`calc(${me.DASHBOARD_DESKTOP_HEIGHT+80}px + var(--thg-safe-top, 0px))`},pb:{xs:`${me.MOBILE_HEIGHT+24}px`,lg:`${me.DASHBOARD_DESKTOP_HEIGHT+24}px`}},children:i(Tt,{})}),t[12]=$):$=t[12];let O;return t[13]!==x||t[14]!==R?(O=P(de,{children:[g,S,T,I,E,x,R,$]}),t[13]=x,t[14]=R,t[15]=O):O=t[15],O}let f,u,b,h,p,m;t[16]===Symbol.for("react.memo_cache_sentinel")?(f={display:{lg:"flex"},minHeight:{lg:1}},u=i(Ot,{}),b=i(Dt,{}),h=i(Ht,{}),p=i(Lt,{}),m=i(Mt,{}),t[16]=f,t[17]=u,t[18]=b,t[19]=h,t[20]=p,t[21]=m):(f=t[16],u=t[17],b=t[18],h=t[19],p=t[20],m=t[21]);let y;t[22]!==n||t[23]!==c?(y=c&&i(it,{isCollapse:n,onOpenSidebar:()=>s(!0)}),t[22]=n,t[23]=c,t[24]=y):y=t[24];let v;t[25]===Symbol.for("react.memo_cache_sentinel")?(v=()=>s(!1),t[25]=v):v=t[25];let w;t[26]!==l?(w=i(ot,{isOpenSidebar:l,onCloseSidebar:v}),t[26]=l,t[27]=w):w=t[27];let C;t[28]===Symbol.for("react.memo_cache_sentinel")?(C=i(Tt,{}),t[28]=C):C=t[28];let k;t[29]!==e?(k=i(Ea,{collapseClick:e,children:C}),t[29]=e,t[30]=k):k=t[30];let _;return t[31]!==k||t[32]!==y||t[33]!==w?(_=P(L,{sx:f,children:[u,b,h,p,m,y,w,k]}
1),t[31]=k,t[32]=y,t[33]=w,t[34]=_):_=t[34],_}const ms=()=>[{name:"robots",content:"noindex"}];function gs(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i(Aa,{}),t[0]=e):e=t[0],e}export{gs as default,ms as meta}; 2//# sourceMappingURL=_auth.dashboard-CdahP9Ss.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.