'use strict';

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

const index$1 = require('./index-578e90b1.js');

const BceElementSlider = class {
    constructor(hostRef) {
        index$1.registerInstance(this, hostRef);
        this.value = null;
        this.handleInput = (event) => {
            event.cancelBubble = true;
            const target = event.target;
            this.value = target.value;
            this.el.dispatchEvent(new Event('input', { bubbles: true }));
        };
    }
    async validate(silent = false) {
        const slider = this.el.shadowRoot.querySelector('bce-slider');
        return slider.validate(silent);
    }
    render() {
        if (!this.template)
            return null;
        return [
            index$1.h("p", null, this.handler.t('question')),
            index$1.h("div", null, index$1.h("label", null, this.handler.t('minText')), index$1.h("label", { class: "bold" }, this.value), index$1.h("label", null, this.handler.t('maxText'))),
            index$1.h("bce-slider", { block: true, value: this.value, validation: this.template.required ? 'required' : '', step: this.template.step, min: this.template.min, max: this.template.max, onInput: this.handleInput }),
            index$1.h("div", null, index$1.h("label", null, this.template.min), index$1.h("label", null, this.template.max))
        ];
    }
    get el() { return index$1.getElement(this); }
    static get style() { return ":host p{font-weight:500;text-align:center}\@media screen and (min-width: 1024px){:host p{text-align:left}}:host div{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .bold{font-weight:bold}"; }
};

exports.bce_element_slider = BceElementSlider;
