import { jsx, jsxs } from "react/jsx-runtime";
import { useTheme } from "./theme.mjs";
import { useColorScheme } from "../node_modules/.pnpm/@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-color-scheme/use-color-scheme.mjs";
import { MantineEmotionProvider } from "../node_modules/.pnpm/@mantine_emotion@7.15.2_@emotion_cache@11.14.0_@emotion_react@11.14.0_@types_react@18.3.18_re_vflj3eioazr6wkrxpatinf66nq/node_modules/@mantine/emotion/esm/MantineEmotionProvider.mjs";
import { MantineProvider } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineProvider.mjs";
import { emotionTransform } from "../node_modules/.pnpm/@mantine_emotion@7.15.2_@emotion_cache@11.14.0_@emotion_react@11.14.0_@types_react@18.3.18_re_vflj3eioazr6wkrxpatinf66nq/node_modules/@mantine/emotion/esm/emotion-transform.mjs";
import { mergeMantineTheme } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/merge-mantine-theme/merge-mantine-theme.mjs";
import { Notifications } from "../node_modules/.pnpm/@mantine_notifications@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@man_f2isygx54csmiytvhun5ksd6pm/node_modules/@mantine/notifications/esm/Notifications.mjs";
import { ModalsProvider } from "../node_modules/.pnpm/@mantine_modals@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_ho_m52wnmul7ebc6cajcp6sfoom74/node_modules/@mantine/modals/esm/ModalsProvider.mjs";
function ThemeProvider({
  children,
  colorScheme,
  theme: themeOverride,
  emotionCache,
  notifications,
  modals
}) {
  const systemColorScheme = useColorScheme(colorScheme === "auto" ? void 0 : colorScheme, {
    getInitialValueInEffect: false
  });
  const colorSchemeResult = colorScheme === "auto" ? systemColorScheme : colorScheme;
  const theme = useTheme(colorSchemeResult);
  return /* @__PURE__ */ jsx(MantineEmotionProvider, { cache: emotionCache, children: /* @__PURE__ */ jsxs(
    MantineProvider,
    {
      forceColorScheme: colorSchemeResult,
      stylesTransform: emotionTransform,
      theme: mergeMantineTheme(theme, themeOverride),
      children: [
        /* @__PURE__ */ jsx(Notifications, { position: "top-center", ...notifications }),
        /* @__PURE__ */ jsx(ModalsProvider, { ...modals, children })
      ]
    }
  ) });
}
export {
  ThemeProvider
};
