"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.navigationRoute = void 0;
var _router = require("@wordpress/router");
var _editor = _interopRequireDefault(require("../editor"));
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
var _sidebarNavigationScreenUnsupported = _interopRequireDefault(require("../sidebar-navigation-screen-unsupported"));
var _lockUnlock = require("../../lock-unlock");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  useLocation
} = (0, _lockUnlock.unlock)(_router.privateApis);
function MobileNavigationView() {
  const {
    query = {}
  } = useLocation();
  const {
    canvas = 'view'
  } = query;
  return canvas === 'edit' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
    backPath: "/"
  });
}
const navigationRoute = exports.navigationRoute = {
  name: 'navigation',
  path: '/navigation',
  areas: {
    sidebar({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
        backPath: "/"
      }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenUnsupported.default, {});
    },
    preview({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : undefined;
    },
    mobile({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(MobileNavigationView, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenUnsupported.default, {});
    }
  }
};
//# sourceMappingURL=navigation.js.map