/*
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/ES2015/type";
import { Path } from "igniteui-react-core/ES2015/Path";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { ISortingAxis_$type } from "./ISortingAxis";
/**
 * @hidden
 */
export class SplineSeries extends SplineSeriesBase {
    constructor() {
        super();
        this.qk = null;
        this.qk = new CategoryLineRasterizer();
        this.ab = SplineSeries.$;
    }
    bf() {
        return new SplineSeriesView(this);
    }
    im(a) {
        super.im(a);
        this.ql = a;
    }
    preferredCategoryMode(a) {
        return 0;
    }
    hp(a, b) {
        super.hp(a, b);
        let c = b;
        c.c8();
    }
    oh(a, b) {
        super.oh(a, b);
        let c = b;
        let d = c.cn.d;
        let e = typeCast(SplineSeriesView.$, b);
        let f = a.f;
        let g = this.getEffectiveViewport1(b);
        this.m7.x(this, this.ns(), this.pr, runOn(this, this.mt), this.n0(b), this.n1(b));
        let h = false;
        let i = this.m7.c;
        if (i != null) {
            h = true;
        }
        if (h) {
            let j = new ScalerParams(0, b.bs, b.br, this.pr.b8, g);
            this.od(f, -1, this.valueColumn.count, this.pr, j, b.n);
        }
        let k = e.de;
        let l = e.df;
        let m = e.dd;
        this.m7.ae(k, true, false, true, false);
        this.m7.ae(l, true, false, true, false);
        this.m7.ae(m, false, true, false, false);
        m._opacity = 0.75 * this.m7.i;
        if (b.cr(a)) {
            e.c9(f.count, f, true, 1, this.op(f, f.count - 1, b.br, b.bs), d, this.er);
            b.cu(a);
        }
    }
    get useHighMarkerFidelity() {
        return this.nv;
    }
}
SplineSeries.$t = markType(SplineSeries, 'SplineSeries', SplineSeriesBase.$);
/**
 * @hidden
 */
export class SplineSeriesView extends SplineSeriesBaseView {
    constructor(a) {
        super(a);
        this.c7 = null;
        this.dh = new Path();
        this.dg = new Path();
        this.di = new Path();
        this.dc = new Path();
        this.db = new Path();
        this.da = new Path();
        this.c7 = a;
    }
    get de() {
        return this.dh;
    }
    get df() {
        return this.di;
    }
    get dd() {
        return this.dg;
    }
    c8() {
        this.dg.aj = null;
        this.dh.aj = null;
        this.di.aj = null;
        this.an();
    }
    c9(a, b, c, d, e, f, g) {
        this.c7.qk.a = typeCast(ISortingAxis_$type, this.cp.fetchXAxis()) !== null ? true : false;
        this.c7.qk.m(this.dh, this.dg, this.di, a, b, c, d, e, f, g);
        this.an();
    }
    a9() {
        super.a9();
        this.db.aj = this.dh.aj;
        this.dc.aj = this.di.aj;
        this.da.aj = this.dg.aj;
        let a = this.bl();
        this.db._stroke = a;
        this.db.ac = this.e.ev + 3;
        this.dc._stroke = a;
        this.dc.ac = this.e.ev + 3;
        this.da._fill = a;
        this.da._opacity = 1;
    }
    a3(a, b) {
        super.a3(a, b);
        if (a.d) {
            if (b) {
                a.s(this.da);
                a.s(this.db);
                a.s(this.dc);
            }
            else {
                a.s(this.dg);
                a.s(this.dh);
                a.s(this.di);
            }
        }
    }
    ai(a) {
        super.ai(a);
        this.e.a2.exportPathData(a, this.dh, "lowerShape", ["Lower", "Main"]);
        this.e.a2.exportPathData(a, this.di, "upperShape", ["Upper"]);
        this.e.a2.exportPathData(a, this.dg, "translucentShape", ["Translucent"]);
    }
}
SplineSeriesView.$t = markType(SplineSeriesView, 'SplineSeriesView', SplineSeriesBaseView.$);
