globalThis.process ??= {}; globalThis.process.env ??= {};
import { c as createJsonResponse } from '../../chunks/apiHelpers_CD8DANYs.mjs';
import { f as fetchApiIndex } from '../../chunks/fetch_CoXtH9RF.mjs';
export { r as renderers } from '../../chunks/_@astro-renderers_DcHY5gmj.mjs';

const prerender = false;
const GET = async ({ params, url }) => {
  const { version } = params;
  if (!version) {
    return createJsonResponse(
      { error: "Version parameter is required" },
      400
    );
  }
  try {
    const index = await fetchApiIndex(url);
    const sections = index.sections[version];
    if (!sections) {
      return createJsonResponse({ error: `Version '${version}' not found` }, 404);
    }
    return createJsonResponse(sections);
  } catch (error) {
    return createJsonResponse(
      { error: "Failed to load API index", details: error },
      500
    );
  }
};

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  GET,
  prerender
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
