1import{a as e}from"./DH_oPWig.js";import{dt as t,nt as n,qt as r,w as i}from"./BaBhFZm2.js";import{n as a}from"./CU89Zi3L.js";import{Rt as o,a as s,it as c,n as l}from"./1wMlAD5r.js";import{i as u,r as d}from"./Den9CWLs2.js";import{n as f,r as p,t as m}from"./Cz7n-Gt32.js";import{t as h}from"./CeNoSHFK2.js";var g=a(`event`,{state:()=>({events:{},isLoading:{},isLoadingMore:{},moreToLoad:{}}),actions:{async fetchEvents(e){let{fetch:t,...n}=e;if(!(e.hash in this.events)){this.isLoading[e.hash]=!0;let r=await new p({fetch:t}).get(n);this.events[e.hash]=r,this.isLoading[e.hash]=!1}this.fetchGameCenterLiveGames({payload:n,fetch:t})},async fetchMoreEvents(e){let{fetch:t,...n}=e;this.isLoadingMore[e.hash]=!0;let r=await new p({fetch:t}).get(n),{props:i}=e;(!r||!r.length||r.length&&i.count&&r.length<i.count)&&(this.moreToLoad[e.hash]=!1),e.hash in this.events&&(this.events[e.hash]=[...this.events[e.hash]??[],...r]),this.isLoadingMore[e.hash]=!1},async fetchEventsLiveStats(e){let t=this.getEvents(e.hash);if(!t||!t?.length)return;let n=f();if(n.statsAvailable||await n.fetchLiveStats({fetch:e.fetch}),n.statsAvailable)for(let r of t){let t=n.getLiveStatsByGameId(r.id??0);if(!t||!Object.keys(t)?.length)continue;let i=null;e?.props?.extra&&Object?.keys(e.props.extra)?.length&&`detailedLiveStats`in e.props.extra&&e.props.extra.detailedLiveStats&&(await n.fetchDetailedLiveStats({gameId:r.id??0,fetch:e.fetch}),i=n.getDetailedLiveStatsByGameId(r.id??0));let a=this.events[e.hash]?.findIndex(e=>e&&e.id===r.id);if(a!==void 0&&a>-1){let n=this.events[e.hash]?.[a],r=c(t,n?.location_indicator);i&&(r=s(r,i)),this.events?.[e.hash]&&this.events[e.hash]?.length&&this.events?.[e.hash]?.[a]&&(this.events[e.hash][a]={...n,is_live:!0,livestats:r})}}},async fetchGameCenterLiveGames({payload:e,fetch:t}){let n=this.getEvents(e.hash);if(!n||!n?.length)return;let r=h();if(r.liveGamesAvailable||await r.fetchLiveGames({fetch:t}),r.liveGamesAvailable)for(let t of n){let n=r.getLiveGameById(t.id??0);if(!n||!Object.keys(n)?.length)continue;let i=this.events[e.hash]?.findIndex(e=>e&&e.id===t.id);if(i!==void 0&&i>-1){let t=this.events[e.hash]?.[i];this.events?.[e.hash]&&this.events[e.hash]?.length&&this.events?.[e.hash]?.[i]&&t&&(n.game_state===l.Live||t.game_state!==n.game_state)&&(this.events[e.hash][i]={...t,is_live:n.game_state===l.Live,livestats:n.game_state===l.Live?o(n):null})}}}},getters:{getEvents:e=>t=>t in e.events?e.events[t]:[],getLoadingMoreFlag:e=>t=>t in e.isLoadingMore?e.isLoadingMore[t]??!1:!1,getLoadingFlag:e=>t=>t in e.isLoading?e.isLoading[t]??!1:!1,getMoreToLoad:e=>t=>t in e.moreToLoad?e.moreToLoad[t]??!0:!0}}),_={__name:`EventsComponent`,props:{...d},setup(a){let o=g(),s=a,{$customFetch:c}=e(),{initialize:l,loadMore:d,getComponentData:f,currentSportId:p,config:h,hash:_}=u({props:s,fetch:c}),{sports:v,selectedSport:y,updateSport:b}=m(s,p,f,o.fetchEvents),x=i(()=>o.getEvents(_())),S=i(()=>o.getMoreToLoad(_())),C=i(()=>o.getLoadingMoreFlag(_())),w=i(()=>o.getLoadingFlag(_()));return n(async()=>{await f(o.fetchEvents),l(o.fetchMoreEvents)}),(e,n)=>t(e.$slots,`content`,{data:r(x),config:r(h),loadMore:r(d),moreToLoad:r(S),isLoadingMore:r(C),isLoading:r(w),currentSportId:r(p),sports:r(v),selectedSport:r(y),updateSport:r(b)})}};export{g as n,_ as t};
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.