"use client";
import formatErrorMessage from "../../../../utils/esm/formatErrorMessage.js";
import * as React from "react";
const DialogRootContext = /* @__PURE__ */ React.createContext(void 0);
if (process.env.NODE_ENV !== "production") DialogRootContext.displayName = "DialogRootContext";
function useDialogRootContext(optional) {
  const dialogRootContext = React.useContext(DialogRootContext);
  if (optional === false && dialogRootContext === void 0) {
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>." : formatErrorMessage(27));
  }
  return dialogRootContext;
}
export {
  DialogRootContext,
  useDialogRootContext
};
//# sourceMappingURL=DialogRootContext.js.map
