/*
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 { 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
 */
export let PolarLineSeriesBase = /*@__PURE__*/ (() => {
    class PolarLineSeriesBase extends PolarBase {
        constructor() {
            super();
            this.va = null;
            this.vc = null;
            this.vb = null;
            this.va = new PathRenderer(1, new DefaultFlattener());
            this.vc = new PathRenderer(0);
        }
        get_sx() {
            return true;
        }
        by() {
            return new PolarLineSeriesBaseView(this);
        }
        l4(a) {
            super.l4(a);
            this.vd = a;
        }
        ve() {
            return 1;
        }
        get_vh() {
            return false;
        }
        get vh() {
            return this.get_vh();
        }
        get_vj() {
            return false;
        }
        get vj() {
            return this.get_vj();
        }
        ua(a, b) {
            super.ua(a, b);
            a.m.clear();
            let c = b.bv;
            let d = b.bu;
            let e = this.sn != null ? this.sn.count : 0;
            let f = this.so != null ? this.so.count : 0;
            let g = Math.min(e, f);
            let h = ((() => {
                let $ret = new PolarLinePlanner();
                $ret.m = (i) => this.r5.a.getScaledAngle1(this.sn.item(i), this.r5.e, this.r5.d);
                $ret.q = g;
                $ret.n = (i) => 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 = (i) => this.vk(a, i);
                $ret.p = (i) => this.vl(a, i);
                $ret.ab = d;
                $ret.ac = c;
                $ret.d = this.vj;
                $ret.c = this.vh;
                return $ret;
            })());
            let i = new List$1(Number_$type, 0);
            for (let 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);
        }
        vk(a, b) {
            return a.w._inner[b].x;
        }
        vl(a, b) {
            return a.w._inner[b].y;
        }
        vg() {
            return !this.vf();
        }
        vf() {
            let a = this.ce.ta;
            return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
        }
        vi(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)));
        }
        k2(a, b) {
            super.k2(a, b);
            this.vm(b);
        }
        ue(a, b) {
            super.ue(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;
})();
/**
 * @hidden
 */
export let PolarLineSeriesBaseView = /*@__PURE__*/ (() => {
    class PolarLineSeriesBaseView extends PolarBaseView {
        constructor(a) {
            super(a);
            this.c3 = null;
            this.c3 = a;
        }
        af() {
            let 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;
})();
