/*
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 } from "tslib";
import { XYChart } from "./XYChart";
import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar, getInstanceType } from "igniteui-angular-core";
import { CategoryChartType_$type } from "./CategoryChartType";
import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { CategoryXAxis } from "./CategoryXAxis";
import { List$1 } from "igniteui-angular-core";
import { DataSeriesType_$type } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-angular-core";
import { SimpleCategorySeriesRule } from "igniteui-angular-core";
import { SubCollectionsRule } from "igniteui-angular-core";
import { Series } from "./Series";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { CategoryChartMockDataGenerator } from "./CategoryChartMockDataGenerator";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var CategoryChart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryChart, _super);
    function CategoryChart() {
        var _this = _super.call(this) || this;
        _this.sl = 1000;
        _this.rk = null;
        _this.q4 = 9;
        _this.q6 = 1;
        _this.ro = false;
        _this.q8 = 0;
        _this.ri = 0;
        _this.ry = 0;
        _this.rz = 0;
        _this.rx = 0;
        _this.r0 = 0;
        _this.r1 = NaN;
        _this.rq = false;
        _this.sm = 10;
        _this.r3 = NaN;
        _this.r2 = NaN;
        _this.r4 = 0;
        _this.q0 = null;
        _this.q1 = null;
        _this.rp = true;
        _this.rm = false;
        _this.rn = false;
        _this.rw = null;
        _this.hz();
        return _this;
    }
    CategoryChart.prototype.ic = function () {
        _super.prototype.ic.call(this);
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.b8.j.e();
        this.q2 = a.d;
        this.q3 = a.e;
        if (this.qc == null) {
            this.qc = a.k;
        }
        if (this.qj == null) {
            this.qj = a.k;
        }
    };
    CategoryChart.prototype.ie = function (a, b) {
        _super.prototype.ie.call(this, a, b);
        a.gk = this.sn;
        a.b9 = this.rl;
    };
    CategoryChart.prototype.i0 = function (a, b, c) {
        var _this = this;
        _super.prototype.i0.call(this, a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.tc(function (d) { return d.gk = _this.sn; });
                break;
            case "TransitionInEasingFunction":
                this.tc(function (d) { return d.b9 = _this.rl; });
                break;
        }
    };
    Object.defineProperty(CategoryChart.prototype, "sn", {
        get: function () {
            return this.sl;
        },
        set: function (a) {
            var b = this.sn;
            if (a != b) {
                this.sl = a;
                this.iz("TransitionInDuration", b, this.sn);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rl", {
        get: function () {
            return this.rk;
        },
        set: function (a) {
            var b = this.rl;
            if (a != b) {
                this.rk = a;
                this.iz("TransitionInEasingFunction", b, this.rl);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.sq = function () {
        var cvd_ = this.es();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    CategoryChart.prototype.h7 = function (a) {
        _super.prototype.h7.call(this, a);
        a.c3 = this.b2;
    };
    CategoryChart.prototype.id = function (a, b) {
        _super.prototype.id.call(this, a, b);
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.ro = this.q7;
        c.ql = this.rt;
        c.p5 = this.q9;
        c.b3 = this.rj;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.t, b);
        c.trendLineType = this.be;
        c.trendLineThickness = this.ef;
        c.oi = this.av(a, b);
        if (a.de) {
            a.k8(ArrayExtension.getModulus$1(Brush.$, this.q2, b), ArrayExtension.getModulus$1(Brush.$, this.q3, b));
        }
    };
    CategoryChart.prototype.ra = function () {
        return new CategoryXAxis();
    };
    CategoryChart.prototype.re = function () {
        return new NumericYAxis();
    };
    CategoryChart.prototype.hw = function () {
        this.xAxis = this.ra();
        this.xAxis.name = "xAxis";
        var a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.te));
        this.yAxis = this.re();
        this.yAxis.name = "yAxis";
        var b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.tf));
        if (this.xAxis.ay == null) {
            this.xAxis.ay = new AxisLabelSettings();
        }
        if (this.yAxis.ay == null) {
            this.yAxis.ay = new AxisLabelSettings();
        }
    };
    CategoryChart.prototype.pe = function (a) {
        _super.prototype.pe.call(this, a);
        a.jx = this.ru;
    };
    Object.defineProperty(CategoryChart.prototype, "q5", {
        get: function () {
            return this.q4;
        },
        set: function (a) {
            if (a != this.q4) {
                var b = this.q5;
                this.q4 = a;
                this.iz("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.q5));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q7", {
        get: function () {
            return this.q6;
        },
        set: function (a) {
            var b = this.q7;
            if (a != b) {
                this.q6 = a;
                this.iz("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.q7));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rt", {
        get: function () {
            return this.ro;
        },
        set: function (a) {
            var b = this.rt;
            if (a != b) {
                this.ro = a;
                this.iz("IsTransitionInEnabled", b, this.rt);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q9", {
        get: function () {
            return this.q8;
        },
        set: function (a) {
            var b = this.q9;
            if (a != b) {
                this.q8 = a;
                this.iz("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.q9));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rj", {
        get: function () {
            return this.ri;
        },
        set: function (a) {
            var b = this.rj;
            if (a != b) {
                this.ri = a;
                this.iz("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.rj));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sc", {
        get: function () {
            return this.ry;
        },
        set: function (a) {
            var b = this.sc;
            if (a != b) {
                this.ry = a;
                this.iz("XAxisInterval", b, this.sc);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sd", {
        get: function () {
            return this.rz;
        },
        set: function (a) {
            var b = this.sd;
            if (a != b) {
                this.rz = a;
                this.iz("XAxisMinorInterval", b, this.sd);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sb", {
        get: function () {
            return this.rx;
        },
        set: function (a) {
            var b = this.sb;
            if (a != b) {
                this.rx = a;
                this.iz("XAxisGap", b, this.sb);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "se", {
        get: function () {
            return this.r0;
        },
        set: function (a) {
            var b = this.se;
            if (a != b) {
                this.r0 = a;
                this.iz("XAxisOverlap", b, this.se);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sh", {
        get: function () {
            return this.r1;
        },
        set: function (a) {
            var b = this.sh;
            if (a != b) {
                this.r1 = a;
                this.iz("YAxisInterval", b, this.sh);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rv", {
        get: function () {
            return this.rq;
        },
        set: function (a) {
            var b = this.rv;
            if (a != b) {
                this.rq = a;
                this.iz("YAxisIsLogarithmic", b, this.rv);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "so", {
        get: function () {
            return this.sm;
        },
        set: function (a) {
            var b = this.so;
            if (a != b) {
                this.sm = a;
                this.iz("YAxisLogarithmBase", b, this.so);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sj", {
        get: function () {
            return this.r3;
        },
        set: function (a) {
            var b = this.sj;
            if (a != b) {
                this.r3 = a;
                this.iz("YAxisMinimumValue", b, this.sj);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "si", {
        get: function () {
            return this.r2;
        },
        set: function (a) {
            var b = this.si;
            if (a != b) {
                this.r2 = a;
                this.iz("YAxisMaximumValue", b, this.si);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sk", {
        get: function () {
            return this.r4;
        },
        set: function (a) {
            var b = this.sk;
            if (a != b) {
                this.r4 = a;
                this.iz("YAxisMinorInterval", b, this.sk);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sa", {
        get: function () {
            return this.xAxis.lk;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "r9", {
        get: function () {
            return this.xAxis.lj;
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.r6 = function () {
        return this.sa;
    };
    CategoryChart.prototype.r8 = function () {
        return this.sg;
    };
    CategoryChart.prototype.r5 = function () {
        return this.r9;
    };
    CategoryChart.prototype.r7 = function () {
        return this.sf;
    };
    Object.defineProperty(CategoryChart.prototype, "sg", {
        get: function () {
            return this.yAxis.kd;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "sf", {
        get: function () {
            return this.yAxis.kc;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q2", {
        get: function () {
            return this.q0;
        },
        set: function (a) {
            var b = this.q2;
            if (a != b) {
                this.q0 = a;
                this.iz("NegativeBrushes", b, this.q2);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q3", {
        get: function () {
            return this.q1;
        },
        set: function (a) {
            var b = this.q3;
            if (a != b) {
                this.q1 = a;
                this.iz("NegativeOutlines", b, this.q3);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ru", {
        get: function () {
            return this.rp;
        },
        set: function (a) {
            var b = this.ru;
            if (a != b) {
                this.rp = a;
                this.iz("YAxisAbbreviateLargeNumbers", b, this.ru);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rr", {
        get: function () {
            return this.rm;
        },
        set: function (a) {
            var b = this.rr;
            if (a != b) {
                this.rm = a;
                this.iz("IsCategoryHighlightingEnabled", b, this.rr);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rs", {
        get: function () {
            return this.rn;
        },
        set: function (a) {
            var b = this.rs;
            if (a != b) {
                this.rn = a;
                this.iz("IsItemHighlightingEnabled", b, this.rs);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.get_cv = function () {
        var a = new List$1(DataSeriesType_$type, 0);
        if (TypeRegistrar.isRegistered("AreaSeries")) {
            a.add(2);
        }
        if (TypeRegistrar.isRegistered("ColumnSeries")) {
            a.add(1);
        }
        if (TypeRegistrar.isRegistered("LineSeries")) {
            a.add(0);
        }
        if (TypeRegistrar.isRegistered("PointSeries")) {
            a.add(10);
        }
        if (TypeRegistrar.isRegistered("SplineSeries")) {
            a.add(6);
        }
        if (TypeRegistrar.isRegistered("SplineAreaSeries")) {
            a.add(7);
        }
        if (TypeRegistrar.isRegistered("StepAreaSeries")) {
            a.add(5);
        }
        if (TypeRegistrar.isRegistered("StepLineSeries")) {
            a.add(4);
        }
        if (TypeRegistrar.isRegistered("WaterfallSeries")) {
            a.add(8);
        }
        return a;
    };
    Object.defineProperty(CategoryChart.prototype, "cv", {
        get: function () {
            return this.get_cv();
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.c4 = function () {
        if (this.rw == null) {
            this.rw = CategoryChartMockDataGenerator.a();
        }
        return this.rw;
    };
    CategoryChart.prototype.te = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.i6("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.i6("XAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.tf = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.i6("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.i6("YAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.jh = function () {
        _super.prototype.jh.call(this);
        this.xAxis.fa = this.mo == null ? XYChart.m0(this.xAxis, this.ac.dataSeries) : this.mo;
        this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null;
    };
    Object.defineProperty(CategoryChart.prototype, "xAxis", {
        get: function () {
            return this._xAxis;
        },
        set: function (a) {
            this._xAxis = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "yAxis", {
        get: function () {
            return this._yAxis;
        },
        set: function (a) {
            this._yAxis = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.rd = function (a, b) {
        switch (a) {
            case 2: return this.a4(1);
            case 3: return this.a4(10);
            case 0: return this.a4(0);
            case 1: return this.a4(2);
            case 6: return this.a4(6);
            case 7: return this.a4(7);
            case 4: return this.a4(4);
            case 5: return this.a4(5);
            case 8: return this.a4(8);
            case 9: return this.rc(b);
            default: return this.a4(1);
        }
    };
    CategoryChart.prototype.rc = function (a) {
        return this.a4(a);
    };
    CategoryChart.prototype.ab = function (a) {
        switch (this.q5) {
            case 1: return 2;
            case 0: return 0;
            case 3: return 10;
            case 6: return 6;
            case 7: return 7;
            case 5: return 5;
            case 4: return 4;
            case 8: return 8;
            case 9: return a.suggestedSeries;
            default:
            case 2: return 1;
        }
    };
    CategoryChart.prototype.a3 = function (a, b) {
        var c = this.rd(this.q5, a.suggestedSeries);
        c.r2 = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    };
    CategoryChart.prototype.jf = function (a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.j2 = true;
            this.yAxis.kp = 10;
        }
    };
    CategoryChart.prototype.ji = function () {
        this.yAxis.j2 = this.rv;
        this.yAxis.kp = this.so;
    };
    CategoryChart.prototype.get_cu = function () {
        return ((function () {
            var $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
            $ret.add(new SimpleCategorySeriesRule());
            $ret.add(new SubCollectionsRule());
            return $ret;
        })());
    };
    Object.defineProperty(CategoryChart.prototype, "cu", {
        get: function () {
            return this.get_cu();
        },
        enumerable: false,
        configurable: true
    });
    CategoryChart.prototype.hu = function (a, b) {
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.ro = this.q7;
            c.oi = this.av(a, b);
        }
    };
    CategoryChart.prototype.tc = function (a) {
        this.td(function (b, c) { return a(b); });
    };
    CategoryChart.prototype.td = function (a) {
        if (this.dataChart == null) {
            return;
        }
        for (var b = 0; b < this.dataChart.series.count; b++) {
            var c = typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]);
            if (c == null) {
                continue;
            }
            a(c, b);
        }
    };
    CategoryChart.prototype.ka = function () {
        return this.xAxis;
    };
    CategoryChart.prototype.kb = function () {
        return this.yAxis;
    };
    CategoryChart.prototype.rg = function () {
        return this.a4(30);
    };
    CategoryChart.prototype.rh = function () {
        return this.a4(31);
    };
    CategoryChart.prototype.cr = function (a, b) {
        var c = _super.prototype.cr.call(this, a, b);
        if (c != null) {
            var d = new List$1(Series.$, 0);
            if (this.rm) {
                d.add(this.rg());
            }
            if (this.rn) {
                d.add(this.rh());
            }
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.name = a + getInstanceType(f).typeName;
                c.add(f);
            }
        }
        return c;
    };
    CategoryChart.prototype.jm = function (a, b, c) {
        _super.prototype.jm.call(this, a, b, c);
        if (this.ac.dataSeries.count > 0) {
            if (stringIsNullOrEmpty(this.fo)) {
                this.aj.setXMemberPath(a, c.getMemberPathFor(16));
            }
            if (stringIsNullOrEmpty(this.fq)) {
                this.aj.setYMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.fk)) {
                this.aj.setLabelMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.fh)) {
                this.aj.setContentMemberPath(a, c.getMemberPathFor(0));
            }
        }
    };
    CategoryChart.prototype.iz = function (a, b, c) {
        var _this = this;
        _super.prototype.iz.call(this, a, b, c);
        switch (a) {
            case "ChartType":
                this.jh();
                break;
            case "MarkerCollisionAvoidance":
                this.tc(function (d) { return d.ro = _this.q7; });
                break;
            case "IsTransitionInEnabled":
                this.tc(function (d) { return d.ql = _this.rt; });
                break;
            case "TransitionInMode":
                this.tc(function (d) { return d.p5 = _this.q9; });
                break;
            case "TransitionInSpeedType":
                this.tc(function (d) { return d.b3 = _this.rj; });
                break;
            case "XAxisInterval":
                this.xAxis.lf = this.sc;
                break;
            case "XAxisMinorInterval":
                this.xAxis.lg = this.sd;
                break;
            case "XAxisGap":
                this.xAxis.jx = this.sb;
                break;
            case "XAxisOverlap":
                this.xAxis.j4 = this.se;
                break;
            case "YAxisInterval":
                this.yAxis.kh = this.sh;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.j2 = this.rv;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.kp = this.so;
                break;
            case "YAxisMinimumValue":
                this.yAxis.kl = this.sj;
                break;
            case "YAxisMaximumValue":
                this.yAxis.kk = this.si;
                break;
            case "YAxisMinorInterval":
                this.yAxis.km = this.sk;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.td(function (d, e) {
                    if (d.de) {
                        d.k8(ArrayExtension.getModulus$1(Brush.$, _this.q2, e), ArrayExtension.getModulus$1(Brush.$, _this.q3, e));
                    }
                });
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.pk(function (d) { return d.jx = _this.ru; });
                break;
            case "IsCategoryHighlightingEnabled":
            case "IsItemHighlightingEnabled":
                this.jh();
                break;
        }
    };
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
}(XYChart));
export { CategoryChart };
//# sourceMappingURL=CategoryChart.js.map
