// #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 '../../../Behaviors/Themeable';
import { CssLength } from '@breadstone/mosaik-themes';
import { Fitable } from '../../../Behaviors/Fitable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { masonryElementTemplate } from './MasonryElementTemplate';
import { masonryElementJoyStyle } from './Themes/MasonryElement.Joy';
import { masonryElementRetroStyle } from './Themes/MasonryElement.Retro';
import { masonryElementCosmopolitanStyle } from './Themes/MasonryElement.Cosmopolitan';
// #endregion
/**
 * Masonry - A grid-based layout system for arranging elements in a dynamic, vertical grid.
 *
 * @description
 * The Masonry is a popular grid-based layout system used to arrange elements of varying heights in a vertical grid.
 * It is particularly useful when dealing with content like cards, images, or articles with different heights. Unlike traditional
 * grid systems, Masonry optimizes space utilization by aligning elements to fill gaps in a visually pleasing manner. This layout
 * is commonly used in websites and applications to create visually appealing and responsive grid designs.
 *
 * @element mosaik-masonry
 * @category Layout
 *
 * @slot - The default slot.
 *
 * @public
 */
let MasonryElement = class MasonryElement extends Themeable(Fitable(CustomElement)) {
    // #region Fields
    _gap;
    _columns;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._gap = 0;
        this._columns = 1;
    }
    // #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-masonry';
    }
    /**
     * The `gap` represents the space between the child elements.
     *
     * @public
     * @attr
     */
    get gap() {
        return this._gap;
    }
    set gap(value) {
        const v = CssLength.tryParse(value);
        if (v) {
            if (this._gap !== v) {
                this._gap = v;
                this.requestUpdate('gap');
            }
        }
        else {
            this._gap = 0;
            this.requestUpdate('gap');
        }
    }
    /**
     * Gets or sets the `columns` property.
     *
     * @public
     */
    get columns() {
        return this._columns;
    }
    set columns(value) {
        if (this._columns !== value) {
            this._columns = value;
            this.requestUpdate('columns');
        }
    }
};
__decorate([
    Attribute({
        type: String,
        converter: {
            fromAttribute: (value) => CssLength.tryParse(value)
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], MasonryElement.prototype, "gap", null);
__decorate([
    Property({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], MasonryElement.prototype, "columns", null);
MasonryElement = __decorate([
    Component({
        selector: 'mosaik-masonry',
        template: masonryElementTemplate,
        themes: {
            joy: masonryElementJoyStyle,
            retro: masonryElementRetroStyle,
            cosmopolitan: masonryElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], MasonryElement);
export { MasonryElement };
//# sourceMappingURL=MasonryElement.js.map