"use client";

// src/lib/component-registry.ts
var registry = /* @__PURE__ */ new Map();
function registerThemeVariant(componentName, theme, component) {
  if (!registry.has(componentName)) {
    registry.set(componentName, /* @__PURE__ */ new Map());
  }
  registry.get(componentName).set(theme, component);
}
function getThemedComponent(componentName, theme = "classic") {
  const variants = registry.get(componentName);
  if (!variants || variants.size === 0) {
    throw new Error(`No theme variants registered for "${componentName}"`);
  }
  if (variants.has(theme)) {
    return variants.get(theme);
  }
  if (theme === "classic") {
    throw new Error(`No classic variant for "${componentName}" - use base component`);
  }
  throw new Error(`No variant available for "${componentName}.${theme}"`);
}
function getRegistry() {
  const result = {};
  registry.forEach((variants, name) => {
    result[name] = Array.from(variants.keys());
  });
  return result;
}
export {
  getRegistry,
  getThemedComponent,
  registerThemeVariant
};
//# sourceMappingURL=component-registry.js.map