"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.templatesRoute = void 0;
var _editor = _interopRequireDefault(require("../editor"));
var _sidebarNavigationScreenTemplatesBrowse = _interopRequireDefault(require("../sidebar-navigation-screen-templates-browse"));
var _sidebarNavigationScreenUnsupported = _interopRequireDefault(require("../sidebar-navigation-screen-unsupported"));
var _pageTemplates = _interopRequireDefault(require("../page-templates"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * Internal dependencies
 */

const templatesRoute = exports.templatesRoute = {
  name: 'templates',
  path: '/template',
  areas: {
    sidebar({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenTemplatesBrowse.default, {
        backPath: "/"
      }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenUnsupported.default, {});
    },
    content({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageTemplates.default, {}) : undefined;
    },
    preview({
      query,
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      if (!isBlockTheme) {
        return undefined;
      }
      const isListView = query.layout === 'list';
      return isListView ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : undefined;
    },
    mobile({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageTemplates.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenUnsupported.default, {});
    }
  },
  widths: {
    content({
      query
    }) {
      const isListView = query.layout === 'list';
      return isListView ? 380 : undefined;
    }
  }
};
//# sourceMappingURL=templates.js.map