// #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 { DomServiceLocator } from '../../../../Dom/Dom';
import { TextFormattable } from '../../../Behaviors/TextFormattable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { ContentElement } from '../../Primitives/Content/ContentElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { cardContentElementTemplate } from './CardContentElementTemplate';
import { cardContentElementCosmopolitanStyle } from './Themes/CardContentElement.Cosmopolitan';
import { cardContentElementJoyStyle } from './Themes/CardContentElement.Joy';
import { cardContentElementMemphisStyle } from './Themes/CardContentElement.Memphis';
// #endregion
/**
 * CardContent - A component that represents the content area of a card.
 *
 * @description This component is used to encapsulate the main content of a card, allowing for structured and visually distinct presentations of information within the card.
 *
 * @name CardContent
 * @element mosaik-card-content
 * @category UI Components
 *
 * @slot - The default slot for placing the main content within the card.
 *
 * @csspart contentText - The part representing the text content area of the card.
 *
 * @cssprop {String} --card-content-padding-top - The padding-top property for the card content.
 * @cssprop {String} --card-content-padding-right - The padding-right property for the card content.
 * @cssprop {String} --card-content-padding-bottom - The padding-bottom property for the card content.
 * @cssprop {String} --card-content-padding-left - The padding-left property for the card content.
 * @cssprop {String} --card-content-gap - The gap property between elements in the card content.
 *
 * @dependency {TextElement} - The Text element used for displaying the content text.
 *
 * @example
 * ```html
 * <mosaik-card-content>
 *   <p>This is the main content of the card.</p>
 * </mosaik-card-content>
 * ```
 *
 * @public
 */
let CardContentElement = class CardContentElement extends Themeable(TextFormattable(ContentElement)) {
    // #region Fields
    _text;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @override
     * @readonly
     */
    static get is() {
        return 'mosaik-card-content';
    }
    /**
     * 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');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @override
     */
    onApplyTemplate() {
        super.onApplyTemplate();
        const card = DomServiceLocator.current.findShadowDomHost(this, { strict: true });
        if (this._text === '' && card.content !== '') {
            this.text = card.content;
        }
        if (this.formatter === null && card.formatter !== null) {
            this.formatter = card.formatter;
        }
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], CardContentElement.prototype, "text", null);
CardContentElement = __decorate([
    Component({
        selector: 'mosaik-card-content',
        template: cardContentElementTemplate,
        themes: {
            joy: cardContentElementJoyStyle,
            memphis: cardContentElementMemphisStyle,
            cosmopolitan: cardContentElementCosmopolitanStyle
        },
        host: {
            slot: 'content'
        },
        imports: [TextElement]
    }),
    __metadata("design:paramtypes", [])
], CardContentElement);
export { CardContentElement };
//# sourceMappingURL=CardContentElement.js.map