"use strict";(()=>{var e={};e.id=9798,e.ids=[9798],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")},65863:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>f,patchFetch:()=>g,requestAsyncStorage:()=>c,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var s={};r.r(s),r.d(s,{POST:()=>d,dynamic:()=>p});var o=r(7849),a=r(94966),i=r(79169),n=r(1237),u=r(39708);let p="force-dynamic";async function d(){let{key:e}=await (0,u.Pi)();if(!e)return n.NextResponse.json({ok:!1,reason:"no-key",message:"No API key configured."},{status:400});try{let t=await fetch("https://openrouter.ai/api/v1/key",{method:"GET",headers:{Authorization:`Bearer ${e}`,"HTTP-Referer":"https://github.com/ddsyasas/llm-wiki","X-Title":"LLM Wiki"}});if(401===t.status||403===t.status)return n.NextResponse.json({ok:!1,reason:"invalid-key",message:"OpenRouter rejected the API key."},{status:200});if(!t.ok)return n.NextResponse.json({ok:!1,reason:"remote-error",message:`OpenRouter returned ${t.status}.`},{status:200});let r=await t.json();return n.NextResponse.json({ok:!0,label:r.data?.label??null,usageUsd:r.data?.usage??0,limitUsd:r.data?.limit??null})}catch(e){return n.NextResponse.json({ok:!1,reason:"network",message:`Could not reach OpenRouter: ${e.message}`},{status:200})}}let l=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/config/test/route",pathname:"/api/config/test",filename:"route",bundlePath:"app/api/config/test/route"},resolvedPagePath:"/Users/ddsyasas/ProjectFiles/Dev Projects/Business dev/llm-wiki/apps/web/src/app/api/config/test/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:c,staticGenerationAsyncStorage:m,serverHooks:x}=l,f="/api/config/test/route";function g(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[6485,5444,9708],()=>r(65863));module.exports=s})();