"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.SidePageContainerDataTids = exports.SidePageContainer = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));

var _ThemeContext = require("../../lib/theming/ThemeContext");

var _CommonWrapper = require("../../internal/CommonWrapper");

var _Emotion = require("../../lib/theming/Emotion");
var _decorator = require("../ResponsiveLayout/decorator");

var _rootNode = require("../../lib/rootNode");

var _SidePage = require("./SidePage.styles");
var _SidePageContext = require("./SidePageContext");var _class, _SidePageContainer;



var SidePageContainerDataTids = exports.SidePageContainerDataTids = {
  root: 'SidePageContainer__root'
};

/**
 * Контейнер с отступами
 *
 * @visibleName SidePage.Container
 */var


SidePageContainer = exports.SidePageContainer = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.rootNode)(_class = (_SidePageContainer = /*#__PURE__*/function (_React$Component) {function SidePageContainer() {return _React$Component.apply(this, arguments) || this;}(0, _inheritsLoose2.default)(SidePageContainer, _React$Component);var _proto = SidePageContainer.prototype;_proto.








  render = function render() {var _this = this;
    return /*#__PURE__*/(
      _react.default.createElement(_ThemeContext.ThemeContext.Consumer, null,
      function (theme) {
        _this.theme = theme;
        return _this.renderMain();
      }
      ));

  };_proto.

  renderMain = function renderMain() {var _this2 = this;
    return /*#__PURE__*/(
      _react.default.createElement(_SidePageContext.SidePageContext.Consumer, null,
      function (_ref) {var _cx;var hasHeader = _ref.hasHeader,hasFooter = _ref.hasFooter,hasPanel = _ref.hasPanel;return /*#__PURE__*/(
          _react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: _this2.setRootNode }, _this2.props), /*#__PURE__*/
          _react.default.createElement("div", {
            "data-tid": SidePageContainerDataTids.root,
            className: (0, _Emotion.cx)((_cx = {}, _cx[
            _SidePage.styles.container(_this2.theme)] = true, _cx[
            _SidePage.styles.containerWithoutHeader(_this2.theme)] = !hasHeader, _cx[
            _SidePage.styles.containerWithoutFooter(_this2.theme)] = !hasFooter, _cx[
            _SidePage.styles.containerWithPanel(_this2.theme)] = hasPanel, _cx[
            _SidePage.styles.mobileContainer(_this2.theme)] = _this2.isMobileLayout, _cx[
            _SidePage.styles.mobileContainerWithoutHeader(_this2.theme)] = _this2.isMobileLayout && !hasHeader, _cx)
            ) },

          _this2.props.children
          )
          ));}

      ));

  };return SidePageContainer;}(_react.default.Component), _SidePageContainer.__KONTUR_REACT_UI__ = 'SidePageContainer', _SidePageContainer.displayName = 'SidePageContainer', _SidePageContainer)) || _class) || _class;