"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("react");
require("react/jsx-runtime");
const Mantine_context = require("../../MantineProvider/Mantine.context.cjs");
const MantineThemeProvider = require("../../MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
function useStylesTransform({ props, stylesCtx, themeName }) {
  var _a;
  const theme = MantineThemeProvider.useMantineTheme();
  const stylesTransform = (_a = Mantine_context.useMantineStylesTransform()) == null ? void 0 : _a();
  const getTransformedStyles = (styles) => {
    if (!stylesTransform) {
      return [];
    }
    const transformedStyles = styles.map(
      (style) => stylesTransform(style, { props, theme, ctx: stylesCtx })
    );
    return [
      ...transformedStyles,
      ...themeName.map(
        (n) => {
          var _a2;
          return stylesTransform((_a2 = theme.components[n]) == null ? void 0 : _a2.styles, { props, theme, ctx: stylesCtx });
        }
      )
    ].filter(Boolean);
  };
  return {
    getTransformedStyles,
    withStylesTransform: !!stylesTransform
  };
}
exports.useStylesTransform = useStylesTransform;
