/*
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 * as tslib_1 from "tslib";
import { SplineSeriesBase } from "./SplineSeriesBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, runOn, markType } from "igniteui-react-core/ES5/type";
import { Path } from "igniteui-react-core/ES5/Path";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core/ES5/Color";
var SplineAreaSeries = /** @class */ (function (_super) {
    tslib_1.__extends(SplineAreaSeries, _super);
    function SplineAreaSeries() {
        var _this = _super.call(this) || this;
        _this.qg = null;
        _this.qg = new CategoryLineRasterizer();
        _this.ab = SplineAreaSeries.$;
        return _this;
    }
    SplineAreaSeries.prototype.bf = function () {
        return new SplineAreaSeriesView(this);
    };
    SplineAreaSeries.prototype.m4 = function () {
        return 1;
    };
    SplineAreaSeries.prototype.ii = function (a) {
        _super.prototype.ii.call(this, a);
        this.qh = a;
    };
    SplineAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    SplineAreaSeries.prototype.hl = function (a, b) {
        _super.prototype.hl.call(this, a, b);
        var c = b;
        c.c6();
    };
    SplineAreaSeries.prototype.de = function (a, b) {
        var 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;
    };
    SplineAreaSeries.prototype.ob = function (a, b) {
        var _this = this;
        _super.prototype.ob.call(this, a, b);
        var c = this.m3.cl.d;
        var d = typeCast(SplineAreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(b);
        this.m2.x(this, this.nn(), this.pn, runOn(this, this.mo), this.nv(b), this.nw(b));
        var g = false;
        var h = this.m2.c;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.bq, b.bp, this.pn.b8, f);
            this.n7(e, -1, this.valueColumn.count, this.pn, i, b.n);
        }
        var j = d.dd;
        var k = d.de;
        var l = d.dg;
        var m = d.di;
        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);
        l._opacity = this.m2.i * this.d1;
        m._opacity = 0.5 * this.m2.i * this.d1;
        if (b.cp(a)) {
            d.c8(a.f.count, e, true, c, this.eo, function (n, o, p, q, r) { return _this.o7(n, a.f.count, b); }, 1, a.f.count == 1 ? null : this.om(e, e.count - 1, b.bp, b.bq, true));
            b.cs(a);
        }
        var n = this.fetchYAxis();
    };
    Object.defineProperty(SplineAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.nq;
        },
        enumerable: true,
        configurable: true
    });
    SplineAreaSeries.$t = markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
}(SplineSeriesBase));
export { SplineAreaSeries };
var SplineAreaSeriesView = /** @class */ (function (_super) {
    tslib_1.__extends(SplineAreaSeriesView, _super);
    function SplineAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c5 = null;
        _this.df = new Path();
        _this.dj = new Path();
        _this.dh = new Path();
        _this.dk = new Path();
        _this.c9 = new Path();
        _this.db = new Path();
        _this.da = new Path();
        _this.dc = new Path();
        _this.c5 = a;
        return _this;
    }
    SplineAreaSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 1;
        }
    };
    Object.defineProperty(SplineAreaSeriesView.prototype, "dd", {
        get: function () {
            return this.dj;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SplineAreaSeriesView.prototype, "de", {
        get: function () {
            return this.dk;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SplineAreaSeriesView.prototype, "dg", {
        get: function () {
            return this.df;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SplineAreaSeriesView.prototype, "di", {
        get: function () {
            return this.dh;
        },
        enumerable: true,
        configurable: true
    });
    SplineAreaSeriesView.prototype.c6 = function () {
        this.df.aj = null;
        this.dh.aj = null;
        this.dj.aj = null;
        this.dk.aj = null;
        this.an();
    };
    SplineAreaSeriesView.prototype.c7 = function (a, b, c, d, e, f, g) {
        this.c8(a, b, c, d, e, f, g, null);
    };
    SplineAreaSeriesView.prototype.c8 = function (a, b, c, d, e, f, g, h) {
        this.c5.qg.a = typeCast(ISortingAxis_$type, this.cn.fetchXAxis()) !== null ? true : false;
        this.c5.qg.j(this.df, this.dj, this.dh, this.dk, a, b, c, d, e, f, g, h);
        this.an();
    };
    SplineAreaSeriesView.prototype.a9 = function () {
        _super.prototype.a9.call(this);
        this.c9.aj = this.df.aj;
        this.db.aj = this.dj.aj;
        this.da.aj = this.dh.aj;
        this.dc.aj = this.dk.aj;
        var a = this.bk();
        this.c9._fill = a;
        this.c9._opacity = 1;
        this.da._fill = a;
        this.da._opacity = 1;
        this.db._stroke = a;
        this.db.ac = this.e.es + 3;
        this.dc._stroke = a;
        this.dc.ac = this.e.es + 3;
    };
    SplineAreaSeriesView.prototype.a3 = function (a, b) {
        _super.prototype.a3.call(this, a, b);
        if (b) {
            a.s(this.c9);
            a.s(this.da);
            a.s(this.db);
            a.s(this.dc);
        }
        else {
            a.s(this.df);
            a.s(this.dh);
            a.s(this.dj);
            a.s(this.dk);
        }
    };
    SplineAreaSeriesView.prototype.ai = function (a) {
        _super.prototype.ai.call(this, a);
        this.e.a2.exportPathData(a, this.dj, "lowerShape", ["Lower"]);
        this.e.a2.exportPathData(a, this.dk, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPathData(a, this.dh, "translucentShape", ["Translucent"]);
        this.e.a2.exportPathData(a, this.df, "fillShape", ["Fill"]);
    };
    SplineAreaSeriesView.prototype.ac = function () {
        var 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;
    };
    SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
}(SplineSeriesBaseView));
export { SplineAreaSeriesView };
