"use client";
const require_get_single_element_child = require("../../core/utils/get-single-element-child/get-single-element-child.cjs");
const require_VisuallyHidden = require("../VisuallyHidden/VisuallyHidden.cjs");
let react = require("react");
let _mantine_hooks = require("@mantine/hooks");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/FocusTrap/FocusTrap.tsx
function FocusTrap({ children, active = true, refProp = "ref", innerRef }) {
	const ref = (0, _mantine_hooks.useMergedRef)((0, _mantine_hooks.useFocusTrap)(active), innerRef);
	const child = require_get_single_element_child.getSingleElementChild(children);
	if (!child) return children;
	return (0, react.cloneElement)(child, { [refProp]: ref });
}
function FocusTrapInitialFocus(props) {
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VisuallyHidden.VisuallyHidden, {
		tabIndex: -1,
		"data-autofocus": true,
		...props
	});
}
FocusTrap.displayName = "@mantine/core/FocusTrap";
FocusTrapInitialFocus.displayName = "@mantine/core/FocusTrapInitialFocus";
FocusTrap.InitialFocus = FocusTrapInitialFocus;
//#endregion
exports.FocusTrap = FocusTrap;
exports.FocusTrapInitialFocus = FocusTrapInitialFocus;

//# sourceMappingURL=FocusTrap.cjs.map