"use strict";

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

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

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

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

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

var _lib = require("@sentecacommerce-theme/lib");

/* eslint-disable jsx-a11y/alt-text */
// eslint-disable-line
var LazyResponsiveImage = function LazyResponsiveImage(_ref) {
  var _ref$defaultSize = _ref.defaultSize,
      defaultSize = _ref$defaultSize === void 0 ? 'large' : _ref$defaultSize,
      _ref$backgroundOverIm = _ref.backgroundOverImage,
      backgroundOverImage = _ref$backgroundOverIm === void 0 ? true : _ref$backgroundOverIm,
      rest = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["defaultSize", "backgroundOverImage"]);

  var _useConfigState = (0, _lib.useConfigState)(),
      imagesConfig = _useConfigState.imagesConfig,
      theme = _useConfigState.theme;

  return /*#__PURE__*/_react["default"].createElement(_lib.LazyResponsiveImage, (0, _extends2["default"])({
    aspectRatio: [imagesConfig.ratio.width, imagesConfig.ratio.height],
    fallbackImage: imagesConfig.fallbackImage,
    breakpointsMap: theme.breakpoints,
    backgroundOverImage: backgroundOverImage,
    background: backgroundOverImage ? theme.palette.primary : theme.palette.disabled,
    defaultSize: defaultSize
  }, rest));
};

exports.LazyResponsiveImage = LazyResponsiveImage;
//# sourceMappingURL=index.js.map