/*
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/ES2015/IUnknownValuePlotting";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES2015/UnknownValuePlotting";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { Type, typeCast, runOn, enumGetBox, markType } from "igniteui-react-core/ES2015/type";
import { Path } from "igniteui-react-core/ES2015/Path";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core/ES2015/Color";
export class AreaSeries extends HorizontalAnchoredCategorySeries {
    constructor() {
        super();
        this.p7 = null;
        this.p7 = new CategoryLineRasterizer();
        this.ab = AreaSeries.$;
        this.pq = 0;
    }
    bf() {
        return new AreaSeriesView(this);
    }
    m4() {
        return 1;
    }
    ii(a) {
        super.ii(a);
        this.p6 = a;
    }
    get_cj() {
        return true;
    }
    get cj() {
        return this.get_cj();
    }
    preferredCategoryMode(a) {
        return this.pq;
    }
    de(a, b) {
        let c = this.k9(this.lc(a), true, false);
        if (this.px(a, c, b)) {
            return true;
        }
        if (this.dd(a, b)) {
            return true;
        }
        if (this.ls(a, b)) {
            return true;
        }
        return false;
    }
    hl(a, b) {
        super.hl(a, b);
        let c = b;
        c.c5();
    }
    ob(a, b) {
        super.ob(a, b);
        let c = b.cl.d;
        let d = typeCast(AreaSeriesView.$, b);
        let e = a.f;
        let f = this.getEffectiveViewport1(d);
        this.m2.x(this, this.nn(), this.pn, runOn(this, this.mo), this.nv(b), this.nw(b));
        let g = false;
        let h = this.m2.c;
        if (h != null) {
            g = true;
        }
        if (g) {
            let i = new ScalerParams(0, b.bq, b.bp, this.pn.b8, f);
            this.n7(e, -1, this.valueColumn.count, this.pn, i, b.n);
        }
        let j = d.dc;
        let k = d.dd;
        let l = d.df;
        let m = d.dh;
        this.m2.ae(j, true, false, true, true);
        this.m2.ae(k, true, false, true, true);
        this.m2.ae(l, false, true, false, false);
        this.m2.ae(m, false, true, false, false);
        if (b.cp(a)) {
            d.c7(e.count, e, true, c, this.eo, (n, o, p, q, r) => this.o7(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.om(e, e.count - 1, b.bp, b.bq, true));
            b.cs(a);
        }
        let n = this.fetchYAxis();
        l._opacity = this.m2.i * this.d1;
        m._opacity = 0.5 * this.m2.i * this.d1;
    }
    io(a, b, c, d) {
        super.io(a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.mz.m = this.unknownValuePlotting == 0;
                this.i1(false);
                this.h8();
                break;
        }
    }
    get useHighMarkerFidelity() {
        return this.nq;
    }
}
AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
Type.dep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::p9', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
export class AreaSeriesView extends AnchoredCategorySeriesView {
    constructor(a) {
        super(a);
        this.c4 = null;
        this.de = new Path();
        this.di = new Path();
        this.dg = new Path();
        this.dj = new Path();
        this.c8 = new Path();
        this.da = new Path();
        this.c9 = new Path();
        this.db = new Path();
        this.c4 = a;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 1;
        }
    }
    get dc() {
        return this.di;
    }
    get dd() {
        return this.dj;
    }
    get df() {
        return this.de;
    }
    get dh() {
        return this.dg;
    }
    c5() {
        this.de.aj = null;
        this.dg.aj = null;
        this.di.aj = null;
        this.dj.aj = null;
        this.an();
    }
    c6(a, b, c, d, e, f, g) {
        this.c7(a, b, c, d, e, f, g, null);
    }
    c7(a, b, c, d, e, f, g, h) {
        this.c4.p7.a = typeCast(ISortingAxis_$type, this.cn.fetchXAxis()) !== null ? true : false;
        this.c4.p7.j(this.de, this.di, this.dg, this.dj, a, b, c, d, e, f, g, h);
        this.an();
    }
    a9() {
        super.a9();
        this.c8.aj = this.de.aj;
        this.da.aj = this.di.aj;
        this.c9.aj = this.dg.aj;
        this.db.aj = this.dj.aj;
        let a = this.bk();
        this.c8._fill = a;
        this.c8._opacity = 1;
        this.c9._fill = a;
        this.c9._opacity = 1;
        this.da._stroke = a;
        this.da.ac = this.e.es + 3;
        this.db._stroke = a;
        this.db.ac = this.e.es + 3;
    }
    a3(a, b) {
        super.a3(a, b);
        if (b) {
            a.s(this.c8);
            a.s(this.c9);
            a.s(this.da);
            a.s(this.db);
        }
        else {
            a.s(this.de);
            a.s(this.dg);
            a.s(this.di);
            a.s(this.dj);
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPathData(a, this.di, "lowerShape", ["Lower"]);
        this.e.a2.exportPathData(a, this.dj, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPathData(a, this.dg, "translucentShape", ["Translucent"]);
        this.e.a2.exportPathData(a, this.de, "fillShape", ["Fill"]);
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.ky = a;
        this.e.ep = 5;
        this.e.eq = 1;
        this.e.er = -3;
    }
}
AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
/*<BeginStatics Name="Infragistics.Controls.Charts.AreaSeries" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.AreaSeries" />*/
