"use strict";(()=>{var e={};e.id=2525,e.ids=[2525],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},43108:(e,s,a)=>{a.r(s),a.d(s,{originalPathname:()=>x,patchFetch:()=>v,requestAsyncStorage:()=>m,routeModule:()=>g,serverHooks:()=>h,staticGenerationAsyncStorage:()=>f});var t={};a.r(t),a.d(t,{GET:()=>c});var n=a(49303),o=a(88716),r=a(60670),i=a(87070);let l=process.env.API_FOOTBALL_URL||"https://v3.football.api-sports.io",d=process.env.API_FOOTBALL_KEY||"",p={EPL:39,UCL:2,LALIGA:140,BUN:78,SERIEA:135,LIGA1:274},u=new Map;async function c(e){try{let{searchParams:s}=new URL(e.url),a=(s.get("league_code")||"EPL").toUpperCase(),t=parseInt(s.get("season")||"2025"),n=p[a];if(!n)return i.NextResponse.json({success:!1,message:"league_code tidak valid"},{status:400});let o=`${a}-${t}`,r=Date.now(),c=u.get(o);if(c&&r-c.ts<3e5)return i.NextResponse.json({success:!0,source:"cache",league_code:a,season:t,data:c.data});let g=`${l}/standings?league=${n}&season=${t}`,m=await fetch(g,{headers:{"x-apisports-key":d},next:{revalidate:300}});if(!m.ok)return i.NextResponse.json({success:!1,message:`Gagal ambil standings: HTTP ${m.status}`},{status:500});let f=await m.json(),h=(f?.response?.[0]?.league?.standings?.[0]??[]).map(e=>({rank:e.rank,team:{id:e.team?.id,name:e.team?.name,logo:e.team?.logo},played:e.all?.played??0,win:e.all?.win??0,draw:e.all?.draw??0,lose:e.all?.lose??0,goals_for:e.all?.goals?.for??0,goals_against:e.all?.goals?.against??0,goal_diff:e.goalsDiff??0,points:e.points??0,form:e.form??"",description:e.description??null}));return u.set(o,{data:h,ts:r}),i.NextResponse.json({success:!0,source:"api",league_code:a,season:t,data:h})}catch(e){return console.error("Admin standings GET error:",e),i.NextResponse.json({success:!1,message:"Gagal memuat standings"},{status:500})}}let g=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/admin/matches/standings/route",pathname:"/api/admin/matches/standings",filename:"route",bundlePath:"app/api/admin/matches/standings/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\matches\\standings\\route.ts",nextConfigOutput:"standalone",userland:t}),{requestAsyncStorage:m,staticGenerationAsyncStorage:f,serverHooks:h}=g,x="/api/admin/matches/standings/route";function v(){return(0,r.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:f})}}};var s=require("../../../../../webpack-runtime.js");s.C(e);var a=e=>s(s.s=e),t=s.X(0,[9276,5972],()=>a(43108));module.exports=t})();