/*
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 { IUnknownValuePlotting_$type } from "igniteui-react-core";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let AreaSeries = /*@__PURE__*/ (() => {
    class AreaSeries extends HorizontalAnchoredCategorySeries {
        bj() {
            return new AreaSeries();
        }
        cs() {
            return new AreaSeriesView(this);
        }
        y2() {
            return 1;
        }
        cy() {
            if (this.cz == 0) {
                return 2;
            }
            return super.cy();
        }
        qz(a) {
            super.qz(a);
            this.acu = a;
        }
        get_ev() {
            return true;
        }
        get_eu() {
            return true;
        }
        constructor() {
            super();
            this.acv = null;
            this.acv = new CategoryLineRasterizer();
            this.ab = AreaSeries.$;
            this.ace = 0;
        }
        preferredCategoryMode(a) {
            return this.ace;
        }
        gw(a, b) {
            let c = this.wa(this.wf(a), true, false);
            if (this.acl(a, c, b)) {
                return true;
            }
            if (this.gv(a, b)) {
                return true;
            }
            if (this.xf(a, b)) {
                return true;
            }
            return false;
        }
        o5(a, b) {
            super.o5(a, b);
            let c = b;
            c.dg();
        }
        aai(a, b) {
            super.aai(a, b);
            let c = b.cw.d;
            let d = typeCast(AreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(d);
            this.y0.a2(this, this.zk(), runOn(this, this.yk), this.zt(b), this.zu(b));
            let g = false;
            let h = this.y0.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.by, b.bx, this.acb.ch, f);
                this.aae(e, -1, this.valueColumn.count, this.acb, i, b.q, -1);
            }
            let j = d.ds;
            let k = d.dt;
            let l = d.du;
            let m = d.dv;
            this.y0.ad(j, true, false, true, true);
            this.y0.ad(k, true, false, true, true);
            this.y0.ad(l, false, true, false, false);
            this.y0.ad(m, false, true, false, false);
            if (b.c0(a)) {
                d.di(e.count, e, true, c, this.id, (n, o, p, q, r) => this.abr(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.aas(e, e.count - 1, b.bx, b.by, true));
                b.c3(a);
            }
            let n = this.fetchYAxis();
            l._opacity = this.y0.j * this.h9;
            m._opacity = 0.5 * this.y0.j * this.h9;
        }
        q7(a, b, c, d) {
            super.q7(a, b, c, d);
            switch (b) {
                case AreaSeries.$$p[0]:
                    this.yx.m = this.unknownValuePlotting == 0;
                    this.rp(false);
                    this.qj();
                    break;
            }
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.p2(a, c, b);
            return c.toArray();
        }
        p2(a, b, c) {
            this.aaa(a, b, c, this.yr, 0);
        }
        get useHighMarkerFidelity() {
            return this.zo;
        }
    }
    AreaSeries.$t = /*@__PURE__*/ markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::acx', [UnknownValuePlotting_$type, /*@__PURE__*/ enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
})();
/**
 * @hidden
 */
export let AreaSeriesView = /*@__PURE__*/ (() => {
    class AreaSeriesView extends AnchoredCategorySeriesView {
        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.w8 = 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.acv.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false;
            this.df.acv.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.ie + 3;
            this.dm._stroke = a;
            this.dm.ad = this.e.ie + 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.bc.exportPathData(a, this.dq, "lowerShape", ["Lower"]);
            this.e.bc.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]);
            this.e.bc.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
            this.e.bc.exportPathData(a, this.dn, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.vz = a;
            this.e.jm = 5;
            this.e.jn = 1;
            this.e.jo = -3;
        }
    }
    AreaSeriesView.$t = /*@__PURE__*/ markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
})();
