/*
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-react-core/ES2015/type";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
import { Color } from "igniteui-react-core/ES2015/Color";
/**
 * @hidden
 */
export class PolarLineSeriesBase extends PolarBase {
    constructor() {
        super();
        this.os = null;
        this.ou = null;
        this.ot = null;
        this.os = new PathRenderer(1, new DefaultFlattener());
        this.ou = new PathRenderer(0);
    }
    bf() {
        return new PolarLineSeriesBaseView(this);
    }
    im(a) {
        super.im(a);
        this.ov = a;
    }
    ow() {
        return 1;
    }
    get_oz() {
        return false;
    }
    get oz() {
        return this.get_oz();
    }
    get_o1() {
        return false;
    }
    get o1() {
        return this.get_o1();
    }
    n2(a, b) {
        super.n2(a, b);
        a.m.clear();
        let c = b.bs;
        let d = b.br;
        let e = this.nb != null ? this.nb.count : 0;
        let f = this.nc != null ? this.nc.count : 0;
        let g = Math.min(e, f);
        let h = ((() => {
            let $ret = new PolarLinePlanner();
            $ret.m = (i) => this.mz.a.getScaledAngle1(this.nb.item(i), this.mz.e, this.mz.d);
            $ret.q = g;
            $ret.n = (i) => this.mx.lj(this.nc.item(i), this.mz.g, this.mz.f, this.mz.i, this.mz.h);
            $ret.l = this.er;
            $ret.f = this.nh;
            $ret.b = this.ow();
            $ret.o = (i) => this.o2(a, i);
            $ret.p = (i) => this.o3(a, i);
            $ret.ab = d;
            $ret.ac = c;
            $ret.d = this.o1;
            $ret.c = this.oz;
            return $ret;
        })());
        let i = new List$1(Number_$type, 0);
        for (let j = 0; j < g; j++) {
            if (this.o0(j)) {
                i.add(j);
            }
        }
        if (this.o1 && i.count > 0) {
            i.add(i._inner[0]);
        }
        h.x(a.m, i);
    }
    o2(a, b) {
        return a.w._inner[b].x;
    }
    o3(a, b) {
        return a.w._inner[b].y;
    }
    oy() {
        return !this.ox();
    }
    ox() {
        let a = this.bs.mq;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    }
    o0(a) {
        return (this.nb.item(a) >= this.mz.a.jx && this.nb.item(a) <= this.mz.a.jw && this.nc.item(a) >= this.mz.b.jx && this.nc.item(a) <= this.mz.b.jw) || (isNaN_(this.nb.item(a)) || isNaN_(this.nc.item(a)));
    }
    hp(a, b) {
        super.hp(a, b);
        this.o4(b);
    }
    n4(a, b) {
        super.n4(a, b);
        if (this.nh) {
            this.ot = this.os;
        }
        else {
            this.ot = this.ou;
        }
        this.ot.b = this.ow();
        this.o4(b);
        this.o5(a, b);
    }
}
PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
/**
 * @hidden
 */
export class PolarLineSeriesBaseView extends PolarBaseView {
    constructor(a) {
        super(a);
        this.cy = null;
        this.cy = a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k3 = a;
        this.e.es = 3;
        this.e.et = 1;
        this.e.eu = 4;
        this.e.dt = false;
    }
}
PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
