import { useCallback as e } from "react";
import { FloatingFocusManager as t, FloatingOverlay as n, FloatingPortal as r, useDismiss as i, useFloating as a, useInteractions as o, useRole as s } from "@floating-ui/react";
import { jsx as c } from "react/jsx-runtime";
var l = {
	overlay: "fY8BBX",
	panel: "M9Yms2"
};
//#endregion
//#region src/fullscreen-portal/FullscreenPortal.tsx
function u(e, t) {
	let n = e.trim();
	return n ? `${n}. ${t}` : t;
}
function d({ open: d, title: f, description: p, onOpenChange: m, children: h }) {
	let { refs: g, context: _ } = a({
		open: d,
		onOpenChange: m
	}), v = i(_, { outsidePress: !1 }), y = s(_, { role: "dialog" }), { getFloatingProps: b } = o([v, y]), x = e((e) => {
		g.setFloating(e);
	}, [g]);
	return d ? /* @__PURE__ */ c(r, { children: /* @__PURE__ */ c(n, {
		lockScroll: !0,
		className: l.overlay,
		children: /* @__PURE__ */ c(t, {
			context: _,
			modal: !1,
			returnFocus: !0,
			children: /* @__PURE__ */ c("section", {
				ref: x,
				...b({
					className: l.panel,
					"aria-label": u(f, p)
				}),
				children: h
			})
		})
	}) }) : null;
}
//#endregion
export { d as FullscreenPortal };

//# sourceMappingURL=index.js.map