// #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 { HTMLElementEventEmitter } from '@breadstone/mosaik-elements';
import { Emit } from '../../../../events/Decorators/EmitDecorator';
import { Slottable } from '../../../Behaviors/Slottable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { contentElementTemplate } from './ContentElementTemplate';
import { contentElementCosmopolitanStyle } from './Themes/ContentElement.Cosmopolitan';
import { contentElementJoyStyle } from './Themes/ContentElement.Joy';
import { contentElementMemphisStyle } from './Themes/ContentElement.Memphis';
// #endregion
/**
 * Content - A slot observer that detects and reports content presence changes.
 *
 * @description
 * The Content component is a lightweight wrapper that monitors its slotted content and automatically
 * updates the hasContent property based on whether content is present. It fires the contentChanged
 * event whenever content is added or removed, making it ideal for conditional rendering, placeholder
 * displays, and empty state handling. This element provides a declarative way to handle dynamic
 * content scenarios without manual JavaScript observers.
 *
 * @name Content
 * @element mosaik-content
 * @category Primitives
 *
 * @slot - The default content slot for any child content
 *
 * @cssprop {String} --content-font-family - The font family CSS custom property.
 * @cssprop {String} --content-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --content-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --content-font-size - The font size CSS custom property.
 * @cssprop {String} --content-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --content-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --content-font-weight - The font weight CSS custom property.
 * @cssprop {String} --content-gap - The gap CSS custom property.
 * @cssprop {String} --content-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --content-padding-left - The padding left CSS custom property.
 * @cssprop {String} --content-padding-right - The padding right CSS custom property.
 * @cssprop {String} --content-padding-top - The padding top CSS custom property.
 * @cssprop {String} --content-shadow - The shadow CSS custom property.
 * @cssprop {String} --content-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --content-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --content-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --content-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --content-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --content-transition-duration - The transition duration CSS custom property.
 * @cssprop {String} --content-transition-mode - The transition mode CSS custom property.
 * @cssprop {String} --content-transition-property - The transition property CSS custom property.
 * @cssprop {String} --content-translate - The translate CSS custom property.
 *
 * @fires contentChanged {ContentChangedEvent} - Fired when the content presence changes
 *
 * @example
 * Basic usage with conditional styling:
 * ```html
 * <mosaik-content id="myContent">
 *   <p>Some content here</p>
 * </mosaik-content>
 * <style>
 *   mosaik-content:not([has-content]) {
 *     display: none;
 *   }
 * </style>
 * ```
 *
 * @example
 * Listening to content changes:
 * ```html
 * <mosaik-content id="wrapper"></mosaik-content>
 * <script>
 *   const wrapper = document.querySelector('#wrapper');
 *   wrapper.addEventListener('contentChanged', (e) => {
 *     console.log('Has content:', e.detail.hasContent);
 *   });
 * </script>
 * ```
 *
 * @example
 * Dynamic content with placeholder:
 * ```html
 * <div class="container">
 *   <mosaik-content id="dynamicContent"></mosaik-content>
 *   <div class="placeholder" hidden>No content available</div>
 * </div>
 * <script>
 *   const content = document.querySelector('#dynamicContent');
 *   const placeholder = document.querySelector('.placeholder');
 *   content.addEventListener('contentChanged', (e) => {
 *     placeholder.hidden = e.detail.hasContent;
 *   });
 * </script>
 * ```
 *
 * @public
 */
let ContentElement = class ContentElement extends Themeable(Slottable(CustomElement)) {
    // #region Fields
    _contentChanged;
    _hasContent;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._hasContent = false;
        this._contentChanged = new HTMLElementEventEmitter(this, 'contentChanged');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-content';
    }
    /**
     * Gets or sets the `hasContent` property.
     *
     * @public
     * @readonly
     * @attr
     */
    get hasContent() {
        return this._hasContent;
    }
    set hasContent(value) {
        if (this._hasContent !== value) {
            this._hasContent = value;
            this.requestUpdate('hasContent');
        }
    }
    /**
     * Called when the content changes.
     * Provides reference to `IEventDetail` as event detail.
     *
     * @public
     * @readonly
     * @eventProperty
     */
    get contentChanged() {
        return this._contentChanged;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    onSlotChanges() {
        this.hasContent = this.hasSlotContent('');
    }
    /**
     * Emits the `contentChanged` event.
     *
     * @protected
     */
    onContentChanged(args) {
        this._contentChanged.emit(args);
    }
};
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ContentElement.prototype, "hasContent", null);
__decorate([
    Emit({ eventName: 'contentChanged' }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [])
], ContentElement.prototype, "contentChanged", null);
ContentElement = __decorate([
    Component({
        selector: 'mosaik-content',
        template: contentElementTemplate,
        themes: {
            joy: contentElementJoyStyle,
            memphis: contentElementMemphisStyle,
            cosmopolitan: contentElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ContentElement);
export { ContentElement };
//# sourceMappingURL=ContentElement.js.map