"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const react = require("react");
const HoveringToolbarContents = require("./HoveringToolbarContents.cjs");
const useToolbarsState = require("../editorSelection/useToolbarsState.cjs");
const HoveringToolbars = react.memo(({
  blockButtons,
  inlineButtons,
  shouldDisplayInlineToolbar: shouldDisplayInlineToolbarProp,
  showLabels,
  toolbarScheme,
  ...props
}) => {
  const { inlineToolbarRef, blockToolbarActive, inlineToolbarActive } = useToolbarsState.useToolbarState();
  const shouldDisplayInlineToolbar = inlineToolbarActive && (shouldDisplayInlineToolbarProp === void 0 || shouldDisplayInlineToolbarProp());
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.DialogProvider, { children: [
    /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Portal, { children: inlineButtons && /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.HoveringToolbar, { scheme: toolbarScheme, isActive: shouldDisplayInlineToolbar, ref: inlineToolbarRef, scope: "contextual", children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(HoveringToolbarContents.HoveringToolbarContents, { buttons: inlineButtons, showLabels }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
      lineNumber: 36,
      columnNumber: 7
    }, void 0) }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
      lineNumber: 35,
      columnNumber: 6
    }, void 0) }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
      lineNumber: 33,
      columnNumber: 4
    }, void 0),
    blockButtons && /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.HoveringToolbar, { scheme: toolbarScheme, isActive: blockToolbarActive, children: [
      Array.isArray(blockButtons) && /* @__PURE__ */ jsxDevRuntime.jsxDEV(HoveringToolbarContents.HoveringToolbarContents, { buttons: blockButtons, showLabels }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
        lineNumber: 42,
        columnNumber: 38
      }, void 0),
      Array.isArray(blockButtons) || blockButtons
    ] }, void 0, true, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
      lineNumber: 41,
      columnNumber: 5
    }, void 0)
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbars.tsx",
    lineNumber: 32,
    columnNumber: 3
  }, void 0);
});
exports.HoveringToolbars = HoveringToolbars;
//# sourceMappingURL=HoveringToolbars.cjs.map
