import * as s from "react";
import { useMenuRootContext as a } from "../root/MenuRootContext.js";
import { MenuPortalContext as l } from "./MenuPortalContext.js";
import { jsx as t } from "react/jsx-runtime";
import { FloatingPortal as m } from "../../floating-ui-react/components/FloatingPortal.js";
const d = /* @__PURE__ */ s.forwardRef(function(e, r) {
  const {
    keepMounted: o = !1,
    ...n
  } = e, {
    store: u
  } = a();
  return u.useState("mounted") || o ? /* @__PURE__ */ t(l.Provider, {
    value: o,
    children: /* @__PURE__ */ t(m, {
      ref: r,
      ...n
    })
  }) : null;
});
process.env.NODE_ENV !== "production" && (d.displayName = "MenuPortal");
export {
  d as MenuPortal
};
