1import{r as d,j as e,P as S,a$ as O,aj as U,aW as Ee,T as f,aL as $,c6 as ke,aS as q,c7 as F,A as Re,bb as Be,B as T,c8 as Se,c9 as Q,k as le,ca as J,cb as N,aX as Ae,b1 as M,cc as D,am as w,an as He,ar as Le,at as Me,cd as Oe,aM as We,ce as Fe,cf as Pe,cg as $e,N as Ne,Q as De,L as Ge,ch as H,ci as Ve,X as Ue,cj as ze,b5 as _e,ck as Ye,cl as Xe,bj as K}from"./index-bBuPCj8X.js";import{c as qe,a as Qe,t as Je,b as Z,i as Ke,S as oe,M as de}from"./meetLog-q6S7aKQj.js";import{E as me,a as ee}from"./util-B5O9bxOB.js";import{Progress as G}from"./MeetHostStats-V0NpfRuO.js";import{S as Ze}from"./SelectField-BbhdOjZE.js";import{I as te}from"./InlineAlert-ChMsYUVG.js";import{E as ie}from"./EditIcon-BPDq8wZu.js";import{D as ne}from"./DollarIcon-CWFfru7v.js";import{M as se}from"./MenuIcon-C0MRaN7a.js";import"./index-C967YkgP.js";import"./Select-tB1Cb1DO.js";const et="_timeline_1k72r_1",tt={timeline:et},P=({val:i})=>i>0&&e.jsx("span",{title:`${i} scratched`,style:{color:"rgba(200,0,0,0.8)",textDecoration:"line-through",marginLeft:".3em",fontSize:".85em"},children:i});function it({slowestTimelineMs:i,maxTimelineExceeded:t,maxTimeline:n}){return e.jsxs("div",{style:{color:t?"rgba(200,0,0)":"rgba(0,0,0,0.5)"},children:[F.fromMillis(i).toFormat("hh:mm:ss"),Ke(n)&&` / ${F.fromObject({seconds:n}).toFormat("hh:mm:ss")}`,t&&e.jsx("b",{children:" (timeline exceeded)"})]})}const v={width:"12em",flexShrink:0},nt={padding:10},st=d.memo(({meetSession:i,timelineState:t,updateFormState:n})=>{const{getSwimmerIdAge:m,hasChangedTimelineFormState:u,onSaveTimelineParametersClick:h,basicMeetInfo:l}=O(),g=U(),{formState:o,state:y,isValid:I,isNumLanesValid:E,isNumLanesGirlsValid:A,isNumLanesBoysValid:k,isScratchRateValid:R,isIntervalValid:r,isInterval50Valid:b,isIntervalOddChaseHeatsValid:a,isExtraIntervalBackstrokeValid:p,isSessionStartTimeOffsetValid:c,isMaxTimelineValid:x}=t,{timelineMode:j,numLanes:W,numLanesBoys:z,numLanesGirls:_,interval:he,interval50:xe,intervalOddChaseHeats:ue,extraIntervalBackstroke:ge,scratchRate:je,sessionStartTimeOffset:ve}=y,B=I?qe({availableEvents:i.availableEvents,numLanes:W,numLanesBoys:z,numLanesGirls:_,interval:he,interval50:xe,intervalOddChaseHeats:ue,extraIntervalBackstroke:ge,scratchRate:je,sessionStartTimeOffset:ve,timelineMode:j,getSwimmerIdAge:m}):void 0,{slowestTimelineMs:ye,maxTimelineExceeded:Y}=d.useMemo(()=>Qe({calculatedTimeline:B,maxTimeline:y.maxTimeline}),[B,y.maxTimeline]);function pe(){const s=Y&&i.status==="open";return e.jsxs(Re,{intent:s?"warning":void 0,title:"You have changes to the timeline parameters that are not yet stored. Once you're done, remember to save the changes.",children:[s&&e.jsx(Be,{color:"warning",fontWeight:"bold",marginTop:".5em",marginBottom:".5em",children:"Note: the calculated timeline exceeds the maximum duration. This means that meet will automatically close after you save these changes."}),e.jsx(T,{appearance:"primary",marginTop:"1em",onClick:h,children:"Save changes"})]})}return e.jsxs(e.Fragment,{children:[e.jsxs(S,{backgroundColor:"white",elevation:1,padding:10,marginBottom:25,children:[e.jsxs("div",{style:{marginBottom:"2em",display:"flex",flexWrap:"wrap",gap:"0 .7em",alignItems:"center"},children:[e.jsx("div",{style:{fontWeight:"bold"},children:i.name}),it({slowestTimelineMs:ye,maxTimelineExceeded:Y,maxTimeline:y.maxTimeline}),e.jsx(Ee,{status:l.status==="open"?i.status:"closed",marginLeft:".3em",marginRight:".5em"})]}),e.jsx("div",{style:{marginBottom:"1em"},children:e.jsxs("div",{style:{display:"flex",gap:"0 1em",flexWrap:"wrap",alignItems:"flex-start"},children:[e.jsxs("div",{style:v,children:[e.jsx(Ze,{marginTop:3,label:"Timeline mode",value:o.timelineMode,onChange:s=>n({timelineMode:s.target.value}),children:Je.map(s=>e.jsx("option",{value:s,children:Z[s]},s))}),o.timelineMode==="boysGirls"&&e.jsx("div",{style:{marginTop:".5em",fontSize:".9em"},children:I&&`Total lanes: ${z+_}`})]}),j==="boysGirls"||j==="oddEvenHeats"?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:v,children:e.jsx(f,{label:"Lanes (girls)",value:o.numLanesGirls,onChange:s=>n({numLanesGirls:s.target.value}),isInvalid:!A})}),e.jsx($.div,{initial:{scale:0},animate:{scale:1},style:{...v,overflow:"hidden"},children:e.jsx(f,{label:"Lanes (boys)",value:o.numLanesBoys,onChange:s=>n({numLanesBoys:s.target.value}),isInvalid:!k})})]}):e.jsx("div",{style:v,children:e.jsx(f,{label:"Lanes",value:o.numLanes,onChange:s=>n({numLanes:s.target.value}),isInvalid:!E})}),e.jsx("div",{style:v,children:e.jsx(f,{label:"Scratch rate (%)",hint:"How many percent of entries to scratch.",value:o.scratchRate,onChange:s=>n({scratchRate:s.target.value}),isInvalid:!R})}),e.jsx("div",{style:v,children:e.jsx(f,{label:"Interval (seconds)",hint:"Interval (seconds) to wait between heats.",value:o.interval,onChange:s=>n({interval:s.target.value}),isInvalid:!r,validationMessage:r?void 0:j==="chase"?"Interval must be a negative number when chase starts mode has been selected.":"Interval must be a positive number."})}),j==="chase"&&e.jsxs($.div,{initial:{scale:0},animate:{scale:1},style:{...v,overflow:"hidden"},children:[e.jsx(f,{label:"Interval (50m)",value:o.interval50,onChange:s=>n({interval50:s.target.value}),isInvalid:!b,hint:"Interval to wait between heats of 50m events (because they cannot have chases)."}),e.jsx(f,{label:"Interval (regular)",value:o.intervalOddChaseHeats,onChange:s=>n({intervalOddChaseHeats:s.target.value}),isInvalid:!a,hint:"Interval to wait after the last heat of every event that has an odd number of heats."})]}),e.jsx("div",{style:v,children:e.jsx(f,{label:"Backstroke extra",hint:"Extra time added to the interval between heats for Backstroke events.",value:o.extraIntervalBackstroke,onChange:s=>n({extraIntervalBackstroke:s.target.value}),isInvalid:!p})}),e.jsx("div",{style:v,children:e.jsx(f,{label:"Session start time",hint:c&&"Format: HH:MM:SS",value:o.sessionStartTimeOffset,onChange:s=>n({sessionStartTimeOffset:s.target.value}),isInvalid:!c,validationMessage:c?void 0:"Enter a time with the format HH:MM:SS"})}),e.jsx("div",{style:v,children:e.jsxs(ke,{label:"Max duration (hours, minutes)",labelFor:"maxTimelineHours",hint:"System will auto-close the session once this duration is exceeded. Set both values to 0 to disable auto-closing sessions.",children:[e.jsx(q,{id:"maxTimelineHours",width:"50%",placeholder:"Hours",value:o.maxTimelineHours,onChange:s=>n({maxTimelineHours:s.target.value}),isInvalid:!x}),e.jsx(q,{width:"50%",placeholder:"Minutes",value:o.maxTimelineMinutes,onChange:s=>n({maxTimelineMinutes:s.target.value}),isInvalid:!x})]})})]})}),j==="oddEvenHeats"&&e.jsxs(te,{intent:"warning",children:['Timeline mode "',Z.oddEvenHeats,'" is not yet available.']}),B==null&&j!=="oddEvenHeats"&&e.jsx(te,{intent:"warning",children:"Please check all input parameters."}),B!=null&&u&&pe()]}),e.jsx("div",{style:{minHeight:500},children:B!=null&&B.map(({groupName:s,eventsStats:fe,sessionEndTimeMs:we,numHeats:be,numEntriesScratched:X,numEntriesAfterScratch:Ce,numSwimmersAfterScratch:Ie,numSwimmersScratched:Te})=>e.jsxs("div",{style:{marginBottom:"2em"},children:[s!=null&&e.jsxs("div",{style:{marginBottom:".7em",marginLeft:".5em"}
1,children:["Calculated timeline for ",s,":"]}),e.jsxs(S,{backgroundColor:"white",elevation:1,padding:"1em",children:[e.jsxs("table",{className:tt.timeline,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left"},children:"Event"}),e.jsx("th",{style:{textAlign:"left"},children:"Age"}),e.jsx("th",{style:{textAlign:"right"},children:g?"E":"Entries"}),e.jsx("th",{style:{textAlign:"right"},children:g?"H":"Heats"}),e.jsx("th",{style:{textAlign:"right"},children:"Starts at"})]})}),e.jsxs("tbody",{children:[fe.map(C=>e.jsxs("tr",{style:nt,children:[e.jsxs("td",{style:{fontWeight:"bold"},children:[e.jsx("span",{style:{display:"inline-block",minWidth:"1.5em",marginRight:".4em"},children:C.availableEvent.eventNumber}),e.jsx(me,{availableEvent:C.availableEvent})]}),e.jsx("td",{style:{textAlign:"left"},children:C.effectiveAgeRange}),e.jsxs("td",{style:{textAlign:"right"},children:[e.jsx(P,{val:C.numEntriesScratched})," ",C.numEntriesAfterScratch]}),e.jsx("td",{style:{textAlign:"right"},children:C.numHeats}),e.jsx("td",{style:{textAlign:"right"},children:F.fromMillis(C.eventStartTimeMsWithOffset).toFormat("hh:mm:ss")})]},C.availableEvent.id)),e.jsxs("tr",{children:[e.jsx("th",{}),e.jsx("th",{}),e.jsx("th",{}),e.jsx("th",{}),e.jsx("th",{style:{paddingTop:"1em",textAlign:"right"},children:"Finish at"})]}),e.jsxs("tr",{children:[e.jsx("th",{style:{paddingTop:"1em",textAlign:"left"},children:"Total"}),e.jsx("th",{}),e.jsxs("th",{style:{textAlign:"right"},children:[X>0&&e.jsx(P,{val:X})," ",Ce]}),e.jsxs("th",{style:{textAlign:"right"},children:[be," "]}),e.jsx("th",{style:{textAlign:"right"},children:F.fromMillis(we).toFormat("hh:mm:ss")})]})]})]}),e.jsxs("div",{style:{marginTop:"1em"},children:["Swimmers count for warm-ups: ",e.jsxs("b",{children:[Ie," ",e.jsx(P,{val:Te})]})]})]})]},s||"none"))})]})}),at=d.memo(({selectedMeetSession:i})=>{const{getTimelineStateForSession:t,updatePerSessionTimelineFormState:n}=O(),m=d.useCallback(h=>n({meetSession:i,update:h}),[i,n]),u=d.useMemo(()=>t(i),[t,i]);return e.jsx(st,{meetSession:i,timelineState:u,updateFormState:m})});function rt({selectedMeetSession:i}){return i==null?e.jsx("div",{style:{minHeight:300},children:e.jsx(S,{elevation:1,padding:10,backgroundColor:"white",children:"Select a session to view the timeline."})}):e.jsx(at,{selectedMeetSession:i})}const lt=d.memo(rt),L={position:"sticky",top:0,backgroundColor:"rgba(255,255,255,0.7)",padding:"0 .3em"},V=i=>i.entryRestrictions.length>1;function ce(i,t,n){function m(u={}){const h=Xe(u);return Object.entries(h).filter(([,l])=>l.min!=null||l.max!=null).map(([l,{min:g,max:o}])=>e.jsxs("div",{children:[e.jsx("b",{children:l}),": ",g!=null&&`Min: ${K(g)}`," ",o!=null&&`Max: ${K(o)}`]},l))}Ue.fire({title:`Event ${n} entry restriction`,html:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsxs("div",{children:[e.jsx("b",{children:"Age:"})," ",t]}),e.jsxs("div",{children:[e.jsx("b",{children:"Gender:"})," ",ze[i.gender]]}),e.jsxs("div",{children:[e.jsx("b",{children:"Time required:"})," ",i.timeRequired?"Yes":"No"]}),e.jsxs("div",{style:{marginBottom:".5em"},children:[e.jsx("b",{children:"Bonus allowed:"})," ",i.bonusAllowed?"Yes":"No"]}),e.jsxs("div",{style:{marginBottom:".5em"},children:[e.jsx("div",{style:{fontWeight:"bold"},children:"Time standards:"}),m(i.timeStandards)]}),i.bonusAllowed&&e.jsxs("div",{style:{marginBottom:".5em"},children:[e.jsx("div",{style:{fontWeight:"bold"},children:"Bonus time standards:"}),m(i.bonusTimeStandards)]})]})})}function ae({availableEvent:i,expanded:t,enteredEvents:n,renderEvent:m}){const u=U();return e.jsx(_e,{children:t&&(n.length>0||V(i))&&e.jsx($.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.4,ease:"easeOut"},style:{overflow:"hidden",display:"flex",flexDirection:"column",marginLeft:".5em"},children:e.jsxs("div",{style:{marginTop:".7em"},children:[V(i)&&e.jsxs("div",{style:{marginBottom:"1em",color:"rgba(0,0,0,0.5)",fontSize:".9em",display:"flex",flexWrap:"wrap",gap:"1em"},children:[e.jsx("div",{children:"Multiple entry restrictions:"}),Ye(i).map(({name:h,restriction:l})=>e.jsx("button",{type:"button",style:{all:"unset",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:".5em"},onClick:()=>ce(l,h,i.eventNumber),children:h},h))]}),n.length>0&&e.jsx("div",{style:{marginBottom:"1em"},children:n.map(h=>e.jsx("div",{style:{borderBottom:"1px solid rgba(0,0,0,0.1)",display:"flex",alignItems:"center",marginBottom:u?".5em":void 0,paddingBottom:u?".3em":void 0,gap:u?".2em 0":void 0,flexWrap:"wrap"},children:m({enteredEvent:h})},h.id))})]})})})}const ot=d.memo(({meet:i,availableEvent:t,getSwimmerById:n,isMeetSessionOpen:m})=>{const[u,h]=d.useState(!1),{onRefundEntriesClick:l,mutateBasicMeetInfo:g,mutateMeetHostData:o}=O(),y=U(),I=d.useMemo(()=>N(t.enteredIndividualEvents,a=>n(a.swimmerId).lastName),[t.enteredIndividualEvents,n]),E=d.useMemo(()=>N(t.enteredRelayEvents,a=>a.team.teamCode,a=>a.teamNameSuffix),[t.enteredRelayEvents]),A=d.useCallback(async a=>{await le.put(`meets/${encodeURIComponent(i.id)}/available-events/${encodeURIComponent(t.id)}/status/${encodeURIComponent(a?"open":"closed")}`),await o(),await g()},[t.id,i.id,g,o]),k=Oe(t.strokeCode),R=V(t),r=We(t),b=d.useCallback(a=>{a.stopPropagation(),ce(t.entryRestrictions[0],r,t.eventNumber)},[t.entryRestrictions,t.eventNumber,r]);return e.jsxs(S,{backgroundColor:"white",elevation:1,paddingX:10,marginBottom:5,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",cursor:"pointer",paddingTop:".3em",paddingBottom:".3em",gap:".5em"},role:"button",tabIndex:0,onClick:()=>h(a=>!a),children:[e.jsxs("div",{style:{minWidth:"6em"},children:["Event ",t.eventNumber]}),R?e.jsxs("div",{style:{minWidth:"5em"},children:[r," *"]}
1):e.jsx("div",{style:{minWidth:"5em",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:".3em"},role:"button",tabIndex:0,onClick:b,children:r}),e.jsx("div",{style:{minWidth:"8em"},children:e.jsx(me,{availableEvent:t})}),e.jsx("div",{style:{minWidth:"8em",marginRight:"2em"},children:e.jsx(G,{animate:!1,num:(k?E:I).length,max:t.maxEntries})}),e.jsxs("div",{style:{display:"flex",minWidth:"7em"},children:[e.jsx(oe,{style:{marginRight:".5em"},checked:m&&t.status==="open",disabled:!m,updater:A,text:m?t.status:"closed"}),e.jsx(de,{meetId:i.id,availableEventId:t.id})]}),e.jsx("div",{style:{flexGrow:1}}),e.jsx(T,{appearance:"minimal",iconBefore:D,is:M,to:`../../contact?type=users-with-orders&availableEventId=${t.id}`,children:"Contact all"})]}),k?e.jsx(ae,{availableEvent:t,expanded:u,enteredEvents:E,renderEvent:({enteredEvent:a})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{minWidth:"7em",paddingRight:"1em"},children:e.jsx(ee,{enteredEvent:a})}),e.jsx("div",{children:Fe(a)}),e.jsx("div",{style:{flexGrow:1}}),e.jsx(T,{appearance:"minimal",iconBefore:ie,is:M,to:Pe(i.id),children:"Edit or enter"}),e.jsx(T,{appearance:"minimal",iconBefore:ne,onClick:()=>l({enteredRelayEvents:[a]}),children:"Refund"})]})}):e.jsx(ae,{availableEvent:t,expanded:u,enteredEvents:I,renderEvent:({enteredEvent:a})=>{const p=n(a.swimmerId);return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{minWidth:"15em",paddingRight:"1em"},children:$e(p)}),e.jsx("div",{children:e.jsx(ee,{enteredEvent:a})}),e.jsx("div",{style:{flexGrow:1}}),e.jsx(Ne,{position:De.BOTTOM_LEFT,content:e.jsx(H,{children:e.jsxs(H.Group,{children:[e.jsx(H.Item,{icon:ie,is:M,to:Ve(i.id,[p.id]),children:"Edit or enter"}),e.jsx(H.Item,{icon:D,is:M,to:`../../contact?type=users-with-orders&swimmerId=${p.id}`,children:"Contact swimmer"}),e.jsx(H.Item,{icon:ne,onClick:()=>l({enteredIndividualEvents:[a]}),children:"Refund entry"})]})}),children:y?e.jsx(Ge,{icon:se,appearance:"minimal"}):e.jsx(T,{iconAfter:se,appearance:"minimal",children:"Entry actions"})})]})}})]})}),dt=d.memo(({meet:i,selectedMeetSession:t})=>{const{getSwimmerById:n,mutateBasicMeetInfo:m,mutateMeetHostData:u,basicMeetInfo:h,provideMeetSessionClosureReason:l}=O(),g=h.status==="open",o=d.useCallback(async r=>{t!=null&&(await le.put(`meets/${encodeURIComponent(i.id)}/sessions/${encodeURIComponent(t.id)}/status/${encodeURIComponent(r?"open":"closed")}`),await m(),await u())},[t,i.id,m,u]),y=d.useMemo(()=>t==null?i.meetSessions.flatMap(r=>r.availableEvents):t.availableEvents,[i.meetSessions,t]),I=d.useMemo(()=>{let r=0;const b=new Map,a=new Set;function p(c){b.has(c)||b.set(c,{numEntries:0,swimmerIds:new Set,relayOnlySwimmerIds:new Set,hasCoachCredentials:!1});const x=b.get(c);return Me(x!=null),x}return i.relayOnlySwimmers.forEach(({swimmerId:c})=>{const x=n(c);p(x.team?.teamCode??J).relayOnlySwimmerIds.add(c),t==null&&i.maxSwimmersAffectsRelayOnlySwimmers&&a.add(c)}),i.coachCredentialsOrders.forEach(c=>{c.coachCredentials.forEach(x=>{const j=p(x.team.teamCode);j.hasCoachCredentials=!0})}),y.forEach(c=>{r+=c.enteredIndividualEvents.length+c.enteredRelayEvents.length,c.enteredIndividualEvents.forEach(x=>{a.add(x.swimmerId);const j=n(x.swimmerId),W=p(j.team?.teamCode??J);W.numEntries+=1,W.swimmerIds.add(x.swimmerId)})}),{numEntries:r,teamsStats:N([...b.entries()].map(([c,x])=>({teamCode:c,numEntries:x.numEntries,numSwimmers:x.swimmerIds.size,numRelayOnlySwimmers:x.relayOnlySwimmerIds.size,hasCoachCredentials:x.hasCoachCredentials})),"teamCode"),numSwimmers:a.size}},[y,n,i.coachCredentialsOrders,i.maxSwimmersAffectsRelayOnlySwimmers,i.relayOnlySwimmers,t]),{numEntries:E,teamsStats:A,numSwimmers:k}=I,R=g&&t?.status==="open";return e.jsxs(e.Fragment,{children:[e.jsxs(S,{backgroundColor:"white",elevation:1,padding:10,marginBottom:10,children:[e.jsxs("div",{style:{marginBottom:".7em",gap:".5em 1em",minHeight:"2em",display:"flex",flexWrap:"wrap",alignItems:"center"},children:[e.jsx("div",{style:{fontWeight:"bold"},children:t==null?"Whole meet":t.name}),t!=null&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{checked:R,disabled:!g,updater:o,text:g?t.status:"closed"}),e.jsx(de,{meetId:i.id,meetSessionId:t.id}),t.status==="closed"&&e.jsx(T,{onClick:()=>l(t),appearance:t.closureReason==null?"primary":void 0,children:"Closure reason"}),e.jsx("div",{style:{flexGrow:1}}),e.jsx(T,{iconBefore:D,is:M,to:`../../contact?type=users-with-orders&meetSessionId=${t.id}`,children:"Contact all"})]})]}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".7em 1em",justifyContent:"space-between"},children:[e.jsx("div",{style:{overflowY:"scroll",maxHeight:130,border:"1px solid rgba(0,0,0,0.15)",padding:".2em",borderRadius:3},children:e.jsxs("table",{style:{borderCollapse:"collapse",color:"rgba(0,0,0,0.8)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{...L,textAlign:"left",paddingRight:".5em"},children:"Team"}),e.jsx("th",{style:{...L,textAlign:"right",paddingRight:".5em"},children:"Swimmers"}),e.jsx("th",{style:{...L,textAlign:"right",paddingRight:".5em"},children:"Entries"}),t==null&&e.jsxs(e.Fragment,{children:[e.jsx("th",{style:{...L,textAlign:"right"},children:"Relay-only"}),e.jsx("th",{style:{...L,textAlign:"right"},children:"Coach credentials"})]})]})}),e.jsx("tbody",{children:A.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:r.teamCode}),e.jsx("td",{style:{textAlign:"right"},children:r.numSwimmers}),e.jsx("td",{style:{textAlign:"right"},children:r.numEntries}),t==null&&e.jsxs(e.Fragment,{children:[e.jsx("td",{style:{textAlign:"right"},children:r.numRelayOnlySwimmers}),e.jsx("td",{style:{textAlign:"right"},children:r.hasCoachCredentials?"â
":"âï¸"})]})]},r.teamCode))})]})}),e.jsxs("div",{style:{flexBasis:"10em",flexShrink:1},children:[e.jsx("div",{children:"Swimmers"}),e.jsx("div",{style:{marginBottom:".3em"},children:e.jsx(G,{num:k,max:t==null?i.maxSwimmers:t.maxSwimmers})}),e.jsx("div",{children:"Entries"}),e.jsx("div",{style:{marginBottom:".3em"},children:e.jsx(G,{num:E,max:t==null?i.maxTotalEntries:t.maxTotalEntries})})]}),e.jsxs("div",{style:{marginRight:".5em",fontSize:".9em"},children:[e.jsxs("div",{children:["Entry limits: ",e.jsx("b",{children:(t==null?i.maxEntriesPerSwimmerLenient:t.maxEntriesPerSwimmerLenient)?"Lenient":"Strict"})]}),e.jsxs("div",{children:["Max entries per swimmer: ",(t==null?i.maxEntriesPerSwimmer:t.maxEntriesPerSwimmer)??"-"]}),t!=null&&e.jsxs("div",{children:["Entry times priority: ",t.entryTimesPr
1iority.join(", ")]}),t!=null?e.jsxs("div",{children:["Splash fee: ",w(t.participationFee,!0)," (outreach: ",w(t.outreachParticipationFee,!0),") ",e.jsx(He,{content:'Expecting a value here? If the participation is for the whole meet, and not per session, please check the "Whole meet" tab.',children:e.jsx(Le,{style:{verticalAlign:"middle"}})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Splash fee: ",w(i.participationFee,!0)," (outreach: ",w(i.outreachParticipationFee,!0),")"]}),e.jsxs("div",{children:["Facility fee: ",w(i.facilityFee,!0)," (outreach: ",w(0,!0),")"]})]}),t!=null&&e.jsxs("div",{children:["Fee per event: ",w(t.individualEventFee)," (outreach: ",w(t.outreachIndividualEventFee,!0),")"]}),t!=null&&e.jsxs("div",{children:["Fee per relay: ",w(t.relayEventFee)]})]})]})]}),t==null?e.jsx("div",{style:{minHeight:300},children:e.jsx(S,{elevation:1,padding:10,backgroundColor:"white",children:"Select a session to view events."})}):Ae(t.availableEvents).map(r=>e.jsx(ot,{meet:i,availableEvent:r,getSwimmerById:n,isMeetSessionOpen:R},r.id))]})}),re=i=>({padding:".5em",color:"inherit",fontSize:"inherit",border:"none",background:"transparent",cursor:"pointer",textDecoration:i?"underline":void 0,textUnderlineOffset:".5em"});function mt(){const{meetHostData:{meet:i}}=O(),[t,n]=d.useState(i.meetSessions[0]?.id),m=d.useMemo(()=>t!=null?i.meetSessions.find(l=>l.id===t):void 0,[i.meetSessions,t]),u=d.useCallback(l=>{n(l)},[]),h=d.useCallback(()=>{n(void 0)},[]);return e.jsxs("div",{style:{marginTop:"1.5em"},children:[e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0 2em",marginBottom:".5em"},children:[i.meetSessions.map(l=>e.jsx("button",{type:"button",onClick:()=>u(l.id),style:re(m===l),children:e.jsx("div",{children:l.name})},l.id)),i.meetSessions.length>0&&e.jsx("button",{type:"button",onClick:h,style:re(m==null),children:e.jsx("div",{children:"Whole meet"})})]}),e.jsxs(Se,{children:[e.jsx(Q,{path:"entries",element:e.jsx(dt,{meet:i,selectedMeetSession:m})}),e.jsx(Q,{path:"timeline",element:e.jsx(lt,{selectedMeetSession:m})})]})]})}const bt=d.memo(mt);export{bt as default}; 2//# sourceMappingURL=MeetHostSessions-CbSgtTtd.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.