/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Polyline } from "igniteui-angular-core";
import { Polygon } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-angular-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
var RangeAreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeries, _super);
    function RangeAreaSeries() {
        var _this = _super.call(this) || this;
        _this.ab = RangeAreaSeries.$;
        return _this;
    }
    RangeAreaSeries.prototype.bx = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.ly = function (a) {
        _super.prototype.ly.call(this, a);
        this.ud = a;
    };
    RangeAreaSeries.prototype.get_de = function () {
        return true;
    };
    RangeAreaSeries.prototype.get_dd = function () {
        return true;
    };
    RangeAreaSeries.prototype.ue = function (a, b, c, d) {
        if (isNaN_(b.x) || isNaN_(b.y)) {
            return false;
        }
        if (isNaN_(c.x) || isNaN_(c.y)) {
            return false;
        }
        if ((a.y <= b.y && a.y >= c.y)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.ev = function (a, b) {
        if (this.eu(a, b)) {
            return true;
        }
        if (this.qf(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.kx = function (a, b) {
        _super.prototype.kx.call(this, a, b);
        var c = b;
        c.c3();
    };
    RangeAreaSeries.prototype.s6 = function (a, b) {
        _super.prototype.s6.call(this, a, b);
        var c = a.f.count;
        var d = new List$1(Array_$type, 2, c);
        for (var e = 0; e < c; e++) {
            var f = a.f._inner[e];
            var g = new Array(4);
            g[0] = f[0];
            g[1] = f[1];
            var h = a.f._inner[a.f.count - 1 - e];
            g[2] = h[0];
            g[3] = h[2];
            d.add(g);
        }
        var i = typeCast(RangeAreaSeriesView.$, b);
        var j = this.getEffectiveViewport1(i);
        this.rw.a0(this, this.sg(), runOn(this, this.rh), this.so(b), this.sp(b));
        var k = false;
        var l = this.rw.b;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.bv, b.bu, this.xAxis.cg, j);
            this.s2(d, -1, this.lowColumn.count, this.xAxis, m, b.q);
        }
        var n = i.dc;
        var o = i.dd;
        var p = i.c7;
        this.rw.ad(n, true, false, true, true);
        this.rw.ad(o, true, false, true, true);
        this.rw.ad(p, false, true, false, false);
        if (b.cv(a)) {
            i.c4(a.f.count, d, false);
            b.cy(a);
        }
        i.c7._opacity = this.rw.j * this.fq;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.sj;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
}(HorizontalRangeCategorySeries));
export { RangeAreaSeries };
/**
 * @hidden
 */
var RangeAreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeriesView, _super);
    function RangeAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c2 = null;
        _this.da = new Polyline();
        _this.c6 = new Polygon();
        _this.db = new Polyline();
        _this.c9 = new Polyline();
        _this.c8 = new Polyline();
        _this.c5 = new Polygon();
        _this.c2 = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.c2.qc = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "dc", {
        get: function () {
            return this.da;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c7", {
        get: function () {
            return this.c6;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dd", {
        get: function () {
            return this.db;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeriesView.prototype.c3 = function () {
        this.c6.ak.clear();
        this.da.ak.clear();
        this.db.ak.clear();
    };
    RangeAreaSeriesView.prototype.c4 = function (a, b, c) {
        this.c1(this.da, this.c6, this.db, a, b, c);
        this.aq();
    };
    RangeAreaSeriesView.prototype.bc = function () {
        _super.prototype.bc.call(this);
        this.c8.ak = this.da.ak;
        this.c9.ak = this.db.ak;
        this.c5.ak = this.c6.ak;
        var a = this.bo();
        this.c8._stroke = a;
        this.c8.ac = this.e.fu + 3;
        this.c9._stroke = a;
        this.c9.ac = this.e.fu + 3;
        this.c5._fill = a;
        this.c5._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a6 = function (a, b) {
        _super.prototype.a6.call(this, a, b);
        if (a.d) {
            if (b) {
                a.t(this.c5);
                a.u(this.c8);
                a.u(this.c9);
            }
            else {
                a.t(this.c6);
                a.u(this.da);
                a.u(this.db);
            }
        }
    };
    RangeAreaSeriesView.prototype.al = function (a) {
        _super.prototype.al.call(this, a);
        this.e.a8.exportPolylineData(a, this.da, "lowerShape", ["Lower"]);
        this.e.a8.exportPolylineData(a, this.db, "upperShape", ["Upper", "Main"]);
        this.e.a8.exportPolygonData(a, this.c6, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
