import { jsx as e, Fragment as I, jsxs as r } from "react/jsx-runtime";
import { G as P } from "../../../index-f4a9ae4d.js";
import { MenuSeparator as T } from "./MenuSeparator.js";
import { MenuItem as m } from "./MenuItem.js";
import { DualPageIcon as C } from "../../icons/SinglePageIcon.js";
import { SinglePageIcon as h } from "../../icons/DualPageIcon.js";
import { useViewModeContext as x } from "../../../contexts/ViewModeContext.js";
import { ScrollMode as N, ViewMode as l } from "../../../utils/types.js";
import { CheckIcon as c } from "../../icons/CheckIcon.js";
import { useToolbarComponentContext as w } from "../../../contexts/ToolbarComponentContext.js";
import { useScrollModeContext as L } from "../../../contexts/ScrollModeContext.js";
import { useMemo as S } from "react";
import { useLocalizationContext as M } from "../../../contexts/LocalizationContext.js";
import u from "../../ui/RPTooltip.js";
import { useIconContext as a } from "../../../contexts/IconContext.js";
import { useIconToolContext as d } from "../../../contexts/IconToolContext.js";
import { useToolComponentContext as G } from "../../../contexts/ToolComponentContext.js";
const b = () => {
  const { singlePageIcon: n } = a(), { singlePageIcon: t } = d();
  return n || t || /* @__PURE__ */ e(h, {});
}, v = () => {
  const { dualPageIcon: n } = a(), { dualPageIcon: t } = d();
  return n || t || /* @__PURE__ */ e(C, {});
}, J = () => {
  const { viewMode: n, setDualPage: t, setSinglePage: p } = x(), { viewModeTool: s = !0 } = w(), { viewModeTool: f = !0 } = G(), { scrollMode: i } = L(), { localeMessages: o } = M(), g = S(() => [N.HORIZONTAL_SCROLLING].includes(i), [i]);
  return !s || !f ? null : /* @__PURE__ */ e(I, { children: /* @__PURE__ */ r(P, { children: [
    /* @__PURE__ */ e(m, { onClick: p, children: /* @__PURE__ */ r(u, { className: "rp-menu-item", content: o == null ? void 0 : o.singlePageTooltip, children: [
      /* @__PURE__ */ e("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ e(b, {}) }),
      o == null ? void 0 : o.singlePageLabel,
      n === l.SINGLE_PAGE ? /* @__PURE__ */ e(c, { className: "rp-menu-item-right" }) : null
    ] }) }),
    /* @__PURE__ */ e(m, { disabled: g, onClick: t, children: /* @__PURE__ */ r(u, { className: "rp-menu-item", content: o == null ? void 0 : o.dualPageTooltip, children: [
      /* @__PURE__ */ e("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ e(v, {}) }),
      o == null ? void 0 : o.dualPageLabel,
      n === l.DUAL_PAGE ? /* @__PURE__ */ e(c, { className: "rp-menu-item-right" }) : null
    ] }) }),
    /* @__PURE__ */ e(T, {})
  ] }) });
};
export {
  J as ViewModeTool
};
