'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var styled = require('styled-components');
var index = require('../../../../utils/index.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);

const ButtonSheetImageWrapper = styled__default['default'].figure `
  height: ${({ imgHeight }) => imgHeight || '162px'};
  margin: ${index.getSpacing('s00')};
  overflow: hidden;
  position: relative;

  button {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
  }
`;
const ImageStyled = styled__default['default'].img `
  width: 100%;
  height: 100%;

  ${({ asHeader }) => asHeader &&
    styled.css `
      border-radius: ${({ theme: { radius } }) => `${radius.roundedC} ${radius.roundedC} ${radius.roundedNone} ${radius.roundedNone}`};
    `};

  ${({ objectFit }) => {
    switch (objectFit) {
        case 'contain':
            return styled.css `
          object-fit: contain;
        `;
        case 'fill':
            return styled.css `
          object-fit: fill;
        `;
        case 'none':
            return styled.css `
          object-fit: none;
        `;
        case 'scale-down':
            return styled.css `
          object-fit: scale-down;
        `;
        default:
            return styled.css `
          object-fit: cover;
        `;
    }
}};

  ${({ objectPosition }) => {
    switch (objectPosition) {
        case 'bottom':
            return styled.css `
          object-position: bottom;
        `;
        case 'inherit':
            return styled.css `
          object-position: inherit;
        `;
        case 'initial':
            return styled.css `
          object-position: initial;
        `;
        case 'left':
            return styled.css `
          object-position: left;
        `;
        case 'revert':
            return styled.css `
          object-position: revert;
        `;
        case 'revert-layer':
            return styled.css `
          object-position: revert-layer;
        `;
        case 'right':
            return styled.css `
          object-position: right;
        `;
        case 'top':
            return styled.css `
          object-position: top;
        `;
        case 'unset':
            return styled.css `
          object-position: unset;
        `;
        default:
            return styled.css `
          object-position: center;
        `;
    }
}}
`;

exports.ButtonSheetImageWrapper = ButtonSheetImageWrapper;
exports.ImageStyled = ImageStyled;
