"use strict";(()=>{var e={};e.id=495,e.ids=[495],e.modules={2934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},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")},8893:e=>{e.exports=require("buffer")},4770:e=>{e.exports=require("crypto")},6162:e=>{e.exports=require("stream")},1764:e=>{e.exports=require("util")},8589:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>k,patchFetch:()=>m,requestAsyncStorage:()=>h,routeModule:()=>x,serverHooks:()=>f,staticGenerationAsyncStorage:()=>y});var a={};r.r(a),r.d(a,{GET:()=>p,PATCH:()=>l,POST:()=>d});var s=r(9303),n=r(8716),i=r(670),o=r(7070),u=r(728),c=r(5456);async function p(){if(!await (0,c.PR)())return o.NextResponse.json({error:"Unauthorized"},{status:401});let e=await u._.launchTask.findMany({orderBy:[{phase:"asc"},{sortOrder:"asc"}]});return o.NextResponse.json({tasks:e})}async function d(e){let t=await (0,c.PR)();if(!t)return o.NextResponse.json({error:"Unauthorized"},{status:401});let r=await e.json(),a=await u._.launchTask.create({data:r});return await u._.activityLog.create({data:{userId:t.userId,action:"created",entity:"LaunchTask",entityId:a.id,details:a.title}}),o.NextResponse.json({task:a})}async function l(e){let t=await (0,c.PR)();if(!t)return o.NextResponse.json({error:"Unauthorized"},{status:401});let{id:r,...a}=await e.json(),s=await u._.launchTask.update({where:{id:r},data:a});return await u._.activityLog.create({data:{userId:t.userId,action:"updated",entity:"LaunchTask",entityId:s.id,details:`${s.title} → ${a.status||"edited"}`}}),o.NextResponse.json({task:s})}let x=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/tasks/route",pathname:"/api/tasks",filename:"route",bundlePath:"app/api/tasks/route"},resolvedPagePath:"/Users/jakeshore/.clawdbot/workspace/oskv-dashboard/src/app/api/tasks/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:h,staticGenerationAsyncStorage:y,serverHooks:f}=x,k="/api/tasks/route";function m(){return(0,i.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:y})}},5456:(e,t,r)=>{r.d(t,{PR:()=>u,fT:()=>o});var a=r(1482),s=r.n(a),n=r(1615);let i=process.env.JWT_SECRET||"fallback-secret";function o(e){return s().sign(e,i,{expiresIn:"7d"})}async function u(){let e=await (0,n.cookies)(),t=e.get("token")?.value;return t?function(e){try{return s().verify(e,i)}catch{return null}}(t):null}},728:(e,t,r)=>{r.d(t,{_:()=>s});let a=require("@prisma/client"),s=globalThis.prisma||new a.PrismaClient}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[276,972,261],()=>r(8589));module.exports=a})();