import { jsx } from "react/jsx-runtime";
import { forwardRef, memo } from "react";
import { getRootElement } from "../../../state/react-page";
import { DocumentKeyContext, DocumentLocaleContext } from "../hooks/use-document-context";
import { Element } from "./Element";
const Document = memo(
  forwardRef(function Document2({ document }, ref) {
    return /* @__PURE__ */ jsx(DocumentKeyContext.Provider, { value: document.key, children: /* @__PURE__ */ jsx(DocumentLocaleContext.Provider, { value: document.locale, children: /* @__PURE__ */ jsx(Element, { ref, element: getRootElement(document) }) }) });
  })
);
export {
  Document
};
//# sourceMappingURL=Document.js.map