/*
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, __values } from "tslib";
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
 */
var RadialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBucketCalculator, _super);
    function RadialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.c = 0;
        _this.d = 0;
        _this.b = 0;
        _this.a = a;
        return _this;
    }
    RadialBucketCalculator.prototype.getBucket = function (a) {
        throw new NotImplementedException(0);
    };
    RadialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    RadialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    RadialBucketCalculator.prototype.getBucketInfo = function (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
        };
    };
    RadialBucketCalculator.prototype.e = function (a) {
        var b = this.a.by;
        var c = this.a.bx;
        var d = this.a.getEffectiveViewport();
        var 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;
        }
        var f = Math.floor(e.m6(c, d, b));
        var 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;
        }
        var h = this.a.cw.yv;
        var i = h != null ? h.np : 0.75;
        var j = Math.min(c.width, c.height) * 0.5 * (i) * 2 * Math.PI;
        var 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));
        }
    };
    RadialBucketCalculator.prototype.cacheValues = function () {
    };
    RadialBucketCalculator.prototype.unCacheValues = function () {
    };
    RadialBucketCalculator.$t = markType(RadialBucketCalculator, 'RadialBucketCalculator', Base.$, [IBucketizer_$type]);
    return RadialBucketCalculator;
}(Base));
export { RadialBucketCalculator };
/**
 * @hidden
 */
var RadialBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBase, _super);
    function RadialBase() {
        var _this = _super.call(this) || this;
        _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();
        return _this;
    }
    RadialBase.prototype.qw = function (a) {
        _super.prototype.qw.call(this, a);
        this.yz = a;
    };
    RadialBase.prototype.aax = function () {
        if (this.da.g) {
            this.da.t();
        }
    };
    Object.defineProperty(RadialBase.prototype, "categoryAxis", {
        get: function () {
            return this.yq;
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.az = function () {
        return this.yq;
    };
    RadialBase.prototype.ye = function (a, b) {
        return null;
    };
    RadialBase.prototype.po = function (a) {
        if (a == this.yx) {
            if (this.fg) {
                this.a9.a$x(this, a, this.yq.lh - 1);
            }
            return;
        }
        _super.prototype.po.call(this, a);
    };
    RadialBase.prototype.ec = function (a) {
        if (a == this.yx && this.yq != null && this.yq.cl && this.yq.hasOthersCategory) {
            return true;
        }
        return _super.prototype.ec.call(this, a);
    };
    RadialBase.prototype.pm = function (a) {
        if (a == this.yx) {
            if (this.fg) {
                this.a9.a$an(this, a, this.dl.count - 1);
            }
            return;
        }
        _super.prototype.pm.call(this, a);
    };
    RadialBase.prototype.d9 = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.yq;
        var f = new ScalerParams(1, this.c9.vl, this.wk, e.ch);
        f.c = this.getEffectiveViewport1(this.ct);
        var g = this.yv;
        var h = new ScalerParams(1, this.c9.vl, this.wk, g.ch);
        h.c = this.getEffectiveViewport1(this.ct);
        var i = this.zv;
        a.clear();
        this.wx.cj(function (j) {
            if (j._visibility == 0) {
                var k = new SeriesPointOfInterest();
                var l = j.n;
                var m = j.o;
                if (l < _this.wk.left || l > _this.wk.right || m < _this.wk.top || m > _this.wk.bottom) {
                    return;
                }
                var n = null;
                if (j.content != null) {
                    n = j.content.item;
                }
                var o = void 0;
                var p = void 0;
                var 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;
                var r = k.e;
                var 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;
    };
    RadialBase.prototype.kq = function (a, b) {
        var 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;
            }
        }
        var d = NaN;
        if (c != null) {
            d = this.ja(c);
        }
        var e = this.aau(d, c, a, this.zu >= 0 ? this.zu : 5, this.zv, false, false, b);
        if (e != null) {
            return e;
        }
        return _super.prototype.kq.call(this, a, b);
    };
    RadialBase.prototype.aau = function (a, b, c, d, e, f, g, h) {
        var i = null;
        var j = (b == this.yx);
        var 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)))) {
            var l_1 = this.zr(a, b, c, d, f);
            var m_1 = this.zs(a, b, c, e, f);
            var n_1 = this.aab(c);
            var o = ((function () {
                var $ret = new ProportionalRadialLabelContext();
                $ret.value = l_1;
                $ret.percent = m_1;
                $ret.label = n_1;
                $ret.item = b;
                return $ret;
            })());
            var 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:
                    {
                        var q = this.aac(a, b, c, d, f);
                        var r = this.aad(a, b, c, e, f);
                        i = q + this.z3 + r;
                    }
                    break;
                case 5:
                    i = this.aab(c);
                    break;
                case 6:
                    {
                        var s = this.aac(a, b, c, d, f);
                        var t = this.aab(c);
                        i = t + this.z3 + s;
                    }
                    break;
                case 7:
                    {
                        var u = this.aad(a, b, c, e, f);
                        var v = this.aab(c);
                        i = v + this.z3 + u;
                    }
                    break;
                case 8:
                    {
                        var w = this.aac(a, b, c, d, f);
                        var x = this.aad(a, b, c, e, f);
                        var 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;
    };
    RadialBase.prototype.aab = function (a) {
        var b = this.yq;
        var 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) {
            var d = _super.prototype.kq.call(this, a, false);
            if (d != null) {
                return c.i(d);
            }
            else {
                return null;
            }
        }
        else {
            return b.ge(a);
        }
    };
    RadialBase.prototype.aac = function (a, b, c, d, e) {
        var 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);
            }
        }
    };
    RadialBase.prototype.zr = function (a, b, c, d, e) {
        var f = a;
        f = this.zz(c, f);
        if (e) {
            return f;
        }
        else {
            a = this.ja(b);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.aad = function (a, b, c, d, e) {
        if (this.yq == null || !this.yq.cl) {
            return this.aac(a, b, c, d, e);
        }
        var 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) + "%";
            }
        }
    };
    RadialBase.prototype.zs = function (a, b, c, d, e) {
        if (this.yq == null || !this.yq.cl) {
            return this.zr(a, b, c, d, e);
        }
        var f = this.yq.n6(c);
        if (e) {
            return f;
        }
        else {
            a = this.yq.n6(c);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.zz = function (a, b) {
        return b;
    };
    RadialBase.prototype.z1 = function (a, b) {
        var c;
        if (b >= 0) {
            c = round10N(a, b);
        }
        else {
            c = a;
        }
        var d = this.at(false);
        if (d != null) {
            var e = d;
            return e.i(c);
        }
        else {
            return c.toString();
        }
    };
    RadialBase.prototype.get_fr = function () {
        return true;
    };
    RadialBase.prototype.get_fc = function () {
        return true;
    };
    RadialBase.prototype.y7 = function (a, b, c) {
        var 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;
    };
    RadialBase.prototype.zo = function () {
        return false;
    };
    RadialBase.prototype.hr = function () {
        var a = _super.prototype.hr.call(this);
        if (this.zo()) {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "DashArray";
                $ret.p = true;
                $ret.x = ((function () {
                    var $ret = new DoubleCollection();
                    $ret.add(5);
                    $ret.add(5);
                    return $ret;
                })());
                $ret.q = true;
                return $ret;
            })());
            a.add(b);
        }
        if (!this.zo()) {
            var c = ((function () {
                var $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()) {
            var d = ((function () {
                var $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);
        }
        var e = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "IsTransitionInEnabled";
            $ret.x = true;
            $ret.q = true;
            return $ret;
        })());
        a.add(e);
        var f = ((function () {
            var $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;
    };
    RadialBase.prototype.ks = function () {
        if (this.d1()) {
            return this.bl.y3;
        }
        else {
            return this.bl.y0;
        }
    };
    RadialBase.prototype.y8 = function (a, b, c) {
        if (this.dl == null) {
            return null;
        }
        var d = this.yz.cx.c;
        var e = this.yz.cx.d;
        var f = this.yz.cx.b;
        var g = this.y1();
        var h = this.dl.count;
        var i = this.yq;
        var j = -1;
        var k = -1;
        var 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;
        }
        var m = new HighlightingInfo();
        m.i = this;
        m.g = j;
        m.f = k;
        return m;
    };
    RadialBase.prototype.y9 = function (a, b, c) {
        if (this.dl == null) {
            return null;
        }
        var d = this.yz.cx.c;
        var e = this.yz.cx.d;
        var f = this.yz.cx.b;
        var g = this.y1();
        var h = this.dl.count;
        var i = this.yq;
        var j = -1;
        var k = -1;
        var 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;
        }
        var m = new HighlightingInfo();
        m.d = true;
        m.i = this;
        m.g = j;
        m.f = k;
        return m;
    };
    RadialBase.prototype.de = function (a, b, c) {
        if (this.eb && this.fx(this.bv) && !c) {
            var d = this.y8(a, b, this.za);
            this.za = d;
            return d;
        }
        else {
            var e = this.y7(a, b, this.za);
            this.za = e;
            return e;
        }
    };
    RadialBase.prototype.df = function (a, b, c) {
        if (this.fx(this.bv) && !c) {
            var d = this.y9(a, b, this.zb);
            this.zb = d;
            return d;
        }
        else {
            var e = this.y7(a, b, this.zb);
            e.d = true;
            this.zb = e;
            return e;
        }
    };
    RadialBase.prototype.zn = function () {
        return (this.assigningRadialStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
    };
    RadialBase.prototype.zm = function () {
        return (this.assigningRadialMarkerStyle != null && this.zc) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
    };
    RadialBase.prototype.aa0 = function (a) {
        if (this.assigningRadialStyle != null && this.zd) {
            this.assigningRadialStyle(this, a);
        }
    };
    RadialBase.prototype.aaz = function (a) {
        if (this.assigningRadialMarkerStyle != null && this.zc) {
            this.assigningRadialMarkerStyle(this, a);
        }
    };
    RadialBase.prototype.zw = function (a) {
        return a.cx.b;
    };
    RadialBase.prototype.zx = function (a) {
        return a.cx.c;
    };
    RadialBase.prototype.ai = function () {
        return [this.yq, this.yv];
    };
    RadialBase.prototype.sk = function (a, b) {
        this.yz.cx.e(this.ib);
        this.rm(false);
    };
    RadialBase.prototype.sj = function (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);
    };
    RadialBase.prototype.q4 = function (a, b, c, d) {
        _super.prototype.q4.call(this, 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;
        }
    };
    RadialBase.prototype.zl = function () {
        return this.zi;
    };
    RadialBase.prototype.zk = function () {
        return this.zh;
    };
    RadialBase.prototype.zf = function (a) {
        if (typeCast(NumericRadiusAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.ze = function (a) {
        if (typeCast(CategoryAngleAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.get_yx = function () {
        return this.yw;
    };
    Object.defineProperty(RadialBase.prototype, "yx", {
        get: function () {
            return this.get_yx();
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.kl = function (a) {
        var b = this.j1(a);
        var c = false;
        if (this.yq != null && this.yq.cl) {
            var d = this.yq;
            var e = d.hasOthersCategory && b == this.yq.lg - 1;
            c = e;
        }
        if (c) {
            var f = this.yq;
            return this.yx;
        }
        return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
    };
    RadialBase.prototype.zp = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = this.ct.getEffectiveViewport();
        if (this.yq != null && !b.isEmpty && !c.isEmpty && this.yy != null) {
            var 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;
    };
    RadialBase.prototype.ip = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = this.getEffectiveViewport1(this.ct);
        var e = -1;
        if (this.yq != null && !b.isEmpty && !c.isEmpty && this.yy != null) {
            var f = this.yy.c(a, b, c, d);
            if (f < 0) {
                f += Math.PI * 2;
            }
            if (f > Math.PI * 2) {
                f -= Math.PI * 2;
            }
            var g = this.yq.getUnscaledAngle(f);
            if (this.yq.categoryMode != 0) {
                g -= 0.5;
            }
            e = g;
        }
        return e;
    };
    RadialBase.prototype.zq = function (a, b, c, d) {
        return this.yq.m4(a, b, c, d);
    };
    RadialBase.prototype.j1 = function (a) {
        var b = truncate(Math.round(this.ip(a)));
        var c = false;
        if (this.yq != null && this.yq.cl) {
            var d = this.yq;
            var e = d.hasOthersCategory && b == this.yq.lg - 1;
            c = e;
        }
        if (c) {
            var f = this.yq;
            return this.yq.lg - 1;
        }
        if (this.dl != null && b == this.dl.count) {
            b = 0;
        }
        return b;
    };
    RadialBase.prototype.gb = function (a) {
        return false;
    };
    RadialBase.prototype.y1 = function () {
        var a = this.y0;
        if (this.d1()) {
            if (this.da.g) {
                this.da.t();
            }
            a = this.y3;
        }
        return a;
    };
    RadialBase.prototype.p5 = function () {
        _super.prototype.p5.call(this);
        if (this.yq != null) {
            this.yq.h9(false);
        }
        if (this.yv != null) {
            this.yv.h9(false);
        }
    };
    RadialBase.prototype.hc = function (a, b, c) {
        var d = true;
        var e = c;
        if (!_super.prototype.hc.call(this, 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;
    };
    RadialBase.prototype.ys = function () {
        return 1;
    };
    RadialBase.prototype.zt = function () {
        return Math.max(0, 0.5 * this.yv.no);
    };
    RadialBase.prototype.gl = function () {
        return this.zj;
    };
    RadialBase.prototype.gm = function () {
        return true;
    };
    RadialBase.prototype.rn = function (a) {
        _super.prototype.rn.call(this, 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)) {
            var 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;
            }
            var 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) {
                    var 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) {
                    var 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) {
                    var 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);
                var g = this.y0;
                this.y0 = this.y2;
                this.y2 = g;
                if (this.gz) {
                    var 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);
        }
    };
    RadialBase.prototype.zy = function () {
        var e_1, _a;
        if (this.bl != null) {
            var a = this.bl;
            return a.zy();
        }
        var b = 0;
        try {
            for (var _b = __values(fromEnum(this.c9.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                if (c == this || this.bl == c) {
                    return b;
                }
                var d = typeCast(RadialBase.$, c);
                if (d != null && d.yq == this.yq && d.preferredCategoryMode(d.yq) == 2) {
                    b++;
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return -1;
    };
    RadialBase.$t = markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = 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, 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, 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, enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:yv:abn', [NumericRadiusAxis.$, null]]);
    return RadialBase;
}(MarkerSeries));
export { RadialBase };
/**
 * @hidden
 */
var RadialBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBaseView, _super);
    function RadialBaseView(a) {
        var _this = _super.call(this, a) || this;
        _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);
        return _this;
    }
    RadialBaseView.prototype.cj = function (a) {
        this.cy.c(a);
    };
    RadialBaseView.$t = markType(RadialBaseView, 'RadialBaseView', MarkerSeriesView.$);
    return RadialBaseView;
}(MarkerSeriesView));
export { RadialBaseView };
