import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.index-of.js";
var __rest = this && this.__rest || function (s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};
import * as React from 'react';
import { Carousel } from '@megafon/ui-core';
import { cnCreate, breakpoints } from '@megafon/ui-helpers';
var getDefaultSlideSettings = function getDefaultSlideSettings(desktopSlidesPerView) {
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, breakpoints.MOBILE_SMALL_START, {
    slidesPerView: 1,
    spaceBetween: 16
  }), breakpoints.MOBILE_BIG_START, {
    slidesPerView: 2,
    spaceBetween: 20
  }), breakpoints.DESKTOP_SMALL_START, {
    slidesPerView: 3,
    spaceBetween: 20
  }), breakpoints.DESKTOP_MIDDLE_START, {
    slidesPerView: desktopSlidesPerView,
    spaceBetween: 20
  });
};
var cn = cnCreate('mfui-carousel-box');
var CarouselBox = function CarouselBox(_a) {
  var children = _a.children,
    slidesSettings = _a.slidesSettings,
    _a$desktopSlidesPerVi = _a.desktopSlidesPerView,
    desktopSlidesPerView = _a$desktopSlidesPerVi === void 0 ? 4 : _a$desktopSlidesPerVi,
    props = __rest(_a, ["children", "slidesSettings", "desktopSlidesPerView"]);
  var settings = slidesSettings || getDefaultSlideSettings(desktopSlidesPerView);
  return /*#__PURE__*/React.createElement("div", {
    className: cn()
  }, /*#__PURE__*/React.createElement(Carousel, _extends({}, props, {
    slidesSettings: settings
  }), children));
};
export default CarouselBox;