/*
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 { 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 { 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 { 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.ib;
            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.yq;
            if (b.isEmpty || c.isEmpty || e == null || this.a.cw.dl == null || this.a.cw.dl.count == 0) {
                this.b = 0;
                return;
            }
            let f = Math.floor(e.m6(c, d, b));
            let g = Math.ceil(e.m5(c, d, b));
            if (e.ch) {
                g = Math.ceil(e.m6(c, d, b));
                f = Math.floor(e.m5(c, d, b));
            }
            if (g < f) {
                g = e.lg + g;
            }
            let h = this.a.cw.yv;
            let i = h != null ? h.np : 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 {
        qw(a) {
            super.qw(a);
            this.yz = a;
        }
        constructor() {
            super();
            this.y6 = null;
            this.zd = false;
            this.zc = false;
            this.za = null;
            this.zb = null;
            this.assigningRadialStyle = null;
            this.assigningRadialMarkerStyle = null;
            this.yj = null;
            this.yn = null;
            this.yk = null;
            this.ym = null;
            this.yl = null;
            this.yw = new OthersCategoryContext();
            this.y2 = new RadialFrame(4);
            this.y3 = new RadialFrame(4);
            this.y0 = new RadialFrame(4);
            this.yy = null;
            this.yu = null;
            this.yu = new CategoryTransitionSourceFramePreparer();
            this.y6 = new RadialSeriesRenderManager();
        }
        aax() {
            if (this.da.g) {
                this.da.t();
            }
        }
        get categoryAxis() {
            return this.yq;
        }
        az() {
            return this.yq;
        }
        ye(a, b) {
            return null;
        }
        po(a) {
            if (a == this.yx) {
                if (this.fg) {
                    this.a9.a$x(this, a, this.yq.lh - 1);
                }
                return;
            }
            super.po(a);
        }
        ec(a) {
            if (a == this.yx && this.yq != null && this.yq.cl && this.yq.hasOthersCategory) {
                return true;
            }
            return super.ec(a);
        }
        pm(a) {
            if (a == this.yx) {
                if (this.fg) {
                    this.a9.a$an(this, a, this.dl.count - 1);
                }
                return;
            }
            super.pm(a);
        }
        d9(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.yq;
            let f = new ScalerParams(1, this.c9.vl, this.wk, e.ch);
            f.c = this.getEffectiveViewport1(this.ct);
            let g = this.yv;
            let h = new ScalerParams(1, this.c9.vl, this.wk, g.ch);
            h.c = this.getEffectiveViewport1(this.ct);
            let i = this.zv;
            a.clear();
            this.wx.cj((j) => {
                if (j._visibility == 0) {
                    let k = new SeriesPointOfInterest();
                    let l = j.n;
                    let m = j.o;
                    if (l < this.wk.left || l > this.wk.right || m < this.wk.top || m > this.wk.bottom) {
                        return;
                    }
                    let n = null;
                    if (j.content != null) {
                        n = j.content.item;
                    }
                    let o;
                    let p;
                    let q = this.yy.g(l, m, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport(), o, p);
                    o = q.p5;
                    p = q.p6;
                    k.d = o;
                    k.e = p;
                    let r = k.e;
                    let s = j.ak;
                    k.f = this.aau(r, n, s, d, i, c, b, false);
                    k.b = j.content;
                    k.g = this.u9;
                    k.c = j.ak;
                    if (this.g7) {
                        k.g = this.vg(j.ak);
                    }
                    k.a = this.aq(j.ak, j.al);
                    a.add(k);
                }
            });
            return true;
        }
        kq(a, b) {
            let c = null;
            if (this.dl != null) {
                if (a >= 0 && a < this.dl.count) {
                    c = this.dl.item(a);
                }
                if (this.yq != null && this.yq.cl && a == this.yq.othersIndex) {
                    c = this.yx;
                }
            }
            let d = NaN;
            if (c != null) {
                d = this.ja(c);
            }
            let e = this.aau(d, c, a, this.zu >= 0 ? this.zu : 5, this.zv, false, false, b);
            if (e != null) {
                return e;
            }
            return super.kq(a, b);
        }
        aau(a, b, c, d, e, f, g, h) {
            let i = null;
            let j = (b == this.yx);
            let k = this.y4;
            if (h) {
                k = this.y5;
            }
            if (k == 0) {
                if (h) {
                    k = 5;
                }
                else {
                    k = 6;
                }
            }
            if ((h && ((this.yk != null) || (j && this.yl != null))) || (!h && ((this.yn != null) || (j && this.ym != null)))) {
                let l = this.zr(a, b, c, d, f);
                let m = this.zs(a, b, c, e, f);
                let n = this.aab(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.yl;
                    }
                    else {
                        p = this.ym;
                    }
                    if (p == null) {
                        if (h) {
                            p = this.yk;
                        }
                        else {
                            p = this.yn;
                        }
                    }
                }
                else {
                    if (h) {
                        p = this.yk;
                    }
                    else {
                        p = this.yn;
                    }
                }
                i = p.i(o);
            }
            else if (k != 1) {
                switch (k) {
                    case 2:
                        i = this.aac(a, b, c, d, f);
                        break;
                    case 3:
                        i = this.aad(a, b, c, e, f);
                        break;
                    case 4:
                        {
                            let q = this.aac(a, b, c, d, f);
                            let r = this.aad(a, b, c, e, f);
                            i = q + this.z3 + r;
                        }
                        break;
                    case 5:
                        i = this.aab(c);
                        break;
                    case 6:
                        {
                            let s = this.aac(a, b, c, d, f);
                            let t = this.aab(c);
                            i = t + this.z3 + s;
                        }
                        break;
                    case 7:
                        {
                            let u = this.aad(a, b, c, e, f);
                            let v = this.aab(c);
                            i = v + this.z3 + u;
                        }
                        break;
                    case 8:
                        {
                            let w = this.aac(a, b, c, d, f);
                            let x = this.aad(a, b, c, e, f);
                            let y = this.aab(c);
                            i = y + this.z3 + w + this.z3 + x;
                        }
                        break;
                }
            }
            else {
                if (g) {
                    i = this.aac(a, b, c, d, f);
                }
                else {
                    i = this.aab(c);
                }
            }
            return i;
        }
        aab(a) {
            let b = this.yq;
            let c = this.at(true);
            if (this.yq != null && this.yq.cl && this.yq.hasOthersCategory && a == this.yq.othersIndex) {
                if (this.yj != null) {
                    c = this.yj;
                }
            }
            if (c != null) {
                let d = super.kq(a, false);
                if (d != null) {
                    return c.i(d);
                }
                else {
                    return null;
                }
            }
            else {
                return b.ge(a);
            }
        }
        aac(a, b, c, d, e) {
            let f = a;
            f = this.zz(c, f);
            if (e) {
                return this.z1(f, d);
            }
            else {
                a = this.ja(b);
                if (!isNaN_(a)) {
                    return this.z1(a, d);
                }
                else {
                    return this.z1(f, d);
                }
            }
        }
        zr(a, b, c, d, e) {
            let f = a;
            f = this.zz(c, f);
            if (e) {
                return f;
            }
            else {
                a = this.ja(b);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        aad(a, b, c, d, e) {
            if (this.yq == null || !this.yq.cl) {
                return this.aac(a, b, c, d, e);
            }
            let f = this.yq.n6(c);
            if (e) {
                return this.z1(f, d) + "%";
            }
            else {
                a = this.yq.n6(c);
                if (!isNaN_(a)) {
                    return this.z1(a, d) + "%";
                }
                else {
                    return this.z1(f, d) + "%";
                }
            }
        }
        zs(a, b, c, d, e) {
            if (this.yq == null || !this.yq.cl) {
                return this.zr(a, b, c, d, e);
            }
            let f = this.yq.n6(c);
            if (e) {
                return f;
            }
            else {
                a = this.yq.n6(c);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        zz(a, b) {
            return b;
        }
        z1(a, b) {
            let c;
            if (b >= 0) {
                c = round10N(a, b);
            }
            else {
                c = a;
            }
            let d = this.at(false);
            if (d != null) {
                let e = d;
                return e.i(c);
            }
            else {
                return c.toString();
            }
        }
        get_fr() {
            return true;
        }
        get_fc() {
            return true;
        }
        y7(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dl.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        zo() {
            return false;
        }
        hr() {
            let a = super.hr();
            if (this.zo()) {
                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.zo()) {
                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.ru));
                a.add(c);
            }
            if (!this.zo()) {
                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.ru));
                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;
        }
        ks() {
            if (this.d1()) {
                return this.bl.y3;
            }
            else {
                return this.bl.y0;
            }
        }
        y8(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.yz.cx.c;
            let e = this.yz.cx.d;
            let f = this.yz.cx.b;
            let g = this.y1();
            let h = this.dl.count;
            let i = this.yq;
            let j = -1;
            let k = -1;
            let l = this.j1(b);
            if (isNaN_(b.x) || isNaN_(b.y)) {
                if (a != null && this.dl != null) {
                    if (a == this.yx) {
                        l = this.yq.othersIndex;
                    }
                    else {
                        l = this.dl.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;
        }
        y9(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.yz.cx.c;
            let e = this.yz.cx.d;
            let f = this.yz.cx.b;
            let g = this.y1();
            let h = this.dl.count;
            let i = this.yq;
            let j = -1;
            let k = -1;
            let l = this.j1(b);
            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;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.y8(a, b, this.za);
                this.za = d;
                return d;
            }
            else {
                let e = this.y7(a, b, this.za);
                this.za = e;
                return e;
            }
        }
        df(a, b, c) {
            if (this.fx(this.bv) && !c) {
                let d = this.y9(a, b, this.zb);
                this.zb = d;
                return d;
            }
            else {
                let e = this.y7(a, b, this.zb);
                e.d = true;
                this.zb = e;
                return e;
            }
        }
        zn() {
            return (this.assigningRadialStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        zm() {
            return (this.assigningRadialMarkerStyle != null && this.zc) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        aa0(a) {
            if (this.assigningRadialStyle != null && this.zd) {
                this.assigningRadialStyle(this, a);
            }
        }
        aaz(a) {
            if (this.assigningRadialMarkerStyle != null && this.zc) {
                this.assigningRadialMarkerStyle(this, a);
            }
        }
        zw(a) {
            return a.cx.b;
        }
        zx(a) {
            return a.cx.c;
        }
        ai() {
            return [this.yq, this.yv];
        }
        sk(a, b) {
            this.yz.cx.e(this.ib);
            this.rm(false);
        }
        sj(a, b) {
            if (this.gz && this.jo < 0.05 && (this.c9 == null || !this.c9.fj())) {
                this.g0 = true;
                this.g3 = false;
                this.gi = false;
            }
            this.yz.cx.e(this.ib);
            this.rm(false);
        }
        q4(a, b, c, d) {
            super.q4(a, b, c, d);
            switch (b) {
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.yq != null) {
                            this.yq.b0(this);
                        }
                        if (this.yv != null) {
                            this.yv.b0(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.yq != null) {
                            this.yq.ct(this);
                        }
                        if (this.yv != null) {
                            this.yv.ct(this);
                        }
                    }
                    this.yz.cx.e(this.ib);
                    this.rm(false);
                    break;
                case RadialBase.$$p[0]:
                    if (this.yq != null && this.yv != null) {
                        this.yy = new RadialAxes(this.yv, this.yq);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.yz.cx.e(this.ib);
                    this.rm(false);
                    break;
                case RadialBase.$$p[21]:
                    if (this.yq != null && this.yv != null) {
                        this.yy = new RadialAxes(this.yv, this.yq);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.yz.cx.e(this.ib);
                    if (this.yv == null || !this.yv.c1()) {
                        this.rm(false);
                    }
                    break;
                case RadialBase.$$p[3]:
                case RadialBase.$$p[4]:
                    if (this.z5 != null) {
                        this.yj = new BindingFormatter();
                        this.yj.j = this.z5;
                        this.yj.d = this.yd;
                    }
                    else {
                        this.yj = null;
                    }
                    break;
                case RadialBase.$$p[18]:
                case RadialBase.$$p[19]:
                    if (this.aar != null) {
                        this.yn = new BindingFormatter();
                        this.yn.j = this.aar;
                        this.yn.d = this.yi;
                    }
                    else {
                        this.yn = null;
                    }
                    break;
                case RadialBase.$$p[11]:
                case RadialBase.$$p[12]:
                    if (this.aah != null) {
                        this.yk = new BindingFormatter();
                        this.yk.j = this.aah;
                        this.yk.d = this.yf;
                    }
                    else {
                        this.yk = null;
                    }
                    break;
                case RadialBase.$$p[16]:
                case RadialBase.$$p[17]:
                    if (this.aar != null) {
                        this.ym = new BindingFormatter();
                        this.ym.j = this.aao;
                        this.ym.d = this.yh;
                    }
                    else {
                        this.ym = null;
                    }
                    break;
                case RadialBase.$$p[14]:
                case RadialBase.$$p[15]:
                    if (this.aah != null) {
                        this.yl = new BindingFormatter();
                        this.yl.j = this.aal;
                        this.yl.d = this.yg;
                    }
                    else {
                        this.yl = null;
                    }
                    break;
                case "SyncLink":
                    if (this.c1 != null && this.c9 != null) {
                        this.yz.cx.e(this.ib);
                        this.rm(false);
                    }
                    break;
                case "TransitionProgress":
                    this.y3.c(this.jo, this.y2, this.y0);
                    if (this.d3(this.ct)) {
                        return;
                    }
                    if (this.jo == 1) {
                        this.y0.w();
                        this.aa1(this.y0, this.yz);
                        if (this.gz) {
                            this.gz = false;
                            this.o3();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                        }
                        if (this.g2) {
                            this.g2 = false;
                            this.o3();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                            this.qv();
                        }
                        this.qj();
                    }
                    else {
                        this.aa1(this.y3, this.yz);
                    }
                    if (this.c9 != null) {
                        this.c9.qa(this);
                    }
                    break;
                case RadialBase.$$p[7]:
                    this.rm(false);
                    this.qg();
                    break;
                case "VisibilityProxy":
                    if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                        this.yz.cx.e(this.ib);
                    }
                    break;
                case RadialBase.$$p[9]:
                    this.zd = this.zl();
                    this.rm(false);
                    break;
                case RadialBase.$$p[8]:
                    this.zc = this.zk();
                    this.rm(false);
                    break;
            }
        }
        zl() {
            return this.zi;
        }
        zk() {
            return this.zh;
        }
        zf(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        ze(a) {
            if (typeCast(CategoryAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get_yx() {
            return this.yw;
        }
        get yx() {
            return this.get_yx();
        }
        kl(a) {
            let b = this.j1(a);
            let c = false;
            if (this.yq != null && this.yq.cl) {
                let d = this.yq;
                let e = d.hasOthersCategory && b == this.yq.lg - 1;
                c = e;
            }
            if (c) {
                let f = this.yq;
                return this.yx;
            }
            return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
        }
        zp(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.ct.getEffectiveViewport();
            if (this.yq != null && !b.isEmpty && !c.isEmpty && this.yy != null) {
                let e = this.yy.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;
        }
        ip(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.getEffectiveViewport1(this.ct);
            let e = -1;
            if (this.yq != null && !b.isEmpty && !c.isEmpty && this.yy != null) {
                let f = this.yy.c(a, b, c, d);
                if (f < 0) {
                    f += Math.PI * 2;
                }
                if (f > Math.PI * 2) {
                    f -= Math.PI * 2;
                }
                let g = this.yq.getUnscaledAngle(f);
                if (this.yq.categoryMode != 0) {
                    g -= 0.5;
                }
                e = g;
            }
            return e;
        }
        zq(a, b, c, d) {
            return this.yq.m4(a, b, c, d);
        }
        j1(a) {
            let b = truncate(Math.round(this.ip(a)));
            let c = false;
            if (this.yq != null && this.yq.cl) {
                let d = this.yq;
                let e = d.hasOthersCategory && b == this.yq.lg - 1;
                c = e;
            }
            if (c) {
                let f = this.yq;
                return this.yq.lg - 1;
            }
            if (this.dl != null && b == this.dl.count) {
                b = 0;
            }
            return b;
        }
        gb(a) {
            return false;
        }
        y1() {
            let a = this.y0;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.y3;
            }
            return a;
        }
        p5() {
            super.p5();
            if (this.yq != null) {
                this.yq.h9(false);
            }
            if (this.yv != null) {
                this.yv.h9(false);
            }
        }
        hc(a, b, c) {
            let d = true;
            let e = c;
            if (!super.hc(a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yq == null || this.yq.itemsSource == null || this.yv == null || this.yy == null || this.dl == null || this.yq.bi == null || this.yv.bi == null || this.yv.ly == this.yv.lx) {
                e.cx.b = 0;
                d = false;
            }
            return d;
        }
        ys() {
            return 1;
        }
        zt() {
            return Math.max(0, 0.5 * this.yv.no);
        }
        gl() {
            return this.zj;
        }
        gm() {
            return true;
        }
        rn(a) {
            super.rn(a);
            this.yz.cx.e(this.ib);
            if (this.d3(this.ct)) {
                this.y0.z();
                this.y3.z();
                this.y2.z();
                return;
            }
            if (this.gp) {
                if (this.d1()) {
                    if (this.da.g) {
                        this.da.t();
                    }
                    this.aa1(this.y3, this.yz);
                }
                else {
                    this.aa1(this.y0, this.yz);
                }
                return;
            }
            if (this.gd(a)) {
                let b = this.y2;
                if (this.d1()) {
                    if (this.da.g) {
                        this.da.t();
                    }
                    this.y2 = this.y3;
                    this.y3 = b;
                }
                else {
                    this.y2 = this.y0;
                    this.y0 = b;
                }
                let c = false;
                this.aay(this.y0, this.yz);
                if (this.g1) {
                    this.da.w();
                    this.da.r = truncate(this.i8());
                    this.da.b = this.dc != null ? this.dc : this.db;
                    if (this.g2) {
                        let d = this.y3;
                        this.y3 = this.y2;
                        this.y2 = d;
                        c = true;
                    }
                    this.yu.s(this, this.y2, this.y0, this.isVertical, this.yq, this.yv, this.yt, this.ys(), this.c3, this.c2(), runOn(this, this.zt), this.yz.bx);
                    if (this.g2) {
                        let e = this.y3;
                        this.y3 = this.y2;
                        this.y2 = e;
                    }
                    this.g2 = false;
                }
                if (this.g4) {
                    this.da.w();
                    this.da.r = truncate(this.i9());
                    this.da.b = this.dd != null ? this.dd : this.db;
                    if (this.gz) {
                        let f = this.y3;
                        this.y3 = this.y2;
                        this.y2 = f;
                        c = true;
                    }
                    this.yu.s(this, this.y2, this.y0, this.isVertical, this.yq, this.yv, this.yt, this.ys(), this.c3, this.c2(), runOn(this, this.zt), this.yz.bx);
                    let g = this.y0;
                    this.y0 = this.y2;
                    this.y2 = g;
                    if (this.gz) {
                        let h = this.y3;
                        this.y3 = this.y2;
                        this.y2 = h;
                    }
                    this.gz = false;
                }
                this.d7 = false;
                if (!c) {
                    this.oy();
                }
                this.r0();
                if (this.g1) {
                    this.g0 = false;
                    this.gz = true;
                }
                if (this.g4) {
                    this.g3 = false;
                    this.g2 = true;
                }
            }
            else {
                this.aay(this.y0, this.yz);
                this.aa1(this.y0, this.yz);
            }
        }
        zy() {
            if (this.bl != null) {
                let a = this.bl;
                return a.zy();
            }
            let b = 0;
            for (let c of fromEnum(this.c9.series)) {
                if (c == this || this.bl == c) {
                    return b;
                }
                let d = typeCast(RadialBase.$, c);
                if (d != null && d.yq == this.yq && d.preferredCategoryMode(d.yq) == 2) {
                    b++;
                }
            }
            return -1;
        }
    }
    RadialBase.$t = /*@__PURE__*/ markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RadialBase, 'raisePropertyChanged', ['AngleAxis:yq:aa2', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:zu:aa3', [1, -1], 'AutoCalloutLabelValueSeparator:z3:aa4', [2, " - "], 'AutoCalloutOthersLabelFormat:z5:aa5', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:yd:aa6', [Array_$type, null], 'AutoCalloutPercentagePrecision:zv:aa7', [1, 2], 'AutoCalloutRadialLabelMode:y4:aa8', [RadialLabelMode_$type, /*@__PURE__*/ enumGetBox(RadialLabelMode_$type, 0)], 'ClipSeriesToBounds:zg:aa9', [0, false], 'IsCustomRadialMarkerStyleAllowed:zh:aba', [0, false], 'IsCustomRadialStyleAllowed:zi:abb', [0, false], 'IsTransitionInEnabled:zj:abc', [0, false], 'LegendProportionalRadialLabelFormat:aah:abd', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:yf:abe', [Array_$type, null], 'LegendRadialLabelMode:y5:abf', [RadialLabelMode_$type, /*@__PURE__*/ enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aal:abg', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yg:abh', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aao:abi', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:yh:abj', [Array_$type, null], 'ProportionalRadialLabelFormat:aar:abk', [2, null], 'ProportionalRadialLabelFormatSpecifiers:yi:abl', [Array_$type, null], 'TransitionInMode:yt:abm', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:yv:abn', [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;
})();
