/*
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 { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
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 {
        cg() {
            return new AreaSeriesView(this);
        }
        vw() {
            return 1;
        }
        cm() {
            if (this.cn == 0) {
                return 2;
            }
            return super.cm();
        }
        o0(a) {
            super.o0(a);
            this.ze = a;
        }
        get_d9() {
            return true;
        }
        get_d8() {
            return true;
        }
        constructor() {
            super();
            this.zf = null;
            this.zf = new CategoryLineRasterizer();
            this.ab = AreaSeries.$;
            this.yy = 0;
        }
        preferredCategoryMode(a) {
            return this.yy;
        }
        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;
        }
        nj(a, b) {
            super.nj(a, b);
            let c = b;
            c.de();
        }
        w5(a, b) {
            super.w5(a, b);
            let c = b.cu.d;
            let d = typeCast(AreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(d);
            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.dq;
            let k = d.dr;
            let l = d.ds;
            let m = d.dt;
            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);
            if (b.cy(a)) {
                d.dg(e.count, e, true, c, this.hj, (n, o, p, q, r) => this.yb(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.xe(e, e.count - 1, b.bx, b.by, true));
                b.c1(a);
            }
            let n = this.fetchYAxis();
            l._opacity = this.vu.j * this.hf;
            m._opacity = 0.5 * this.vu.j * this.hf;
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case AreaSeries.$$p[0]:
                    this.vr.m = this.unknownValuePlotting == 0;
                    this.pp(false);
                    this.ol();
                    break;
            }
        }
        get useHighMarkerFidelity() {
            return this.wi;
        }
    }
    AreaSeries.$t = /*@__PURE__*/ markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::zh', [UnknownValuePlotting_$type, /*@__PURE__*/ enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
})();
/**
 * @hidden
 */
export let AreaSeriesView = /*@__PURE__*/ (() => {
    class AreaSeriesView extends AnchoredCategorySeriesView {
        constructor(a) {
            super(a);
            this.dd = null;
            this.dl = new Path();
            this.dn = new Path();
            this.dm = new Path();
            this.dp = new Path();
            this.dh = new Path();
            this.dj = new Path();
            this.di = new Path();
            this.dk = new Path();
            this.dd = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.dd.ua = Defaults.e;
            }
        }
        get dq() {
            return this.dn;
        }
        get dr() {
            return this.dp;
        }
        get ds() {
            return this.dl;
        }
        get dt() {
            return this.dm;
        }
        de() {
            this.dl.an = null;
            this.dm.an = null;
            this.dn.an = null;
            this.dp.an = null;
            this.as();
        }
        df(a, b, c, d, e, f, g) {
            this.dg(a, b, c, d, e, f, g, null);
        }
        dg(a, b, c, d, e, f, g, h) {
            this.dd.zf.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
            this.dd.zf.j(this.dl, this.dn, this.dm, this.dp, a, b, c, d, e, f, g, h);
            this.as();
        }
        be() {
            super.be();
            this.dh.an = this.dl.an;
            this.dj.an = this.dn.an;
            this.di.an = this.dm.an;
            this.dk.an = this.dp.an;
            let a = this.br();
            this.dh._fill = a;
            this.dh._opacity = 1;
            this.di._fill = a;
            this.di._opacity = 1;
            this.dj._stroke = a;
            this.dj.ad = this.e.hk + 3;
            this.dk._stroke = a;
            this.dk.ad = this.e.hk + 3;
        }
        a8(a, b) {
            super.a8(a, b);
            if (b) {
                a.t(this.dh);
                a.t(this.di);
                a.t(this.dj);
                a.t(this.dk);
            }
            else {
                a.t(this.dl);
                a.t(this.dm);
                a.t(this.dn);
                a.t(this.dp);
            }
        }
        an(a) {
            super.an(a);
            this.e.a9.exportPathData(a, this.dn, "lowerShape", ["Lower"]);
            this.e.a9.exportPathData(a, this.dp, "upperShape", ["Upper", "Main"]);
            this.e.a9.exportPathData(a, this.dm, "translucentShape", ["Translucent"]);
            this.e.a9.exportPathData(a, this.dl, "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;
        }
    }
    AreaSeriesView.$t = /*@__PURE__*/ markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
})();
