"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../core/Box/Box.cjs");
const factory = require("../../core/factory/factory.cjs");
const useFloatingIndicator = require("./use-floating-indicator.cjs");
const FloatingIndicator_module_css = require("./FloatingIndicator.module.css.cjs");
const useMergedRef = require("../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-merged-ref/use-merged-ref.cjs");
const defaultProps = {};
const varsResolver = createVarsResolver.createVarsResolver(
  (_theme, { transitionDuration }) => ({
    root: {
      "--transition-duration": typeof transitionDuration === "number" ? `${transitionDuration}ms` : transitionDuration
    }
  })
);
const FloatingIndicator = factory.factory((_props, ref) => {
  const props = useProps.useProps("FloatingIndicator", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    target,
    parent,
    transitionDuration,
    mod,
    displayAfterTransitionEnd,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "FloatingIndicator",
    classes: FloatingIndicator_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  const innerRef = React.useRef(null);
  const { initialized, hidden } = useFloatingIndicator.useFloatingIndicator({
    target,
    parent,
    ref: innerRef,
    displayAfterTransitionEnd
  });
  const mergedRef = useMergedRef.useMergedRef(ref, innerRef);
  if (!target || !parent) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { ref: mergedRef, mod: [{ initialized, hidden }, mod], ...getStyles("root"), ...others });
});
FloatingIndicator.displayName = "@mantine/core/FloatingIndicator";
FloatingIndicator.classes = FloatingIndicator_module_css.default;
exports.FloatingIndicator = FloatingIndicator;
