import { jsx as i } from "react/jsx-runtime";
import { createContext as f, useContext as a, useEffect as n } from "react";
import { useDarkMode as u } from "../utils/hooks/useDarkMode.js";
import { appConsole as p } from "../utils/appConsole.js";
const d = f({
  darkMode: !1,
  setDarkMode: (e) => {
  }
}), M = () => {
  const e = a(d);
  return typeof (e == null ? void 0 : e.darkMode) > "u" && p.warn("Please use this hooks inside children component of RPProvider"), e;
}, v = ({
  children: e,
  darkMode: o,
  onDarkModeChange: r
}) => {
  const { darkMode: t, setDarkMode: s } = u(o);
  return n(() => {
    typeof o == "boolean" && s(o);
  }, [o, s]), n(() => {
    r && r(t);
  }, [r, t]), /* @__PURE__ */ i(d.Provider, { value: { darkMode: t, setDarkMode: s }, children: e });
};
export {
  d as DarkModeContext,
  v as DarkModeProvider,
  M as useDarkModeContext
};
