import { r as registerInstance, h, g as getElement } from './core-095fd691.js';

const BceElementInput = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.handleInput = (event) => {
            event.cancelBubble = true;
            const target = event.target;
            this.value = target.value;
            this.el.dispatchEvent(new Event('input', { bubbles: true }));
        };
    }
    render() {
        if (!this.template)
            return null;
        const type = this.template.multiline ? 'textarea' : 'text';
        return [
            h("p", null, this.template.question),
            h("bce-input", { value: this.value, onInput: this.handleInput, validation: this.template.required ? 'required' : '', type: type })
        ];
    }
    get el() { return getElement(this); }
    static get style() { return "bce-element-input p{font-weight:500;text-align:center}\@media screen and (min-width:1024px){bce-element-input p{text-align:left}}"; }
};

export { BceElementInput as bce_element_input };
