"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _components = require("@wordpress/components");
var _icons = require("@wordpress/icons");
var _i18n = require("@wordpress/i18n");
var _blockEditor = require("@wordpress/block-editor");
var _navigationButton = require("./navigation-button");
var _lockUnlock = require("../../lock-unlock");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  useHasDimensionsPanel,
  useHasTypographyPanel,
  useHasColorPanel,
  useGlobalSetting,
  useSettingsForBlockElement,
  useHasBackgroundPanel
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
function RootMenu() {
  const [rawSettings] = useGlobalSetting('');
  const settings = useSettingsForBlockElement(rawSettings);
  /*
   * Use the raw settings to determine if the background panel should be displayed,
   * as the background panel is not dependent on the block element settings.
   */
  const hasBackgroundPanel = useHasBackgroundPanel(rawSettings);
  const hasTypographyPanel = useHasTypographyPanel(settings);
  const hasColorPanel = useHasColorPanel(settings);
  const hasShadowPanel = true; // useHasShadowPanel( settings );
  const hasDimensionsPanel = useHasDimensionsPanel(settings);
  const hasLayoutPanel = hasDimensionsPanel;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
      children: [hasTypographyPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
        icon: _icons.typography,
        path: "/typography",
        children: (0, _i18n.__)('Typography')
      }), hasColorPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
        icon: _icons.color,
        path: "/colors",
        children: (0, _i18n.__)('Colors')
      }), hasBackgroundPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
        icon: _icons.background,
        path: "/background",
        "aria-label": (0, _i18n.__)('Background styles'),
        children: (0, _i18n.__)('Background')
      }), hasShadowPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
        icon: _icons.shadow,
        path: "/shadows",
        children: (0, _i18n.__)('Shadows')
      }), hasLayoutPanel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
        icon: _icons.layout,
        path: "/layout",
        children: (0, _i18n.__)('Layout')
      })]
    })
  });
}
var _default = exports.default = RootMenu;
//# sourceMappingURL=root-menu.js.map