// #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 { Themeable } from '../../../../Controls/Behaviors/Themeable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Expandable } from '../../../Behaviors/Expandable';
import { TextFormattable } from '../../../Behaviors/TextFormattable';
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 { ContentElement } from '../../Primitives/Content/ContentElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { messageContentElementTemplate } from './MessageContentElementTemplate';
import { MESSAGE_INHERITANCE_CONTEXT } from './MessageInheritanceContext';
import { messageContentElementCosmopolitanStyle } from './Themes/MessageContentElement.Cosmopolitan';
import { messageContentElementJoyStyle } from './Themes/MessageContentElement.Joy';
import { messageContentElementMemphisStyle } from './Themes/MessageContentElement.Memphis';
// #endregion
/**
 * Message Content - A component that displays the content text of a message with expandable/collapsible functionality.
 *
 * @description
 * This component handles the display of message content text with support for line clamping
 * when the parent message is in a collapsed state. It automatically syncs with the parent
 * MessageElement's expanded state and formatting settings.
 *
 * @name MessageContent
 * @element mosaik-message-content
 * @category UI Components
 *
 * @slot - The default slot for placing custom content instead of the text property.
 *
 * @csspart text - The text element displaying the content.
 *
 * @fires expanded {ExpandedEvent} - Fired when the content is expanded.
 * @fires collapsed {CollapsedEvent} - Fired when the content is collapsed.
 * @fires toggled {ToggledEvent} - Fired when the content expansion state is toggled.
 *
 * @dependency mosaik-text - The Text element.
 *
 * @example
 * ```html
 * <mosaik-message-content collapsed-lines="2">
 *   This is the message content.
 * </mosaik-message-content>
 * ```
 *
 * @public
 */
let MessageContentElement = class MessageContentElement extends Themeable(Expandable(Disableable(Variantable(TextFormattable(ContentElement))))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: MESSAGE_INHERITANCE_CONTEXT
    });
    _text;
    _collapsedLines;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
        this._collapsedLines = 2;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @override
     * @readonly
     */
    static get is() {
        return 'mosaik-message-content';
    }
    /**
     * Gets or sets the `text` property.
     * The text content to display.
     * If not explicitly set, inherits from parent MessageElement's content property.
     *
     * @public
     * @attr
     */
    get text() {
        return this._inheritance.get('content', this._text);
    }
    set text(value) {
        this._inheritance.markExplicit('content');
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    /**
     * Gets or sets the `collapsedLines` property.
     * The number of visible lines when the content is collapsed.
     *
     * @default 2
     * @public
     * @attr
     */
    get collapsedLines() {
        return this._collapsedLines;
    }
    set collapsedLines(value) {
        if (this._collapsedLines !== value) {
            this._collapsedLines = value;
            this.requestUpdate('collapsedLines');
        }
    }
    /**
     * Gets or sets the `isExpanded` property.
     * If not explicitly set, inherits from parent MessageElement.
     *
     * @public
     * @override
     */
    get isExpanded() {
        return this._inheritance.get('isExpanded', super.isExpanded);
    }
    set isExpanded(value) {
        this._inheritance.markExplicit('isExpanded');
        super.isExpanded = value;
    }
    /**
     * Gets or sets the `disabled` property.
     * If not explicitly set, inherits from parent MessageElement.
     *
     * @public
     * @override
     */
    get disabled() {
        return this._inheritance.get('disabled', super.disabled);
    }
    set disabled(value) {
        this._inheritance.markExplicit('disabled');
        super.disabled = value;
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], MessageContentElement.prototype, "text", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], MessageContentElement.prototype, "collapsedLines", null);
MessageContentElement = __decorate([
    Component({
        selector: 'mosaik-message-content',
        template: messageContentElementTemplate,
        themes: {
            joy: messageContentElementJoyStyle,
            memphis: messageContentElementMemphisStyle,
            cosmopolitan: messageContentElementCosmopolitanStyle
        },
        host: {
            slot: 'content'
        },
        imports: [TextElement]
    }),
    __metadata("design:paramtypes", [])
], MessageContentElement);
export { MessageContentElement };
//# sourceMappingURL=MessageContentElement.js.map