"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const mobileContext_1 = require("../../gravity-blocks/context/mobileContext/index.js");
const utils_1 = require("../../utils/index.js");
const AnimateBlock_1 = tslib_1.__importDefault(require("../AnimateBlock/AnimateBlock.js"));
const Media_1 = tslib_1.__importDefault(require("../Media/Media.js"));
const b = (0, utils_1.block)('BackgroundMedia');
const BackgroundMedia = ({ className, color, animated, parallax = true, video, mediaClassName, fullWidthMedia, qa, ...props }) => {
    const isMobile = React.useContext(mobileContext_1.MobileContext);
    const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'media');
    return ((0, jsx_runtime_1.jsx)(AnimateBlock_1.default, { className: b(null, className), style: { backgroundColor: color }, animate: animated, qa: qaAttributes.animate, children: (0, jsx_runtime_1.jsx)(Media_1.default, { className: b('media', { 'full-width-media': fullWidthMedia }, mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, qa: qaAttributes.media, height: 720,
            color,
            parallax,
            video: isMobile ? undefined : video,
            ...props }) }));
};
exports.default = BackgroundMedia;
//# sourceMappingURL=BackgroundMedia.js.map
