/*
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 { PolarBase } from "./PolarBase";
import { PathRenderer } from "./PathRenderer";
import { DefaultFlattener } from "./DefaultFlattener";
import { PolarBaseView } from "./PolarBaseView";
import { Number_$type, Point_$type, markType } from "igniteui-angular-core";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var PolarLineSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBase, _super);
    function PolarLineSeriesBase() {
        var _this = _super.call(this) || this;
        _this.va = null;
        _this.vc = null;
        _this.vb = null;
        _this.va = new PathRenderer(1, new DefaultFlattener());
        _this.vc = new PathRenderer(0);
        return _this;
    }
    PolarLineSeriesBase.prototype.get_sx = function () {
        return true;
    };
    PolarLineSeriesBase.prototype.by = function () {
        return new PolarLineSeriesBaseView(this);
    };
    PolarLineSeriesBase.prototype.l4 = function (a) {
        _super.prototype.l4.call(this, a);
        this.vd = a;
    };
    PolarLineSeriesBase.prototype.ve = function () {
        return 1;
    };
    PolarLineSeriesBase.prototype.get_vh = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "vh", {
        get: function () {
            return this.get_vh();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.get_vj = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "vj", {
        get: function () {
            return this.get_vj();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.ua = function (a, b) {
        var _this = this;
        _super.prototype.ua.call(this, a, b);
        a.m.clear();
        var c = b.bv;
        var d = b.bu;
        var e = this.sn != null ? this.sn.count : 0;
        var f = this.so != null ? this.so.count : 0;
        var g = Math.min(e, f);
        var h = ((function () {
            var $ret = new PolarLinePlanner();
            $ret.m = function (i) { return _this.r5.a.getScaledAngle1(_this.sn.item(i), _this.r5.e, _this.r5.d); };
            $ret.q = g;
            $ret.n = function (i) { return _this.r3.nu(_this.so.item(i), _this.r5.g, _this.r5.f, _this.r5.i, _this.r5.h); };
            $ret.l = _this.fx;
            $ret.f = _this.s2;
            $ret.b = _this.ve();
            $ret.o = function (i) { return _this.vk(a, i); };
            $ret.p = function (i) { return _this.vl(a, i); };
            $ret.ab = d;
            $ret.ac = c;
            $ret.d = _this.vj;
            $ret.c = _this.vh;
            return $ret;
        })());
        var i = new List$1(Number_$type, 0);
        for (var j = 0; j < g; j++) {
            if (this.vi(j)) {
                i.add(j);
            }
        }
        if (this.vj && i.count > 0) {
            i.add(i._inner[0]);
        }
        h.x(a.m, i);
    };
    PolarLineSeriesBase.prototype.vk = function (a, b) {
        return a.w._inner[b].x;
    };
    PolarLineSeriesBase.prototype.vl = function (a, b) {
        return a.w._inner[b].y;
    };
    PolarLineSeriesBase.prototype.vg = function () {
        return !this.vf();
    };
    PolarLineSeriesBase.prototype.vf = function () {
        var a = this.ce.ta;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    PolarLineSeriesBase.prototype.vi = function (a) {
        return (this.sn.item(a) >= this.r5.a.lw && this.sn.item(a) <= this.r5.a.lv && this.so.item(a) >= this.r5.b.lw && this.so.item(a) <= this.r5.b.lv) || (isNaN_(this.sn.item(a)) || isNaN_(this.so.item(a)));
    };
    PolarLineSeriesBase.prototype.k2 = function (a, b) {
        _super.prototype.k2.call(this, a, b);
        this.vm(b);
    };
    PolarLineSeriesBase.prototype.ue = function (a, b) {
        _super.prototype.ue.call(this, a, b);
        if (this.s2) {
            this.vb = this.va;
        }
        else {
            this.vb = this.vc;
        }
        this.vb.b = this.ve();
        this.vm(b);
        this.vn(a, b);
    };
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
}(PolarBase));
export { PolarLineSeriesBase };
/**
 * @hidden
 */
var PolarLineSeriesBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBaseView, _super);
    function PolarLineSeriesBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.c3 = null;
        _this.c3 = a;
        return _this;
    }
    PolarLineSeriesBaseView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.ph = a;
        this.e.g1 = 3;
        this.e.g2 = 1;
        this.e.g3 = 4;
        this.e.fb = false;
    };
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
}(PolarBaseView));
export { PolarLineSeriesBaseView };
