/*
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 { XYChart } from "./XYChart";
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-react-core/ES2015/List$1";
import { DataSeriesType_$type } from "igniteui-react-core/ES2015/DataSeriesType";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-react-core/ES2015/IDataSeriesAdapterRule";
import { SimpleCategorySeriesRule } from "igniteui-react-core/ES2015/SimpleCategorySeriesRule";
import { SubCollectionsRule } from "igniteui-react-core/ES2015/SubCollectionsRule";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-react-core/ES2015/ArrayExtension";
import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar } from "igniteui-react-core/ES2015/type";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { ScalerParams } from "./ScalerParams";
export class CategoryChart extends XYChart {
    constructor() {
        super();
        this.of = 1000;
        this.nh = null;
        this.m2 = 9;
        this.m4 = 1;
        this.nk = false;
        this.m6 = 0;
        this.nf = 0;
        this.ns = 0;
        this.nt = 0;
        this.nr = 0;
        this.nu = 0;
        this.nv = NaN;
        this.nm = false;
        this.og = 10;
        this.nx = NaN;
        this.nw = NaN;
        this.ny = 0;
        this.my = null;
        this.mz = null;
        this.nj = false;
        this.nl = true;
        this.eo();
    }
    e1() {
        super.e1();
        if (this.dataChart == null) {
            return;
        }
        let a = this.dataChart.bk.i.e();
        this.m0 = a.d;
        this.m1 = a.e;
        this.mh = this.ma = a.k;
    }
    e3(a, b) {
        super.e3(a, b);
        a.fd = this.oh;
        a.bv = this.ni;
    }
    fk(a, b, c) {
        super.fk(a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.o5((d) => d.fd = this.oh);
                break;
            case "TransitionInEasingFunction":
                this.o5((d) => d.bv = this.ni);
                break;
        }
    }
    get oh() {
        return this.of;
    }
    set oh(a) {
        let b = this.oh;
        if (a != b) {
            this.of = a;
            this.fj("TransitionInDuration", b, this.oh);
        }
    }
    get ni() {
        return this.nh;
    }
    set ni(a) {
        let b = this.ni;
        if (a != b) {
            this.nh = a;
            this.fj("TransitionInEasingFunction", b, this.ni);
        }
    }
    ol() {
        let cvd_ = this.cn();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    }
    ew(a) {
        super.ew(a);
        a.ca = this.nn;
    }
    e2(a, b) {
        super.e2(a, b);
        let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.op = this.m5;
        c.nm = this.no;
        c.m5 = this.m7;
        c.bp = this.ng;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.ai;
        c.trendLineThickness = this.ca;
        c.lp = this.ad(a, b);
        if (a.cy) {
            a.i6(ArrayExtension.getModulus$1(Brush.$, this.m0, b), ArrayExtension.getModulus$1(Brush.$, this.m1, b));
        }
    }
    m8() {
        return new CategoryXAxis();
    }
    nd() {
        return new NumericYAxis();
    }
    em() {
        this.xAxis = this.m8();
        this.xAxis.name = "xAxis";
        let a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.o7));
        this.yAxis = this.nd();
        this.yAxis.name = "yAxis";
        let b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.o8));
        if (this.xAxis.aw == null) {
            this.xAxis.aw = new AxisLabelSettings();
        }
        if (this.yAxis.aw == null) {
            this.yAxis.aw = new AxisLabelSettings();
        }
    }
    lg(a) {
        super.lg(a);
        a.jg = this.np;
    }
    get m3() {
        return this.m2;
    }
    set m3(a) {
        if (a != this.m2) {
            let b = this.m3;
            this.m2 = a;
            this.fj("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.m3));
        }
    }
    get m5() {
        return this.m4;
    }
    set m5(a) {
        let b = this.m5;
        if (a != b) {
            this.m4 = a;
            this.fj("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.m5));
        }
    }
    get no() {
        return this.nk;
    }
    set no(a) {
        let b = this.no;
        if (a != b) {
            this.nk = a;
            this.fj("IsTransitionInEnabled", b, this.no);
        }
    }
    get m7() {
        return this.m6;
    }
    set m7(a) {
        let b = this.m7;
        if (a != b) {
            this.m6 = a;
            this.fj("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.m7));
        }
    }
    get ng() {
        return this.nf;
    }
    set ng(a) {
        let b = this.ng;
        if (a != b) {
            this.nf = a;
            this.fj("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.ng));
        }
    }
    get n6() {
        return this.ns;
    }
    set n6(a) {
        let b = this.n6;
        if (a != b) {
            this.ns = a;
            this.fj("XAxisInterval", b, this.n6);
        }
    }
    get n7() {
        return this.nt;
    }
    set n7(a) {
        let b = this.n7;
        if (a != b) {
            this.nt = a;
            this.fj("XAxisMinorInterval", b, this.n7);
        }
    }
    get n5() {
        return this.nr;
    }
    set n5(a) {
        let b = this.n5;
        if (a != b) {
            this.nr = a;
            this.fj("XAxisGap", b, this.n5);
        }
    }
    get n8() {
        return this.nu;
    }
    set n8(a) {
        let b = this.n8;
        if (a != b) {
            this.nu = a;
            this.fj("XAxisOverlap", b, this.n8);
        }
    }
    get ob() {
        return this.nv;
    }
    set ob(a) {
        let b = this.ob;
        if (a != b) {
            this.nv = a;
            this.fj("YAxisInterval", b, this.ob);
        }
    }
    get nq() {
        return this.nm;
    }
    set nq(a) {
        let b = this.nq;
        if (a != b) {
            this.nm = a;
            this.fj("YAxisIsLogarithmic", b, this.nq);
        }
    }
    get oi() {
        return this.og;
    }
    set oi(a) {
        let b = this.oi;
        if (a != b) {
            this.og = a;
            this.fj("YAxisLogarithmBase", b, this.oi);
        }
    }
    get od() {
        return this.nx;
    }
    set od(a) {
        let b = this.od;
        if (a != b) {
            this.nx = a;
            this.fj("YAxisMinimumValue", b, this.od);
        }
    }
    get oc() {
        return this.nw;
    }
    set oc(a) {
        let b = this.oc;
        if (a != b) {
            this.nw = a;
            this.fj("YAxisMaximumValue", b, this.oc);
        }
    }
    get oe() {
        return this.ny;
    }
    set oe(a) {
        let b = this.oe;
        if (a != b) {
            this.ny = a;
            this.fj("YAxisMinorInterval", b, this.oe);
        }
    }
    get n4() {
        return this.xAxis.k3;
    }
    get n3() {
        return this.xAxis.k2;
    }
    get oa() {
        return this.yAxis.jw;
    }
    get n9() {
        return this.yAxis.jv;
    }
    get m0() {
        return this.my;
    }
    set m0(a) {
        let b = this.m0;
        if (a != b) {
            this.my = a;
            this.fj("NegativeBrushes", b, this.m0);
        }
    }
    get m1() {
        return this.mz;
    }
    set m1(a) {
        let b = this.m1;
        if (a != b) {
            this.mz = a;
            this.fj("NegativeOutlines", b, this.m1);
        }
    }
    get nn() {
        return this.nj;
    }
    set nn(a) {
        let b = this.nn;
        if (a != b) {
            this.nj = a;
            this.fj("AnimateSeriesWhenAxisRangeChanges", b, this.nn);
        }
    }
    get np() {
        return this.nl;
    }
    set np(a) {
        let b = this.np;
        if (a != b) {
            this.nl = a;
            this.fj("YAxisAbbreviateLargeNumbers", b, this.np);
        }
    }
    get_ba() {
        let 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;
    }
    get ba() {
        return this.get_ba();
    }
    o7(a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.fo("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.fo("XAxisActualMaximum");
                break;
        }
    }
    o8(a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.fo("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.fo("YAxisActualMaximum");
                break;
        }
    }
    fz() {
        super.fz();
        this.xAxis.e1 = XYChart.i8(this.xAxis, this.s.dataSeries);
        this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null;
    }
    get xAxis() {
        return this._xAxis;
    }
    set xAxis(a) {
        this._xAxis = a;
    }
    get yAxis() {
        return this._yAxis;
    }
    set yAxis(a) {
        this._yAxis = a;
    }
    na(seriesType_) {
        return (this.externalObject.createSeries(seriesType_).i);
    }
    nc(a, b) {
        switch (a) {
            case 2: return this.na(1);
            case 3: return this.na(10);
            case 0: return this.na(0);
            case 1: return this.na(2);
            case 6: return this.na(6);
            case 7: return this.na(7);
            case 4: return this.na(4);
            case 5: return this.na(5);
            case 8: return this.na(8);
            case 9: return this.nb(b);
            default: return this.na(1);
        }
    }
    nb(a) {
        return this.na(a);
    }
    nz(a) {
        return this.xAxis.dt(a, new ScalerParams(1, this.gj, this.gi, this.xAxis.b8));
    }
    n1(a) {
        return this.xAxis.dw(a, new ScalerParams(1, this.gj, this.gi, this.xAxis.b8));
    }
    n0(a) {
        return this.yAxis.dt(a, new ScalerParams(1, this.gj, this.gi, this.yAxis.b8));
    }
    n2(a) {
        return this.yAxis.dw(a, new ScalerParams(1, this.gj, this.gi, this.yAxis.b8));
    }
    r(a) {
        switch (this.m3) {
            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;
        }
    }
    ag(a, b) {
        let c = this.nc(this.m3, a.suggestedSeries);
        c.o2 = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    }
    fx(a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.jl = true;
            this.yAxis.j8 = 10;
        }
    }
    f0() {
        this.yAxis.jl = this.nq;
        this.yAxis.j8 = this.oi;
    }
    f2(a) {
        super.f2(a);
        let b = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (b == null) {
            return;
        }
        b.xAxis = null;
        b.yAxis = null;
    }
    get_a9() {
        return ((() => {
            let $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
            $ret.add(new SimpleCategorySeriesRule());
            $ret.add(new SubCollectionsRule());
            return $ret;
        })());
    }
    get a9() {
        return this.get_a9();
    }
    ek(a, b) {
        let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.op = this.m5;
            c.lp = this.ad(a, b);
        }
    }
    o5(a) {
        this.o6((b, c) => a(b));
    }
    o6(a) {
        if (this.dataChart == null) {
            return;
        }
        for (let b = 0; b < this.dataChart.series.count; b++) {
            a(typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]), b);
        }
    }
    gk() {
        return this.xAxis;
    }
    gl() {
        return this.yAxis;
    }
    fj(a, b, c) {
        super.fj(a, b, c);
        switch (a) {
            case "ChartType":
                this.fz();
                break;
            case "MarkerCollisionAvoidance":
                this.o5((d) => d.op = this.m5);
                break;
            case "IsTransitionInEnabled":
                this.o5((d) => d.nm = this.no);
                break;
            case "TransitionInMode":
                this.o5((d) => d.m5 = this.m7);
                break;
            case "TransitionInSpeedType":
                this.o5((d) => d.bp = this.ng);
                break;
            case "XAxisInterval":
                this.xAxis.ky = this.n6;
                break;
            case "XAxisMinorInterval":
                this.xAxis.kz = this.n7;
                break;
            case "XAxisGap":
                this.xAxis.jg = this.n5;
                break;
            case "XAxisOverlap":
                this.xAxis.jn = this.n8;
                break;
            case "YAxisInterval":
                this.yAxis.j0 = this.ob;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.jl = this.nq;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.j8 = this.oi;
                break;
            case "YAxisMinimumValue":
                this.yAxis.j4 = this.od;
                break;
            case "YAxisMaximumValue":
                this.yAxis.j3 = this.oc;
                break;
            case "YAxisMinorInterval":
                this.yAxis.j5 = this.oe;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.o6((d, e) => {
                    if (d.cy) {
                        d.i6(ArrayExtension.getModulus$1(Brush.$, this.m0, e), ArrayExtension.getModulus$1(Brush.$, this.m1, e));
                    }
                });
                break;
            case "AnimateSeriesWhenAxisRangeChanges":
                if (this.dataChart != null) {
                    this.dataChart.ca = this.nn;
                }
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.lm((d) => d.jg = this.np);
                break;
        }
    }
}
CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
