/*
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-react-core";
import { List$1 } from "igniteui-react-core";
import { Polyline } from "igniteui-react-core";
import { Polygon } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-react-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.cg = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.o0 = function (a) {
        _super.prototype.o0.call(this, a);
        this.yk = a;
    };
    RangeAreaSeries.prototype.get_d9 = function () {
        return true;
    };
    RangeAreaSeries.prototype.get_d8 = function () {
        return true;
    };
    RangeAreaSeries.prototype.yl = 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.f4 = function (a, b) {
        if (this.f3(a, b)) {
            return true;
        }
        if (this.ud(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.nj = function (a, b) {
        _super.prototype.nj.call(this, a, b);
        var c = b;
        c.c6();
    };
    RangeAreaSeries.prototype.w5 = function (a, b) {
        _super.prototype.w5.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.vu.a2(this, this.we(), runOn(this, this.vf), this.wn(b), this.wo(b));
        var k = false;
        var l = this.vu.b;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.by, b.bx, this.xAxis.ch, j);
            this.w1(d, -1, this.lowColumn.count, this.xAxis, m, b.q);
        }
        var n = i.df;
        var o = i.dg;
        var p = i.da;
        this.vu.ad(n, true, false, true, true);
        this.vu.ad(o, true, false, true, true);
        this.vu.ad(p, false, true, false, false);
        if (b.cy(a)) {
            i.c7(a.f.count, d, false);
            b.c1(a);
        }
        i.da._opacity = this.vu.j * this.hf;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.wi;
        },
        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.c5 = null;
        _this.dd = new Polyline();
        _this.c9 = new Polygon();
        _this.de = new Polyline();
        _this.dc = new Polyline();
        _this.db = new Polyline();
        _this.c8 = new Polygon();
        _this.c5 = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.c5.ua = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "df", {
        get: function () {
            return this.dd;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "da", {
        get: function () {
            return this.c9;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dg", {
        get: function () {
            return this.de;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeriesView.prototype.c6 = function () {
        this.c9.an.clear();
        this.dd.an.clear();
        this.de.an.clear();
    };
    RangeAreaSeriesView.prototype.c7 = function (a, b, c) {
        this.c4(this.dd, this.c9, this.de, a, b, c);
        this.as();
    };
    RangeAreaSeriesView.prototype.be = function () {
        _super.prototype.be.call(this);
        this.db.an = this.dd.an;
        this.dc.an = this.de.an;
        this.c8.an = this.c9.an;
        var a = this.br();
        this.db._stroke = a;
        this.db.ad = this.e.hk + 3;
        this.dc._stroke = a;
        this.dc.ad = this.e.hk + 3;
        this.c8._fill = a;
        this.c8._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a8 = function (a, b) {
        _super.prototype.a8.call(this, a, b);
        if (a.d) {
            if (b) {
                a.u(this.c8);
                a.v(this.db);
                a.v(this.dc);
            }
            else {
                a.u(this.c9);
                a.v(this.dd);
                a.v(this.de);
            }
        }
    };
    RangeAreaSeriesView.prototype.an = function (a) {
        _super.prototype.an.call(this, a);
        this.e.a9.exportPolylineData(a, this.dd, "lowerShape", ["Lower"]);
        this.e.a9.exportPolylineData(a, this.de, "upperShape", ["Upper", "Main"]);
        this.e.a9.exportPolygonData(a, this.c9, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
