/*
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-react-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-react-core";
import { DataSeriesType_$type } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-react-core";
import { SimpleCategorySeriesRule } from "igniteui-react-core";
import { SubCollectionsRule } from "igniteui-react-core";
import { Series } from "./Series";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
export let CategoryChart = /*@__PURE__*/ (() => {
    class CategoryChart extends XYChart {
        constructor() {
            super();
            this.rt = 1000;
            this.qt = null;
            this.qd = 9;
            this.qf = 1;
            this.qx = false;
            this.qh = 0;
            this.qr = 0;
            this.q6 = 0;
            this.q7 = 0;
            this.q5 = 0;
            this.q8 = 0;
            this.q9 = NaN;
            this.qz = false;
            this.ru = 10;
            this.rb = NaN;
            this.ra = NaN;
            this.rc = 0;
            this.p9 = null;
            this.qa = null;
            this.qy = true;
            this.qv = false;
            this.qw = false;
            this.hf();
        }
        hs() {
            super.hs();
            if (this.dataChart == null) {
                return;
            }
            let a = this.dataChart.b8.j.e();
            this.qb = a.d;
            this.qc = a.e;
            if (this.pl == null) {
                this.pl = a.k;
            }
            if (this.ps == null) {
                this.ps = a.k;
            }
        }
        hu(a, b) {
            super.hu(a, b);
            a.gk = this.rv;
            a.b9 = this.qu;
        }
        ie(a, b, c) {
            super.ie(a, b, c);
            switch (a) {
                case "TransitionInDuration":
                    this.sk((d) => d.gk = this.rv);
                    break;
                case "TransitionInEasingFunction":
                    this.sk((d) => d.b9 = this.qu);
                    break;
            }
        }
        get rv() {
            return this.rt;
        }
        set rv(a) {
            let b = this.rv;
            if (a != b) {
                this.rt = a;
                this.id("TransitionInDuration", b, this.rv);
            }
        }
        get qu() {
            return this.qt;
        }
        set qu(a) {
            let b = this.qu;
            if (a != b) {
                this.qt = a;
                this.id("TransitionInEasingFunction", b, this.qu);
            }
        }
        ry() {
            let cvd_ = this.ee();
            cvd_.scaleByViewport();
            return (cvd_.serialize());
        }
        hn(a) {
            super.hn(a);
            a.c3 = this.bv;
        }
        ht(a, b) {
            super.ht(a, b);
            let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
            if (c == null) {
                return;
            }
            c.ro = this.qg;
            c.ql = this.q2;
            c.p5 = this.qi;
            c.b3 = this.qs;
            c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
            c.trendLineType = this.a9;
            c.trendLineThickness = this.d1;
            c.oi = this.aq(a, b);
            if (a.de) {
                a.k8(ArrayExtension.getModulus$1(Brush.$, this.qb, b), ArrayExtension.getModulus$1(Brush.$, this.qc, b));
            }
        }
        qj() {
            return new CategoryXAxis();
        }
        qn() {
            return new NumericYAxis();
        }
        hc() {
            this.xAxis = this.qj();
            this.xAxis.name = "xAxis";
            let a = this.xAxis;
            a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.sm));
            this.yAxis = this.qn();
            this.yAxis.name = "yAxis";
            let b = this.yAxis;
            b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.sn));
            if (this.xAxis.ay == null) {
                this.xAxis.ay = new AxisLabelSettings();
            }
            if (this.yAxis.ay == null) {
                this.yAxis.ay = new AxisLabelSettings();
            }
        }
        or(a) {
            super.or(a);
            a.jx = this.q3;
        }
        get qe() {
            return this.qd;
        }
        set qe(a) {
            if (a != this.qd) {
                let b = this.qe;
                this.qd = a;
                this.id("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.qe));
            }
        }
        get qg() {
            return this.qf;
        }
        set qg(a) {
            let b = this.qg;
            if (a != b) {
                this.qf = a;
                this.id("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.qg));
            }
        }
        get q2() {
            return this.qx;
        }
        set q2(a) {
            let b = this.q2;
            if (a != b) {
                this.qx = a;
                this.id("IsTransitionInEnabled", b, this.q2);
            }
        }
        get qi() {
            return this.qh;
        }
        set qi(a) {
            let b = this.qi;
            if (a != b) {
                this.qh = a;
                this.id("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.qi));
            }
        }
        get qs() {
            return this.qr;
        }
        set qs(a) {
            let b = this.qs;
            if (a != b) {
                this.qr = a;
                this.id("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.qs));
            }
        }
        get rk() {
            return this.q6;
        }
        set rk(a) {
            let b = this.rk;
            if (a != b) {
                this.q6 = a;
                this.id("XAxisInterval", b, this.rk);
            }
        }
        get rl() {
            return this.q7;
        }
        set rl(a) {
            let b = this.rl;
            if (a != b) {
                this.q7 = a;
                this.id("XAxisMinorInterval", b, this.rl);
            }
        }
        get rj() {
            return this.q5;
        }
        set rj(a) {
            let b = this.rj;
            if (a != b) {
                this.q5 = a;
                this.id("XAxisGap", b, this.rj);
            }
        }
        get rm() {
            return this.q8;
        }
        set rm(a) {
            let b = this.rm;
            if (a != b) {
                this.q8 = a;
                this.id("XAxisOverlap", b, this.rm);
            }
        }
        get rp() {
            return this.q9;
        }
        set rp(a) {
            let b = this.rp;
            if (a != b) {
                this.q9 = a;
                this.id("YAxisInterval", b, this.rp);
            }
        }
        get q4() {
            return this.qz;
        }
        set q4(a) {
            let b = this.q4;
            if (a != b) {
                this.qz = a;
                this.id("YAxisIsLogarithmic", b, this.q4);
            }
        }
        get rw() {
            return this.ru;
        }
        set rw(a) {
            let b = this.rw;
            if (a != b) {
                this.ru = a;
                this.id("YAxisLogarithmBase", b, this.rw);
            }
        }
        get rr() {
            return this.rb;
        }
        set rr(a) {
            let b = this.rr;
            if (a != b) {
                this.rb = a;
                this.id("YAxisMinimumValue", b, this.rr);
            }
        }
        get rq() {
            return this.ra;
        }
        set rq(a) {
            let b = this.rq;
            if (a != b) {
                this.ra = a;
                this.id("YAxisMaximumValue", b, this.rq);
            }
        }
        get rs() {
            return this.rc;
        }
        set rs(a) {
            let b = this.rs;
            if (a != b) {
                this.rc = a;
                this.id("YAxisMinorInterval", b, this.rs);
            }
        }
        get ri() {
            return this.xAxis.lk;
        }
        get rh() {
            return this.xAxis.lj;
        }
        re() {
            return this.ri;
        }
        rg() {
            return this.ro;
        }
        rd() {
            return this.rh;
        }
        rf() {
            return this.rn;
        }
        get ro() {
            return this.yAxis.kd;
        }
        get rn() {
            return this.yAxis.kc;
        }
        get qb() {
            return this.p9;
        }
        set qb(a) {
            let b = this.qb;
            if (a != b) {
                this.p9 = a;
                this.id("NegativeBrushes", b, this.qb);
            }
        }
        get qc() {
            return this.qa;
        }
        set qc(a) {
            let b = this.qc;
            if (a != b) {
                this.qa = a;
                this.id("NegativeOutlines", b, this.qc);
            }
        }
        get q3() {
            return this.qy;
        }
        set q3(a) {
            let b = this.q3;
            if (a != b) {
                this.qy = a;
                this.id("YAxisAbbreviateLargeNumbers", b, this.q3);
            }
        }
        get q0() {
            return this.qv;
        }
        set q0(a) {
            let b = this.q0;
            if (a != b) {
                this.qv = a;
                this.id("IsCategoryHighlightingEnabled", b, this.q0);
            }
        }
        get q1() {
            return this.qw;
        }
        set q1(a) {
            let b = this.q1;
            if (a != b) {
                this.qw = a;
                this.id("IsItemHighlightingEnabled", b, this.q1);
            }
        }
        get_cl() {
            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 cl() {
            return this.get_cl();
        }
        sm(a, b) {
            switch (b.propertyName) {
                case "ActualMinimum":
                    this.il("XAxisActualMinimum");
                    break;
                case "ActualMaximum":
                    this.il("XAxisActualMaximum");
                    break;
            }
        }
        sn(a, b) {
            switch (b.propertyName) {
                case "ActualMinimumValue":
                    this.il("YAxisActualMinimum");
                    break;
                case "ActualMaximumValue":
                    this.il("YAxisActualMaximum");
                    break;
            }
        }
        ix() {
            super.ix();
            this.xAxis.fa = this.l3 == null ? XYChart.md(this.xAxis, this.x.dataSeries) : this.l3;
            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;
        }
        qm(a, b) {
            switch (a) {
                case 2: return this.az(1);
                case 3: return this.az(10);
                case 0: return this.az(0);
                case 1: return this.az(2);
                case 6: return this.az(6);
                case 7: return this.az(7);
                case 4: return this.az(4);
                case 5: return this.az(5);
                case 8: return this.az(8);
                case 9: return this.ql(b);
                default: return this.az(1);
            }
        }
        ql(a) {
            return this.az(a);
        }
        w(a) {
            switch (this.qe) {
                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;
            }
        }
        ay(a, b) {
            let c = this.qm(this.qe, a.suggestedSeries);
            c.r2 = a.findMatchingHint(0).path;
            c.xAxis = this.xAxis;
            c.yAxis = this.yAxis;
            return c;
        }
        iv(a) {
            if (a.suggestedSecondaryAxis == 2) {
                this.yAxis.j2 = true;
                this.yAxis.kp = 10;
            }
        }
        iy() {
            this.yAxis.j2 = this.q4;
            this.yAxis.kp = this.rw;
        }
        get_ck() {
            return ((() => {
                let $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
                $ret.add(new SimpleCategorySeriesRule());
                $ret.add(new SubCollectionsRule());
                return $ret;
            })());
        }
        get ck() {
            return this.get_ck();
        }
        ha(a, b) {
            let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
            if (c != null) {
                c.ro = this.qg;
                c.oi = this.aq(a, b);
            }
        }
        sk(a) {
            this.sl((b, c) => a(b));
        }
        sl(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);
            }
        }
        jp() {
            return this.xAxis;
        }
        jq() {
            return this.yAxis;
        }
        qp() {
            return this.az(30);
        }
        qq() {
            return this.az(31);
        }
        ch(a, b) {
            let c = super.ch(a, b);
            if (c != null) {
                let d = new List$1(Series.$, 0);
                if (this.qv) {
                    d.add(this.qp());
                }
                if (this.qw) {
                    d.add(this.qq());
                }
                for (let e = 0; e < d.count; e++) {
                    let f = d._inner[e];
                    f.name = a + getInstanceType(f).typeName;
                    c.add(f);
                }
            }
            return c;
        }
        i2(a, b, c) {
            super.i2(a, b, c);
            if (this.x.dataSeries.count > 0) {
                if (stringIsNullOrEmpty(this.e6)) {
                    this.ae.setXMemberPath(a, c.getMemberPathFor(16));
                }
                if (stringIsNullOrEmpty(this.e8)) {
                    this.ae.setYMemberPath(a, c.getMemberPathFor(0));
                }
                if (stringIsNullOrEmpty(this.e2)) {
                    this.ae.setLabelMemberPath(a, c.getMemberPathFor(0));
                }
                if (stringIsNullOrEmpty(this.ez)) {
                    this.ae.setContentMemberPath(a, c.getMemberPathFor(0));
                }
            }
        }
        id(a, b, c) {
            super.id(a, b, c);
            switch (a) {
                case "ChartType":
                    this.ix();
                    break;
                case "MarkerCollisionAvoidance":
                    this.sk((d) => d.ro = this.qg);
                    break;
                case "IsTransitionInEnabled":
                    this.sk((d) => d.ql = this.q2);
                    break;
                case "TransitionInMode":
                    this.sk((d) => d.p5 = this.qi);
                    break;
                case "TransitionInSpeedType":
                    this.sk((d) => d.b3 = this.qs);
                    break;
                case "XAxisInterval":
                    this.xAxis.lf = this.rk;
                    break;
                case "XAxisMinorInterval":
                    this.xAxis.lg = this.rl;
                    break;
                case "XAxisGap":
                    this.xAxis.jx = this.rj;
                    break;
                case "XAxisOverlap":
                    this.xAxis.j4 = this.rm;
                    break;
                case "YAxisInterval":
                    this.yAxis.kh = this.rp;
                    break;
                case "YAxisIsLogarithmic":
                    this.yAxis.j2 = this.q4;
                    break;
                case "YAxisLogarithmBase":
                    this.yAxis.kp = this.rw;
                    break;
                case "YAxisMinimumValue":
                    this.yAxis.kl = this.rr;
                    break;
                case "YAxisMaximumValue":
                    this.yAxis.kk = this.rq;
                    break;
                case "YAxisMinorInterval":
                    this.yAxis.km = this.rs;
                    break;
                case "NegativeBrushes":
                case "NegativeOutlines":
                    this.sl((d, e) => {
                        if (d.de) {
                            d.k8(ArrayExtension.getModulus$1(Brush.$, this.qb, e), ArrayExtension.getModulus$1(Brush.$, this.qc, e));
                        }
                    });
                    break;
                case "YAxisAbbreviateLargeNumbers":
                    this.ox((d) => d.jx = this.q3);
                    break;
                case "IsCategoryHighlightingEnabled":
                case "IsItemHighlightingEnabled":
                    this.ix();
                    break;
            }
        }
    }
    CategoryChart.$t = /*@__PURE__*/ markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
})();
//# sourceMappingURL=CategoryChart.js.map
