// #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 { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Variantable } from '../../../Behaviors/Variantable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { MessageBoxButtons } from '../../../Types/MessageBoxButtons';
import { ButtonElement } from '../../Buttons/Button/ButtonElement';
import { IconElement } from '../../Media/Icon/IconElement';
import { SpacerElement } from '../../Primitives/Spacer/SpacerElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { OverlayElement } from '../Abstracts/OverlayElement';
import { DialogElement } from '../Dialog/DialogElement';
import { messageBoxElementTemplate } from './MessageBoxElementTemplate';
import { messageBoxElementJoyStyle } from './Themes/MessageBoxElement.Joy';
import { messageBoxElementRetroStyle } from './Themes/MessageBoxElement.Retro';
import { messageBoxElementCosmopolitanStyle } from './Themes/MessageBoxElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * The `{@link MessageBoxElement}` element.
 *
 * @public
 */
let MessageBoxElement = class MessageBoxElement extends Themeable(Appearanceable(Variantable(OverlayElement))) {
    // #region Fields
    _header;
    _subHeader;
    _message;
    _buttons;
    _labels;
    _icon;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._header = '';
        this._subHeader = '';
        this._message = '';
        this._buttons = MessageBoxButtons.OK;
        this._labels = {
            ok: 'OK',
            cancel: 'Cancel',
            yes: 'Yes',
            no: 'No'
        };
        this._icon = '';
    }
    // #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-message-box';
    }
    /**
     * Gets or sets the `header` property.
     *
     * @public
     */
    get header() {
        return this._header;
    }
    set header(value) {
        if (this._header !== value) {
            this._header = value;
            this.requestUpdate('header');
        }
    }
    /**
     * Gets or sets the `subHeader` property.
     *
     * @public
     */
    get subHeader() {
        return this._subHeader;
    }
    set subHeader(value) {
        if (this._subHeader !== value) {
            this._subHeader = value;
            this.requestUpdate('subHeader');
        }
    }
    /**
     * Gets or sets the `message` property.
     *
     * @public
     */
    get message() {
        return this._message;
    }
    set message(value) {
        if (this._message !== value) {
            this._message = value;
            this.requestUpdate('message');
        }
    }
    /**
     * Gets or sets the `buttons` property.
     *
     * @public
     * @attr
     */
    get buttons() {
        return this._buttons;
    }
    set buttons(value) {
        if (this._buttons !== value) {
            this._buttons = value;
            this.requestUpdate('buttons');
        }
    }
    /**
     * Gets or sets the `labels` property.
     *
     * @public
     */
    get labels() {
        return this._labels;
    }
    set labels(value) {
        if (this._labels !== value) {
            this._labels = value;
            this.requestUpdate('labels');
        }
    }
    /**
     * Gets or sets the `icon` property.
     *
     * @public
     */
    get icon() {
        return this._icon;
    }
    set icon(value) {
        if (this._icon !== value) {
            this._icon = value;
            this.requestUpdate('icon');
        }
    }
    // #endregion
    // #region Methods
    onDialogResult(result) {
        this.emit(new CustomEvent('dialogResult'), { detail: result });
        this.close();
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageBoxElement.prototype, "header", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageBoxElement.prototype, "subHeader", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageBoxElement.prototype, "message", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageBoxElement.prototype, "buttons", null);
__decorate([
    Property({ type: Object }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], MessageBoxElement.prototype, "labels", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageBoxElement.prototype, "icon", null);
MessageBoxElement = __decorate([
    Component({
        selector: 'mosaik-message-box',
        template: messageBoxElementTemplate,
        themes: {
            joy: messageBoxElementJoyStyle,
            retro: messageBoxElementRetroStyle,
            cosmopolitan: messageBoxElementCosmopolitanStyle
        },
        imports: [
            DialogElement,
            ButtonElement,
            SpacerElement,
            TextElement,
            IconElement
        ]
    }),
    __metadata("design:paramtypes", [])
], MessageBoxElement);
export { MessageBoxElement };
//# sourceMappingURL=MessageBoxElement.js.map