"use strict";(()=>{var e={};e.id=1238,e.ids=[1238],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")},33875:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>x,patchFetch:()=>g,requestAsyncStorage:()=>c,routeModule:()=>m,serverHooks:()=>h,staticGenerationAsyncStorage:()=>f});var s={};a.r(s),a.d(s,{GET:()=>p});var n=a(49303),r=a(88716),i=a(60670),o=a(87070);let l=process.env.API_FOOTBALL_KEY||"",d=process.env.API_FOOTBALL_URL||"https://v3.football.api-sports.io",u=new Map;async function p(e,{params:t}){let{id:a}=await t,{searchParams:s}=new URL(e.url),n=parseInt(s.get("homeId")||"1"),r=parseInt(s.get("awayId")||"2"),i=s.get("homeNama")||void 0,p=s.get("awayNama")||void 0,m=s.get("homeLogo")||void 0,c=s.get("awayLogo")||void 0,f=s.get("status")||"upcoming",h=u.get(a);if(h&&Date.now()-h.ts<6e4)return o.NextResponse.json({sukses:!0,data:h.data,dariCache:!0});if(l)try{let e=await fetch(`${d}/fixtures/events?fixture=${a}`,{headers:{"x-apisports-key":l},next:{revalidate:60}});if(e.ok){let t=(await e.json()).response||[];if(t.length>0)return u.set(a,{data:t,ts:Date.now()}),o.NextResponse.json({sukses:!0,data:t,dariCache:!1})}else console.warn(`Events API returned ${e.status} for fixture ${a}`)}catch(e){console.warn("Events API error:",e)}if(!("live"===f||"finished"===f))return o.NextResponse.json({sukses:!0,data:[],dariCache:!1,sumber:"unavailable"});let x=function(e,t,a,s,n,r,i){let o=e.split("").reduce((e,t)=>e+t.charCodeAt(0),0),l=e=>Math.abs(o*(e+1)*7919%100),d=s?.split(" ")[0]||"Kandang",u=n?.split(" ")[0]||"Tandang",p={id:t,name:s||`Tim ${t}`,logo:r||""},m={id:a,name:n||`Tim ${a}`,logo:i||""},c=[],f=l(1)%4,h=l(2)%4;for(let e=0;e<f;e++){let a=5+l(10+3*e)%85,s=l(60+e)%10;c.push({time:{elapsed:a,extra:null},team:p,player:{id:100*t+e,name:`Penyerang ${d} ${e+1}`},assist:{id:100*t+50+e,name:`Gelandang ${d} ${e+1}`},type:"Goal",detail:0===s?"Penalty":"Normal Goal",comments:null})}for(let e=0;e<h;e++){let t=5+l(15+3*e)%85,s=l(65+e)%10;c.push({time:{elapsed:t,extra:null},team:m,player:{id:100*a+e,name:`Penyerang ${u} ${e+1}`},assist:{id:100*a+50+e,name:`Gelandang ${u} ${e+1}`},type:"Goal",detail:0===s?"Penalty":"Normal Goal",comments:null})}let x=2+l(3)%3;for(let e=0;e<x;e++){let t=l(70+e)%2==0,a=t?p:m,s=t?d:u;c.push({time:{elapsed:15+l(80+e)%75,extra:null},team:a,player:{id:100*a.id+60+e,name:`Pemain ${s} ${e+1}`},assist:{id:null,name:null},type:"Card",detail:"Yellow Card",comments:null})}let g=3+l(4)%3;for(let e=0;e<g;e++){let t=l(100+e)%2==0,a=t?p:m,s=t?d:u;c.push({time:{elapsed:55+l(130+e)%35,extra:null},team:a,player:{id:100*a.id+70+e,name:`Pemain Masuk ${s} ${e+1}`},assist:{id:null,name:`Pemain Keluar ${s} ${e+1}`},type:"subst",detail:"Substitution 1",comments:null})}return c.sort((e,t)=>e.time.elapsed-t.time.elapsed),c}(a,n,r,i,p,m,c);return u.set(a,{data:x,ts:Date.now()}),o.NextResponse.json({sukses:!0,data:x,dariCache:!1,sumber:"estimasi"})}let m=new n.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/fixtures/[id]/events/route",pathname:"/api/fixtures/[id]/events",filename:"route",bundlePath:"app/api/fixtures/[id]/events/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\fixtures\\[id]\\events\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:c,staticGenerationAsyncStorage:f,serverHooks:h}=m,x="/api/fixtures/[id]/events/route";function g(){return(0,i.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:f})}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),s=t.X(0,[9276,5972],()=>a(33875));module.exports=s})();