PageSourceSearch

https://edgemxtiming.com/assets/PodiumTab-CbmpDvjy.js

js edgemxtiming.com collected 2026-10-02 01:31:01 UTC 4,830 bytes, 1 lines download raw bytes

1import{b2 as j,Z as v,r as g,l as N,s as m,j as i,_ as w}from"./index-Ct8eLu1I.js";import{u as k}from"./useSelectedTimingEvent-IKCMbW8S.js";import{B as E}from"./BikeMakeBadge-CLPRnHpn.js";import{R as M}from"./RiderProfileDialog-DAi80iMe.js";import{T as h}from"./trophy-Bwwh5BxN.js";import{M as I}from"./useRiderResults-Cb6CRYFg.js";import{A as y}from"./award-BLsrLjlR.js";import"./TimingSelectionContext-0R53bEzZ.js";import"./useTimingEvents-a-TBF05g.js";import"./useOrganizationSlug-Im1jCHRI.js";import"./useBikeMakeLogos-BM39csav.js";import"./bikeMakeStyle-RND07Se0.js";import"./map-pin-DUB0IYFr.js";import"./flag-BttTACQc.js";import"./timer-BmWXyNuG.js";import"./history-BS_575gd.js";const C=[{color:"bg-yellow-400 text-yellow-950",Icon:h,label:"1st"},{color:"bg-zinc-300 text-zinc-900",Icon:I,label:"2nd"},{color:"bg-amber-700 text-amber-50",Icon:y,label:"3rd"}];function Z(){const{orgSlug:a,event:s}=k(),c=j().bikeMakeColumn,u=v(),[p,l]=g.useState(null),n=["timing-event-podium",a,(s==null?void 0:s.id)??(s==null?void 0:s.event_name)],{data:t,isLoading:_}=N({queryKey:n,queryFn:async()=>{if(!a||!(s!=null&&s.id))return{podiums:{}};const{data:r,error:e}=await m.functions.invoke("fetch-public-lab-event-podium",{body:{org_slug:a,event_name:s.event_name,lab_event_id:s.id,event_date:s.event_date}});if(e)throw e;return r??{podiums:{}}},enabled:!!a&&!!(s!=null&&s.id),refetchInterval:5e3});if(g.useEffect(()=>{if(!(s!=null&&s.id))return;const r=m.channel(`podium-${s.id}`).on("postgres_changes",{event:"*",schema:"public",table:"timing_lab_session_entries"},()=>u.invalidateQueries({queryKey:n})).on("postgres_changes",{event:"*",schema:"public",table:"timing_lab_sessions",filter:`event_id=eq.${s.id}`},()=>u.invalidateQueries({queryKey:n})).subscribe();return()=>{m.removeChannel(r)}},[s==null?void 0:s.id]),_)return i.jsx("div",{className:"flex justify-center py-12",children:i.jsx(w,{className:"h-6 w-6 animate-spin text-primary"})});const x=Object.keys((t==null?void 0:t.podiums)??{});return x.length?i.jsxs("div",{className:"space-y-4 py-3",children:[x.map(r=>i.jsxs("div",{className:"overflow-hidden rounded-md border bg-card",children:[i.jsx("div",{className:"bg-foreground px-3 py-1.5 text-xs font-bold uppercase tracking-wide text-background",children:r}),i.jsx("div",{className:"grid gap-2 p-2 sm:grid-cols-3",children:t.podiums[r].map(e=>{var f,b;const d=C[e.position-1];return i.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View ${e.rider_name}'s profile`,onClick:()=>l({rider_id:e.rider_id??null,member_number:e.member_number??null,rider_name:e.rider_name}),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),l({rider_id:e.rider_id??null,member_number:e.member_number??null,rider_name:e.rider_name}))},className:"relative flex cursor-pointer items-stretch gap-2 overflow-hidden rounded-md border bg-background p-2 transition-colors hover:bg-muted/50 focus:bg-muted/50 focus:outline-none",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[i.jsxs("div",{className:`flex w-fit items-center gap-1.5 rounded px-2 py-1 text-xs font-bold ${d.color}`,children:[i.jsx(d.Icon,{className:"h-3.5 w-3.5"})," ",d.label]}),i.jsxs("div",{className:"text-sm font-bold leading-tight",children:["#",e.rider_number??"—"," ",e.rider_name]}),c&&i.jsx("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]",children:i.jsx(E,{make:e.make})}),(e.city||e.state)&&i.jsx("div",{className:"text-[11px] text-muted-foreground",children:[e.city,e.state].filter(Boolean).join(", ")}),!!((f=e.team_members)!=null&&f.length)&&i.jsx("div",{className:"text-[11px] text-muted-foreground",children:e.team_members.join(" · ")}
1),(b=e.team_members)!=null&&b.length?i.jsxs("div",{className:"mt-auto text-[11px] text-muted-foreground",children:["Laps: ",i.jsx("span",{className:"font-semibold text-foreground",children:e.laps??0})]}):i.jsxs("div",{className:"mt-auto text-[11px] text-muted-foreground",children:["M1: ",i.jsx("span",{className:"font-semibold text-foreground",children:e.moto_1_finish})," · ","M2: ",i.jsx("span",{className:"font-semibold text-foreground",children:e.moto_2_finish})]})]}),e.photo_url?i.jsx("div",{className:"h-28 w-24 flex-shrink-0 self-center overflow-hidden rounded-md sm:h-36 sm:w-28",children:i.jsx("img",{src:e.photo_url,alt:e.rider_name,loading:"lazy",onError:o=>{o.currentTarget.parentElement.style.display="none"},className:"h-full w-full object-cover"})}):null]},e.position)})})]},r)),i.jsx(M,{identity:p,labEventId:(s==null?void 0:s.id)??null,open:!!p,onOpenChange:r=>{r||l(null)},showMake:c})]}):i.jsxs("p",{className:"my-4 rounded-md border bg-card p-6 text-center text-sm text-muted-foreground",children:[i.jsx(h,{className:"mx-auto mb-2 h-6 w-6"})," No podiums available yet — needs all three top finishers."]})}export{Z as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.