// #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 { Busyable } from '../../../Behaviors/Busyable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Slottable } from '../../../Behaviors/Slottable';
import { TextFormattable } from '../../../Behaviors/TextFormattable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { addInheritanceConsumerController } from '../../../Controllers/InheritanceConsumerController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { StackElement } from '../../Layouts/Stack/StackElement';
import { DotElement } from '../../Primitives/Dot/DotElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { AvatarElement } from '../Avatar/AvatarElement';
import { CHAT_INHERITANCE_CONTEXT } from './ChatInheritanceContext';
import { ChatMessageAvatarElement } from './ChatMessageAvatarElement';
import { chatMessageElementTemplate } from './ChatMessageElementTemplate';
import { chatMessageElementCosmopolitanStyle } from './Themes/ChatMessageElement.Cosmopolitan';
import { chatMessageElementJoyStyle } from './Themes/ChatMessageElement.Joy';
import { chatMessageElementMemphisStyle } from './Themes/ChatMessageElement.Memphis';
// #endregion
/**
 * Chat Message - Represents a single message in the chat.
 *
 * @slot actions - The actions slot.
 * @slot after - Slot for content displayed after the message bubble.
 * @slot at - The slot for timestamp elements.
 * @slot attachment - The slot for attachment elements.
 * @slot author - The slot for author elements.
 * @slot avatar - The slot for avatar elements.
 * @slot reaction - The slot for reaction elements.
 * @slot text - The slot for message elements.
 *
 * @csspart actions - The actions part containing action buttons.
 * @csspart at - The at part.
 * @csspart author - The author part.
 * @csspart busy - The busy part.
 * @csspart dot - The dot part.
 * @csspart footer - The footer part containing actions and reactions.
 * @csspart header - The header part.
 * @csspart message - The message part.
 * @csspart message-after - The container for content displayed after the message bubble.
 * @csspart message-area - The message area part containing the message stack and attachments.
 * @csspart message-body - The message body part containing text or busy state.
 * @csspart message-line - The line containing the message bubble and after slot.
 * @csspart message-stack - The stack containing the message line and footer.
 * @csspart reactions - The reactions part containing reaction elements.
 * @csspart root - The root part.
 * @csspart text - The text part.
 *
 * @cssprop {String} --chat-message-background-color - The message background color CSS custom property.
 * @cssprop {String} --chat-message-border-color - The message border color CSS custom property.
 * @cssprop {String} --chat-message-border-radius - The message border radius CSS custom property.
 * @cssprop {String} --chat-message-border-style - The message border style CSS custom property.
 * @cssprop {String} --chat-message-border-width - The message border width CSS custom property.
 * @cssprop {String} --chat-message-font-family - The message font family CSS custom property.
 * @cssprop {String} --chat-message-font-letter-spacing - The message font letter spacing CSS custom property.
 * @cssprop {String} --chat-message-font-line-height - The message font line height CSS custom property.
 * @cssprop {String} --chat-message-font-size - The message font size CSS custom property.
 * @cssprop {String} --chat-message-font-text-decoration - The message font text decoration CSS custom property.
 * @cssprop {String} --chat-message-font-text-transform - The message font text transform CSS custom property.
 * @cssprop {String} --chat-message-font-weight - The message font weight CSS custom property.
 * @cssprop {String} --chat-message-foreground-color - The message foreground color CSS custom property.
 * @cssprop {String} --chat-message-gap - The message gap CSS custom property.
 * @cssprop {String} --chat-message-padding-bottom - The message padding bottom CSS custom property.
 * @cssprop {String} --chat-message-padding-left - The message padding left CSS custom property.
 * @cssprop {String} --chat-message-padding-right - The message padding right CSS custom property.
 * @cssprop {String} --chat-message-padding-top - The message padding top CSS custom property.
 * @cssprop {String} --chat-message-shadow - The message shadow CSS custom property.
 * @cssprop {String} --chat-message-shadow-blur - The message shadow blur CSS custom property.
 * @cssprop {String} --chat-message-shadow-color - The message shadow color CSS custom property.
 * @cssprop {String} --chat-message-shadow-offset-x - The message shadow offset x CSS custom property.
 * @cssprop {String} --chat-message-shadow-offset-y - The message shadow offset y CSS custom property.
 * @cssprop {String} --chat-message-shadow-spread - The message shadow spread CSS custom property.
 * @cssprop {String} --chat-message-transition-duration - The message transition duration CSS custom property.
 * @cssprop {String} --chat-message-transition-mode - The message transition mode CSS custom property.
 * @cssprop {String} --chat-message-transition-property - The message transition property CSS custom property.
 * @cssprop {String} --chat-message-translate - The message translate CSS custom property.
 * @cssprop {String} --chat-message-white-space - The message white space CSS custom property.
 *
 * @dependency mosaik-dot - The Dot element.
 * @dependency mosaik-text - The Text element.
 *
 * @example
 * Basic chat message:
 * ```html
 * <mosaik-chat-message></mosaik-chat-message>
 * ```
 *
 * @example
 * Reply message with a variant:
 * ```html
 * <mosaik-chat-message reply variant="primary"></mosaik-chat-message>
 * ```
 *
 * @public
 */
let ChatMessageElement = class ChatMessageElement extends Themeable(Variantable(Appearanceable(Disableable(TextFormattable(Busyable(Valueable(Slottable(CustomElement)))))))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: CHAT_INHERITANCE_CONTEXT
    });
    _text;
    _author;
    _attachments;
    _reply;
    _at;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
        this._author = '';
        this._attachments = new Array();
        this._reply = false;
        this._at = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-chat-message';
    }
    /**
     * Gets or sets the `author` property.
     *
     * @public
     */
    get author() {
        return this._author;
    }
    set author(value) {
        if (this._author !== value) {
            this._author = value;
            this.requestUpdate('author');
        }
    }
    /**
     * Gets or sets the `text` property.
     *
     * @public
     */
    get text() {
        return this._text;
    }
    set text(value) {
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    /**
     * Gets or sets the `attachments` property.
     *
     * @public
     */
    get attachments() {
        return this._attachments;
    }
    set attachments(value) {
        if (this._attachments !== value) {
            this._attachments = value;
            this.requestUpdate('attachments');
        }
    }
    /**
     * Gets or sets the `reply` property.
     *
     * @public
     * @attr
     */
    get reply() {
        return this._reply;
    }
    set reply(value) {
        if (this._reply !== value) {
            this._reply = value;
            this.requestUpdate('reply');
        }
    }
    /**
     * Gets or sets the `at` property.
     *
     * @public
     */
    get at() {
        return this._at;
    }
    set at(value) {
        if (this._at !== value) {
            this._at = value;
            this.requestUpdate('at');
        }
    }
    /**
     * Gets or sets the `variant` property.
     * Inherits from parent `ChatElement` if not explicitly set.
     *
     * @override
     * @public
     */
    get variant() {
        return this._inheritance.get('variant', super.variant);
    }
    set variant(value) {
        this._inheritance.markExplicit('variant');
        super.variant = value;
    }
    /**
     * Gets or sets the `appearance` property.
     * Inherits from parent `ChatElement` if not explicitly set.
     *
     * @override
     * @public
     */
    get appearance() {
        return this._inheritance.get('appearance', super.appearance);
    }
    set appearance(value) {
        this._inheritance.markExplicit('appearance');
        super.appearance = value;
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @template
     */
    onSlotChange(_event) {
        // No-op: Child elements inherit from context directly
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ChatMessageElement.prototype, "author", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ChatMessageElement.prototype, "text", null);
__decorate([
    Property({ type: Array }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], ChatMessageElement.prototype, "attachments", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ChatMessageElement.prototype, "reply", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ChatMessageElement.prototype, "at", null);
ChatMessageElement = __decorate([
    Component({
        selector: 'mosaik-chat-message',
        template: chatMessageElementTemplate,
        themes: {
            joy: chatMessageElementJoyStyle,
            memphis: chatMessageElementMemphisStyle,
            cosmopolitan: chatMessageElementCosmopolitanStyle
        },
        host: {
            role: 'listitem',
            slot: 'message'
        },
        imports: [
            TextElement,
            DotElement,
            AvatarElement,
            ChatMessageAvatarElement,
            StackElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ChatMessageElement);
export { ChatMessageElement };
//# sourceMappingURL=ChatMessageElement.js.map