"use strict";

exports.__esModule = true;
exports.default = void 0;
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _reactFontawesome = require("@fortawesome/react-fontawesome");
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _cta = _interopRequireDefault(require("../../atom/cta"));
var _select = _interopRequireDefault(require("../../atom/select"));
var _picture = _interopRequireDefault(require("../../atom/picture"));
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _inputSearch = _interopRequireDefault(require("../../atom/input-search"));
var _searchForm = _interopRequireDefault(require("../../molecule/search-form"));
var _buttonMenuAction = _interopRequireDefault(require("../../molecule/button-menu-action"));
var _colors = require("../../variables/colors");
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
class MoocHeader extends _react.default.Component {
  static contextTypes = {
    translate: _provider.default.childContextTypes.translate,
    skin: _provider.default.childContextTypes.skin
  };
  constructor(props) {
    super(props);
    this.state = {
      isSettingsOpen: false,
      isMenuOpen: false,
      isFocus: false,
      isToolTipOpen: false
    };
    this.handleSettingsToggle = this.handleSettingsToggle.bind(this);
    this.handleMenuToggle = this.handleMenuToggle.bind(this);
    this._checkOnClose = this._checkOnClose.bind(this);
    this.handleLinkClick = this.handleLinkClick.bind(this);
    this.setMenuSettings = this.setMenuSettings.bind(this);
    this.handleSubmitSearch = this.handleSubmitSearch.bind(this);
    this.handleResetSearch = this.handleResetSearch.bind(this);
    this.handleOnFocus = this.handleOnFocus.bind(this);
    this.handleOnBlur = this.handleOnBlur.bind(this);
    this.handleOnMenuOpen = this.handleOnMenuOpen.bind(this);
    this.handleOnMenuClose = this.handleOnMenuClose.bind(this);
    this.handleOnMouseOver = this.handleOnMouseOver.bind(this);
    this.handleOnMouseLeave = this.handleOnMouseLeave.bind(this);
    this.handleKeyPress = this.handleKeyPress.bind(this);
  }
  componentDidUpdate(prevProps, prevState, prevContext) {
    const {
      isSettingsOpen
    } = this.state;
    if (isSettingsOpen) {
      document.addEventListener('click', this._checkOnClose);
      document.addEventListener('touchstart', this._checkOnClose);
    } else {
      document.removeEventListener('click', this._checkOnClose);
      document.removeEventListener('touchstart', this._checkOnClose);
    }
  }
  setMenuSettings(el) {
    this.menuSettings = el;
  }
  _checkOnClose(clickEvent) {
    const {
      isSettingsOpen
    } = this.state;
    if (isSettingsOpen) {
      const menu = this.menuSettings;
      if (menu && !menu.contains(clickEvent.target)) {
        this.handleSettingsToggle();
      }
    }
  }
  handleLinkClick() {
    const {
      isMenuOpen
    } = this.state;
    isMenuOpen && this.handleMenuToggle();
  }
  handleSettingsToggle() {
    this.setState(prevState => ({
      isSettingsOpen: !prevState.isSettingsOpen
    }));
  }
  handleMenuToggle() {
    const {
      isMenuOpen
    } = this.state;
    isMenuOpen ? this.handleOnMenuClose() : this.handleOnMenuOpen();
  }
  handleSubmitSearch() {
    const {
      onSubmitSearch
    } = this.props;
    if (onSubmitSearch) {
      onSubmitSearch();
    }
  }
  handleResetSearch() {
    const {
      onResetSearch
    } = this.props;
    if (onResetSearch) {
      onResetSearch();
    }
  }
  handleOnFocus() {
    this.setState(prevState => ({
      isFocus: true
    }));
  }
  handleOnBlur() {
    this.setState(prevState => ({
      isFocus: false
    }));
  }
  handleOnMenuOpen() {
    const {
      onMenuOpen
    } = this.props;
    if (onMenuOpen) {
      onMenuOpen();
    }
    this.setState(() => ({
      isMenuOpen: true
    }));
  }
  handleOnMenuClose() {
    const {
      onMenuClose
    } = this.props;
    if (onMenuClose) {
      onMenuClose();
    }
    this.setState(() => ({
      isMenuOpen: false
    }));
  }
  handleOnMouseOver() {
    this.setState(() => ({
      isToolTipOpen: true
    }));
  }
  handleOnMouseLeave() {
    this.setState(() => ({
      isToolTipOpen: false
    }));
  }
  handleKeyPress(event) {
    if (event.key === 'Enter') {
      this.setState(() => ({
        isToolTipOpen: true
      }));
    } else if (event.key === 'Tab' || event.key === 'Escape') {
      this.setState(() => ({
        isToolTipOpen: false
      }));
    }
  }
  createMenuButtons = (items, primaryColor) => {
    return items.map(item => ({
      label: item.title,
      disabled: item.disabled,
      type: 'defaultLeft',
      link: {
        href: item.href
      },
      'data-name': `item-more-${item.name}`,
      customStyle: {
        padding: '0 16px',
        ...(item.selected && {
          color: primaryColor
        })
      }
    }));
  };
  render() {
    if ((0, _isEmpty2.default)(this.props)) return null;
    const {
      logo = {},
      pages: items,
      settings,
      user,
      links,
      search,
      'search-reset-aria-label': searchResetAriaLabel,
      'settings-aria-label': settingsAriaLabel,
      'active-page-aria-label': activePageAriaLabel,
      'group-settings-aria-label': groupAriaLbale
    } = this.props;
    const {
      isFocus,
      isSettingsOpen,
      isMenuOpen,
      isToolTipOpen
    } = this.state;
    const {
      translate,
      skin
    } = this.context;
    const {
      'aria-label': logoAriaLabel,
      closeMenuAriaLabel,
      openMenuAriaLabel,
      toolTipText,
      closeToolTipInformationTextAriaLabel
    } = logo;
    const logoUrl = (0, _get2.default)('src', logo) || (0, _get2.default)('images.logo', skin);
    const logoMobileUrl = (0, _get2.default)('srcMobile', logo) || (0, _getOr2.default)(logoUrl, 'images.logo-mobile', skin);
    let pagesView = null;
    let linksView = null;
    let userView = null;
    let settingsView = null;
    let notificationsView = null;
    let searchFormView = null;
    const moreAriaLabel = translate('More');
    const primaryColor = (0, _get2.default)('common.primary', skin);
    const mediumColor = (0, _get2.default)('common.medium', skin);
    const darkColor = (0, _get2.default)('common.dark', skin);
    if (items) {
      const displayedPages = items.displayed.map((item, index) => {
        const activeColor = item.selected ? {
          color: primaryColor
        } : null;
        const {
          'page-count-aria-label': pageCountAriaLabel
        } = item;
        const itemLabel = item.selected ? `${item.title}. ${activePageAriaLabel}` : item.title;
        const pageBadge = item.counter > 0 ? /*#__PURE__*/_react.default.createElement(_link.default, {
          href: item.href,
          "data-name": "item-badge",
          disabled: item.disabled,
          className: (0, _classnames.default)(_style.default.itemBadge, item.selected && _style.default.activePage, item.disabled && _style.default.disabled),
          "aria-label": pageCountAriaLabel
        }, /*#__PURE__*/_react.default.createElement("span", {
          className: _style.default.counter
        }, item.counter > 99 ? '99+' : item.counter)) : null;
        const {
          name: itemName = index
        } = item;
        return /*#__PURE__*/_react.default.createElement(_link.default, {
          key: itemName,
          "data-name": `item-${itemName}`,
          href: item.href,
          disabled: item.disabled,
          className: (0, _classnames.default)(_style.default.item, item.disabled && item.selected && _style.default.activePage, item.disabled && _style.default.disabled),
          hoverColor: item.disabled ? '' : (0, _getOr2.default)(_colors.COLORS.brand, 'common.primary', skin),
          onClick: this.handleLinkClick,
          target: item.target || null,
          "aria-label": itemLabel,
          style: {
            ...activeColor
          }
        }, item.title, pageBadge, /*#__PURE__*/_react.default.createElement("span", {
          className: _style.default.bar,
          style: {
            backgroundColor: primaryColor
          }
        }));
      });
      const optionsView = items.more.map((item, index) => {
        const activeColor = item.selected ? {
          color: primaryColor
        } : null;
        const itemLabel = item.selected ? `${item.title}. ${activePageAriaLabel}` : item.title;
        const {
          name: itemName = index
        } = item;
        return /*#__PURE__*/_react.default.createElement(_link.default, {
          href: item.href,
          key: itemName,
          disabled: item.disabled,
          className: (0, _classnames.default)(_style.default.option, item.disabled && _style.default.disabled),
          "data-name": `item-more-${itemName}`,
          target: item.target || null,
          "aria-label": itemLabel,
          onClick: this.handleLinkClick,
          hoverColor: item.disabled ? '' : (0, _getOr2.default)(_colors.COLORS.brand, 'common.primary', skin),
          style: {
            ...activeColor
          }
        }, item.title, /*#__PURE__*/_react.default.createElement("span", {
          className: _style.default.line,
          style: {
            backgroundColor: primaryColor
          }
        }));
      });
      pagesView = /*#__PURE__*/_react.default.createElement("div", {
        className: search.value || isFocus ? _style.default.noItems : _style.default.items
      }, displayedPages, items.more ? /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.desktopOnlyMoreMenu
      }, /*#__PURE__*/_react.default.createElement(_buttonMenuAction.default, {
        button: {
          label: moreAriaLabel,
          'aria-label': moreAriaLabel,
          'data-name': 'item-more'
        },
        type: "link",
        primaryColor: primaryColor,
        containerCustom: {
          alignItems: 'flex-start'
        },
        menuWrapper: {
          customStyle: {
            top: '30px'
          }
        },
        menu: {
          buttons: this.createMenuButtons(items.more, primaryColor)
        }
      })) : null, /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.tabletOnlyMoreMenu
      }, /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.optionsGroup
      }, optionsView)));
    }
    if (links) {
      const ctas = links.map((cta, index) => {
        return /*#__PURE__*/_react.default.createElement(_cta.default, _extends({}, cta, {
          key: index,
          className: index + 1 === links.length ? null : _style.default.ctaLink
        }));
      });
      linksView = /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.links
      }, ctas);
    }
    if (user) {
      const nbNotifications = (0, _getOr2.default)(0, 'notifications.value', user);
      const notificationsAriaLabel = (0, _getOr2.default)('', 'notifications.aria-label', user);
      notificationsView = nbNotifications > 0 ? /*#__PURE__*/_react.default.createElement(_link.default, {
        href: user.notifications.href,
        "data-name": "user-notifications",
        className: _style.default.notifications
      }, nbNotifications > 99 ? '99+' : nbNotifications) : null;
      const notificationPageView = /*#__PURE__*/_react.default.createElement(_link.default, {
        className: (0, _classnames.default)(_style.default.notification, nbNotifications > 0 ? _style.default.active : null),
        "data-name": "stat-notifications",
        href: user.notifications.href,
        "aria-label": notificationsAriaLabel
      }, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
        icon: "bell",
        style: {
          color: nbNotifications > 0 ? _colors.COLORS.negative_700 : _colors.COLORS.neutral_500
        }
      }), notificationsView);
      userView = /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.user
      }, /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.stats
      }, /*#__PURE__*/_react.default.createElement(_link.default, {
        className: _style.default.stat,
        "data-name": "stat-stars",
        href: user.stats.stars.href,
        onClick: this.handleLinkClick,
        "aria-label": user.stats.stars['aria-label']
      }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
        icon: "star",
        style: {
          color: _colors.COLORS.yellow_500
        },
        className: _style.default.stars
      })), /*#__PURE__*/_react.default.createElement("div", {
        "data-name": "value",
        className: _style.default.label
      }, user.stats.stars.label)), /*#__PURE__*/_react.default.createElement(_link.default, {
        className: _style.default.stat,
        "data-name": "stat-ranking",
        href: user.stats.ranking.href,
        onClick: this.handleLinkClick,
        "aria-label": user.stats.ranking['aria-label']
      }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
        icon: "ranking-star",
        className: _style.default.ranking,
        style: {
          color: primaryColor
        }
      })), /*#__PURE__*/_react.default.createElement("div", {
        "data-name": "value",
        className: _style.default.label
      }, user.stats.ranking.label)), /*#__PURE__*/_react.default.createElement(_link.default, {
        className: _style.default.stat,
        "data-name": "stat-badge",
        href: user.stats.badge.href,
        onClick: this.handleLinkClick,
        "aria-label": user.stats.badge['aria-label']
      }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
        icon: "trophy",
        className: _style.default.badge,
        style: {
          color: _colors.COLORS.neutral_400
        }
      })), /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.label
      }, user.stats.badge.label))), /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.avatarWrapper
      }, notificationPageView, /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.avatar,
        "data-name": "user-avatar"
      }, /*#__PURE__*/_react.default.createElement(_link.default, {
        href: user.href,
        className: _style.default.userLink,
        onClick: this.handleLinkClick,
        "aria-label": user['picture-aria-label']
      }, /*#__PURE__*/_react.default.createElement(_picture.default, {
        src: user.picture,
        alt: user.profileAvatarAlt
      })))));
    }
    if (settings) {
      const settingsElements = settings.map((setting, index) => {
        let settingView = null;
        const {
          options,
          type,
          title,
          name: settingName = index,
          color,
          hoverColor,
          'aria-label': ariaLabel
        } = setting;
        switch (type) {
          case 'link':
            {
              settingView = /*#__PURE__*/_react.default.createElement("div", {
                "data-name": `setting-${settingName}`,
                className: _style.default.setting,
                key: settingName
              }, /*#__PURE__*/_react.default.createElement(_link.default, {
                className: _style.default.link,
                href: options.href,
                hoverColor: hoverColor,
                onClick: this.handleLinkClick,
                target: options.target || null,
                "aria-label": ariaLabel || title,
                style: {
                  color
                }
              }, title));
              break;
            }
          case 'select':
            {
              const selectProps = {};
              selectProps.options = options.values;
              selectProps.title = '';
              selectProps.theme = 'header';
              selectProps.onChange = options.onChange;
              selectProps.className = _style.default.languageSelect;
              settingView = /*#__PURE__*/_react.default.createElement("div", {
                "data-name": `setting-${settingName}`,
                className: (0, _classnames.default)(_style.default.setting, _style.default.selectBoxes),
                key: settingName
              }, /*#__PURE__*/_react.default.createElement("span", {
                className: _style.default.label
              }, title), /*#__PURE__*/_react.default.createElement(_select.default, _extends({}, selectProps, {
                "aria-label": ariaLabel || title
              })));
              break;
            }
          case 'switch':
            {
              const switchProps = {};
              switchProps.value = options.value;
              switchProps.id = `input-switch-${index}`;
              switchProps.onChange = options.onChange;
              settingView = /*#__PURE__*/_react.default.createElement("div", {
                "data-name": `setting-${settingName}`,
                className: _style.default.setting,
                key: settingName,
                "aria-label": ariaLabel || title
              }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, _extends({}, switchProps, {
                "aria-labelledby": `title-id-${settingName}`
              })), /*#__PURE__*/_react.default.createElement("span", {
                id: `title-id-${settingName}`,
                className: _style.default.label
              }, title));
              break;
            }
        }
        return settingView;
      });
      settingsView = /*#__PURE__*/_react.default.createElement("div", {
        className: _style.default.settings,
        ref: this.setMenuSettings
      }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyCog, {
        "data-name": "settings-toggle",
        style: {
          color: darkColor
        },
        className: _style.default.settingsToggle,
        onClick: this.handleSettingsToggle,
        "aria-expanded": isSettingsOpen,
        "aria-label": settingsAriaLabel
      }), /*#__PURE__*/_react.default.createElement("div", {
        className: isSettingsOpen ? _style.default.settingsWrapper : _style.default.settingsWrapperHidden
      }, /*#__PURE__*/_react.default.createElement("div", {
        "data-name": "settings",
        className: _style.default.settingsGroup,
        role: "group",
        "aria-label": groupAriaLbale
      }, settingsElements)));
    }
    if (search) {
      searchFormView = /*#__PURE__*/_react.default.createElement("div", {
        "data-name": "Search-Bar",
        className: isMenuOpen ? _style.default.hiddenSearchBar : _style.default.searchBar
      }, /*#__PURE__*/_react.default.createElement(_searchForm.default, {
        search: search,
        onSubmit: this.handleSubmitSearch,
        onReset: this.handleResetSearch,
        onSearchFocus: this.handleOnFocus,
        onSearchBlur: this.handleOnBlur,
        "search-reset-aria-label": searchResetAriaLabel
      }));
    }
    return /*#__PURE__*/_react.default.createElement("header", {
      className: _style.default.wrapper
    }, /*#__PURE__*/_react.default.createElement("div", {
      "data-name": "moocHeader",
      "data-open": isMenuOpen,
      className: isMenuOpen ? _style.default.open : _style.default.header
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: _style.default.logoWrapper,
      "aria-label": toolTipText,
      onMouseOver: this.handleOnMouseOver,
      onMouseLeave: this.handleOnMouseLeave
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: _style.default.navMobile,
      "data-name": "nav-mobile"
    }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationBurger, {
      role: "button",
      "data-name": "nav-mobile-open",
      style: {
        color: mediumColor
      },
      className: isMenuOpen ? _style.default.burgerHidden : _style.default.burger,
      onClick: this.handleOnMenuOpen,
      "aria-label": openMenuAriaLabel
    }), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationClose, {
      "data-name": "nav-mobile-close",
      style: {
        color: mediumColor
      },
      className: isMenuOpen ? _style.default.close : _style.default.closeHidden,
      onClick: this.handleOnMenuClose,
      "aria-label": closeMenuAriaLabel
    }), /*#__PURE__*/_react.default.createElement(_link.default, {
      "data-name": "logo-mobile",
      href: logo.href
    }, /*#__PURE__*/_react.default.createElement(_picture.default, {
      src: logoMobileUrl,
      alt: logoAriaLabel
    }))), /*#__PURE__*/_react.default.createElement(_link.default, {
      className: _style.default.logo,
      "data-name": "logo",
      id: "logo",
      href: logo.href,
      onKeyDown: this.handleKeyPress,
      tabIndex: 0,
      "data-testid": "brand-logo"
    }, /*#__PURE__*/_react.default.createElement(_picture.default, {
      src: logoUrl,
      alt: logoAriaLabel
    }), isToolTipOpen ? /*#__PURE__*/_react.default.createElement("div", {
      "aria-label": toolTipText,
      tabIndex: 0,
      "data-testid": "home-tooltip"
    }, /*#__PURE__*/_react.default.createElement("div", {
      "aria-label": `${toolTipText} ${closeToolTipInformationTextAriaLabel}`,
      role: "tooltip",
      className: _style.default.tooltipIconContainer,
      tabIndex: 0
    }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyPlacesHome24, {
      className: _style.default.homeIcon,
      style: {
        color: primaryColor
      }
    }), /*#__PURE__*/_react.default.createElement("p", {
      className: _style.default.toolTipText
      // eslint-disable-next-line react/no-danger
      ,
      dangerouslySetInnerHTML: {
        __html: toolTipText
      },
      style: {
        color: primaryColor
      }
    }))) : null)), searchFormView, /*#__PURE__*/_react.default.createElement("nav", {
      className: isMenuOpen ? _style.default.menuWrapper : _style.default.hiddenMenuWrapper,
      "data-name": "menu-wrapper"
    }, pagesView, userView || linksView, settingsView)));
  }
}
MoocHeader.propTypes = process.env.NODE_ENV !== "production" ? {
  logo: _propTypes.default.shape({
    src: _propTypes.default.string,
    srcMobile: _propTypes.default.string,
    href: _propTypes.default.string,
    'aria-label': _propTypes.default.string,
    'button-aria-label': _propTypes.default.string,
    toolTipText: _propTypes.default.string,
    closeToolTipInformationTextAriaLabel: _propTypes.default.string
  }),
  search: _propTypes.default.shape(_inputSearch.default.propTypes),
  'search-reset-aria-label': _propTypes.default.string,
  onSubmitSearch: _propTypes.default.func,
  onResetSearch: _propTypes.default.func,
  pages: _propTypes.default.shape({
    displayed: _propTypes.default.arrayOf(_propTypes.default.shape({
      target: _propTypes.default.oneOf(['_self', '_blank', '_parent', '_top']),
      title: _propTypes.default.string,
      name: _propTypes.default.string,
      href: _propTypes.default.string,
      selected: _propTypes.default.bool,
      disabled: _propTypes.default.bool,
      counter: _propTypes.default.number,
      'page-count-aria-label': _propTypes.default.string
    })),
    more: _propTypes.default.arrayOf(_propTypes.default.shape({
      target: _propTypes.default.oneOf(['_self', '_blank', '_parent', '_top']),
      title: _propTypes.default.string,
      name: _propTypes.default.string,
      href: _propTypes.default.string,
      selected: _propTypes.default.bool,
      disabled: _propTypes.default.bool,
      counter: _propTypes.default.number
    }))
  }),
  links: _propTypes.default.arrayOf(_propTypes.default.shape(_cta.default.propTypes)),
  user: _propTypes.default.shape({
    picture: _propTypes.default.string,
    'picture-aria-label': _propTypes.default.string,
    profileAvatarAlt: _propTypes.default.string,
    href: _propTypes.default.string,
    notifications: _propTypes.default.shape({
      href: _propTypes.default.string,
      value: _propTypes.default.number,
      'aria-label': _propTypes.default.string
    }),
    stats: _propTypes.default.shape({
      stars: _propTypes.default.shape({
        href: _propTypes.default.string,
        label: _propTypes.default.string,
        'aria-label': _propTypes.default.string
      }),
      ranking: _propTypes.default.shape({
        href: _propTypes.default.string,
        label: _propTypes.default.string,
        'aria-label': _propTypes.default.string
      }),
      badge: _propTypes.default.shape({
        href: _propTypes.default.string,
        label: _propTypes.default.string,
        'aria-label': _propTypes.default.string
      })
    })
  }),
  'settings-aria-label': _propTypes.default.string,
  'active-page-aria-label': _propTypes.default.string,
  'group-settings-aria-label': _propTypes.default.string,
  settings: _propTypes.default.arrayOf(_propTypes.default.shape({
    title: _propTypes.default.string,
    name: _propTypes.default.string,
    type: _propTypes.default.oneOf(['select', 'switch', 'link']),
    color: _propTypes.default.string,
    'aria-label': _propTypes.default.string,
    options: _propTypes.default.shape({
      href: _propTypes.default.string,
      onChange: _propTypes.default.func,
      value: _propTypes.default.bool,
      target: _propTypes.default.oneOf(['_self', '_blank', '_parent', '_top']),
      values: _propTypes.default.arrayOf(_propTypes.default.shape({
        value: _propTypes.default.string,
        name: _propTypes.default.string,
        selected: _propTypes.default.bool
      }))
    })
  })),
  onMenuOpen: _propTypes.default.func,
  onMenuClose: _propTypes.default.func
} : {};
var _default = exports.default = MoocHeader;
//# sourceMappingURL=index.js.map