// #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 { Listen } from '../../../../Events/Decorators/ListenDecorator';
import { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Focusable } from '../../../Behaviors/Focusable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { RippleElement } from '../../Effects/Ripple/RippleElement';
import { StackElement } from '../../Layouts/Stack/StackElement';
import { DotElement } from '../../Primitives/Dot/DotElement';
import { FocusRingElement } from '../../Primitives/FocusRing/FocusRingElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { calendarItemElementTemplate } from './CalendarItemElementTemplate';
import { calendarItemElementJoyStyle } from './Themes/CalendarItemElement.Joy';
import { calendarItemElementMemphisStyle } from './Themes/CalendarItemElement.Memphis';
import { calendarItemElementCosmopolitanStyle } from './Themes/CalendarItemElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * The `{@link CalendarItemElement}` element.
 *
 * @public
 */
let CalendarItemElement = class CalendarItemElement extends Themeable(Appearanceable(Variantable(Disableable(Valueable(Focusable(CustomElement)))))) {
    // #region Fields
    _text;
    _value;
    _isSelected;
    _isBlackout;
    _isSpecial;
    _isToday;
    _isWeekend;
    _isAdjacent;
    _markers;
    _isRangeStart;
    _isRangeMiddle;
    _isRangeEnd;
    _isRangePreview;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
        this._value = null;
        this._isSelected = false;
        this._isBlackout = false;
        this._isSpecial = false;
        this._isToday = false;
        this._isWeekend = false;
        this._isAdjacent = false;
        this._markers = [];
        this._isRangeStart = false;
        this._isRangeMiddle = false;
        this._isRangeEnd = false;
        this._isRangePreview = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-calendar-item';
    }
    /**
     * Gets or sets the `text` property.
     *
     * @public
     * @attr
     */
    get text() {
        return this._text;
    }
    set text(value) {
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     */
    get value() {
        return this._value;
    }
    set value(value) {
        if (this._value !== value) {
            this._value = value;
            this.requestUpdate('value');
        }
    }
    /**
     * Gets or sets the `isSelected` property.
     *
     * @public
     * @attr
     */
    get isSelected() {
        return this._isSelected;
    }
    set isSelected(value) {
        if (this._isSelected !== value) {
            this._isSelected = value;
            this.requestUpdate('isSelected');
        }
    }
    /**
     * Gets or sets the `isBlackout` property.
     *
     * @public
     * @attr
     */
    get isBlackout() {
        return this._isBlackout;
    }
    set isBlackout(value) {
        if (this._isBlackout !== value) {
            this._isBlackout = value;
            this.requestUpdate('isBlackout');
        }
    }
    /**
     * Gets or sets the `isSpecial` property.
     *
     * @public
     * @attr
     */
    get isSpecial() {
        return this._isSpecial;
    }
    set isSpecial(value) {
        if (this._isSpecial !== value) {
            this._isSpecial = value;
            this.requestUpdate('isSpecial');
        }
    }
    /**
     * Gets or sets the `isToday` property.
     *
     * @public
     * @attr
     */
    get isToday() {
        return this._isToday;
    }
    set isToday(value) {
        if (this._isToday !== value) {
            this._isToday = value;
            this.requestUpdate('isToday');
        }
    }
    /**
     * Gets or sets the `isWeekend` property.
     *
     * @public
     * @attr
     */
    get isWeekend() {
        return this._isWeekend;
    }
    set isWeekend(value) {
        if (this._isWeekend !== value) {
            this._isWeekend = value;
            this.requestUpdate('isWeekend');
        }
    }
    /**
     * Gets or sets the `isAdjacent` property.
     *
     * @public
     * @attr
     */
    get isAdjacent() {
        return this._isAdjacent;
    }
    set isAdjacent(value) {
        if (this._isAdjacent !== value) {
            this._isAdjacent = value;
            this.requestUpdate('isAdjacent');
        }
    }
    /**
     * Gets or sets the `markers` property.
     *
     * @public
     */
    get markers() {
        return this._markers;
    }
    set markers(value) {
        if (this._markers !== value) {
            this._markers = value;
            this.requestUpdate('markers');
        }
    }
    /**
     * Gets or sets the `isRangeStart` property.
     *
     * @public
     * @attr
     */
    get isRangeStart() {
        return this._isRangeStart;
    }
    set isRangeStart(value) {
        if (this._isRangeStart !== value) {
            this._isRangeStart = value;
            this.requestUpdate('isRangeStart');
        }
    }
    /**
     * Gets or sets the `isRangeMiddle` property.
     *
     * @public
     * @attr
     */
    get isRangeMiddle() {
        return this._isRangeMiddle;
    }
    set isRangeMiddle(value) {
        if (this._isRangeMiddle !== value) {
            this._isRangeMiddle = value;
            this.requestUpdate('isRangeMiddle');
        }
    }
    /**
     * Gets or sets the `isRangeEnd` property.
     *
     * @public
     * @attr
     */
    get isRangeEnd() {
        return this._isRangeEnd;
    }
    set isRangeEnd(value) {
        if (this._isRangeEnd !== value) {
            this._isRangeEnd = value;
            this.requestUpdate('isRangeEnd');
        }
    }
    /**
     * Gets or sets the `isRangePreview` property.
     *
     * @public
     * @attr
     */
    get isRangePreview() {
        return this._isRangePreview;
    }
    set isRangePreview(value) {
        if (this._isRangePreview !== value) {
            this._isRangePreview = value;
            this.requestUpdate('isRangePreview');
        }
    }
    // #endregion
    // #region Methods
    onClick(event) {
        if (this.disabled) {
            event.preventDefault();
            event.stopPropagation();
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], CalendarItemElement.prototype, "text", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : undefined,
            toAttribute: (value) => value?.toISOString()
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], CalendarItemElement.prototype, "value", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isSelected", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isBlackout", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isSpecial", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isToday", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isWeekend", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isAdjacent", null);
__decorate([
    Property({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], CalendarItemElement.prototype, "markers", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isRangeStart", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isRangeMiddle", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isRangeEnd", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], CalendarItemElement.prototype, "isRangePreview", null);
__decorate([
    Listen('click'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Event]),
    __metadata("design:returntype", void 0)
], CalendarItemElement.prototype, "onClick", null);
CalendarItemElement = __decorate([
    Component({
        selector: 'mosaik-calendar-item',
        template: calendarItemElementTemplate,
        themes: {
            joy: calendarItemElementJoyStyle,
            memphis: calendarItemElementMemphisStyle,
            cosmopolitan: calendarItemElementCosmopolitanStyle
        },
        imports: [
            TextElement,
            FocusRingElement,
            RippleElement,
            DotElement,
            StackElement
        ]
    }),
    __metadata("design:paramtypes", [])
], CalendarItemElement);
export { CalendarItemElement };
//# sourceMappingURL=CalendarItemElement.js.map