/**
 * Copyright Aquera Inc 2023
 *
 * This source code is licensed under the BSD-3-Clause license found in the
 * LICENSE file in the root directory of this source tree.
 */
import { __decorate } from "tslib";
import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styles } from './nile-button-toggle.css';
import NileElement from '../internal/nile-element';
/**
 * Nile icon component.
 *
 * @tag nile-button-toggle
 *
 */
let NileButtonToggle = class NileButtonToggle extends NileElement {
    constructor() {
        super(...arguments);
        this.active = false;
        this.initial = false;
        this.middle = false;
        this.end = false;
        this.disabled = false;
        this.value = '';
        /* #endregion */
    }
    /**
     * The styles for ButtonToggle
     * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
     */
    static get styles() {
        return [styles];
    }
    connectedCallback() {
        super.connectedCallback();
        this.addEventListener('click', this.toggle);
    }
    disconnectedCallback() {
        this.removeEventListener('click', this.toggle);
        super.disconnectedCallback();
    }
    toggle() {
        if (this.disabled)
            return;
        this.emit('nile-toggle-change', { active: this.active, value: this.value });
    }
    /**
     * Render method
     * @slot This is a slot test
     */
    render() {
        let classes = ['nile-button-toggle'];
        if (this.active) {
            classes.push('nile-button-toggle__active');
        }
        if (this.initial) {
            classes.push('nile-button-toggle__initial');
        }
        if (this.middle) {
            classes.push('nile-button-toggle__middle');
        }
        if (this.end) {
            classes.push('nile-button-toggle__end');
        }
        if (this.disabled) {
            classes.push('nile-button-toggle__disabled');
        }
        const classString = classes.join(' ');
        return html `
      <div class="${classString} " part="base">
        <slot name="prefix"></slot>
        <slot> </slot>
      </div>
    `;
    }
};
__decorate([
    property({ type: Boolean, reflect: true })
], NileButtonToggle.prototype, "active", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], NileButtonToggle.prototype, "initial", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], NileButtonToggle.prototype, "middle", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], NileButtonToggle.prototype, "end", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], NileButtonToggle.prototype, "disabled", void 0);
__decorate([
    property({ type: String })
], NileButtonToggle.prototype, "value", void 0);
NileButtonToggle = __decorate([
    customElement('nile-button-toggle')
], NileButtonToggle);
export { NileButtonToggle };
export default NileButtonToggle;
//# sourceMappingURL=nile-button-toggle.js.map