/*
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 { SplineSeriesBase } from "./SplineSeriesBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, runOn, markType } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let SplineAreaSeries = /*@__PURE__*/ (() => {
    class SplineAreaSeries extends SplineSeriesBase {
        bc() {
            return new SplineAreaSeries();
        }
        get_d9() {
            return true;
        }
        get_fe() {
            return true;
        }
        cd() {
            return new SplineAreaSeriesView(this);
        }
        vy() {
            return 1;
        }
        o2(a) {
            super.o2(a);
            this.z1 = a;
        }
        constructor() {
            super();
            this.z0 = null;
            this.z0 = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        cj() {
            if (this.ck == 0) {
                return 2;
            }
            return super.cj();
        }
        nk(a, b) {
            super.nk(a, b);
            let c = b;
            c.dg();
        }
        f5(a, b) {
            let c = this.tj(this.to(a), true, false);
            if (this.y7(a, c, b)) {
                return true;
            }
            if (this.f4(a, b)) {
                return true;
            }
            if (this.uf(a, b)) {
                return true;
            }
            return false;
        }
        w7(a, b) {
            super.w7(a, b);
            let c = this.vx.cu.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.vw.a2(this, this.wg(), runOn(this, this.vh), this.wp(b), this.wq(b));
            let g = false;
            let h = this.vw.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.by, b.bx, this.yx.ch, f);
                this.w3(e, -1, this.valueColumn.count, this.yx, i, b.q);
            }
            let j = d.ds;
            let k = d.dt;
            let l = d.du;
            let m = d.dv;
            this.vw.ad(j, true, false, true, true);
            this.vw.ad(k, true, false, true, true);
            this.vw.ad(l, false, true, false, false);
            this.vw.ad(m, false, true, false, false);
            l._opacity = this.vw.j * this.hg;
            m._opacity = 0.5 * this.vw.j * this.hg;
            if (b.cy(a)) {
                d.di(a.f.count, e, true, c, this.hk, (n, o, p, q, r) => this.yd(n, a.f.count, b), 1, a.f.count == 1 ? null : this.xg(e, e.count - 1, b.bx, b.by, true));
                b.c1(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.wk;
        }
    }
    SplineAreaSeries.$t = /*@__PURE__*/ markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
})();
/**
 * @hidden
 */
export let SplineAreaSeriesView = /*@__PURE__*/ (() => {
    class SplineAreaSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.df = null;
            this.dn = new Path();
            this.dq = new Path();
            this.dp = new Path();
            this.dr = new Path();
            this.dj = new Path();
            this.dl = new Path();
            this.dk = new Path();
            this.dm = new Path();
            this.df = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.df.uc = Defaults.e;
            }
        }
        get ds() {
            return this.dq;
        }
        get dt() {
            return this.dr;
        }
        get du() {
            return this.dn;
        }
        get dv() {
            return this.dp;
        }
        dg() {
            this.dn.an = null;
            this.dp.an = null;
            this.dq.an = null;
            this.dr.an = null;
            this.as();
        }
        dh(a, b, c, d, e, f, g) {
            this.di(a, b, c, d, e, f, g, null);
        }
        di(a, b, c, d, e, f, g, h) {
            this.df.z0.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
            this.df.z0.j(this.dn, this.dq, this.dp, this.dr, a, b, c, d, e, f, g, h);
            this.as();
        }
        be() {
            super.be();
            this.dj.an = this.dn.an;
            this.dl.an = this.dq.an;
            this.dk.an = this.dp.an;
            this.dm.an = this.dr.an;
            let a = this.br();
            this.dj._fill = a;
            this.dj._opacity = 1;
            this.dk._fill = a;
            this.dk._opacity = 1;
            this.dl._stroke = a;
            this.dl.ad = this.e.hl + 3;
            this.dm._stroke = a;
            this.dm.ad = this.e.hl + 3;
        }
        a8(a, b) {
            super.a8(a, b);
            if (b) {
                a.t(this.dj);
                a.t(this.dk);
                a.t(this.dl);
                a.t(this.dm);
            }
            else {
                a.t(this.dn);
                a.t(this.dp);
                a.t(this.dq);
                a.t(this.dr);
            }
        }
        an(a) {
            super.an(a);
            this.e.a5.exportPathData(a, this.dq, "lowerShape", ["Lower"]);
            this.e.a5.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]);
            this.e.a5.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
            this.e.a5.exportPathData(a, this.dn, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.s8 = a;
            this.e.is = 5;
            this.e.it = 1;
            this.e.iu = -3;
        }
    }
    SplineAreaSeriesView.$t = /*@__PURE__*/ markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
