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

const prerender = false;
async function GET({ request }) {
  const url = new URL(request.url);
  const components = url.searchParams.get("components");
  if (!components) {
    return createJsonResponse(
      { error: "components query parameter is required" },
      400
    );
  }
  try {
    const props = await fetchProps(url);
    const propsData = components.split(",").map((component) => props[component.trim()]);
    return createJsonResponse(propsData);
  } catch (error) {
    const details = error instanceof Error ? error.message : String(error);
    return createJsonResponse(
      { error: "Failed to load props data", details },
      500
    );
  }
}

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

const page = () => _page;

export { page };
