/*
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 { __extends } from "tslib";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-angular-core";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var AreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeries, _super);
    function AreaSeries() {
        var _this = _super.call(this) || this;
        _this.vk = null;
        _this.vk = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.u3 = 0;
        return _this;
    }
    AreaSeries.prototype.by = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.r7 = function () {
        return 1;
    };
    AreaSeries.prototype.b4 = function () {
        if (this.b5 == 0) {
            return 2;
        }
        return _super.prototype.b4.call(this);
    };
    AreaSeries.prototype.l4 = function (a) {
        _super.prototype.l4.call(this, a);
        this.vj = a;
    };
    AreaSeries.prototype.get_dg = function () {
        return true;
    };
    AreaSeries.prototype.get_df = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.u3;
    };
    AreaSeries.prototype.ez = function (a, b) {
        var c = this.ps(this.px(a), true, false);
        if (this.va(a, c, b)) {
            return true;
        }
        if (this.ey(a, b)) {
            return true;
        }
        if (this.qo(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.k2 = function (a, b) {
        _super.prototype.k2.call(this, a, b);
        var c = b;
        c.db();
    };
    AreaSeries.prototype.tf = function (a, b) {
        var _this = this;
        _super.prototype.tf.call(this, a, b);
        var c = b.cr.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(d);
        this.r5.a2(this, this.sp(), runOn(this, this.rq), this.sx(b), this.sy(b));
        var g = false;
        var h = this.r5.b;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.bv, b.bu, this.u0.cg, f);
            this.tb(e, -1, this.valueColumn.count, this.u0, i, b.q);
        }
        var j = d.dm;
        var k = d.dn;
        var l = d.dp;
        var m = d.dq;
        this.r5.ad(j, true, false, true, true);
        this.r5.ad(k, true, false, true, true);
        this.r5.ad(l, false, true, false, false);
        this.r5.ad(m, false, true, false, false);
        if (b.cv(a)) {
            d.dd(e.count, e, true, c, this.fx, function (n, o, p, q, r) { return _this.uh(n, a.f.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.to(e, e.count - 1, b.bu, b.bv, true));
            b.cy(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.r5.j * this.fu;
        m._opacity = 0.5 * this.r5.j * this.fu;
    };
    AreaSeries.prototype.l9 = function (a, b, c, d) {
        _super.prototype.l9.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.r2.m = this.unknownValuePlotting == 0;
                this.mn(false);
                this.lu();
                break;
        }
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.ss;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::vm', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
}(HorizontalAnchoredCategorySeries));
export { AreaSeries };
/**
 * @hidden
 */
var AreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeriesView, _super);
    function AreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.da = null;
        _this.di = new Path();
        _this.dk = new Path();
        _this.dj = new Path();
        _this.dl = new Path();
        _this.de = new Path();
        _this.dg = new Path();
        _this.df = new Path();
        _this.dh = new Path();
        _this.da = a;
        return _this;
    }
    AreaSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.da.ql = Defaults.e;
        }
    };
    Object.defineProperty(AreaSeriesView.prototype, "dm", {
        get: function () {
            return this.dk;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dn", {
        get: function () {
            return this.dl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dp", {
        get: function () {
            return this.di;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dq", {
        get: function () {
            return this.dj;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeriesView.prototype.db = function () {
        this.di.an = null;
        this.dj.an = null;
        this.dk.an = null;
        this.dl.an = null;
        this.aq();
    };
    AreaSeriesView.prototype.dc = function (a, b, c, d, e, f, g) {
        this.dd(a, b, c, d, e, f, g, null);
    };
    AreaSeriesView.prototype.dd = function (a, b, c, d, e, f, g, h) {
        this.da.vk.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
        this.da.vk.j(this.di, this.dk, this.dj, this.dl, a, b, c, d, e, f, g, h);
        this.aq();
    };
    AreaSeriesView.prototype.bc = function () {
        _super.prototype.bc.call(this);
        this.de.an = this.di.an;
        this.dg.an = this.dk.an;
        this.df.an = this.dj.an;
        this.dh.an = this.dl.an;
        var a = this.bo();
        this.de._fill = a;
        this.de._opacity = 1;
        this.df._fill = a;
        this.df._opacity = 1;
        this.dg._stroke = a;
        this.dg.ad = this.e.fy + 3;
        this.dh._stroke = a;
        this.dh.ad = this.e.fy + 3;
    };
    AreaSeriesView.prototype.a6 = function (a, b) {
        _super.prototype.a6.call(this, a, b);
        if (b) {
            a.t(this.de);
            a.t(this.df);
            a.t(this.dg);
            a.t(this.dh);
        }
        else {
            a.t(this.di);
            a.t(this.dj);
            a.t(this.dk);
            a.t(this.dl);
        }
    };
    AreaSeriesView.prototype.al = function (a) {
        _super.prototype.al.call(this, a);
        this.e.a9.exportPathData(a, this.dk, "lowerShape", ["Lower"]);
        this.e.a9.exportPathData(a, this.dl, "upperShape", ["Upper", "Main"]);
        this.e.a9.exportPathData(a, this.dj, "translucentShape", ["Translucent"]);
        this.e.a9.exportPathData(a, this.di, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.ph = a;
        this.e.g1 = 5;
        this.e.g2 = 1;
        this.e.g3 = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
