// #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 { Animatable } from '../../../Behaviors/Animatable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { backdropElementTemplate } from './BackdropElementTemplate';
import { backdropElementCosmopolitanStyle } from './Themes/BackdropElement.Cosmopolitan';
import { backdropElementJoyStyle } from './Themes/BackdropElement.Joy';
import { backdropElementMemphisStyle } from './Themes/BackdropElement.Memphis';
// #endregion
/**
 * Backdrop - A semi-transparent overlay that creates visual focus by dimming background content.
 *
 * @description
 * The Backdrop component is a fundamental overlay element used to create visual separation between
 * foreground and background content. It renders as a semi-transparent layer that dims the content
 * beneath it, directing user attention to dialogs, modals, drawers, or other interactive overlays.
 * The component features smooth fade-in and fade-out animations for enhanced visual transitions,
 * supports theme-aware styling, and includes backdrop blur effects for modern glass-morphism designs.
 * Typically positioned with fixed or absolute positioning to cover the entire viewport or a specific
 * container area.
 *
 * @name Backdrop
 * @element mosaik-backdrop
 * @category Primitives
 *
 * @cssprop {String} --backdrop-background-color - The semi-transparent background color of the overlay
 * @cssprop {String} --backdrop-blur - The backdrop blur filter intensity (e.g., 6px)
 * @cssprop {String} --backdrop-font-family - The font family CSS custom property.
 * @cssprop {String} --backdrop-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --backdrop-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --backdrop-font-size - The font size CSS custom property.
 * @cssprop {String} --backdrop-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --backdrop-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --backdrop-font-weight - The font weight CSS custom property.
 * @cssprop {String} --backdrop-gap - The gap CSS custom property.
 * @cssprop {String} --backdrop-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --backdrop-padding-left - The padding left CSS custom property.
 * @cssprop {String} --backdrop-padding-right - The padding right CSS custom property.
 * @cssprop {String} --backdrop-padding-top - The padding top CSS custom property.
 * @cssprop {String} --backdrop-shadow - The shadow CSS custom property.
 * @cssprop {String} --backdrop-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --backdrop-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --backdrop-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --backdrop-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --backdrop-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --backdrop-transition-duration - The duration of fade-in/fade-out animations
 * @cssprop {String} --backdrop-transition-mode - The timing function for transition animations
 * @cssprop {String} --backdrop-transition-property - The CSS properties to animate during transitions
 * @cssprop {String} --backdrop-translate - The translate CSS custom property.
 *
 * @example
 * Basic backdrop for modal overlay:
 * ```html
 * <mosaik-backdrop></mosaik-backdrop>
 * ```
 *
 * @example
 * Programmatic control with hidden state:
 * ```html
 * <mosaik-backdrop id="dialogBackdrop" hidden></mosaik-backdrop>
 * <dialog id="myDialog">
 *   <h2>Confirm Action</h2>
 *   <p>Are you sure you want to proceed?</p>
 *   <button onclick="closeDialog()">Cancel</button>
 *   <button onclick="confirmAction()">Confirm</button>
 * </dialog>
 *
 * <script>
 *   const backdrop = document.getElementById('dialogBackdrop');
 *   const dialog = document.getElementById('myDialog');
 *
 *   function showDialog() {
 *     backdrop.hidden = false;
 *     dialog.showModal();
 *   }
 *
 *   function closeDialog() {
 *     backdrop.hidden = true;
 *     dialog.close();
 *   }
 * </script>
 * ```
 *
 * @public
 */
let BackdropElement = class BackdropElement extends Themeable(Animatable(CustomElement)) {
    // #region Fields
    _hidden;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._hidden = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-backdrop';
    }
    /**
     * Gets or sets the `hidden` property.
     *
     * @public
     * @override
     */
    get hidden() {
        return this._hidden;
    }
    set hidden(value) {
        if (this._hidden !== value) {
            this._hidden = value;
            this.requestUpdate('hidden');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    onEnterAnimation() {
        return this.play(fadeIn);
    }
    /**
     * @public
     * @override
     */
    onExitAnimation() {
        return this.play(fadeOut);
    }
};
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], BackdropElement.prototype, "hidden", null);
BackdropElement = __decorate([
    Component({
        selector: 'mosaik-backdrop',
        template: backdropElementTemplate,
        themes: {
            joy: backdropElementJoyStyle,
            memphis: backdropElementMemphisStyle,
            cosmopolitan: backdropElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], BackdropElement);
export { BackdropElement };
//# sourceMappingURL=BackdropElement.js.map