// #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 { Sizeable } from '../../../Behaviors/Sizeable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Valueable } from '../../../Behaviors/Valueable';
import { addInheritanceConsumerController } from '../../../Controllers/InheritanceConsumerController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { colorSwatchElementTemplate } from './ColorSwatchElementTemplate';
import { COLOR_SWATCH_GROUP_INHERITANCE_CONTEXT } from './ColorSwatchGroupInheritanceContext';
import { colorSwatchElementCosmopolitanStyle } from './Themes/ColorSwatchElement.Cosmopolitan';
import { colorSwatchElementJoyStyle } from './Themes/ColorSwatchElement.Joy';
import { colorSwatchElementMemphisStyle } from './Themes/ColorSwatchElement.Memphis';
// #endregion
/**
 * Color Swatch - A user interface component for displaying colors.
 *
 * @element mosaik-color-swatch
 *
 * @description
 * The Color Swatch component is designed to showcase a collection of colors, typically in a grid or list format.
 * Users can interact with the swatch to view different color options and select a color for various purposes,
 * such as choosing a text color, background color, or customizing the look and feel of elements.
 * Color Swatches are commonly used in design applications, theming interfaces, or color selection tools.
 *
 * @category Media
 *
 * @public
 */
let ColorSwatchElement = class ColorSwatchElement extends Themeable(Valueable(Sizeable(CustomElement))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: COLOR_SWATCH_GROUP_INHERITANCE_CONTEXT
    });
    _name;
    _value;
    _hasBackground;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._name = null;
        this._value = null;
        this._hasBackground = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-color-swatch';
    }
    /**
     * Gets or sets the `size` property.
     * When used inside a ColorSwatchGroup, inherits the group's size unless explicitly set.
     *
     * @public
     * @override
     */
    get size() {
        return this._inheritance.get('size', super.size);
    }
    set size(value) {
        this._inheritance.markExplicit('size');
        super.size = value;
    }
    /**
     * Gets or sets the `name` property.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     */
    get value() {
        return this._value;
    }
    set value(value) {
        if (this._value !== value) {
            this._value = value;
            this.requestUpdate('value');
        }
    }
    /**
     * Gets or sets the `hasBackground` property.
     *
     * @public
     * @attr
     */
    get hasBackground() {
        return this._hasBackground;
    }
    set hasBackground(value) {
        if (this._hasBackground !== value) {
            this._hasBackground = value;
            this.requestUpdate('hasBackground');
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ColorSwatchElement.prototype, "name", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ColorSwatchElement.prototype, "value", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ColorSwatchElement.prototype, "hasBackground", null);
ColorSwatchElement = __decorate([
    Component({
        selector: 'mosaik-color-swatch',
        template: colorSwatchElementTemplate,
        themes: {
            joy: colorSwatchElementJoyStyle,
            memphis: colorSwatchElementMemphisStyle,
            cosmopolitan: colorSwatchElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ColorSwatchElement);
export { ColorSwatchElement };
//# sourceMappingURL=ColorSwatchElement.js.map