/*
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 { PolarBase } from "./PolarBase";
import { PathRenderer } from "./PathRenderer";
import { DefaultFlattener } from "./DefaultFlattener";
import { PolarBaseView } from "./PolarBaseView";
import { Number_$type, Point_$type, markType } from "igniteui-react-core/ES5/type";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { isNaN_ } from "igniteui-react-core/ES5/number";
import { Color } from "igniteui-react-core/ES5/Color";
var PolarLineSeriesBase = /** @class */ (function (_super) {
    tslib_1.__extends(PolarLineSeriesBase, _super);
    function PolarLineSeriesBase() {
        var _this = _super.call(this) || this;
        _this.oq = null;
        _this.os = null;
        _this.or = null;
        _this.oq = new PathRenderer(1, new DefaultFlattener());
        _this.os = new PathRenderer(0);
        return _this;
    }
    PolarLineSeriesBase.prototype.bf = function () {
        return new PolarLineSeriesBaseView(this);
    };
    PolarLineSeriesBase.prototype.il = function (a) {
        _super.prototype.il.call(this, a);
        this.ot = a;
    };
    PolarLineSeriesBase.prototype.ou = function () {
        return 1;
    };
    PolarLineSeriesBase.prototype.get_ox = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "ox", {
        get: function () {
            return this.get_ox();
        },
        enumerable: true,
        configurable: true
    });
    PolarLineSeriesBase.prototype.get_oz = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "oz", {
        get: function () {
            return this.get_oz();
        },
        enumerable: true,
        configurable: true
    });
    PolarLineSeriesBase.prototype.n0 = function (a, b) {
        var _this = this;
        _super.prototype.n0.call(this, a, b);
        a.m.clear();
        var c = b.bs;
        var d = b.br;
        var e = this.m9 != null ? this.m9.count : 0;
        var f = this.na != null ? this.na.count : 0;
        var g = Math.min(e, f);
        var h = ((function () {
            var $ret = new PolarLinePlanner();
            $ret.m = function (i) { return _this.mx.a.getScaledAngle1(_this.m9.item(i), _this.mx.e, _this.mx.d); };
            $ret.q = g;
            $ret.n = function (i) { return _this.mv.lj(_this.na.item(i), _this.mx.g, _this.mx.f, _this.mx.i, _this.mx.h); };
            $ret.l = _this.eq;
            $ret.f = _this.nf;
            $ret.b = _this.ou();
            $ret.o = function (i) { return _this.o0(a, i); };
            $ret.p = function (i) { return _this.o1(a, i); };
            $ret.ab = d;
            $ret.ac = c;
            $ret.d = _this.oz;
            $ret.c = _this.ox;
            return $ret;
        })());
        var i = new List$1(Number_$type, 0);
        for (var j = 0; j < g; j++) {
            if (this.oy(j)) {
                i.add(j);
            }
        }
        if (this.oz && i.count > 0) {
            i.add(i._inner[0]);
        }
        h.x(a.m, i);
    };
    PolarLineSeriesBase.prototype.o0 = function (a, b) {
        return a.w._inner[b].x;
    };
    PolarLineSeriesBase.prototype.o1 = function (a, b) {
        return a.w._inner[b].y;
    };
    PolarLineSeriesBase.prototype.ow = function () {
        return !this.ov();
    };
    PolarLineSeriesBase.prototype.ov = function () {
        var a = this.bs.mn;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    PolarLineSeriesBase.prototype.oy = function (a) {
        return (this.m9.item(a) >= this.mx.a.jx && this.m9.item(a) <= this.mx.a.jw && this.na.item(a) >= this.mx.b.jx && this.na.item(a) <= this.mx.b.jw) || (isNaN_(this.m9.item(a)) || isNaN_(this.na.item(a)));
    };
    PolarLineSeriesBase.prototype.ho = function (a, b) {
        _super.prototype.ho.call(this, a, b);
        this.o2(b);
    };
    PolarLineSeriesBase.prototype.n2 = function (a, b) {
        _super.prototype.n2.call(this, a, b);
        if (this.nf) {
            this.or = this.oq;
        }
        else {
            this.or = this.os;
        }
        this.or.b = this.ou();
        this.o2(b);
        this.o3(a, b);
    };
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
}(PolarBase));
export { PolarLineSeriesBase };
var PolarLineSeriesBaseView = /** @class */ (function (_super) {
    tslib_1.__extends(PolarLineSeriesBaseView, _super);
    function PolarLineSeriesBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.cy = null;
        _this.cy = a;
        return _this;
    }
    PolarLineSeriesBaseView.prototype.ac = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k1 = a;
        this.e.er = 3;
        this.e.es = 1;
        this.e.et = 4;
        this.e.ds = false;
    };
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
}(PolarBaseView));
export { PolarLineSeriesBaseView };
