// #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 { TextFormattable } from '../../../Behaviors/TextFormattable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { TextAlignment } from '../../../Types/TextAlignment';
import { TextOverflow } from '../../../Types/TextOverflow';
import { CustomElement } from '../../Abstracts/CustomElement';
import { TextElement } from '../Text/TextElement';
import { hintElementTemplate } from './HintElementTemplate';
import { hintElementCosmopolitanStyle } from './Themes/HintElement.Cosmopolitan';
import { hintElementJoyStyle } from './Themes/HintElement.Joy';
import { hintElementMemphisStyle } from './Themes/HintElement.Memphis';
// #endregion
/**
 * Hint - Supplementary text providing guidance, context, or additional information.
 *
 * @description
 * The Hint element displays subtle, informative text to guide users, explain features, or provide
 * context for form fields and UI controls. Supports text alignment, truncation/wrapping, and custom
 * formatting. Typically styled with reduced visual weight (smaller font, muted color) to distinguish
 * it from primary content. Commonly used below input fields, alongside buttons, in tooltips, or as
 * descriptive captions for complex UI elements.
 *
 * @name Hint
 * @element mosaik-hint
 * @category Primitives
 *
 * @csspart text - The rendered hint text element
 *
 * @dependency {TextElement} - Text rendering component
 *
 * @example
 * Basic hint for an input field:
 * ```html
 * <label for="username">Username</label>
 * <input id="username" type="text">
 * <mosaik-hint text="Must be 3-20 characters, alphanumeric only"></mosaik-hint>
 * ```
 *
 * @example
 * Hint with custom alignment and wrapping:
 * ```html
 * <mosaik-hint
 *   text="This is a longer explanation that might need to wrap to multiple lines."
 *   alignment="center"
 *   text-overflow="wrap">
 * </mosaik-hint>
 * ```
 *
 * @example
 * Truncated hint with ellipsis:
 * ```html
 * <mosaik-hint
 *   text="This is a very long hint that will be truncated with an ellipsis if it exceeds the available space"
 *   text-overflow="truncate">
 * </mosaik-hint>
 * ```
 *
 * @example
 * Hint with formatted text:
 * ```html
 * <mosaik-hint
 *   id="passwordHint"
 *   text="Password strength: {strength}"
 *   alignment="left">
 * </mosaik-hint>
 *
 * <script>
 *   const hint = document.getElementById('passwordHint');
 *   hint.formatter = (text) => text.replace('{strength}', 'Medium');
 * </script>
 * ```
 *
 * @public
 */
let HintElement = class HintElement extends Themeable(TextFormattable(CustomElement)) {
    // #region Fields
    _text;
    _alignment;
    _textOverflow;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
        this._alignment = TextAlignment.Left;
        this._textOverflow = TextOverflow.Truncate;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-hint';
    }
    /**
     * Gets or sets the `text` property.
     *
     * @public
     * @attr
     */
    get text() {
        return this._text;
    }
    set text(value) {
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    /**
     * Gets or sets the `textOverflow` property.
     *
     * @public
     * @attr
     */
    get textOverflow() {
        return this._textOverflow;
    }
    set textOverflow(value) {
        if (this._textOverflow !== value) {
            this._textOverflow = value;
            this.requestUpdate('textOverflow');
        }
    }
    /**
     * Gets or sets the `alignment` property.
     *
     * Possible values are:
     * * `center` - centers the text horizontally within the element
     * * `justify` - stretches the text to fill the width of the element, adjusting spacing as needed
     * * `left` - aligns the text to the left edge of the element (default)
     * * `right` - aligns the text to the right edge of the element
     *
     * @public
     * @attr
     */
    get alignment() {
        return this._alignment;
    }
    set alignment(value) {
        if (this._alignment !== value) {
            this._alignment = value;
            this.requestUpdate('alignment');
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], HintElement.prototype, "text", null);
__decorate([
    Attribute({ type: TextOverflow }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], HintElement.prototype, "textOverflow", null);
HintElement = __decorate([
    Component({
        selector: 'mosaik-hint',
        template: hintElementTemplate,
        themes: {
            joy: hintElementJoyStyle,
            memphis: hintElementMemphisStyle,
            cosmopolitan: hintElementCosmopolitanStyle
        },
        imports: [
            TextElement
        ]
    }),
    __metadata("design:paramtypes", [])
], HintElement);
export { HintElement };
//# sourceMappingURL=HintElement.js.map