/*
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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, Array_$type, runOn, markType } from "igniteui-react-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { List$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { intDivide, isNaN_ } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
/**
 * @hidden
 */
export let StepAreaSeries = /*@__PURE__*/ (() => {
    class StepAreaSeries extends HorizontalAnchoredCategorySeries {
        constructor() {
            super();
            this.qu = null;
            this.qu = new CategoryLineRasterizer();
            this.ab = StepAreaSeries.$;
        }
        bf() {
            return new StepAreaSeriesView(this);
        }
        i2(a) {
            super.i2(a);
            this.qv = a;
        }
        get_ck() {
            return true;
        }
        preferredCategoryMode(a) {
            return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1;
        }
        h3(a, b) {
            super.h3(a, b);
            let c = b;
            c.c7();
        }
        qw(a, b, c, d, e) {
            if (b) {
                if (e) {
                    if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.f.count) {
                        return c.f._inner[(intDivide(a, 2))][0];
                    }
                    return c.f._inner[(intDivide(a, 2)) + 1][0];
                }
                return c.f._inner[(intDivide(a, 2))][0] + ((a & 1) == 1 ? -d : d);
            }
            if (e) {
                if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.f.count) {
                    return c.f._inner[(intDivide(a, 2))][0];
                }
                return c.f._inner[(intDivide(a, 2)) + 1][0];
            }
            return c.f._inner[(intDivide(a, 2))][0] + ((a & 1) == 0 ? -d : d);
        }
        nt() {
            return 1;
        }
        ef(a, b, c, d, e, f, g, h) {
            let i = NaN;
            if (c >= 0 && c < b.count) {
                i = b.item(c);
            }
            let j = NaN;
            if (d >= 0 && d < b.count) {
                j = b.item(d);
            }
            if (f == 0) {
                return j;
            }
            if (e == b.count - 1) {
                return i;
            }
            if (isNaN_(j) && g != 0 && a <= 0.5 && !h) {
                return i;
            }
            if (isNaN_(i) && g != 0 && a >= 0.5 && !h) {
                return j;
            }
            if (a > 0.5) {
                return j;
            }
            return i;
        }
        bd() {
            if (this.be == 0) {
                return 2;
            }
            else {
                return super.bd();
            }
        }
        o1(a, b) {
            super.o1(a, b);
            let c = b.bs;
            let d = b.br;
            let e = this.getEffectiveViewport1(b);
            let f = typeCast(ISortingAxis_$type, this.qb) != null;
            let g = this.qb != null ? 0.5 * this.qb.getCategorySize(c, d, e) : 0;
            if (this.qb != null && this.qb.ca) {
                g = -g;
            }
            let h = a.f.count * 2;
            let i = new List$1(Array_$type, 2, h);
            this.nr.x(this, this.oc(), this.qb, runOn(this, this.nd), this.ok(b), this.ol(b));
            let j = false;
            let k = this.nr.c;
            if (k != null) {
                j = true;
            }
            for (let l = 0; l < h; l++) {
                let m = new Array(4);
                m[0] = this.qw(l, false, a, g, f);
                m[1] = a.f._inner[(intDivide(l, 2))][1];
                m[2] = this.qw(l, true, a, g, f);
                m[3] = a.f._inner[(intDivide(l, 2))][2];
                i.add(m);
            }
            let n = this.ns.cn.d;
            if (j) {
                let o = new ScalerParams(0, b.bs, b.br, this.qb.ca, e);
                this.ox(i, -1, this.valueColumn.count, this.qb, o, b.n);
            }
            let p = typeCast(StepAreaSeriesView.$, b);
            let q = p.dk;
            let r = p.dl;
            let s = p.di;
            let t = p.dj;
            this.nr.ae(q, true, false, true, true);
            this.nr.ae(r, true, false, true, true);
            this.nr.ae(s, false, true, false, false);
            this.nr.ae(t, false, true, false, false);
            if (b.cr(a)) {
                p.c9(h, i, false, n, this.eu, (u, v, w, x, y) => this.pv(u, 2 * a.f.count, b), 1, this.pa(i, i.count - 1, b.br, b.bs, true));
                b.cu(a);
            }
            let u = this.fetchYAxis();
            p.di._opacity = this.d6;
            p.dj._opacity = 0.5 * this.d6;
        }
        get useHighMarkerFidelity() {
            return this.of;
        }
    }
    StepAreaSeries.$t = /*@__PURE__*/ markType(StepAreaSeries, 'StepAreaSeries', HorizontalAnchoredCategorySeries.$);
    return StepAreaSeries;
})();
/**
 * @hidden
 */
export let StepAreaSeriesView = /*@__PURE__*/ (() => {
    class StepAreaSeriesView extends AnchoredCategorySeriesView {
        constructor(a) {
            super(a);
            this.c6 = null;
            this.de = new Path();
            this.dg = new Path();
            this.df = new Path();
            this.dh = new Path();
            this.da = new Path();
            this.dc = new Path();
            this.db = new Path();
            this.dd = new Path();
            this.c6 = a;
        }
        ap() {
            super.ap();
            if (!this.n) {
                this.e.bj = 1;
            }
        }
        get di() {
            return this.de;
        }
        get dk() {
            return this.dg;
        }
        get dj() {
            return this.df;
        }
        get dl() {
            return this.dh;
        }
        c7() {
            this.de.ak = null;
            this.df.ak = null;
            this.dg.ak = null;
            this.dh.ak = null;
            this.an();
        }
        c8(a, b, c, d, e, f, g) {
            this.c8(a, b, c, d, e, f, g);
        }
        c9(a, b, c, d, e, f, g, h) {
            this.c6.qu.a = typeCast(ISortingAxis_$type, this.cp.fetchXAxis()) !== null ? true : false;
            this.c6.qu.j(this.de, this.dg, this.df, this.dh, a, b, c, d, e, f, g, h);
            this.an();
        }
        a9() {
            super.a9();
            this.da.ak = this.de.ak;
            this.dc.ak = this.dg.ak;
            this.db.ak = this.df.ak;
            this.dd.ak = this.dh.ak;
            let a = this.bl();
            this.da._fill = a;
            this.da._opacity = 1;
            this.db._fill = a;
            this.db._opacity = 1;
            this.dc._stroke = a;
            this.dc.ac = this.e.ey + 3;
            this.dd._stroke = a;
            this.dd.ac = this.e.ey + 3;
        }
        a3(a, b) {
            super.a3(a, b);
            if (b) {
                a.s(this.da);
                a.s(this.db);
                a.s(this.dc);
                a.s(this.dd);
            }
            else {
                a.s(this.de);
                a.s(this.df);
                a.s(this.dg);
                a.s(this.dh);
            }
        }
        ai(a) {
            super.ai(a);
            this.e.a2.exportPathData(a, this.dg, "lowerShape", ["Lower"]);
            this.e.a2.exportPathData(a, this.dh, "upperShape", ["Upper", "Main"]);
            this.e.a2.exportPathData(a, this.df, "translucentShape", ["Translucent"]);
            this.e.a2.exportPathData(a, this.de, "fillShape", ["Fill"]);
        }
    }
    StepAreaSeriesView.$t = /*@__PURE__*/ markType(StepAreaSeriesView, 'StepAreaSeriesView', AnchoredCategorySeriesView.$);
    return StepAreaSeriesView;
})();
//# sourceMappingURL=StepAreaSeries_combined.js.map
