var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/theming/useTheme.tsx
var useTheme_exports = {};
__export(useTheme_exports, {
  ThemeContext: () => ThemeContext,
  ThemeProvider: () => ThemeProvider,
  ThemeUtil: () => ThemeUtil,
  useTheme: () => useTheme
});
module.exports = __toCommonJS(useTheme_exports);
var import_react = require("react");

// src/util/noop.ts
var noop = () => void 0;

// src/theming/useTheme.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var themes = ["light", "dark"];
var defaultThemeTypeTranslation = {
  en: {
    dark: "Dark",
    light: "Light",
    theme: {
      one: "Theme",
      other: "Themes"
    }
  },
  de: {
    dark: "Dunkel",
    light: "Hell",
    theme: {
      one: "Farbschema",
      other: "Farbschemas"
    }
  }
};
var ThemeUtil = {
  themes,
  translation: defaultThemeTypeTranslation
};
var ThemeContext = (0, import_react.createContext)({
  theme: "light",
  setTheme: noop
});
var ThemeProvider = ({ children, initialTheme = "light" }) => {
  const [theme, setTheme] = (0, import_react.useState)(initialTheme);
  (0, import_react.useEffect)(() => {
    if (theme !== initialTheme) {
      console.warn("ThemeProvider initial state changed: Prefer using useTheme's setTheme instead");
      setTheme(initialTheme);
    }
  }, [initialTheme]);
  (0, import_react.useEffect)(() => {
    document.documentElement.setAttribute("data-theme", theme);
  }, [theme]);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeContext.Provider, { value: { theme, setTheme }, children });
};
var useTheme = () => (0, import_react.useContext)(ThemeContext);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ThemeContext,
  ThemeProvider,
  ThemeUtil,
  useTheme
});
//# sourceMappingURL=useTheme.js.map