/*
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 {
        get_d8() {
            return true;
        }
        get_fd() {
            return true;
        }
        cg() {
            return new SplineAreaSeriesView(this);
        }
        vw() {
            return 1;
        }
        o0(a) {
            super.o0(a);
            this.zz = a;
        }
        constructor() {
            super();
            this.zy = null;
            this.zy = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        cm() {
            if (this.cn == 0) {
                return 2;
            }
            return super.cm();
        }
        nj(a, b) {
            super.nj(a, b);
            let c = b;
            c.dg();
        }
        f4(a, b) {
            let c = this.th(this.tm(a), true, false);
            if (this.y5(a, c, b)) {
                return true;
            }
            if (this.f3(a, b)) {
                return true;
            }
            if (this.ud(a, b)) {
                return true;
            }
            return false;
        }
        w5(a, b) {
            super.w5(a, b);
            let c = this.vv.cu.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.vu.a2(this, this.we(), runOn(this, this.vf), this.wn(b), this.wo(b));
            let g = false;
            let h = this.vu.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.by, b.bx, this.yv.ch, f);
                this.w1(e, -1, this.valueColumn.count, this.yv, i, b.q);
            }
            let j = d.ds;
            let k = d.dt;
            let l = d.du;
            let m = d.dv;
            this.vu.ad(j, true, false, true, true);
            this.vu.ad(k, true, false, true, true);
            this.vu.ad(l, false, true, false, false);
            this.vu.ad(m, false, true, false, false);
            l._opacity = this.vu.j * this.hf;
            m._opacity = 0.5 * this.vu.j * this.hf;
            if (b.cy(a)) {
                d.di(a.f.count, e, true, c, this.hj, (n, o, p, q, r) => this.yb(n, a.f.count, b), 1, a.f.count == 1 ? null : this.xe(e, e.count - 1, b.bx, b.by, true));
                b.c1(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.wi;
        }
    }
    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.ua = 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.zy.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
            this.df.zy.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.hk + 3;
            this.dm._stroke = a;
            this.dm.ad = this.e.hk + 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.a9.exportPathData(a, this.dq, "lowerShape", ["Lower"]);
            this.e.a9.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]);
            this.e.a9.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
            this.e.a9.exportPathData(a, this.dn, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.s6 = a;
            this.e.ir = 5;
            this.e.is = 1;
            this.e.it = -3;
        }
    }
    SplineAreaSeriesView.$t = /*@__PURE__*/ markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
