"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.Footer = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _Components = require("./Components");

var _Icons = require("../Common/Icons");

var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;

var Footer = function Footer(_ref) {
  var menu = _ref.menu,
      social = _ref.social,
      copyright = _ref.copyright,
      subfooter = _ref.subfooter,
      contacts = _ref.contacts,
      footerImages = _ref.footerImages;
  return /*#__PURE__*/_react["default"].createElement(Container, {
    className: "py-4 footer mt-md-5"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "container"
  }, /*#__PURE__*/_react["default"].createElement(Inner, null, (menu == null ? void 0 : menu.isEnabled) && /*#__PURE__*/_react["default"].createElement(AccordionContainer, null, menu.elements.map(function (data, index) {
    return /*#__PURE__*/_react["default"].createElement(_Components.Accordion, {
      key: 'menu-' + index,
      data: data
    });
  })), (social == null ? void 0 : social.isEnabled) && /*#__PURE__*/_react["default"].createElement(SocialMenuContainer, null, /*#__PURE__*/_react["default"].createElement(SocialMenuListWrapper, null, social.elements.map(function (data) {
    return /*#__PURE__*/_react["default"].createElement(_Components.SocialMediaIcon, (0, _extends2["default"])({
      key: data.media
    }, data));
  })), (contacts == null ? void 0 : contacts.isEnabled) && /*#__PURE__*/_react["default"].createElement(ContactsWrapper, null, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, contacts == null ? void 0 : contacts.label), /*#__PURE__*/_react["default"].createElement(IconWrapper, null, /*#__PURE__*/_react["default"].createElement(_Icons.IconPhone, null), /*#__PURE__*/_react["default"].createElement("div", {
    className: "ml-2"
  }, /*#__PURE__*/_react["default"].createElement("a", {
    href: 'tel:' + (contacts == null ? void 0 : contacts.phone)
  }, contacts == null ? void 0 : contacts.phone))))))), (footerImages == null ? void 0 : footerImages.isEnabled) && /*#__PURE__*/_react["default"].createElement(_Components.FooterImages, {
    elements: footerImages == null ? void 0 : footerImages.elements
  }), /*#__PURE__*/_react["default"].createElement(SubFooterContainer, {
    className: "mt-4 pb-3 mx-2 px-1"
  }, (copyright == null ? void 0 : copyright.isEnabled) && /*#__PURE__*/_react["default"].createElement(_Components.Copyright, null, copyright.content), (subfooter == null ? void 0 : subfooter.isEnabled) && /*#__PURE__*/_react["default"].createElement(SubFooterListContainer, null, /*#__PURE__*/_react["default"].createElement(_Components.SubFooterList, {
    data: subfooter.elements
  })))));
};

exports.Footer = Footer;

var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  display: block;\n\n  @media (min-width: ", ") {\n    min-height: 20rem;\n  }\n\n  width: 100%;\n  background: ", ";\n  color: ", ";\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.breakpoints.md.min;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.palette.primary;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.palette.secondary;
});

var Inner = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  display: flex;\n  justify-content: space-between;\n  flex-wrap: wrap;\n\n  @media (min-width: ", ") {\n    flex-wrap: nowrap;\n  }\n"])), function (_ref5) {
  var theme = _ref5.theme;
  return theme.breakpoints.md.min;
});

var AccordionContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  display: none;\n  width: 100%;\n  display: inline-block;\n  vertical-align: top;\n\n  @media (min-width: ", ") {\n    width: 75%;\n  }\n"])), function (_ref6) {
  var theme = _ref6.theme;
  return theme.breakpoints.md.min;
});

var SocialMenuContainer = _styledComponents["default"].div.attrs({
  className: 'mt-3 mt-md-1 mx-2 px-1'
})(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  display: inline-block;\n  vertical-align: top;\n  min-width: 22rem;\n  @media (min-width: ", ") {\n    width: 25%;\n    padding-left: 0;\n  }\n"])), function (_ref7) {
  var theme = _ref7.theme;
  return theme.breakpoints.md.min;
});

var SocialMenuListWrapper = _styledComponents["default"].ul(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  list-style: none;\n  text-align: left;\n  display: flex;\n  margin: 0 -8px;\n\n  @media (min-width: ", ") {\n    justify-content: flex-end;\n  }\n"])), function (_ref8) {
  var theme = _ref8.theme;
  return theme.breakpoints.md.min;
});

var SubFooterContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  color: ", ";\n\n  @media (min-width: ", ") {\n    border-top: 1px solid ", ";\n  }\n"])), function (_ref9) {
  var theme = _ref9.theme;
  return theme.palette.hint;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.breakpoints.md.min;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.palette.footerLine;
});

var SubFooterListContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  width: 100%;\n  display: inline-block;\n\n  @media (min-width: ", ") {\n    width: 50%;\n  }\n"])), function (_ref12) {
  var theme = _ref12.theme;
  return theme.breakpoints.md.min;
});

var ContactsWrapper = _styledComponents["default"].div.attrs({
  className: 'mt-3 d-flex'
})(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  color: ", ";\n  @media (min-width: ", ") {\n    margin-right: 2.5rem;\n    justify-content: flex-end;\n  }\n"])), function (_ref13) {
  var theme = _ref13.theme;
  return theme.palette.light;
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.breakpoints.md.min;
});

var IconWrapper = _styledComponents["default"].div.attrs({
  className: 'd-flex align-items-center'
})(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteralLoose2["default"])([""])));
//# sourceMappingURL=footer.component.js.map