// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { fadeIn, fadeOut } from '../../../../Animations/Presets/Fade';
import { Listen } from '../../../../events/Decorators/ListenDecorator';
import { Animatable } from '../../../Behaviors/Animatable';
import { Closeable } from '../../../Behaviors/Closeable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Iconable } from '../../../Behaviors/Iconable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Selectable } from '../../../Behaviors/Selectable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Valueable } from '../../../Behaviors/Valueable';
import { addInheritanceConsumerController } from '../../../Controllers/InheritanceConsumerController';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { TAB_INHERITANCE_CONTEXT } from './TabInheritanceContext';
import { tabItemElementTemplate } from './TabItemElementTemplate';
import { tabItemElementCosmopolitanStyle } from './Themes/TabItemElement.Cosmopolitan';
import { tabItemElementJoyStyle } from './Themes/TabItemElement.Joy';
import { tabItemElementMemphisStyle } from './Themes/TabItemElement.Memphis';
// #endregion
/**
 * Tab Item - A navigation option within a tabbed interface.
 *
 * Used to switch between different views or sections of content.
 * Typically displayed as a clickable label, often accompanied by an icon.
 * Tabs help organize content into manageable sections, improving user experience and navigation.
 *
 * @name TabItemElement
 * @element mosaik-tab-item
 * @category Selector
 *
 * @slot - The default slot.
 *
 * @csspart root - The root part.
 *
 * @cssprop {String} --tab-item-border-radius - The item border radius CSS custom property.
 * @cssprop {String} --tab-item-border-style - The item border style CSS custom property.
 * @cssprop {String} --tab-item-border-width - The item border width CSS custom property.
 * @cssprop {String} --tab-item-font-family - The item font family CSS custom property.
 * @cssprop {String} --tab-item-font-letter-spacing - The item font letter spacing CSS custom property.
 * @cssprop {String} --tab-item-font-line-height - The item font line height CSS custom property.
 * @cssprop {String} --tab-item-font-size - The item font size CSS custom property.
 * @cssprop {String} --tab-item-font-text-decoration - The item font text decoration CSS custom property.
 * @cssprop {String} --tab-item-font-text-transform - The item font text transform CSS custom property.
 * @cssprop {String} --tab-item-font-weight - The item font weight CSS custom property.
 * @cssprop {String} --tab-item-gap - The item gap CSS custom property.
 * @cssprop {String} --tab-item-padding-bottom - The item padding bottom CSS custom property.
 * @cssprop {String} --tab-item-padding-left - The item padding left CSS custom property.
 * @cssprop {String} --tab-item-padding-right - The item padding right CSS custom property.
 * @cssprop {String} --tab-item-padding-top - The item padding top CSS custom property.
 * @cssprop {String} --tab-item-shadow - The item shadow CSS custom property.
 * @cssprop {String} --tab-item-shadow-blur - The item shadow blur CSS custom property.
 * @cssprop {String} --tab-item-shadow-color - The item shadow color CSS custom property.
 * @cssprop {String} --tab-item-shadow-offset-x - The item shadow offset x CSS custom property.
 * @cssprop {String} --tab-item-shadow-offset-y - The item shadow offset y CSS custom property.
 * @cssprop {String} --tab-item-shadow-spread - The item shadow spread CSS custom property.
 * @cssprop {String} --tab-item-transition-duration - The item transition duration CSS custom property.
 * @cssprop {String} --tab-item-transition-mode - The item transition mode CSS custom property.
 * @cssprop {String} --tab-item-transition-property - The item transition property CSS custom property.
 * @cssprop {String} --tab-item-translate - The item translate CSS custom property.
 *
 * @fires selected {SelectedEvent} - Fired when the tab is selected.
 * @fires deselected {DeselectedEvent} - Fired when the tab is deselected.
 * @fires closed {ClosedEvent} - Fired when the tab will be closed.
 *
 * @example
 * ```html
 * <mosaik-tab-item is-selected>Overview content</mosaik-tab-item>
 * ```
 *
 * @example
 * Disabled tab item:
 * ```html
 * <mosaik-tab-item disabled>Unavailable content</mosaik-tab-item>
 * ```
 *
 * @public
 */
let TabItemElement = class TabItemElement extends Themeable(Animatable(Orientable(Closeable(Selectable(Disableable(Labelable(Iconable(Valueable(CustomElement))))))))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: TAB_INHERITANCE_CONTEXT
    });
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `TabItemElement` class.
     *
     * @public
     */
    constructor() {
        super();
        this.enter = fadeIn;
        this.exit = fadeOut;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-tab-item';
    }
    /**
     * @inheritdoc
     * When used inside a Tab, inherits the tab's disabled state unless explicitly set.
     *
     * @public
     * @override
     */
    get disabled() {
        return this._inheritance.get('disabled', super.disabled);
    }
    set disabled(value) {
        this._inheritance.markExplicit('disabled');
        super.disabled = value;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        if (this.isSelected) {
            void this.play(this.enter ?? { steps: [] });
        }
    }
    /**
     * @protected
     */
    onSelected() {
        void this.play(this.enter ?? { steps: [] });
    }
    /**
     * @protected
     */
    onDeselected() {
        // CSS handles hiding via display: none.
    }
};
__decorate([
    Listen('selected'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], TabItemElement.prototype, "onSelected", null);
__decorate([
    Listen('deselected'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], TabItemElement.prototype, "onDeselected", null);
TabItemElement = __decorate([
    Component({
        selector: 'mosaik-tab-item',
        template: tabItemElementTemplate,
        themes: {
            joy: tabItemElementJoyStyle,
            memphis: tabItemElementMemphisStyle,
            cosmopolitan: tabItemElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], TabItemElement);
export { TabItemElement };
//# sourceMappingURL=TabItemElement.js.map