/*
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 { List$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
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.ac9 = null;
        _this.ac9 = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.acs = 0;
        return _this;
    }
    AreaSeries.prototype.bk = function () {
        return new AreaSeries();
    };
    AreaSeries.prototype.ct = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.ze = function () {
        return 1;
    };
    AreaSeries.prototype.cz = function () {
        if (this.c0 == 0) {
            return 2;
        }
        return _super.prototype.cz.call(this);
    };
    AreaSeries.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.ac8 = a;
    };
    AreaSeries.prototype.get_ex = function () {
        return true;
    };
    AreaSeries.prototype.get_ew = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.acs;
    };
    AreaSeries.prototype.gx = function (a, b) {
        var c = this.wm(this.wr(a), true, false);
        if (this.acz(a, c, b)) {
            return true;
        }
        if (this.gw(a, b)) {
            return true;
        }
        if (this.xr(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        var c = b;
        c.du();
    };
    AreaSeries.prototype.aax = function (a, b) {
        var _this = this;
        _super.prototype.aax.call(this, a, b);
        var c = b.c9.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.h;
        var f = this.getEffectiveViewport1(d);
        this.zc.a2(this, this.zw(), runOn(this, this.yw), this.z5(b), this.z6(b));
        var g = false;
        var h = this.zc.b;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.ca, b.b9, this.acp.df, f);
            this.aat(e, -1, this.valueColumn.count, this.acp, i, b.t, -1);
        }
        var j = d.d5;
        var k = d.d6;
        var l = d.d7;
        var m = d.d8;
        this.zc.ad(j, true, false, true, true);
        this.zc.ad(k, true, false, true, true);
        this.zc.ad(l, false, true, false, false);
        this.zc.ad(m, false, true, false, false);
        if (b.dd(a)) {
            d.dw(e.count, e, true, c, this.ie, function (n, o, p, q, r) { return _this.ab5(n, a.h.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.aa6(e, e.count - 1, b.b9, b.ca, true));
            b.dg(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.zc.j * this.ia;
        m._opacity = 0.5 * this.zc.j * this.ia;
    };
    AreaSeries.prototype.rg = function (a, b, c, d) {
        _super.prototype.rg.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.y9.m = this.unknownValuePlotting == 0;
                this.ry(false);
                this.qr();
                break;
        }
    };
    AreaSeries.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.qa(a, c, b);
        return c.toArray();
    };
    AreaSeries.prototype.qa = function (a, b, c) {
        this.aap(a, b, c, this.y3, 0);
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.z0;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::adb', [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.dt = null;
        _this.d1 = new Path();
        _this.d3 = new Path();
        _this.d2 = new Path();
        _this.d4 = new Path();
        _this.dx = new Path();
        _this.dz = new Path();
        _this.dy = new Path();
        _this.d0 = new Path();
        _this.dt = a;
        return _this;
    }
    AreaSeriesView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        if (!this.t) {
            this.dt.xk = Defaults.e;
        }
    };
    Object.defineProperty(AreaSeriesView.prototype, "d5", {
        get: function () {
            return this.d3;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "d6", {
        get: function () {
            return this.d4;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "d7", {
        get: function () {
            return this.d1;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "d8", {
        get: function () {
            return this.d2;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeriesView.prototype.du = function () {
        this.d1.an = null;
        this.d2.an = null;
        this.d3.an = null;
        this.d4.an = null;
        this.a2();
    };
    AreaSeriesView.prototype.dv = function (a, b, c, d, e, f, g) {
        this.dw(a, b, c, d, e, f, g, null);
    };
    AreaSeriesView.prototype.dw = function (a, b, c, d, e, f, g, h) {
        this.dt.ac9.a = typeCast(ISortingAxis_$type, this.db.fetchXAxis()) !== null ? true : false;
        this.dt.ac9.j(this.d1, this.d3, this.d2, this.d4, a, b, c, d, e, f, g, h);
        this.a2();
    };
    AreaSeriesView.prototype.bq = function () {
        _super.prototype.bq.call(this);
        this.dx.an = this.d1.an;
        this.dz.an = this.d3.an;
        this.dy.an = this.d2.an;
        this.d0.an = this.d4.an;
        var a = this.b3();
        this.dx._fill = a;
        this.dx._opacity = 1;
        this.dy._fill = a;
        this.dy._opacity = 1;
        this.dz._stroke = a;
        this.dz.ad = this.f.ig + 3;
        this.d0._stroke = a;
        this.d0.ad = this.f.ig + 3;
    };
    AreaSeriesView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (b) {
            a.t(this.dx);
            a.t(this.dy);
            a.t(this.dz);
            a.t(this.d0);
        }
        else {
            a.t(this.d1);
            a.t(this.d2);
            a.t(this.d3);
            a.t(this.d4);
        }
    };
    AreaSeriesView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        this.f.bc.exportPathData(a, this.d3, "lowerShape", ["Lower"]);
        this.f.bc.exportPathData(a, this.d4, "upperShape", ["Upper", "Main"]);
        this.f.bc.exportPathData(a, this.d2, "translucentShape", ["Translucent"]);
        this.f.bc.exportPathData(a, this.d1, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.an = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.f.wb = a;
        this.f.jq = 5;
        this.f.jr = 1;
        this.f.js = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
