1import{u as w,dA as h,Q as y}from"./main-Dx4_sGQs.js";import{G as N}from"./index-C-Xze8eA.js";import{c as u,l as _}from"./_plugin-vue_export-helper-C8YFU58O.js";const l=(a,o)=>{var p;const e=a[`${o}total`]?a[`${o}won`]/a[`${o}total`]*100:0,g=a[`${o}total`]?a[`${o}draw`]/a[`${o}total`]*100:0,t=a[`${o}total`]?a[`${o}loss`]/a[`${o}total`]*100:0;let r=0,n=0;const s=a[`${o}total`]??0;if(s>0){const c=a[`${o}goals`]??0,$=a[`${o}goals_against`]??0;r=Number((c/s).toFixed(1)),n=Number(($/s).toFixed(1))}return{team_id:a.team_id,name:a.name,total:a[`${o}total`],won:a[`${o}won`],loss:a[`${o}loss`],draw:a[`${o}draw`],goals:a[`${o}goals`],goals_against:a[`${o}goals_against`],goal_diff:a[`${o}goal_diff`],recent_results:[],points:a[`${o}points`],promotion_id:a.promotion_id,position:a[`${o}position`],history:((p=a.history)==null?void 0:p.split(""))??[],won_percent:e%1===0?e:Number(e.toFixed(1)),loss_percent:t%1===0?t:Number(t.toFixed(1)),draw_percent:g%1===0?g:Number(g.toFixed(1)),logo:a.logo,avg_goals:r,avg_goals_against:n}},d=(a,o)=>o.points!==a.points?o.points-a.points:a.goal_diff!==o.goal_diff?o.goal_diff-a.goal_diff:o.goals-a.goals,S=a=>{const o=w({queryKey:[y.LEAGUE_DETAIL.STANDINGS,a],queryFn:()=>h(_(a)),enabled:u(()=>!!_(a)),refetchOnMount:!1,refetchOnWindowFocus:!1,refetchInterval:!1}),e=u(()=>{var t,r;if((r=(t=o.data.value)==null?void 0:t.tables)!=null&&r.length){const n=o.data.value.tables[0];return{data_rank:n.rows.map(s=>l(s,"")),data_home:n.rows.map(s=>l(s,"home_")).sort(d),data_guest:n.rows.map(s=>l(s,"away_")).sort(d)}}return null}),g=u(()=>{var t,r;return(r=(t=o.data.value)==null?void 0:t.tables)!=null&&r.length?o.data.value.tables.map(n=>({tableName:N[n.group]||"",stage_id:n.stage_id,data_rank:n.rows.map(s=>l(s,""))})):null});return{leagueStandings:e,cupStandings:g,mapper:l,compareTeams:d,...o}};export{S 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.