// #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 { Attachable } from '../../../Behaviors/Attachable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Elevatable } from '../../../Behaviors/Elevatable';
import { Variantable } from '../../../Behaviors/Variantable';
import { ResizeController } from '../../../Controllers/ResizeController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { ElevationWeight } from '../../../Types/ElevationWeight';
import { Trigger } from '../../../Types/Trigger';
import { CustomElement } from '../../Abstracts/CustomElement';
import { ElevationElement } from '../Elevation/ElevationElement';
import { popupElementTemplate } from './PopupElementTemplate';
import { popupElementJoyStyle } from './Themes/PopupElement.Joy';
import { popupElementMemphisStyle } from './Themes/PopupElement.Memphis';
import { popupElementCosmopolitanStyle } from './Themes/PopupElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * Popup - A transient dialog or window that appears on top of other content.
 *
 * @element mosaik-popup
 *
 * @public
 */
let PopupElement = class PopupElement extends Themeable(Appearanceable(Variantable(Disableable(Attachable(Elevatable(CustomElement)))))) {
    // #region Fields
    _resizeController;
    _verticalOffset;
    _horizontalOffset;
    _staysOpen;
    _placement;
    _isOpen;
    _openTrigger;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._verticalOffset = '0px';
        this._horizontalOffset = '0px';
        this._staysOpen = false;
        this._placement = 'auto';
        this._isOpen = false;
        this._openTrigger = Trigger.Click;
        this._resizeController = new ResizeController(this, {
            callback: () => this.requestUpdate()
        });
        this.elevation = ElevationWeight.Regular;
    }
    // #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-popup';
    }
    /**
     * Gets or sets the `verticalOffset` property.
     *
     * @public
     * @attr
     */
    get verticalOffset() {
        return this._verticalOffset;
    }
    set verticalOffset(value) {
        if (this._verticalOffset !== value) {
            this._verticalOffset = value;
            this.requestUpdate('verticalOffset');
        }
    }
    /**
     * Gets or sets the `horizontalOffset` property.
     *
     * @public
     * @attr
     */
    get horizontalOffset() {
        return this._horizontalOffset;
    }
    set horizontalOffset(value) {
        if (this._horizontalOffset !== value) {
            this._horizontalOffset = value;
            this.requestUpdate('horizontalOffset');
        }
    }
    /**
     * Gets or sets the `staysOpen` property.
     *
     * @public
     * @attr
     */
    get staysOpen() {
        return this._staysOpen;
    }
    set staysOpen(value) {
        if (this._staysOpen !== value) {
            this._staysOpen = value;
            this.requestUpdate('staysOpen');
        }
    }
    /**
     * Gets or sets the `placement` property.
     *
     * @public
     * @attr
     */
    get placement() {
        return this._placement;
    }
    set placement(value) {
        if (this._placement !== value) {
            this._placement = value;
            this.requestUpdate('placement');
        }
    }
    /**
     * Gets or sets the `isOpen` property.
     *
     * @public
     * @attr
     */
    get isOpen() {
        return this._isOpen;
    }
    set isOpen(value) {
        if (this._isOpen !== value) {
            this._isOpen = value;
            this.requestUpdate('isOpen');
        }
    }
    /**
     * Gets or sets the `openTrigger` property.
     *
     * @public
     * @attr
     */
    get openTrigger() {
        return this._openTrigger;
    }
    set openTrigger(value) {
        if (this._openTrigger !== value) {
            this._openTrigger = value;
            this.requestUpdate('openTrigger');
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PopupElement.prototype, "verticalOffset", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PopupElement.prototype, "horizontalOffset", null);
__decorate([
    Attribute({ type: Boolean, useDefault: true }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], PopupElement.prototype, "staysOpen", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PopupElement.prototype, "placement", null);
__decorate([
    Attribute({ type: Boolean, useDefault: true }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], PopupElement.prototype, "isOpen", null);
__decorate([
    Attribute({ type: Trigger }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PopupElement.prototype, "openTrigger", null);
PopupElement = __decorate([
    Component({
        selector: 'mosaik-popup',
        template: popupElementTemplate,
        themes: {
            joy: popupElementJoyStyle,
            memphis: popupElementMemphisStyle,
            cosmopolitan: popupElementCosmopolitanStyle
        },
        imports: [
            ElevationElement
        ]
    }),
    __metadata("design:paramtypes", [])
], PopupElement);
export { PopupElement };
//# sourceMappingURL=PopupElement.js.map