"use strict";(()=>{var e={};e.id=850,e.ids=[850],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},7561:e=>{e.exports=require("node:fs")},9411:e=>{e.exports=require("node:path")},8455:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>f,requestAsyncStorage:()=>x,routeModule:()=>h,serverHooks:()=>g,staticGenerationAsyncStorage:()=>m});var s={};t.r(s),t.d(s,{GET:()=>l});var o=t(3277),n=t(5265),a=t(5356),i=t(7076),p=t(7561),u=t.n(p),d=t(9411),c=t.n(d);async function l(e){let r=e.nextUrl.searchParams.get("file"),t=parseInt(e.nextUrl.searchParams.get("start")??"1",10),s=parseInt(e.nextUrl.searchParams.get("end")??"0",10);if(!r)return i.NextResponse.json({error:"Missing file parameter"},{status:400});let o=process.env.HEX_PROJECT_DIR??process.env.SOLAUDIT_PROJECT_DIR??process.cwd(),n=c().resolve(o,r);if(!n.startsWith(c().resolve(o)))return i.NextResponse.json({error:"Path outside project directory"},{status:403});try{let e=u().readFileSync(n,"utf-8").split("\n"),r=s>0?Math.min(s,e.length):e.length,o=e.slice(Math.max(1,t)-1,r).join("\n");return i.NextResponse.json({code:o})}catch{return i.NextResponse.json({error:`File not found: ${r}`},{status:404})}}let h=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/code/route",pathname:"/api/code",filename:"route",bundlePath:"app/api/code/route"},resolvedPagePath:"/home/dx/Work/hex/dashboard/app/api/code/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:x,staticGenerationAsyncStorage:m,serverHooks:g}=h,v="/api/code/route";function f(){return(0,a.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:m})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[916,786],()=>t(8455));module.exports=s})();