1import{u as d,dz as I,Q as f}from"./main-Dx4_sGQs.js";import{f as L}from"./fetchLeagueScheduleOdds-8V7aX_01.js";import{Q as m,c as u}from"./_plugin-vue_export-helper-C8YFU58O.js";const S=20,O=({seasonId:v,companyId:D})=>{const r=m(v),n=m(D),o=u(()=>!!r.value),s=d({queryKey:[f.LEAGUE_DETAIL.SCHEDULE,r],queryFn:()=>I(r.value),enabled:o,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchInterval:!1}),l=d({queryKey:[f.LEAGUE_DETAIL.SCHEDULE_ODDS,r,n],queryFn:()=>L(r.value,n.value),enabled:o,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchInterval:!1}),E=u(()=>l.data.value?l.data.value.flat().reduce((a,t)=>(a[t.ScheduleID]||(a[t.ScheduleID]={}),a[t.ScheduleID][t.Type]=t,a),{}):{});return{upcomingMatchesWithOdds:u(()=>{if(!s.data.value)return[];const a=s.data.value.flat(),t=a.filter(e=>e.MatchState>=0).sort((e,c)=>{const i=e.MatchState>0?0:1,h=c.MatchState>0?0:1;return i!==h?i-h:new Date(e.matchTime).getTime()-new Date(c.matchTime).getTime()}).slice(0,S);return(t.length>0?t:a.filter(e=>e.MatchState===-1).sort((e,c)=>new Date(c.matchTime).getTime()-new Date(e.matchTime).getTime()).slice(0,S).reverse()).map(e=>({...e,odds:e.ScheduleID?E.value[e.ScheduleID]:void 0}))}),isLoading:s.isLoading,isError:s.isError,error:s.error}};export{O as u};
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.