/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __read, __spreadArray, __values } from "tslib";
import { Base, typeCast, Boolean_$type, String_$type, fromEnum, markType } from "igniteui-angular-core";
import { IVisualData_$type } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { RectData } from "igniteui-angular-core";
import { ColorData } from "igniteui-angular-core";
import { StringBuilder } from "igniteui-angular-core";
import { stringJoin, stringReplace } from "igniteui-angular-core";
/**
 * @hidden
 */
var DataLegendVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataLegendVisualData, _super);
    function DataLegendVisualData() {
        var _this = _super.call(this) || this;
        _this._rows = null;
        _this._viewport = null;
        _this._width = 0;
        _this._height = 0;
        _this.rows = new List$1(DataLegendVisualDataRow.$, 0);
        return _this;
    }
    DataLegendVisualData.serialize1 = function (a) {
        var b = typeCast(RectData.$, a);
        if (b != null) {
            return "{ left: " + b.left + ", top: " + b.top + ", width: " + b.width + ", height: " + b.height + " }";
        }
        var c = typeCast(ColorData.$, a);
        if (c != null) {
            return "{ a: " + c.a + ", r: " + c.r + ", g: " + c.g + ", b: " + c.b + " }";
        }
        var d = typeCast(IVisualData_$type, a);
        if (d != null) {
            return "\"" + d.serialize() + "\"";
        }
        if (typeof a === 'number' || typeof a === 'number' || typeCast(Boolean_$type, a) !== null) {
            return "" + a.toString() + "";
        }
        return "\"" + (a != null ? a.toString() : "null") + "\"";
    };
    Object.defineProperty(DataLegendVisualData.prototype, "rows", {
        get: function () {
            return this._rows;
        },
        set: function (a) {
            this._rows = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualData.prototype, "viewport", {
        get: function () {
            return this._viewport;
        },
        set: function (a) {
            this._viewport = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualData.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (a) {
            this._width = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualData.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (a) {
            this._height = a;
        },
        enumerable: false,
        configurable: true
    });
    DataLegendVisualData.prototype.serialize = function () {
        var e_1, _a;
        var a = ", ";
        var b = "   ";
        var c = new StringBuilder(0);
        c.u("{");
        c.u(this.e("width") + this.width + a);
        c.u(this.e("height") + this.height + a);
        c.u(this.e("viewport") + DataLegendVisualData.serialize1(this.viewport) + a);
        var d = new List$1(String_$type, 0);
        try {
            for (var _b = __values(fromEnum(this.rows)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                d.add(e.serialize());
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        c.u(this.e("rows") + "[");
        c.u(stringJoin.apply(void 0, __spreadArray([", \n"], __read(d.toArray()))));
        c.u("]");
        c.u("}");
        return c.toString();
    };
    DataLegendVisualData.prototype.e = function (a) {
        return a + ": ";
    };
    DataLegendVisualData.$t = markType(DataLegendVisualData, 'DataLegendVisualData', Base.$, [IVisualData_$type]);
    return DataLegendVisualData;
}(Base));
export { DataLegendVisualData };
/**
 * @hidden
 */
var DataLegendVisualDataColumn = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataLegendVisualDataColumn, _super);
    function DataLegendVisualDataColumn() {
        var _this = _super.call(this) || this;
        _this._text = null;
        _this._bounds = null;
        _this._textColor = null;
        _this._fontFamily = null;
        _this._fontSize = 0;
        _this._fontWeight = null;
        _this._fontStyle = null;
        _this._fontStretch = null;
        _this._marginLeft = 0;
        _this._marginRight = 0;
        _this._marginTop = 0;
        _this._marginBottom = 0;
        _this.bounds = RectData.empty;
        return _this;
    }
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "text", {
        get: function () {
            return this._text;
        },
        set: function (a) {
            this._text = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "bounds", {
        get: function () {
            return this._bounds;
        },
        set: function (a) {
            this._bounds = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "textColor", {
        get: function () {
            return this._textColor;
        },
        set: function (a) {
            this._textColor = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "fontFamily", {
        get: function () {
            return this._fontFamily;
        },
        set: function (a) {
            this._fontFamily = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "fontSize", {
        get: function () {
            return this._fontSize;
        },
        set: function (a) {
            this._fontSize = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "fontWeight", {
        get: function () {
            return this._fontWeight;
        },
        set: function (a) {
            this._fontWeight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "fontStyle", {
        get: function () {
            return this._fontStyle;
        },
        set: function (a) {
            this._fontStyle = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "fontStretch", {
        get: function () {
            return this._fontStretch;
        },
        set: function (a) {
            this._fontStretch = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "marginLeft", {
        get: function () {
            return this._marginLeft;
        },
        set: function (a) {
            this._marginLeft = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "marginRight", {
        get: function () {
            return this._marginRight;
        },
        set: function (a) {
            this._marginRight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "marginTop", {
        get: function () {
            return this._marginTop;
        },
        set: function (a) {
            this._marginTop = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataColumn.prototype, "marginBottom", {
        get: function () {
            return this._marginBottom;
        },
        set: function (a) {
            this._marginBottom = a;
        },
        enumerable: false,
        configurable: true
    });
    DataLegendVisualDataColumn.prototype.serialize = function () {
        var a = ", ";
        var b = "      ";
        var c = new StringBuilder(0);
        c.u("{");
        c.u(b + this.l("bounds") + DataLegendVisualData.serialize1(this.bounds) + a);
        c.u(b + this.l("text") + DataLegendVisualData.serialize1(this.text) + a);
        c.u(b + this.l("textColor") + DataLegendVisualData.serialize1(this.textColor) + a);
        c.u(b + this.l("marginTop") + DataLegendVisualData.serialize1(this.marginTop) + a);
        c.u(b + this.l("marginLeft") + DataLegendVisualData.serialize1(this.marginLeft) + a);
        c.u(b + this.l("marginRight") + DataLegendVisualData.serialize1(this.marginRight) + a);
        c.u(b + this.l("marginBottom") + DataLegendVisualData.serialize1(this.marginBottom) + a);
        var d = "\"" + (this.fontFamily != null ? stringReplace(this.fontFamily, '\"', '\'') : "null") + "\"";
        c.u(b + this.l("fontFamily") + d + a);
        c.u(b + this.l("fontSize") + DataLegendVisualData.serialize1(this.fontSize) + a);
        c.u(b + this.l("fontWeight") + DataLegendVisualData.serialize1(this.fontWeight) + a);
        c.u(b + this.l("fontStyle") + DataLegendVisualData.serialize1(this.fontStyle) + a);
        c.u(b + this.l("fontStretch") + DataLegendVisualData.serialize1(this.fontStretch));
        c.u(b + "}");
        return c.toString();
    };
    DataLegendVisualDataColumn.prototype.l = function (a) {
        return a + ": ";
    };
    DataLegendVisualDataColumn.$t = markType(DataLegendVisualDataColumn, 'DataLegendVisualDataColumn');
    return DataLegendVisualDataColumn;
}(Base));
export { DataLegendVisualDataColumn };
/**
 * @hidden
 */
var DataLegendVisualDataRow = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataLegendVisualDataRow, _super);
    function DataLegendVisualDataRow() {
        var _this = _super.call(this) || this;
        _this._columns = null;
        _this._seriesIndex = 0;
        _this._badgeBounds = null;
        _this._badgeMarginLeft = 0;
        _this._badgeMarginTop = 0;
        _this._badgeMarginRight = 0;
        _this._badgeMarginBottom = 0;
        _this._badgeShape = null;
        _this._rowBounds = null;
        _this._rowMarginLeft = 0;
        _this._rowMarginTop = 0;
        _this._rowMarginRight = 0;
        _this._rowMarginBottom = 0;
        _this.badgeShape = "None";
        _this.columns = new List$1(DataLegendVisualDataColumn.$, 0);
        return _this;
    }
    Object.defineProperty(DataLegendVisualDataRow.prototype, "columns", {
        get: function () {
            return this._columns;
        },
        set: function (a) {
            this._columns = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "seriesIndex", {
        get: function () {
            return this._seriesIndex;
        },
        set: function (a) {
            this._seriesIndex = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeBounds", {
        get: function () {
            return this._badgeBounds;
        },
        set: function (a) {
            this._badgeBounds = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeMarginLeft", {
        get: function () {
            return this._badgeMarginLeft;
        },
        set: function (a) {
            this._badgeMarginLeft = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeMarginTop", {
        get: function () {
            return this._badgeMarginTop;
        },
        set: function (a) {
            this._badgeMarginTop = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeMarginRight", {
        get: function () {
            return this._badgeMarginRight;
        },
        set: function (a) {
            this._badgeMarginRight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeMarginBottom", {
        get: function () {
            return this._badgeMarginBottom;
        },
        set: function (a) {
            this._badgeMarginBottom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "badgeShape", {
        get: function () {
            return this._badgeShape;
        },
        set: function (a) {
            this._badgeShape = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "rowBounds", {
        get: function () {
            return this._rowBounds;
        },
        set: function (a) {
            this._rowBounds = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "rowMarginLeft", {
        get: function () {
            return this._rowMarginLeft;
        },
        set: function (a) {
            this._rowMarginLeft = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "rowMarginTop", {
        get: function () {
            return this._rowMarginTop;
        },
        set: function (a) {
            this._rowMarginTop = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "rowMarginRight", {
        get: function () {
            return this._rowMarginRight;
        },
        set: function (a) {
            this._rowMarginRight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataLegendVisualDataRow.prototype, "rowMarginBottom", {
        get: function () {
            return this._rowMarginBottom;
        },
        set: function (a) {
            this._rowMarginBottom = a;
        },
        enumerable: false,
        configurable: true
    });
    DataLegendVisualDataRow.prototype.serialize = function () {
        var e_2, _a;
        var a = ", ";
        var b = "   ";
        var c = new StringBuilder(0);
        c.u("{");
        c.u(b + this.n("badgeMarginLeft") + this.badgeMarginLeft + a);
        c.u(b + this.n("badgeMarginTop") + this.badgeMarginTop + a);
        c.u(b + this.n("badgeMarginRight") + this.badgeMarginRight + a);
        c.u(b + this.n("badgeMarginBottom") + this.badgeMarginBottom + a);
        if (this.badgeBounds == null) {
            c.u(b + this.n("badgeBounds") + "{}" + a);
        }
        else {
            c.u(b + this.n("badgeBounds") + DataLegendVisualData.serialize1(this.badgeBounds) + a);
        }
        c.u(b + this.n("badgeShape") + DataLegendVisualData.serialize1(this.badgeShape) + a);
        c.u(b + this.n("rowBounds") + DataLegendVisualData.serialize1(this.rowBounds) + a);
        c.u(b + this.n("rowMarginLeft") + this.rowMarginLeft + a);
        c.u(b + this.n("rowMarginTop") + this.rowMarginTop + a);
        c.u(b + this.n("rowMarginRight") + this.rowMarginRight + a);
        c.u(b + this.n("rowMarginBottom") + this.rowMarginBottom + a);
        var d = new List$1(String_$type, 0);
        try {
            for (var _b = __values(fromEnum(this.columns)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                d.add(e.serialize());
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
        c.u(b + this.n("columns") + "[");
        c.u(b + b + stringJoin.apply(void 0, __spreadArray([", \n" + b + b], __read(d.toArray()))));
        c.u(b + "]");
        c.u("}");
        return c.toString();
    };
    DataLegendVisualDataRow.prototype.n = function (a) {
        return a + ": ";
    };
    DataLegendVisualDataRow.$t = markType(DataLegendVisualDataRow, 'DataLegendVisualDataRow');
    return DataLegendVisualDataRow;
}(Base));
export { DataLegendVisualDataRow };
