/*
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 { 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
 */
export let CategoryChart = /*@__PURE__*/ (() => {
    class CategoryChart extends XYChart {
        constructor() {
            super();
            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();
        }
        ic() {
            super.ic();
            if (this.dataChart == null) {
                return;
            }
            let 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;
            }
        }
        ie(a, b) {
            super.ie(a, b);
            a.gk = this.sn;
            a.b9 = this.rl;
        }
        i0(a, b, c) {
            super.i0(a, b, c);
            switch (a) {
                case "TransitionInDuration":
                    this.tc((d) => d.gk = this.sn);
                    break;
                case "TransitionInEasingFunction":
                    this.tc((d) => d.b9 = this.rl);
                    break;
            }
        }
        get sn() {
            return this.sl;
        }
        set sn(a) {
            let b = this.sn;
            if (a != b) {
                this.sl = a;
                this.iz("TransitionInDuration", b, this.sn);
            }
        }
        get rl() {
            return this.rk;
        }
        set rl(a) {
            let b = this.rl;
            if (a != b) {
                this.rk = a;
                this.iz("TransitionInEasingFunction", b, this.rl);
            }
        }
        sq() {
            let cvd_ = this.es();
            cvd_.scaleByViewport();
            return (cvd_.serialize());
        }
        h7(a) {
            super.h7(a);
            a.c3 = this.b2;
        }
        id(a, b) {
            super.id(a, b);
            let 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));
            }
        }
        ra() {
            return new CategoryXAxis();
        }
        re() {
            return new NumericYAxis();
        }
        hw() {
            this.xAxis = this.ra();
            this.xAxis.name = "xAxis";
            let a = this.xAxis;
            a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.te));
            this.yAxis = this.re();
            this.yAxis.name = "yAxis";
            let 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();
            }
        }
        pe(a) {
            super.pe(a);
            a.jx = this.ru;
        }
        get q5() {
            return this.q4;
        }
        set q5(a) {
            if (a != this.q4) {
                let b = this.q5;
                this.q4 = a;
                this.iz("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.q5));
            }
        }
        get q7() {
            return this.q6;
        }
        set q7(a) {
            let b = this.q7;
            if (a != b) {
                this.q6 = a;
                this.iz("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.q7));
            }
        }
        get rt() {
            return this.ro;
        }
        set rt(a) {
            let b = this.rt;
            if (a != b) {
                this.ro = a;
                this.iz("IsTransitionInEnabled", b, this.rt);
            }
        }
        get q9() {
            return this.q8;
        }
        set q9(a) {
            let b = this.q9;
            if (a != b) {
                this.q8 = a;
                this.iz("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.q9));
            }
        }
        get rj() {
            return this.ri;
        }
        set rj(a) {
            let b = this.rj;
            if (a != b) {
                this.ri = a;
                this.iz("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.rj));
            }
        }
        get sc() {
            return this.ry;
        }
        set sc(a) {
            let b = this.sc;
            if (a != b) {
                this.ry = a;
                this.iz("XAxisInterval", b, this.sc);
            }
        }
        get sd() {
            return this.rz;
        }
        set sd(a) {
            let b = this.sd;
            if (a != b) {
                this.rz = a;
                this.iz("XAxisMinorInterval", b, this.sd);
            }
        }
        get sb() {
            return this.rx;
        }
        set sb(a) {
            let b = this.sb;
            if (a != b) {
                this.rx = a;
                this.iz("XAxisGap", b, this.sb);
            }
        }
        get se() {
            return this.r0;
        }
        set se(a) {
            let b = this.se;
            if (a != b) {
                this.r0 = a;
                this.iz("XAxisOverlap", b, this.se);
            }
        }
        get sh() {
            return this.r1;
        }
        set sh(a) {
            let b = this.sh;
            if (a != b) {
                this.r1 = a;
                this.iz("YAxisInterval", b, this.sh);
            }
        }
        get rv() {
            return this.rq;
        }
        set rv(a) {
            let b = this.rv;
            if (a != b) {
                this.rq = a;
                this.iz("YAxisIsLogarithmic", b, this.rv);
            }
        }
        get so() {
            return this.sm;
        }
        set so(a) {
            let b = this.so;
            if (a != b) {
                this.sm = a;
                this.iz("YAxisLogarithmBase", b, this.so);
            }
        }
        get sj() {
            return this.r3;
        }
        set sj(a) {
            let b = this.sj;
            if (a != b) {
                this.r3 = a;
                this.iz("YAxisMinimumValue", b, this.sj);
            }
        }
        get si() {
            return this.r2;
        }
        set si(a) {
            let b = this.si;
            if (a != b) {
                this.r2 = a;
                this.iz("YAxisMaximumValue", b, this.si);
            }
        }
        get sk() {
            return this.r4;
        }
        set sk(a) {
            let b = this.sk;
            if (a != b) {
                this.r4 = a;
                this.iz("YAxisMinorInterval", b, this.sk);
            }
        }
        get sa() {
            return this.xAxis.lk;
        }
        get r9() {
            return this.xAxis.lj;
        }
        r6() {
            return this.sa;
        }
        r8() {
            return this.sg;
        }
        r5() {
            return this.r9;
        }
        r7() {
            return this.sf;
        }
        get sg() {
            return this.yAxis.kd;
        }
        get sf() {
            return this.yAxis.kc;
        }
        get q2() {
            return this.q0;
        }
        set q2(a) {
            let b = this.q2;
            if (a != b) {
                this.q0 = a;
                this.iz("NegativeBrushes", b, this.q2);
            }
        }
        get q3() {
            return this.q1;
        }
        set q3(a) {
            let b = this.q3;
            if (a != b) {
                this.q1 = a;
                this.iz("NegativeOutlines", b, this.q3);
            }
        }
        get ru() {
            return this.rp;
        }
        set ru(a) {
            let b = this.ru;
            if (a != b) {
                this.rp = a;
                this.iz("YAxisAbbreviateLargeNumbers", b, this.ru);
            }
        }
        get rr() {
            return this.rm;
        }
        set rr(a) {
            let b = this.rr;
            if (a != b) {
                this.rm = a;
                this.iz("IsCategoryHighlightingEnabled", b, this.rr);
            }
        }
        get rs() {
            return this.rn;
        }
        set rs(a) {
            let b = this.rs;
            if (a != b) {
                this.rn = a;
                this.iz("IsItemHighlightingEnabled", b, this.rs);
            }
        }
        get_cv() {
            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 cv() {
            return this.get_cv();
        }
        c4() {
            if (this.rw == null) {
                this.rw = CategoryChartMockDataGenerator.a();
            }
            return this.rw;
        }
        te(a, b) {
            switch (b.propertyName) {
                case "ActualMinimum":
                    this.i6("XAxisActualMinimum");
                    break;
                case "ActualMaximum":
                    this.i6("XAxisActualMaximum");
                    break;
            }
        }
        tf(a, b) {
            switch (b.propertyName) {
                case "ActualMinimumValue":
                    this.i6("YAxisActualMinimum");
                    break;
                case "ActualMaximumValue":
                    this.i6("YAxisActualMaximum");
                    break;
            }
        }
        jh() {
            super.jh();
            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;
        }
        get xAxis() {
            return this._xAxis;
        }
        set xAxis(a) {
            this._xAxis = a;
        }
        get yAxis() {
            return this._yAxis;
        }
        set yAxis(a) {
            this._yAxis = a;
        }
        rd(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);
            }
        }
        rc(a) {
            return this.a4(a);
        }
        ab(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;
            }
        }
        a3(a, b) {
            let c = this.rd(this.q5, a.suggestedSeries);
            c.r2 = a.findMatchingHint(0).path;
            c.xAxis = this.xAxis;
            c.yAxis = this.yAxis;
            return c;
        }
        jf(a) {
            if (a.suggestedSecondaryAxis == 2) {
                this.yAxis.j2 = true;
                this.yAxis.kp = 10;
            }
        }
        ji() {
            this.yAxis.j2 = this.rv;
            this.yAxis.kp = this.so;
        }
        get_cu() {
            return ((() => {
                let $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
                $ret.add(new SimpleCategorySeriesRule());
                $ret.add(new SubCollectionsRule());
                return $ret;
            })());
        }
        get cu() {
            return this.get_cu();
        }
        hu(a, b) {
            let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
            if (c != null) {
                c.ro = this.q7;
                c.oi = this.av(a, b);
            }
        }
        tc(a) {
            this.td((b, c) => a(b));
        }
        td(a) {
            if (this.dataChart == null) {
                return;
            }
            for (let b = 0; b < this.dataChart.series.count; b++) {
                let c = typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]);
                if (c == null) {
                    continue;
                }
                a(c, b);
            }
        }
        ka() {
            return this.xAxis;
        }
        kb() {
            return this.yAxis;
        }
        rg() {
            return this.a4(30);
        }
        rh() {
            return this.a4(31);
        }
        cr(a, b) {
            let c = super.cr(a, b);
            if (c != null) {
                let d = new List$1(Series.$, 0);
                if (this.rm) {
                    d.add(this.rg());
                }
                if (this.rn) {
                    d.add(this.rh());
                }
                for (let e = 0; e < d.count; e++) {
                    let f = d._inner[e];
                    f.name = a + getInstanceType(f).typeName;
                    c.add(f);
                }
            }
            return c;
        }
        jm(a, b, c) {
            super.jm(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));
                }
            }
        }
        iz(a, b, c) {
            super.iz(a, b, c);
            switch (a) {
                case "ChartType":
                    this.jh();
                    break;
                case "MarkerCollisionAvoidance":
                    this.tc((d) => d.ro = this.q7);
                    break;
                case "IsTransitionInEnabled":
                    this.tc((d) => d.ql = this.rt);
                    break;
                case "TransitionInMode":
                    this.tc((d) => d.p5 = this.q9);
                    break;
                case "TransitionInSpeedType":
                    this.tc((d) => 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((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((d) => d.jx = this.ru);
                    break;
                case "IsCategoryHighlightingEnabled":
                case "IsItemHighlightingEnabled":
                    this.jh();
                    break;
            }
        }
    }
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
})();
//# sourceMappingURL=CategoryChart.js.map
