import * as o from "react";
import n from "react-dom";
import { Primitive as f } from "../../../../../@radix-ui_react-primitive@2.0.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_rea_bdcf182289a3a76356f07e550726e479/node_modules/@radix-ui/react-primitive/dist/index.js";
import { useLayoutEffect as u } from "../../../../../@radix-ui_react-use-layout-effect@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-use-layout-effect/dist/index.js";
import { j as c } from "../../../../../../../_virtual/jsx-runtime.js";
var l = "Portal", p = o.forwardRef((r, e) => {
  const { container: a, ...s } = r, [i, m] = o.useState(!1);
  u(() => m(!0), []);
  const t = a || i && globalThis?.document?.body;
  return t ? n.createPortal(/* @__PURE__ */ c.jsx(f.div, { ...s, ref: e }), t) : null;
});
p.displayName = l;
export {
  p as Portal
};
//# sourceMappingURL=index.js.map
