'use strict';

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

const index = require('./index-420e0ca1.js');

const eclSocialMediaShareEcCss = ".ecl-social-media-share.sc-ecl-social-media-share-ec{background-color:#fff;border:0;border-radius:0;margin:0;padding:0}.ecl-social-media-share__description.sc-ecl-social-media-share-ec{color:#404040;font:normal normal 400 1rem/1.5rem arial,sans-serif;font-weight:700;margin-bottom:.5rem;margin-top:0}.ecl-social-media-share__list.sc-ecl-social-media-share-ec{align-items:center;display:flex;flex-wrap:wrap;list-style:none;margin-bottom:0;margin-top:-.75rem;padding-inline-start:0}.ecl-social-media-share__item.sc-ecl-social-media-share-ec{display:flex;margin-inline-end:1.5rem;margin-top:1.5rem}.ecl-social-media-share__item.sc-ecl-social-media-share-ec:last-child{margin-inline-end:0}.ecl-social-media-share__link.sc-ecl-social-media-share-ec{align-items:center;display:flex;font:normal normal 400 .875rem/1rem arial,sans-serif;overflow:hidden}.ecl-social-media-share__icon.sc-ecl-social-media-share-ec{flex-shrink:0;top:0!important}.ecl-social-media-share--vertical.sc-ecl-social-media-share-ec .ecl-social-media-share__description.sc-ecl-social-media-share-ec{margin-bottom:0}.ecl-social-media-share--vertical.sc-ecl-social-media-share-ec .ecl-social-media-share__list.sc-ecl-social-media-share-ec{align-items:flex-start;flex-direction:column;margin-top:0}.ecl-social-media-share--vertical.sc-ecl-social-media-share-ec .ecl-social-media-share__item.sc-ecl-social-media-share-ec,.ecl-social-media-share--vertical.sc-ecl-social-media-share-ec .ecl-social-media-share__item.sc-ecl-social-media-share-ec:last-child{margin-inline-end:0}@media (max-width:767px){.ecl-social-media-share__description.sc-ecl-social-media-share-ec{margin-bottom:0}.ecl-social-media-share__list.sc-ecl-social-media-share-ec{align-items:flex-start;flex-direction:column;margin-top:0}.ecl-social-media-share__item.sc-ecl-social-media-share-ec,.ecl-social-media-share__item.sc-ecl-social-media-share-ec:last-child{margin-inline-end:0}}";

const eclSocialMediaShareEuCss = ".ecl-social-media-share.sc-ecl-social-media-share-eu{background-color:#fff;border:0;border-radius:4px;margin:0;padding:0}.ecl-social-media-share__description.sc-ecl-social-media-share-eu{font:normal normal 400 1rem/1.5rem arial,sans-serif;font-weight:700;margin-bottom:.5rem;margin-top:0}.ecl-social-media-share__list.sc-ecl-social-media-share-eu{align-items:center;display:flex;flex-wrap:wrap;list-style:none;margin-bottom:0;margin-top:-.75rem;padding-inline-start:0}.ecl-social-media-share__item.sc-ecl-social-media-share-eu{display:flex;margin-inline-end:1.5rem;margin-top:1.5rem}.ecl-social-media-share__item.sc-ecl-social-media-share-eu:last-child{margin-inline-end:0}.ecl-social-media-share__link.sc-ecl-social-media-share-eu{align-items:center;display:flex;font:normal normal 400 .875rem/1rem arial,sans-serif;overflow:hidden}.ecl-social-media-share__icon.sc-ecl-social-media-share-eu{flex-shrink:0;top:0!important}.ecl-social-media-share--vertical.sc-ecl-social-media-share-eu .ecl-social-media-share__description.sc-ecl-social-media-share-eu{margin-bottom:0}.ecl-social-media-share--vertical.sc-ecl-social-media-share-eu .ecl-social-media-share__list.sc-ecl-social-media-share-eu{align-items:flex-start;flex-direction:column;margin-top:0}.ecl-social-media-share--vertical.sc-ecl-social-media-share-eu .ecl-social-media-share__item.sc-ecl-social-media-share-eu,.ecl-social-media-share--vertical.sc-ecl-social-media-share-eu .ecl-social-media-share__item.sc-ecl-social-media-share-eu:last-child{margin-inline-end:0}@media (max-width:767px){.ecl-social-media-share__description.sc-ecl-social-media-share-eu{margin-bottom:0}.ecl-social-media-share__list.sc-ecl-social-media-share-eu{align-items:flex-start;flex-direction:column;margin-top:0}.ecl-social-media-share__item.sc-ecl-social-media-share-eu,.ecl-social-media-share__item.sc-ecl-social-media-share-eu:last-child{margin-inline-end:0}}";

const EclSocialMediaShare = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.theme = 'ec';
        this.styleClass = undefined;
        this.variant = 'horizontal';
        this.description = undefined;
    }
    getClass() {
        return [
            `ecl-social-media-share`,
            `ecl-social-media-share--${this.variant}`,
            this.styleClass
        ].join(' ');
    }
    componentDidRender() {
        if (this.el.querySelector('.ecl-social-media-share__list')) {
            const list = this.el.querySelector('.ecl-social-media-share__list');
            const popover = this.el.getElementsByTagName('ecl-popover')[0] || false;
            if (popover) {
                const li = document.createElement('li');
                li.classList.add('ecl-social-media-share__item', `sc-ecl-social-media-share-${this.theme}`);
                popover.parentNode.insertBefore(li, popover);
                li.appendChild(popover);
                li.querySelector('.ecl-popover__toggle').classList.add(`ecl-social-media-share__link`, `sc-ecl-social-media-share-${this.theme}`);
            }
            const items = this.el.querySelectorAll('.ecl-social-media-share__item');
            list.innerHTML = '';
            list.append(...items);
        }
    }
    render() {
        return (index.h("div", { class: this.getClass() }, this.description ?
            index.h("p", { class: "ecl-social-media-share__description" }, this.description) : '', index.h("ul", { class: "ecl-social-media-share__list" }, index.h("slot", null))));
    }
    get el() { return index.getElement(this); }
};
EclSocialMediaShare.style = {
    ec: eclSocialMediaShareEcCss,
    eu: eclSocialMediaShareEuCss
};

exports.ecl_social_media_share = EclSocialMediaShare;

//# sourceMappingURL=ecl-social-media-share.cjs.entry.js.map