1import{n as e}from"./CU89Zi3L.js";import{t}from"./oQPVSlJP.js";import{nr as n,zn as r}from"./C1VSbIf4.js";var i=class{fetch;resource=`/api/v2/Stats`;constructor({fetch:e}){this.fetch=e}async get(e){return this.fetch(`${this.resource}/${e}/leaders`).then(e=>{let t=[],i=[],a=null;return e&&(t=e.leaders.map(e=>r(e)),i=e.groups?.length?e.groups:null,a=n(e.sport)),{leaders:t,leader_groups:i,sport:a}}).catch(e=>(console.error(`[StatLeadersRepo] get() Request Failed`,e),{leaders:[],leader_groups:[],sport:null}))}},a=e(`statLeadersModuleStore`,{state:()=>({leaders:{},leaderGroups:{},isLoadingMore:!1,isLoading:!1,moreToLoad:!1}),actions:{async fetchLeaders(e){let{fetch:n}=e;if(!(e.hash in this.leaders)){this.isLoading=!0;let r=t().getSportById(Number.parseInt(e?.props?.sport_id??`0`)),a=await new i({fetch:n}).get(r?.global_sport_name_slug??``);this.leaders[e.hash]=a.leaders||[],this.leaderGroups[e.hash]=a.leader_groups||[],this.isLoading=!1}},async fetchMoreLeaders(e){let{fetch:n}=e;if(!(e.hash in this.leaders)){this.isLoadingMore=!0;let r=t().getSportById(Number.parseInt(e?.props?.sport_id??`0`)),a=await new i({fetch:n}).get(r?.global_sport_name_slug??``);this.leaders[e.hash]=(this.leaders[e.hash]||[]).concat(a.leaders||[]),this.leaderGroups[e.hash]=(this.leaderGroups[e.hash]||[]).concat(a.leader_groups||[]),this.isLoadingMore=!1}}},getters:{getLeaders:e=>t=>{let n=t;return n in e.leaders&&e.leaders[n]?e.leaders[n]:[]},getLeaderGroups:e=>t=>{let n=t;return n in e.leaderGroups&&e.leaderGroups[n]?e.leaderGroups[n]:[]},getLoadingMoreFlag:e=>e.isLoadingMore,getLoadingFlag:e=>e.isLoading,getMoreToLoad:e=>e.moreToLoad}});export{a 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.