// #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 { Component } from '../../../Decorators/ComponentDecorator';
import { portalHostElementTemplate } from './PortalHostElementTemplate';
import { portalHostElementJoyStyle } from './Themes/PortalHostElement.Joy';
import { portalHostElementMemphisStyle } from './Themes/PortalHostElement.Memphis';
import { portalHostElementCosmopolitanStyle } from './Themes/PortalHostElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { CustomElement } from '../../Abstracts/CustomElement';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { PORTAL_HOST_REGISTRY } from './Portal';
import { Slottable } from '../../../Behaviors/Slottable';
// #endregion
/**
 * PortalHost - A designated destination container for portal content rendering.
 *
 * @description
 * The PortalHost component defines named locations where portal content can be rendered. It serves as a
 * landing zone for portals, allowing you to control where teleported content appears in your layout.
 * This is particularly useful for creating dedicated areas for modals, notifications, tooltips, or any
 * layered UI that needs consistent placement. Multiple portal hosts can exist with different names,
 * enabling organized content projection across complex layouts.
 *
 * @name PortalHost
 * @element mosaik-portal-host
 * @category Primitives
 *
 * @slot - The container where portal projections will be rendered
 *
 * @cssprop {String} --portal-host-font-family - The host font family CSS custom property.
 * @cssprop {String} --portal-host-font-letter-spacing - The host font letter spacing CSS custom property.
 * @cssprop {String} --portal-host-font-line-height - The host font line height CSS custom property.
 * @cssprop {String} --portal-host-font-size - The host font size CSS custom property.
 * @cssprop {String} --portal-host-font-text-decoration - The host font text decoration CSS custom property.
 * @cssprop {String} --portal-host-font-text-transform - The host font text transform CSS custom property.
 * @cssprop {String} --portal-host-font-weight - The host font weight CSS custom property.
 * @cssprop {String} --portal-host-gap - The host gap CSS custom property.
 * @cssprop {String} --portal-host-padding-bottom - The host padding bottom CSS custom property.
 * @cssprop {String} --portal-host-padding-left - The host padding left CSS custom property.
 * @cssprop {String} --portal-host-padding-right - The host padding right CSS custom property.
 * @cssprop {String} --portal-host-padding-top - The host padding top CSS custom property.
 * @cssprop {String} --portal-host-shadow - The host shadow CSS custom property.
 * @cssprop {String} --portal-host-shadow-blur - The host shadow blur CSS custom property.
 * @cssprop {String} --portal-host-shadow-color - The host shadow color CSS custom property.
 * @cssprop {String} --portal-host-shadow-offset-x - The host shadow offset x CSS custom property.
 * @cssprop {String} --portal-host-shadow-offset-y - The host shadow offset y CSS custom property.
 * @cssprop {String} --portal-host-shadow-spread - The host shadow spread CSS custom property.
 * @cssprop {String} --portal-host-transition-duration - The host transition duration CSS custom property.
 * @cssprop {String} --portal-host-transition-mode - The host transition mode CSS custom property.
 * @cssprop {String} --portal-host-transition-property - The host transition property CSS custom property.
 * @cssprop {String} --portal-host-translate - The host translate CSS custom property.
 *
 * @example
 * Create modal container:
 * ```html
 * <!-- Define host in layout -->
 * <div class="app-layout">
 *   <main>...</main>
 *   <mosaik-portal-host name="modals"></mosaik-portal-host>
 * </div>
 *
 * <!-- Use portal targeting this host -->
 * <mosaik-portal destination="modals">
 *   <mosaik-dialog>Modal content</mosaik-dialog>
 * </mosaik-portal>
 * ```
 *
 * @example
 * Multiple portal hosts:
 * ```html
 * <div class="app">
 *   <mosaik-portal-host name="toasts" class="toast-container"></mosaik-portal-host>
 *   <mosaik-portal-host name="modals" class="modal-container"></mosaik-portal-host>
 *   <mosaik-portal-host name="tooltips" class="tooltip-container"></mosaik-portal-host>
 * </div>
 * ```
 *
 * @example
 * Styled portal host:
 * ```html
 * <mosaik-portal-host name="notifications" style="position: fixed; top: 20px; right: 20px; z-index: 9999;">
 * </mosaik-portal-host>
 * ```
 *
 * @public
 */
let PortalHostElement = class PortalHostElement extends Themeable(Slottable(CustomElement)) {
    // #region Fields
    _name;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._name = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-portal-host';
    }
    // #endregion
    // #region Properties
    /**
     * Gets or sets the `name` property.
     * The `name` property represents the unique identifier for this portal host.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        PORTAL_HOST_REGISTRY.set(this._name, this);
    }
    /**
     * @public
     * @override
     */
    disconnectedCallback() {
        super.disconnectedCallback();
        PORTAL_HOST_REGISTRY.delete(this._name);
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PortalHostElement.prototype, "name", null);
PortalHostElement = __decorate([
    Component({
        selector: 'mosaik-portal-host',
        template: portalHostElementTemplate,
        themes: {
            joy: portalHostElementJoyStyle,
            memphis: portalHostElementMemphisStyle,
            cosmopolitan: portalHostElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], PortalHostElement);
export { PortalHostElement };
//# sourceMappingURL=PortalHostElement.js.map