"use strict";(()=>{var e={};e.id=7729,e.ids=[7729],e.modules={85890:e=>{e.exports=require("better-sqlite3")},12408:e=>{e.exports=require("chokidar")},25606:e=>{e.exports=require("keytar")},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")},92048:e=>{e.exports=require("fs")},6005:e=>{e.exports=require("node:crypto")},87561:e=>{e.exports=require("node:fs")},93977:e=>{e.exports=require("node:fs/promises")},70612:e=>{e.exports=require("node:os")},49411:e=>{e.exports=require("node:path")},49437:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>j,requestAsyncStorage:()=>m,routeModule:()=>g,serverHooks:()=>q,staticGenerationAsyncStorage:()=>h});var s={};r.r(s),r.d(s,{DELETE:()=>y,GET:()=>f,POST:()=>x,dynamic:()=>l});var n=r(7849),o=r(94966),a=r(79169),i=r(1237),u=r(39708);async function p(){var e;let t=await (0,u.Pi)();return{configured:null!==t.key,source:t.source,keychainAvailable:t.keychainAvailable,hint:(e=t.key)?e.length<=4?e:e.slice(-4):null}}async function c(e){return await (0,u.Lb)(e.trim()),p()}async function d(){return await (0,u.df)(),p()}let l="force-dynamic";async function f(){try{let e=await p();return i.NextResponse.json(e)}catch(e){return i.NextResponse.json({error:e.message??"failed to read config"},{status:500})}}async function x(e){let t={};try{t=await e.json()}catch{return i.NextResponse.json({error:"expected JSON body"},{status:400})}let r=t.apiKey;if("string"!=typeof r||0===r.trim().length)return i.NextResponse.json({error:"apiKey must be a non-empty string"},{status:400});try{let e=await c(r);return i.NextResponse.json(e)}catch(e){return i.NextResponse.json({error:e.message??"failed to save API key"},{status:500})}}async function y(){try{let e=await d();return i.NextResponse.json(e)}catch(e){return i.NextResponse.json({error:e.message??"failed to delete API key"},{status:500})}}let g=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/config/route",pathname:"/api/config",filename:"route",bundlePath:"app/api/config/route"},resolvedPagePath:"/Users/ddsyasas/ProjectFiles/Dev Projects/Business dev/llm-wiki/apps/web/src/app/api/config/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:m,staticGenerationAsyncStorage:h,serverHooks:q}=g,v="/api/config/route";function j(){return(0,a.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:h})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[6485,5444,9708],()=>r(49437));module.exports=s})();