/*
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 { Base, markType, enumGetBox, EnumUtil, Array_$type, runOn, delegateCombine, typeCast, fromEnum, markDep } from "igniteui-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { NotImplementedException } from "igniteui-react-core";
import { CategoryAngleAxis } from "./CategoryAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { truncate, intDivide, isNaN_ } from "igniteui-react-core";
import { MarkerSeries } from "./MarkerSeries";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { DependencyProperty } from "igniteui-react-core";
import { RadialLabelMode_$type } from "igniteui-react-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { HighlightingInfo } from "igniteui-react-core";
import { BindingFormatter } from "igniteui-react-core";
import { OthersCategoryContext } from "./OthersCategoryContext";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { RadialFrame } from "./RadialFrame";
import { RadialSeriesRenderManager } from "./RadialSeriesRenderManager";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { ProportionalRadialLabelContext } from "./ProportionalRadialLabelContext";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { DoubleCollection } from "igniteui-react-core";
import { RadialAxes } from "./RadialAxes";
import { Visibility_$type } from "igniteui-react-core";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-react-core";
import { round10N } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
/**
 * @hidden
 */
export let RadialBucketCalculator = /*@__PURE__*/ (() => {
    class RadialBucketCalculator extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.c = 0;
            this.d = 0;
            this.b = 0;
            this.a = a;
        }
        getBucket(a) {
            throw new NotImplementedException(0);
        }
        getBucketWithoutUnknowns(a) {
            return this.getBucket(a);
        }
        getErrorBucket(a, b) {
            return NaN;
        }
        getBucketInfo(a, b, c, d) {
            a = this.c;
            b = this.d;
            c = this.b;
            d = this.a.cw.id;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.by;
            let c = this.a.bx;
            let d = this.a.getEffectiveViewport();
            let e = this.a.cw.yx;
            if (b.isEmpty || c.isEmpty || e == null || this.a.cw.dn == null || this.a.cw.dn.count == 0) {
                this.b = 0;
                return;
            }
            let f = Math.floor(e.m9(c, d, b));
            let g = Math.ceil(e.m8(c, d, b));
            if (e.ch) {
                g = Math.ceil(e.m9(c, d, b));
                f = Math.floor(e.m8(c, d, b));
            }
            if (g < f) {
                g = e.lj + g;
            }
            let h = this.a.cw.y3;
            let i = h != null ? h.n7 : 0.75;
            let j = Math.min(c.width, c.height) * 0.5 * (i) * 2 * Math.PI;
            let k = Math.floor((g - f + 1) * a / j);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.max(0, Math.floor(f / this.b) - 1));
            this.d = truncate(Math.ceil(g / this.b));
            if (e.cl) {
                this.b = 1;
                this.c = truncate(Math.max(0, Math.floor(f / this.b) - 1));
                this.d = truncate(Math.ceil(g / this.b));
            }
        }
        cacheValues() {
        }
        unCacheValues() {
        }
    }
    RadialBucketCalculator.$t = /*@__PURE__*/ markType(RadialBucketCalculator, 'RadialBucketCalculator', Base.$, [IBucketizer_$type]);
    return RadialBucketCalculator;
})();
/**
 * @hidden
 */
export let RadialBase = /*@__PURE__*/ (() => {
    class RadialBase extends MarkerSeries {
        qz(a) {
            super.qz(a);
            this.y7 = a;
        }
        constructor() {
            super();
            this.ze = null;
            this.zl = false;
            this.zk = false;
            this.zi = null;
            this.zj = null;
            this.assigningRadialStyle = null;
            this.assigningRadialMarkerStyle = null;
            this.yq = null;
            this.yu = null;
            this.yr = null;
            this.yt = null;
            this.ys = null;
            this.y4 = new OthersCategoryContext();
            this.za = new RadialFrame(4);
            this.zb = new RadialFrame(4);
            this.y8 = new RadialFrame(4);
            this.y6 = null;
            this.y2 = null;
            this.y2 = new CategoryTransitionSourceFramePreparer();
            this.ze = new RadialSeriesRenderManager();
        }
        aa6() {
            if (this.dc.g) {
                this.dc.t();
            }
        }
        get categoryAxis() {
            return this.yx;
        }
        a0() {
            return this.yx;
        }
        yl(a, b) {
            return null;
        }
        pr(a) {
            if (a == this.y5) {
                if (this.fi) {
                    this.ba.a$x(this, a, this.yx.lk - 1);
                }
                return;
            }
            super.pr(a);
        }
        ee(a) {
            if (a == this.y5 && this.yx != null && this.yx.cl && this.yx.hasOthersCategory) {
                return true;
            }
            return super.ee(a);
        }
        pp(a) {
            if (a == this.y5) {
                if (this.fi) {
                    this.ba.a$an(this, a, this.dn.count - 1);
                }
                return;
            }
            super.pp(a);
        }
        eb(a, b, c, d, e) {
            if (!this.hasMarkers) {
                return false;
            }
            let f = this.yx;
            let g = new ScalerParams(1, this.db.v4, this.wq, f.ch);
            g.c = this.getEffectiveViewport1(this.cv);
            let h = this.y3;
            let i = new ScalerParams(1, this.db.v4, this.wq, h.ch);
            i.c = this.getEffectiveViewport1(this.cv);
            let j = this.z3;
            a.clear();
            this.w4.cj((k) => {
                if (k._visibility == 0) {
                    let l = new SeriesPointOfInterest();
                    let m = k.n;
                    let n = k.o;
                    if (m < this.wq.left || m > this.wq.right || n < this.wq.top || n > this.wq.bottom) {
                        return;
                    }
                    let o = null;
                    if (k.content != null) {
                        o = k.content.item;
                    }
                    let p;
                    let q;
                    let r = this.y6.h(m, n, this.cv.by, this.cv.bx, this.cv.getEffectiveViewport(), p, q);
                    p = r.p5;
                    q = r.p6;
                    l.d = p;
                    l.e = q;
                    let s = l.e;
                    let t = k.ak;
                    l.f = this.aa3(s, o, t, d, j, c, b, false);
                    l.b = k.content;
                    l.g = this.ve;
                    l.c = k.ak;
                    if (this.g9) {
                        l.g = this.vl(k.ak);
                    }
                    l.a = this.ar(k.ak, k.al);
                    a.add(l);
                }
            });
            return true;
        }
        ks(a, b) {
            let c = null;
            if (this.dn != null) {
                if (a >= 0 && a < this.dn.count) {
                    c = this.dn.item(a);
                }
                if (this.yx != null && this.yx.cl && a == this.yx.othersIndex) {
                    c = this.y5;
                }
            }
            let d = NaN;
            if (c != null) {
                d = this.jc(c);
            }
            let e = this.aa3(d, c, a, this.z2 >= 0 ? this.z2 : 5, this.z3, false, false, b);
            if (e != null) {
                return e;
            }
            return super.ks(a, b);
        }
        aa3(a, b, c, d, e, f, g, h) {
            let i = null;
            let j = (b == this.y5);
            let k = this.zc;
            if (h) {
                k = this.zd;
            }
            if (k == 0) {
                if (h) {
                    k = 5;
                }
                else {
                    k = 6;
                }
            }
            if ((h && ((this.yr != null) || (j && this.ys != null))) || (!h && ((this.yu != null) || (j && this.yt != null)))) {
                let l = this.zz(a, b, c, d, f);
                let m = this.z0(a, b, c, e, f);
                let n = this.aak(c);
                let o = ((() => {
                    let $ret = new ProportionalRadialLabelContext();
                    $ret.value = l;
                    $ret.percent = m;
                    $ret.label = n;
                    $ret.item = b;
                    return $ret;
                })());
                let p = null;
                if (j) {
                    if (h) {
                        p = this.ys;
                    }
                    else {
                        p = this.yt;
                    }
                    if (p == null) {
                        if (h) {
                            p = this.yr;
                        }
                        else {
                            p = this.yu;
                        }
                    }
                }
                else {
                    if (h) {
                        p = this.yr;
                    }
                    else {
                        p = this.yu;
                    }
                }
                i = p.i(o);
            }
            else if (k != 1) {
                switch (k) {
                    case 2:
                        i = this.aal(a, b, c, d, f);
                        break;
                    case 3:
                        i = this.aam(a, b, c, e, f);
                        break;
                    case 4:
                        {
                            let q = this.aal(a, b, c, d, f);
                            let r = this.aam(a, b, c, e, f);
                            i = q + this.aab + r;
                        }
                        break;
                    case 5:
                        i = this.aak(c);
                        break;
                    case 6:
                        {
                            let s = this.aal(a, b, c, d, f);
                            let t = this.aak(c);
                            i = t + this.aab + s;
                        }
                        break;
                    case 7:
                        {
                            let u = this.aam(a, b, c, e, f);
                            let v = this.aak(c);
                            i = v + this.aab + u;
                        }
                        break;
                    case 8:
                        {
                            let w = this.aal(a, b, c, d, f);
                            let x = this.aam(a, b, c, e, f);
                            let y = this.aak(c);
                            i = y + this.aab + w + this.aab + x;
                        }
                        break;
                }
            }
            else {
                if (g) {
                    i = this.aal(a, b, c, d, f);
                }
                else {
                    i = this.aak(c);
                }
            }
            return i;
        }
        aak(a) {
            let b = this.yx;
            let c = this.au(true);
            if (this.yx != null && this.yx.cl && this.yx.hasOthersCategory && a == this.yx.othersIndex) {
                if (this.yq != null) {
                    c = this.yq;
                }
            }
            if (c != null) {
                let d = super.ks(a, false);
                if (d != null) {
                    return c.i(d);
                }
                else {
                    return null;
                }
            }
            else {
                return b.gf(a);
            }
        }
        aal(a, b, c, d, e) {
            let f = a;
            f = this.z7(c, f);
            if (e) {
                return this.z9(f, d);
            }
            else {
                a = this.jc(b);
                if (!isNaN_(a)) {
                    return this.z9(a, d);
                }
                else {
                    return this.z9(f, d);
                }
            }
        }
        zz(a, b, c, d, e) {
            let f = a;
            f = this.z7(c, f);
            if (e) {
                return f;
            }
            else {
                a = this.jc(b);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        aam(a, b, c, d, e) {
            if (this.yx == null || !this.yx.cl) {
                return this.aal(a, b, c, d, e);
            }
            let f = this.yx.oa(c);
            if (e) {
                return this.z9(f, d) + "%";
            }
            else {
                a = this.yx.oa(c);
                if (!isNaN_(a)) {
                    return this.z9(a, d) + "%";
                }
                else {
                    return this.z9(f, d) + "%";
                }
            }
        }
        z0(a, b, c, d, e) {
            if (this.yx == null || !this.yx.cl) {
                return this.zz(a, b, c, d, e);
            }
            let f = this.yx.oa(c);
            if (e) {
                return f;
            }
            else {
                a = this.yx.oa(c);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        z7(a, b) {
            return b;
        }
        z9(a, b) {
            let c;
            if (b >= 0) {
                c = round10N(a, b);
            }
            else {
                c = a;
            }
            let d = this.au(false);
            if (d != null) {
                let e = d;
                return e.i(c);
            }
            else {
                return c.toString();
            }
        }
        get_ft() {
            return true;
        }
        get_fe() {
            return true;
        }
        zf(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dn.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        zw() {
            return false;
        }
        ht() {
            let a = super.ht();
            if (this.zw()) {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "DashArray";
                    $ret.p = true;
                    $ret.x = ((() => {
                        let $ret = new DoubleCollection();
                        $ret.add(5);
                        $ret.add(5);
                        return $ret;
                    })());
                    $ret.q = true;
                    return $ret;
                })());
                a.add(b);
            }
            if (!this.zw()) {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.ry));
                a.add(c);
            }
            if (!this.zw()) {
                let d = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.ry));
                a.add(d);
            }
            let e = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "IsTransitionInEnabled";
                $ret.x = true;
                $ret.q = true;
                return $ret;
            })());
            a.add(e);
            let f = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "TransitionInMode";
                $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
                $ret.q = true;
                return $ret;
            })());
            a.add(f);
            return a;
        }
        kv() {
            if (this.d3()) {
                return this.bn.zb;
            }
            else {
                return this.bn.y8;
            }
        }
        zg(a, b, c) {
            if (this.dn == null) {
                return null;
            }
            let d = this.y7.cx.c;
            let e = this.y7.cx.d;
            let f = this.y7.cx.b;
            let g = this.y9();
            let h = this.dn.count;
            let i = this.yx;
            let j = -1;
            let k = -1;
            let l = this.j3(b);
            if (isNaN_(b.x) || isNaN_(b.y)) {
                if (a != null && this.dn != null) {
                    if (a == this.y5) {
                        l = this.yx.othersIndex;
                    }
                    else {
                        l = this.dn.indexOf(a);
                    }
                }
            }
            j = truncate(Math.floor((intDivide(l, f)))) * f;
            k = j + (f - 1);
            if (c != null && c.g == j && c.f == k) {
                return c;
            }
            let m = new HighlightingInfo();
            m.i = this;
            m.g = j;
            m.f = k;
            return m;
        }
        zh(a, b, c) {
            if (this.dn == null) {
                return null;
            }
            let d = this.y7.cx.c;
            let e = this.y7.cx.d;
            let f = this.y7.cx.b;
            let g = this.y9();
            let h = this.dn.count;
            let i = this.yx;
            let j = -1;
            let k = -1;
            let l = this.j3(b);
            if (isNaN_(b.x) || isNaN_(b.y)) {
                if (a != null && this.dn != null) {
                    if (a == this.y5) {
                        l = this.yx.othersIndex;
                    }
                    else {
                        l = this.dn.indexOf(a);
                    }
                }
            }
            j = truncate(Math.floor((intDivide(l, f)))) * f;
            k = j + (f - 1);
            if (c != null && c.g == j && c.f == k) {
                return c;
            }
            let m = new HighlightingInfo();
            m.d = true;
            m.i = this;
            m.g = j;
            m.f = k;
            return m;
        }
        dg(a, b, c) {
            if (this.ed && this.fz(this.bx) && !c) {
                let d = this.zg(a, b, this.zi);
                this.zi = d;
                return d;
            }
            else {
                let e = this.zf(a, b, this.zi);
                this.zi = e;
                return e;
            }
        }
        dh(a, b, c) {
            if (this.fz(this.bx) && !c) {
                let d = this.zh(a, b, this.zj);
                this.zj = d;
                return d;
            }
            else {
                let e = this.zf(a, b, this.zj);
                e.d = true;
                this.zj = e;
                return e;
            }
        }
        zv() {
            return (this.assigningRadialStyle != null && this.zl) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
        }
        zu() {
            return (this.assigningRadialMarkerStyle != null && this.zk) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
        }
        aa9(a) {
            if (this.assigningRadialStyle != null && this.zl) {
                this.assigningRadialStyle(this, a);
            }
        }
        aa8(a) {
            if (this.assigningRadialMarkerStyle != null && this.zk) {
                this.assigningRadialMarkerStyle(this, a);
            }
        }
        z4(a) {
            return a.cx.b;
        }
        z5(a) {
            return a.cx.c;
        }
        ai() {
            return [this.yx, this.y3];
        }
        sp(a, b) {
            this.y7.cx.e(this.id);
            this.rp(false);
        }
        so(a, b) {
            if (this.g1 && this.jq < 0.05 && (this.db == null || !this.db.fn())) {
                this.g2 = true;
                this.g5 = false;
                this.gk = false;
            }
            this.y7.cx.e(this.id);
            this.rp(false);
        }
        q7(a, b, c, d) {
            super.q7(a, b, c, d);
            switch (b) {
                case RadialBase.$$p[6]:
                    this.rp(false);
                    break;
                case RadialBase.$$p[14]:
                    this.pe();
                    this.rp(false);
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.yx != null) {
                            this.yx.b0(this);
                        }
                        if (this.y3 != null) {
                            this.y3.b0(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.yx != null) {
                            this.yx.ct(this);
                        }
                        if (this.y3 != null) {
                            this.y3.ct(this);
                        }
                    }
                    this.y7.cx.e(this.id);
                    this.rp(false);
                    break;
                case RadialBase.$$p[0]:
                    if (this.yx != null && this.y3 != null) {
                        this.y6 = new RadialAxes(this.y3, this.yx);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.y7.cx.e(this.id);
                    this.rp(false);
                    break;
                case RadialBase.$$p[22]:
                    if (this.yx != null && this.y3 != null) {
                        this.y6 = new RadialAxes(this.y3, this.yx);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.y7.cx.e(this.id);
                    if (this.y3 == null || !this.y3.c1()) {
                        this.rp(false);
                    }
                    break;
                case RadialBase.$$p[3]:
                case RadialBase.$$p[4]:
                    if (this.aad != null) {
                        this.yq = new BindingFormatter();
                        this.yq.j = this.aad;
                        this.yq.d = this.yk;
                    }
                    else {
                        this.yq = null;
                    }
                    break;
                case RadialBase.$$p[19]:
                case RadialBase.$$p[20]:
                    if (this.aa0 != null) {
                        this.yu = new BindingFormatter();
                        this.yu.j = this.aa0;
                        this.yu.d = this.yp;
                    }
                    else {
                        this.yu = null;
                    }
                    break;
                case RadialBase.$$p[12]:
                case RadialBase.$$p[13]:
                    if (this.aaq != null) {
                        this.yr = new BindingFormatter();
                        this.yr.j = this.aaq;
                        this.yr.d = this.ym;
                    }
                    else {
                        this.yr = null;
                    }
                    break;
                case RadialBase.$$p[17]:
                case RadialBase.$$p[18]:
                    if (this.aa0 != null) {
                        this.yt = new BindingFormatter();
                        this.yt.j = this.aax;
                        this.yt.d = this.yo;
                    }
                    else {
                        this.yt = null;
                    }
                    break;
                case RadialBase.$$p[15]:
                case RadialBase.$$p[16]:
                    if (this.aaq != null) {
                        this.ys = new BindingFormatter();
                        this.ys.j = this.aau;
                        this.ys.d = this.yn;
                    }
                    else {
                        this.ys = null;
                    }
                    break;
                case "SyncLink":
                    if (this.c3 != null && this.db != null) {
                        this.y7.cx.e(this.id);
                        this.rp(false);
                    }
                    break;
                case "TransitionProgress":
                    this.zb.c(this.jq, this.za, this.y8);
                    if (this.d5(this.cv)) {
                        return;
                    }
                    if (this.jq == 1) {
                        this.y8.w();
                        this.aba(this.y8, this.y7);
                        if (this.g1) {
                            this.g1 = false;
                            this.o6();
                            this.dc.r = truncate(this.i9());
                            this.dc.b = this.dd;
                        }
                        if (this.g4) {
                            this.g4 = false;
                            this.o6();
                            this.dc.r = truncate(this.i9());
                            this.dc.b = this.dd;
                            this.qy();
                        }
                        this.qm();
                    }
                    else {
                        this.aba(this.zb, this.y7);
                    }
                    if (this.db != null) {
                        this.db.qo(this);
                    }
                    break;
                case RadialBase.$$p[8]:
                    this.rp(false);
                    this.qj();
                    break;
                case "VisibilityProxy":
                    if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                        this.y7.cx.e(this.id);
                    }
                    break;
                case RadialBase.$$p[10]:
                    this.zl = this.zt();
                    this.rp(false);
                    break;
                case RadialBase.$$p[9]:
                    this.zk = this.zs();
                    this.rp(false);
                    break;
            }
        }
        zt() {
            return this.zq;
        }
        zs() {
            return this.zp;
        }
        zn(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zm(a) {
            if (typeCast(CategoryAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get_y5() {
            return this.y4;
        }
        get y5() {
            return this.get_y5();
        }
        kn(a) {
            let b = this.j3(a);
            let c = false;
            if (this.yx != null && this.yx.cl) {
                let d = this.yx;
                let e = d.hasOthersCategory && b == this.yx.lj - 1;
                c = e;
            }
            if (c) {
                let f = this.yx;
                return this.y5;
            }
            return b >= 0 && this.dn != null && b < this.dn.count ? this.dn.item(b) : null;
        }
        zx(a) {
            let b = this.cv.by;
            let c = this.cv.bx;
            let d = this.cv.getEffectiveViewport();
            if (this.yx != null && !b.isEmpty && !c.isEmpty && this.y6 != null) {
                let e = this.y6.c(a, b, c, d);
                if (e < 0) {
                    e += Math.PI * 2;
                }
                if (e > Math.PI * 2) {
                    e -= Math.PI * 2;
                }
                return e;
            }
            return NaN;
        }
        ir(a) {
            let b = this.cv.by;
            let c = this.cv.bx;
            let d = this.getEffectiveViewport1(this.cv);
            let e = -1;
            if (this.yx != null && !b.isEmpty && !c.isEmpty && this.y6 != null) {
                let f = this.y6.c(a, b, c, d);
                if (f < 0) {
                    f += Math.PI * 2;
                }
                if (f > Math.PI * 2) {
                    f -= Math.PI * 2;
                }
                let g = this.yx.getUnscaledAngle(f);
                if (this.yx.categoryMode != 0) {
                    g -= 0.5;
                }
                e = g;
            }
            return e;
        }
        zy(a, b, c, d) {
            return this.yx.m7(a, b, c, d);
        }
        j3(a) {
            let b = truncate(Math.round(this.ir(a)));
            let c = false;
            if (this.yx != null && this.yx.cl) {
                let d = this.yx;
                let e = d.hasOthersCategory && b == this.yx.lj - 1;
                c = e;
            }
            if (c) {
                let f = this.yx;
                return this.yx.lj - 1;
            }
            if (this.dn != null && b == this.dn.count) {
                b = 0;
            }
            return b;
        }
        gd(a) {
            return false;
        }
        y9() {
            let a = this.y8;
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                a = this.zb;
            }
            return a;
        }
        p9() {
            super.p9();
            if (this.yx != null) {
                this.yx.ib(false);
            }
            if (this.y3 != null) {
                this.y3.ib(false);
            }
        }
        he(a, b, c) {
            let d = true;
            let e = c;
            if (!super.he(a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yx == null || this.yx.itemsSource == null || this.y3 == null || this.y6 == null || this.dn == null || this.yx.bi == null || this.y3.bi == null || this.y3.l4 == this.y3.l3) {
                e.cx.b = 0;
                d = false;
            }
            return d;
        }
        y0() {
            return 1;
        }
        z1() {
            return Math.max(0, 0.5 * this.y3.n6);
        }
        gn() {
            return this.zr;
        }
        go() {
            return true;
        }
        rq(a) {
            super.rq(a);
            this.y7.cx.e(this.id);
            if (this.d5(this.cv)) {
                this.y8.z();
                this.zb.z();
                this.za.z();
                return;
            }
            if (this.gr) {
                if (this.d3()) {
                    if (this.dc.g) {
                        this.dc.t();
                    }
                    this.aba(this.zb, this.y7);
                }
                else {
                    this.aba(this.y8, this.y7);
                }
                return;
            }
            if (this.gf(a)) {
                let b = this.za;
                if (this.d3()) {
                    if (this.dc.g) {
                        this.dc.t();
                    }
                    this.za = this.zb;
                    this.zb = b;
                }
                else {
                    this.za = this.y8;
                    this.y8 = b;
                }
                let c = false;
                this.aa7(this.y8, this.y7);
                if (this.g3) {
                    this.dc.w();
                    this.dc.r = truncate(this.ja());
                    this.dc.b = this.de != null ? this.de : this.dd;
                    if (this.g4) {
                        let d = this.zb;
                        this.zb = this.za;
                        this.za = d;
                        c = true;
                    }
                    this.y2.s(this, this.za, this.y8, this.isVertical, this.yx, this.y3, this.y1, this.y0(), this.c5, this.c4(), runOn(this, this.z1), this.y7.bx);
                    if (this.g4) {
                        let e = this.zb;
                        this.zb = this.za;
                        this.za = e;
                    }
                    this.g4 = false;
                }
                if (this.g6) {
                    this.dc.w();
                    this.dc.r = truncate(this.jb());
                    this.dc.b = this.df != null ? this.df : this.dd;
                    if (this.g1) {
                        let f = this.zb;
                        this.zb = this.za;
                        this.za = f;
                        c = true;
                    }
                    this.y2.s(this, this.za, this.y8, this.isVertical, this.yx, this.y3, this.y1, this.y0(), this.c5, this.c4(), runOn(this, this.z1), this.y7.bx);
                    let g = this.y8;
                    this.y8 = this.za;
                    this.za = g;
                    if (this.g1) {
                        let h = this.zb;
                        this.zb = this.za;
                        this.za = h;
                    }
                    this.g1 = false;
                }
                this.d9 = false;
                if (!c) {
                    this.o1();
                }
                this.r5();
                if (this.g3) {
                    this.g2 = false;
                    this.g1 = true;
                }
                if (this.g6) {
                    this.g5 = false;
                    this.g4 = true;
                }
            }
            else {
                this.aa7(this.y8, this.y7);
                this.aba(this.y8, this.y7);
            }
        }
        z6() {
            if (this.bn != null) {
                let a = this.bn;
                return a.z6();
            }
            let b = 0;
            for (let c of fromEnum(this.db.series)) {
                if (c == this || this.bn == c) {
                    return b;
                }
                let d = typeCast(RadialBase.$, c);
                if (d != null && d.yx == this.yx && d.preferredCategoryMode(d.yx) == 2) {
                    b++;
                }
            }
            return -1;
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.p2(a, c, b);
            return c.toArray();
        }
        p2(a, b, c) {
            let d = this.cv.by;
            let e = this.cv.bx;
            let f = this.cv.getEffectiveViewport();
            let g, h;
            let i = this.y6.f(a, d, e, f, g, h);
            g = i.p4;
            h = i.p5;
            if (g == -1 || h == -1) {
                return;
            }
            let j = h - g + 1;
            if (g > h) {
                j = this.yx.lk - g + h + 1;
            }
            if (j > 0 && (c == 7 || c == 6)) {
                b.add(((() => {
                    let $ret = new ChartSelection();
                    $ret.series = this;
                    return $ret;
                })()));
                return;
            }
            for (let k = 0; k < j; k++) {
                let l = (k + g) % (this.yx.lk);
                if (c == 2 || c == 1) {
                    b.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = this.yx.kv.item(l);
                        return $ret;
                    })()));
                }
                else {
                    b.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = this.yx.kv.item(l);
                        $ret.series = this;
                        return $ret;
                    })()));
                }
            }
        }
    }
    RadialBase.$t = /*@__PURE__*/ markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RadialBase, 'raisePropertyChanged', ['AngleAxis:yx:abb', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:z2:abc', [1, -1], 'AutoCalloutLabelValueSeparator:aab:abd', [2, " - "], 'AutoCalloutOthersLabelFormat:aad:abe', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:yk:abf', [Array_$type, null], 'AutoCalloutPercentagePrecision:z3:abg', [1, 2], 'AutoCalloutRadialLabelMode:zc:abh', [RadialLabelMode_$type, /*@__PURE__*/ enumGetBox(RadialLabelMode_$type, 0)], 'CategoryCollisionMode:yy:abi', [CategoryCollisionMode_$type, /*@__PURE__*/ enumGetBox(CategoryCollisionMode_$type, 1)], 'ClipSeriesToBounds:zo:abj', [0, false], 'IsCustomRadialMarkerStyleAllowed:zp:abk', [0, false], 'IsCustomRadialStyleAllowed:zq:abl', [0, false], 'IsTransitionInEnabled:zr:abm', [0, false], 'LegendProportionalRadialLabelFormat:aaq:abn', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:ym:abo', [Array_$type, null], 'LegendRadialLabelMode:zd:abp', [RadialLabelMode_$type, /*@__PURE__*/ enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aau:abq', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yn:abr', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aax:abs', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:yo:abt', [Array_$type, null], 'ProportionalRadialLabelFormat:aa0:abu', [2, null], 'ProportionalRadialLabelFormatSpecifiers:yp:abv', [Array_$type, null], 'TransitionInMode:y1:abw', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:y3:abx', [NumericRadiusAxis.$, null]]);
    return RadialBase;
})();
/**
 * @hidden
 */
export let RadialBaseView = /*@__PURE__*/ (() => {
    class RadialBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.cx = null;
            this.cw = null;
            this.cy = null;
            this.cz = 0;
            this.c0 = null;
            this.cw = a;
            this.cy = new Pool$1(Marker.$);
            this.cn(this.cy);
        }
        cj(a) {
            this.cy.c(a);
        }
    }
    RadialBaseView.$t = /*@__PURE__*/ markType(RadialBaseView, 'RadialBaseView', MarkerSeriesView.$);
    return RadialBaseView;
})();
