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