/*
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 * as tslib_1 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 { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var CategoryChart = /** @class */ (function (_super) {
    tslib_1.__extends(CategoryChart, _super);
    function CategoryChart() {
        var _this = _super.call(this) || this;
        _this.p3 = 1000;
        _this.o7 = null;
        _this.or = 9;
        _this.ot = 1;
        _this.pb = false;
        _this.ov = 0;
        _this.o5 = 0;
        _this.pk = 0;
        _this.pl = 0;
        _this.pj = 0;
        _this.pm = 0;
        _this.pn = NaN;
        _this.pd = false;
        _this.p4 = 10;
        _this.pp = NaN;
        _this.po = NaN;
        _this.pq = 0;
        _this.on = null;
        _this.oo = null;
        _this.pc = true;
        _this.o9 = false;
        _this.pa = false;
        _this.f6();
        return _this;
    }
    CategoryChart.prototype.gj = function () {
        _super.prototype.gj.call(this);
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.bn.i.e();
        this.op = a.d;
        this.oq = a.e;
        if (this.nz == null) {
            this.nz = a.k;
        }
        if (this.n6 == null) {
            this.n6 = a.k;
        }
    };
    CategoryChart.prototype.gl = function (a, b) {
        _super.prototype.gl.call(this, a, b);
        a.fj = this.p5;
        a.bv = this.o8;
    };
    CategoryChart.prototype.g4 = function (a, b, c) {
        var _this = this;
        _super.prototype.g4.call(this, a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.qu(function (d) { return d.fj = _this.p5; });
                break;
            case "TransitionInEasingFunction":
                this.qu(function (d) { return d.bv = _this.o8; });
                break;
        }
    };
    Object.defineProperty(CategoryChart.prototype, "p5", {
        get: function () {
            return this.p3;
        },
        set: function (a) {
            var b = this.p5;
            if (a != b) {
                this.p3 = a;
                this.g3("TransitionInDuration", b, this.p5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o8", {
        get: function () {
            return this.o7;
        },
        set: function (a) {
            var b = this.o8;
            if (a != b) {
                this.o7 = a;
                this.g3("TransitionInEasingFunction", b, this.o8);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.p8 = function () {
        var cvd_ = this.dj();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    CategoryChart.prototype.ge = function (a) {
        _super.prototype.ge.call(this, a);
        a.cd = this.bg;
    };
    CategoryChart.prototype.gk = function (a, b) {
        _super.prototype.gk.call(this, a, b);
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.o0 = this.ou;
        c.ny = this.pg;
        c.nh = this.ow;
        c.bp = this.o6;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.av;
        c.trendLineThickness = this.c6;
        c.l1 = this.ai(a, b);
        if (a.cz) {
            a.ji(ArrayExtension.getModulus$1(Brush.$, this.op, b), ArrayExtension.getModulus$1(Brush.$, this.oq, b));
        }
    };
    CategoryChart.prototype.ox = function () {
        return new CategoryXAxis();
    };
    CategoryChart.prototype.o1 = function () {
        return new NumericYAxis();
    };
    CategoryChart.prototype.f3 = function () {
        this.xAxis = this.ox();
        this.xAxis.name = "xAxis";
        var a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.qw));
        this.yAxis = this.o1();
        this.yAxis.name = "yAxis";
        var b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.qx));
        if (this.xAxis.aw == null) {
            this.xAxis.aw = new AxisLabelSettings();
        }
        if (this.yAxis.aw == null) {
            this.yAxis.aw = new AxisLabelSettings();
        }
    };
    CategoryChart.prototype.m5 = function (a) {
        _super.prototype.m5.call(this, a);
        a.jo = this.ph;
    };
    Object.defineProperty(CategoryChart.prototype, "os", {
        get: function () {
            return this.or;
        },
        set: function (a) {
            if (a != this.or) {
                var b = this.os;
                this.or = a;
                this.g3("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.os));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ou", {
        get: function () {
            return this.ot;
        },
        set: function (a) {
            var b = this.ou;
            if (a != b) {
                this.ot = a;
                this.g3("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.ou));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pg", {
        get: function () {
            return this.pb;
        },
        set: function (a) {
            var b = this.pg;
            if (a != b) {
                this.pb = a;
                this.g3("IsTransitionInEnabled", b, this.pg);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ow", {
        get: function () {
            return this.ov;
        },
        set: function (a) {
            var b = this.ow;
            if (a != b) {
                this.ov = a;
                this.g3("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.ow));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o6", {
        get: function () {
            return this.o5;
        },
        set: function (a) {
            var b = this.o6;
            if (a != b) {
                this.o5 = a;
                this.g3("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.o6));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pu", {
        get: function () {
            return this.pk;
        },
        set: function (a) {
            var b = this.pu;
            if (a != b) {
                this.pk = a;
                this.g3("XAxisInterval", b, this.pu);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pv", {
        get: function () {
            return this.pl;
        },
        set: function (a) {
            var b = this.pv;
            if (a != b) {
                this.pl = a;
                this.g3("XAxisMinorInterval", b, this.pv);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pt", {
        get: function () {
            return this.pj;
        },
        set: function (a) {
            var b = this.pt;
            if (a != b) {
                this.pj = a;
                this.g3("XAxisGap", b, this.pt);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pw", {
        get: function () {
            return this.pm;
        },
        set: function (a) {
            var b = this.pw;
            if (a != b) {
                this.pm = a;
                this.g3("XAxisOverlap", b, this.pw);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pz", {
        get: function () {
            return this.pn;
        },
        set: function (a) {
            var b = this.pz;
            if (a != b) {
                this.pn = a;
                this.g3("YAxisInterval", b, this.pz);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pi", {
        get: function () {
            return this.pd;
        },
        set: function (a) {
            var b = this.pi;
            if (a != b) {
                this.pd = a;
                this.g3("YAxisIsLogarithmic", b, this.pi);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p6", {
        get: function () {
            return this.p4;
        },
        set: function (a) {
            var b = this.p6;
            if (a != b) {
                this.p4 = a;
                this.g3("YAxisLogarithmBase", b, this.p6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p1", {
        get: function () {
            return this.pp;
        },
        set: function (a) {
            var b = this.p1;
            if (a != b) {
                this.pp = a;
                this.g3("YAxisMinimumValue", b, this.p1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p0", {
        get: function () {
            return this.po;
        },
        set: function (a) {
            var b = this.p0;
            if (a != b) {
                this.po = a;
                this.g3("YAxisMaximumValue", b, this.p0);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p2", {
        get: function () {
            return this.pq;
        },
        set: function (a) {
            var b = this.p2;
            if (a != b) {
                this.pq = a;
                this.g3("YAxisMinorInterval", b, this.p2);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ps", {
        get: function () {
            return this.xAxis.lb;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pr", {
        get: function () {
            return this.xAxis.la;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "py", {
        get: function () {
            return this.yAxis.j4;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "px", {
        get: function () {
            return this.yAxis.j3;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "op", {
        get: function () {
            return this.on;
        },
        set: function (a) {
            var b = this.op;
            if (a != b) {
                this.on = a;
                this.g3("NegativeBrushes", b, this.op);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "oq", {
        get: function () {
            return this.oo;
        },
        set: function (a) {
            var b = this.oq;
            if (a != b) {
                this.oo = a;
                this.g3("NegativeOutlines", b, this.oq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ph", {
        get: function () {
            return this.pc;
        },
        set: function (a) {
            var b = this.ph;
            if (a != b) {
                this.pc = a;
                this.g3("YAxisAbbreviateLargeNumbers", b, this.ph);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pe", {
        get: function () {
            return this.o9;
        },
        set: function (a) {
            var b = this.pe;
            if (a != b) {
                this.o9 = a;
                this.g3("IsCategoryHighlightingEnabled", b, this.pe);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pf", {
        get: function () {
            return this.pa;
        },
        set: function (a) {
            var b = this.pf;
            if (a != b) {
                this.pa = a;
                this.g3("IsItemHighlightingEnabled", b, this.pf);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.get_b5 = 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, "b5", {
        get: function () {
            return this.get_b5();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.qw = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.ha("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.ha("XAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.qx = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.ha("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.ha("YAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.hl = function () {
        _super.prototype.hl.call(this);
        this.xAxis.e7 = this.kp == null ? XYChart.kx(this.xAxis, this.v.dataSeries) : this.kp;
        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: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "yAxis", {
        get: function () {
            return this._yAxis;
        },
        set: function (a) {
            this._yAxis = a;
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.o0 = function (a, b) {
        switch (a) {
            case 2: return this.ar(1);
            case 3: return this.ar(10);
            case 0: return this.ar(0);
            case 1: return this.ar(2);
            case 6: return this.ar(6);
            case 7: return this.ar(7);
            case 4: return this.ar(4);
            case 5: return this.ar(5);
            case 8: return this.ar(8);
            case 9: return this.oz(b);
            default: return this.ar(1);
        }
    };
    CategoryChart.prototype.oz = function (a) {
        return this.ar(a);
    };
    CategoryChart.prototype.u = function (a) {
        switch (this.os) {
            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.aq = function (a, b) {
        var c = this.o0(this.os, a.suggestedSeries);
        c.pd = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    };
    CategoryChart.prototype.hj = function (a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.jt = true;
            this.yAxis.kg = 10;
        }
    };
    CategoryChart.prototype.hm = function () {
        this.yAxis.jt = this.pi;
        this.yAxis.kg = this.p6;
    };
    CategoryChart.prototype.get_b4 = 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, "b4", {
        get: function () {
            return this.get_b4();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.f1 = function (a, b) {
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.o0 = this.ou;
            c.l1 = this.ai(a, b);
        }
    };
    CategoryChart.prototype.qu = function (a) {
        this.qv(function (b, c) { return a(b); });
    };
    CategoryChart.prototype.qv = 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.h9 = function () {
        return this.xAxis;
    };
    CategoryChart.prototype.ia = function () {
        return this.yAxis;
    };
    CategoryChart.prototype.o3 = function () {
        return this.ar(30);
    };
    CategoryChart.prototype.o4 = function () {
        return this.ar(31);
    };
    CategoryChart.prototype.b1 = function (a, b) {
        var c = _super.prototype.b1.call(this, a, b);
        if (c != null) {
            var d = new List$1(Series.$, 0);
            if (this.o9) {
                d.add(this.o3());
            }
            if (this.pa) {
                d.add(this.o4());
            }
            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.hq = function (a, b, c) {
        _super.prototype.hq.call(this, a, b, c);
        if (this.v.dataSeries.count > 0) {
            if (stringIsNullOrEmpty(this.ea)) {
                this.ac.setXMemberPath(a, c.getMemberPathFor(16));
            }
            if (stringIsNullOrEmpty(this.ec)) {
                this.ac.setYMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d6)) {
                this.ac.setLabelMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d3)) {
                this.ac.setContentMemberPath(a, c.getMemberPathFor(0));
            }
        }
    };
    CategoryChart.prototype.g3 = function (a, b, c) {
        var _this = this;
        _super.prototype.g3.call(this, a, b, c);
        switch (a) {
            case "ChartType":
                this.hl();
                break;
            case "MarkerCollisionAvoidance":
                this.qu(function (d) { return d.o0 = _this.ou; });
                break;
            case "IsTransitionInEnabled":
                this.qu(function (d) { return d.ny = _this.pg; });
                break;
            case "TransitionInMode":
                this.qu(function (d) { return d.nh = _this.ow; });
                break;
            case "TransitionInSpeedType":
                this.qu(function (d) { return d.bp = _this.o6; });
                break;
            case "XAxisInterval":
                this.xAxis.k6 = this.pu;
                break;
            case "XAxisMinorInterval":
                this.xAxis.k7 = this.pv;
                break;
            case "XAxisGap":
                this.xAxis.jo = this.pt;
                break;
            case "XAxisOverlap":
                this.xAxis.jv = this.pw;
                break;
            case "YAxisInterval":
                this.yAxis.j8 = this.pz;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.jt = this.pi;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.kg = this.p6;
                break;
            case "YAxisMinimumValue":
                this.yAxis.kc = this.p1;
                break;
            case "YAxisMaximumValue":
                this.yAxis.kb = this.p0;
                break;
            case "YAxisMinorInterval":
                this.yAxis.kd = this.p2;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.qv(function (d, e) {
                    if (d.cz) {
                        d.ji(ArrayExtension.getModulus$1(Brush.$, _this.op, e), ArrayExtension.getModulus$1(Brush.$, _this.oq, e));
                    }
                });
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.nb(function (d) { return d.jo = _this.ph; });
                break;
            case "IsCategoryHighlightingEnabled":
            case "IsItemHighlightingEnabled":
                this.hl();
                break;
        }
    };
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
}(XYChart));
export { CategoryChart };
//# sourceMappingURL=CategoryChart.js.map