// @bun
var x=Object.defineProperty;var y=(n)=>n;function h(n,t){this[n]=y.bind(null,t)}var D=(n,t)=>{for(var e in t)x(n,e,{get:t[e],enumerable:!0,configurable:!0,set:h.bind(t,e)})};var I=(n,t)=>()=>(n&&(t=n(n=0)),t);var l="docs-index.manifest.json";var j={};D(j,{listGeneratedDocs:()=>S,getGeneratedDocById:()=>_,getDocsIndexManifest:()=>w});import{readFile as d}from"fs/promises";import*as o from"path";import{fileURLToPath as P}from"url";function M(n){if(!n)return"_common";if(n.includes("/")){let[t]=n.split("/");return t||"_common"}return"_common"}async function f(){if(!a)a=d(o.join(c,l),"utf8").then((n)=>JSON.parse(n));return a}function C(n){let t=n.contentRoot??".";if(t==="../../../../../../../generated/docs")return E;return o.join(c,t)}async function g(n){let t=m.get(n);if(t)return t;let e=d(o.join(c,n),"utf8").then((s)=>JSON.parse(s));return m.set(n,e),e}async function S(){if(!u)u=(async()=>{let n=await f();return(await Promise.all(n.chunks.map((e)=>g(e.file)))).flat()})();return u}async function w(){return f()}async function _(n){let t=await f(),e=M(n),s=t.chunks.find((r)=>r.key===e);if(!s)return null;let i=(await g(s.file)).find((r)=>r.id===n);if(!i||!i.contentPath)return null;let p=o.join(C(t),i.contentPath);try{let r=await d(p,"utf8");return{entry:i,content:r}}catch{return null}}var c,E,a=null,u=null,m;var b=I(()=>{c=o.dirname(P(import.meta.url)),E=o.join(c,"../../../../../../../generated/docs"),m=new Map});b();export{S as listGeneratedDocs,_ as getGeneratedDocById,w as getDocsIndexManifest};
