'use strict';

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

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

const eclSpinnerEcCss = ".ecl-spinner.sc-ecl-spinner-ec{align-items:center;display:none;flex-direction:column;margin:0 .5rem;position:relative;z-index:51}.ecl-spinner--visible.sc-ecl-spinner-ec{display:inline-flex}.ecl-spinner--centered.sc-ecl-spinner-ec{left:0;margin-left:auto;margin-right:auto;position:absolute;right:0;top:2.5rem}.ecl-spinner__loader.sc-ecl-spinner-ec{animation:rotate 2s linear infinite;height:2rem;stroke:#4073af;stroke-linecap:butt;transform-origin:center center;width:2rem}.ecl-spinner__text.sc-ecl-spinner-ec{color:#404040;font:normal normal 400 1rem/1.25rem arial,sans-serif;margin-top:.5rem}.ecl-spinner--negative.sc-ecl-spinner-ec .ecl-spinner__loader.sc-ecl-spinner-ec{stroke:#fff}.ecl-spinner--negative.sc-ecl-spinner-ec .ecl-spinner__text.sc-ecl-spinner-ec{color:#fff}.ecl-spinner--large.sc-ecl-spinner-ec .ecl-spinner__loader.sc-ecl-spinner-ec{height:3rem;width:3rem}.ecl-spinner--small.sc-ecl-spinner-ec{flex-direction:row;justify-content:center}.ecl-spinner--small.sc-ecl-spinner-ec .ecl-spinner__loader.sc-ecl-spinner-ec{height:1.5rem;width:1.5rem}.ecl-spinner--small.sc-ecl-spinner-ec .ecl-spinner__text.sc-ecl-spinner-ec{margin-inline-start:.5rem;margin-top:0}.ecl-spinner__circle.sc-ecl-spinner-ec{animation:dash 1.5s ease-in-out infinite,color 6s ease-in-out infinite;stroke-dasharray:1,200;stroke-dashoffset:0}.ecl-spinner__overlay.sc-ecl-spinner-ec{background-color:hsla(0,0%,100%,.9);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:50}.ecl-spinner__overlay--visible.sc-ecl-spinner-ec{display:block}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}";

const eclSpinnerEuCss = ".ecl-spinner.sc-ecl-spinner-eu{align-items:center;display:none;flex-direction:column;margin:0 .5rem;position:relative;z-index:51}.ecl-spinner--visible.sc-ecl-spinner-eu{display:inline-flex}.ecl-spinner--centered.sc-ecl-spinner-eu{left:0;margin-left:auto;margin-right:auto;position:absolute;right:0;top:2.5rem}.ecl-spinner__loader.sc-ecl-spinner-eu{animation:rotate 2s linear infinite;height:2rem;stroke:#3e6cd5;stroke-linecap:round;transform-origin:center center;width:2rem}.ecl-spinner__text.sc-ecl-spinner-eu{font:normal normal 400 1rem/1.25rem arial,sans-serif;margin-top:.5rem}.ecl-spinner--negative.sc-ecl-spinner-eu .ecl-spinner__loader.sc-ecl-spinner-eu{stroke:#fff}.ecl-spinner--negative.sc-ecl-spinner-eu .ecl-spinner__text.sc-ecl-spinner-eu{color:#fff}.ecl-spinner--large.sc-ecl-spinner-eu .ecl-spinner__loader.sc-ecl-spinner-eu{height:3rem;width:3rem}.ecl-spinner--small.sc-ecl-spinner-eu{flex-direction:row;justify-content:center}.ecl-spinner--small.sc-ecl-spinner-eu .ecl-spinner__loader.sc-ecl-spinner-eu{height:1.5rem;width:1.5rem}.ecl-spinner--small.sc-ecl-spinner-eu .ecl-spinner__text.sc-ecl-spinner-eu{margin-inline-start:.5rem;margin-top:0}.ecl-spinner__circle.sc-ecl-spinner-eu{animation:dash 1.5s ease-in-out infinite,color 6s ease-in-out infinite;stroke-dasharray:1,200;stroke-dashoffset:0}.ecl-spinner__overlay.sc-ecl-spinner-eu{background-color:hsla(0,0%,100%,.9);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:50}.ecl-spinner__overlay--visible.sc-ecl-spinner-eu{display:block}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}";

const EclSpinner = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.styleClass = '';
        this.variant = 'primary';
        this.theme = 'ec';
        this.centered = false;
        this.visible = false;
        this.overlay = false;
        this.size = 'medium';
    }
    getClass() {
        const classes = [
            `ecl-spinner`,
            `ecl-spinner--${this.variant}`,
            `ecl-spinner--${this.size}`,
            this.styleClass
        ];
        if (this.centered) {
            classes.push('ecl-spinner--centered');
        }
        if (this.visible) {
            classes.push('ecl-spinner--visible');
        }
        return classes.join(' ');
    }
    getOverlayClass() {
        const overlayClasses = ['ecl-spinner__overlay'];
        if (this.visible) {
            overlayClasses.push('ecl-spinner__overlay--visible');
        }
        return overlayClasses.join(' ');
    }
    render() {
        return (index.h("div", null, index.h("div", { class: this.getClass() }, index.h("svg", { class: "ecl-spinner__loader", viewBox: "25 25 50 50" }, index.h("circle", { class: "ecl-spinner__circle", cx: "50", cy: "50", r: "20", fill: "none", "stroke-width": "4px", "stroke-miterlimit": "10", "vector-effect": "non-scaling-stroke" })), index.h("div", { class: "ecl-spinner__text" }, index.h("slot", null))), this.overlay ?
            index.h("div", { class: this.getOverlayClass() }) : ''));
    }
};
EclSpinner.style = {
    ec: eclSpinnerEcCss,
    eu: eclSpinnerEuCss
};

exports.ecl_spinner = EclSpinner;

//# sourceMappingURL=ecl-spinner.cjs.entry.js.map