/*
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 {
        bi() {
            return new SplineAreaSeries();
        }
        get_es() {
            return true;
        }
        get_fy() {
            return true;
        }
        cq() {
            return new SplineAreaSeriesView(this);
        }
        yv() {
            return 1;
        }
        qx(a) {
            super.qx(a);
            this.acy = a;
        }
        constructor() {
            super();
            this.acx = null;
            this.acx = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        cw() {
            if (this.cx == 0) {
                return 2;
            }
            return super.cw();
        }
        o3(a, b) {
            super.o3(a, b);
            let c = b;
            c.di();
        }
        gu(a, b) {
            let c = this.v6(this.wb(a), true, false);
            if (this.ab4(a, c, b)) {
                return true;
            }
            if (this.gt(a, b)) {
                return true;
            }
            if (this.w9(a, b)) {
                return true;
            }
            return false;
        }
        z4(a, b) {
            super.z4(a, b);
            let c = this.yu.cw.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.yt.a2(this, this.zd(), runOn(this, this.ye), this.zm(b), this.zn(b));
            let g = false;
            let h = this.yt.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.by, b.bx, this.abu.ch, f);
                this.z0(e, -1, this.valueColumn.count, this.abu, i, b.q, -1);
            }
            let j = d.du;
            let k = d.dv;
            let l = d.dw;
            let m = d.dx;
            this.yt.ad(j, true, false, true, true);
            this.yt.ad(k, true, false, true, true);
            this.yt.ad(l, false, true, false, false);
            this.yt.ad(m, false, true, false, false);
            l._opacity = this.yt.j * this.h7;
            m._opacity = 0.5 * this.yt.j * this.h7;
            if (b.c0(a)) {
                d.dk(a.f.count, e, true, c, this.ib, (n, o, p, q, r) => this.aba(n, a.f.count, b), 1, a.f.count == 1 ? null : this.aad(e, e.count - 1, b.bx, b.by, true));
                b.c3(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.zh;
        }
    }
    SplineAreaSeries.$t = /*@__PURE__*/ markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
})();
/**
 * @hidden
 */
export let SplineAreaSeriesView = /*@__PURE__*/ (() => {
    class SplineAreaSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dh = null;
            this.dq = new Path();
            this.ds = new Path();
            this.dr = new Path();
            this.dt = new Path();
            this.dl = new Path();
            this.dn = new Path();
            this.dm = new Path();
            this.dp = new Path();
            this.dh = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.dh.w2 = Defaults.e;
            }
        }
        get du() {
            return this.ds;
        }
        get dv() {
            return this.dt;
        }
        get dw() {
            return this.dq;
        }
        get dx() {
            return this.dr;
        }
        di() {
            this.dq.an = null;
            this.dr.an = null;
            this.ds.an = null;
            this.dt.an = null;
            this.as();
        }
        dj(a, b, c, d, e, f, g) {
            this.dk(a, b, c, d, e, f, g, null);
        }
        dk(a, b, c, d, e, f, g, h) {
            this.dh.acx.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false;
            this.dh.acx.j(this.dq, this.ds, this.dr, this.dt, a, b, c, d, e, f, g, h);
            this.as();
        }
        be() {
            super.be();
            this.dl.an = this.dq.an;
            this.dn.an = this.ds.an;
            this.dm.an = this.dr.an;
            this.dp.an = this.dt.an;
            let a = this.br();
            this.dl._fill = a;
            this.dl._opacity = 1;
            this.dm._fill = a;
            this.dm._opacity = 1;
            this.dn._stroke = a;
            this.dn.ad = this.e.ic + 3;
            this.dp._stroke = a;
            this.dp.ad = this.e.ic + 3;
        }
        a8(a, b) {
            super.a8(a, b);
            if (b) {
                a.t(this.dl);
                a.t(this.dm);
                a.t(this.dn);
                a.t(this.dp);
            }
            else {
                a.t(this.dq);
                a.t(this.dr);
                a.t(this.ds);
                a.t(this.dt);
            }
        }
        an(a) {
            super.an(a);
            this.e.bb.exportPathData(a, this.ds, "lowerShape", ["Lower"]);
            this.e.bb.exportPathData(a, this.dt, "upperShape", ["Upper", "Main"]);
            this.e.bb.exportPathData(a, this.dr, "translucentShape", ["Translucent"]);
            this.e.bb.exportPathData(a, this.dq, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.vv = a;
            this.e.jk = 5;
            this.e.jl = 1;
            this.e.jm = -3;
        }
    }
    SplineAreaSeriesView.$t = /*@__PURE__*/ markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
