"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const createStyles = require("./create-styles.cjs");
const useCss = require("./use-css.cjs");
const MantineThemeProvider = require("../../../../../@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
function sxTransform() {
  const theme = MantineThemeProvider.useMantineTheme();
  const { css } = useCss.useCss();
  return (sx) => {
    const parsedSx = typeof sx === "function" ? sx(theme, createStyles.getHelpers(theme)) : sx;
    return !parsedSx ? "" : css(parsedSx);
  };
}
function stylesTransform() {
  const theme = MantineThemeProvider.useMantineTheme();
  const { css } = useCss.useCss();
  return (styles, payload) => {
    if (!styles) {
      return {};
    }
    const stylesObject = typeof styles === "function" ? styles(theme, payload.props, createStyles.getHelpers(theme)) : styles;
    return Object.keys(stylesObject).reduce((acc, key) => {
      const value = stylesObject[key];
      const parsedValue = typeof value === "function" ? value(theme) : value;
      return { ...acc, [key]: css(parsedValue) };
    }, {});
  };
}
const emotionTransform = {
  sx: sxTransform,
  styles: stylesTransform
};
exports.emotionTransform = emotionTransform;
