/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Polyline } from "igniteui-react-core/ES5/Polyline";
import { Polygon } from "igniteui-react-core/ES5/Polygon";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-react-core/ES5/number";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
var RangeAreaSeries = /** @class */ (function (_super) {
    tslib_1.__extends(RangeAreaSeries, _super);
    function RangeAreaSeries() {
        var _this = _super.call(this) || this;
        _this.ab = RangeAreaSeries.$;
        return _this;
    }
    RangeAreaSeries.prototype.bf = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.im = function (a) {
        _super.prototype.im.call(this, a);
        this.pc = a;
    };
    RangeAreaSeries.prototype.get_ck = function () {
        return true;
    };
    RangeAreaSeries.prototype.pd = 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.dg = function (a, b) {
        if (this.df(a, b)) {
            return true;
        }
        if (this.lx(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.hp = function (a, b) {
        _super.prototype.hp.call(this, a, b);
        var c = b;
        c.cz();
    };
    RangeAreaSeries.prototype.oh = function (a, b) {
        _super.prototype.oh.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.m7.x(this, this.ns(), this.xAxis, runOn(this, this.mt), this.n0(b), this.n1(b));
        var k = false;
        var l = this.m7.c;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.bs, b.br, this.xAxis.b8, j);
            this.od(d, -1, this.lowColumn.count, this.xAxis, m, b.n);
        }
        var n = i.c7;
        var o = i.c9;
        var p = i.c3;
        this.m7.ae(n, true, false, true, true);
        this.m7.ae(o, true, false, true, true);
        this.m7.ae(p, false, true, false, false);
        if (b.cr(a)) {
            i.c0(a.f.count, d, false);
            b.cu(a);
        }
        i.c3._opacity = this.m7.i * this.d3;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.nv;
        },
        enumerable: true,
        configurable: true
    });
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
}(HorizontalRangeCategorySeries));
export { RangeAreaSeries };
/**
 * @hidden
 */
var RangeAreaSeriesView = /** @class */ (function (_super) {
    tslib_1.__extends(RangeAreaSeriesView, _super);
    function RangeAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.cy = null;
        _this.c6 = new Polyline();
        _this.c2 = new Polygon();
        _this.c8 = new Polyline();
        _this.c5 = new Polyline();
        _this.c4 = new Polyline();
        _this.c1 = new Polygon();
        _this.cy = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "c7", {
        get: function () {
            return this.c6;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c3", {
        get: function () {
            return this.c2;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c9", {
        get: function () {
            return this.c8;
        },
        enumerable: true,
        configurable: true
    });
    RangeAreaSeriesView.prototype.cz = function () {
        this.c2.aj.clear();
        this.c6.aj.clear();
        this.c8.aj.clear();
    };
    RangeAreaSeriesView.prototype.c0 = function (a, b, c) {
        this.cx(this.c6, this.c2, this.c8, a, b, c);
        this.an();
    };
    RangeAreaSeriesView.prototype.a9 = function () {
        _super.prototype.a9.call(this);
        this.c4.aj = this.c6.aj;
        this.c5.aj = this.c8.aj;
        this.c1.aj = this.c2.aj;
        var a = this.bl();
        this.c4._stroke = a;
        this.c4.ac = this.e.ev + 3;
        this.c5._stroke = a;
        this.c5.ac = this.e.ev + 3;
        this.c1._fill = a;
        this.c1._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a3 = function (a, b) {
        _super.prototype.a3.call(this, a, b);
        if (a.d) {
            if (b) {
                a.t(this.c1);
                a.u(this.c4);
                a.u(this.c5);
            }
            else {
                a.t(this.c2);
                a.u(this.c6);
                a.u(this.c8);
            }
        }
    };
    RangeAreaSeriesView.prototype.ai = function (a) {
        _super.prototype.ai.call(this, a);
        this.e.a2.exportPolylineData(a, this.c6, "lowerShape", ["Lower"]);
        this.e.a2.exportPolylineData(a, this.c8, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPolygonData(a, this.c2, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
