"use strict";(()=>{var e={};e.id=3058,e.ids=[3058],e.modules={85890:e=>{e.exports=require("better-sqlite3")},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")},78893:e=>{e.exports=require("buffer")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},20629:e=>{e.exports=require("fs/promises")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},98216:e=>{e.exports=require("net")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},82452:e=>{e.exports=require("tls")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},17679:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>g,patchFetch:()=>v,requestAsyncStorage:()=>w,routeModule:()=>h,serverHooks:()=>k,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>q,dynamic:()=>l});var o=t(49303),i=t(88716),a=t(60670),p=t(87070),n=t(94925),u=t(30721),c=t(85930),x=t(69395),d=t(43895);let l="force-dynamic",m=(0,d.h)("api/worktrees");async function q(e){try{let r=(0,n.getDbInstance)(),t=e.nextUrl?.searchParams,s=t?.get("repository"),o=(0,u.Xv)(r,s||void 0),i=await (0,c.LF)(),a=new Set(i.map(e=>e.name)),d=await Promise.all(o.map(async e=>{let t=await (0,x.r)(e.id,a,r,u._U,u.GP);return{...e,...t}})),l=(0,u.ER)(r);return p.NextResponse.json({worktrees:d,repositories:l},{status:200})}catch(e){return m.error("error-fetching-worktrees:",{error:e instanceof Error?e.message:String(e)}),p.NextResponse.json({error:"Failed to fetch worktrees"},{status:500})}}let h=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:w,staticGenerationAsyncStorage:f,serverHooks:k}=h,g="/api/worktrees/route";function v(){return(0,a.patchFetch)({serverHooks:k,staticGenerationAsyncStorage:f})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,3853,4893,2509,3895,4925,721,9228,550,9395],()=>t(17679));module.exports=s})();