/*
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 { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Point_$type, typeGetValue, fromEnum, runOn, Number_$type, enumGetBox, markDep } from "igniteui-react-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-react-core";
import { Extensions } from "igniteui-react-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-react-core";
import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { DependencyProperty } from "igniteui-react-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-react-core";
import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters";
import { CategoryTickmarkValues } from "./CategoryTickmarkValues";
import { SeriesViewer } from "./SeriesViewer";
import { ScalerParams } from "./ScalerParams";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { LineGeometry } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-react-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { ArcSegment } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var AngleAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AngleAxisLabelPanel, _super);
    function AngleAxisLabelPanel() {
        var _this = _super.call(this) || this;
        _this.da = false;
        _this.di = null;
        _this.df = 0;
        _this.dc = 0;
        _this.de = 0;
        _this.dd = 0;
        _this.db = 0;
        return _this;
    }
    AngleAxisLabelPanel.prototype.ae = function () {
        return new AngleAxisLabelPanelView(this);
    };
    AngleAxisLabelPanel.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    AngleAxisLabelPanel.prototype.at = function (a, b) {
        if (!Extensions.b(b)) {
            return false;
        }
        if (this.ad == null || this.ad.ke.isEmpty) {
            return _super.prototype.at.call(this, a, b);
        }
        return true;
    };
    AngleAxisLabelPanel.prototype.a5 = function () {
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        if (this.bb.count != this.ba.count) {
            return a;
        }
        var c = 1;
        if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
            c = this.ad.mj();
        }
        else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
            c = this.ad.nj();
        }
        if (c == 2) {
            this.c9.a0(a, b);
        }
        else {
            this.c9.a1(a, b);
        }
        var d = false;
        this.ao = this.an(a, b);
        if (!this.ad.b8()) {
            d = true;
            switch (c) {
                case 1:
                    this.dk();
                    break;
                case 2:
                    this.dj();
                    break;
            }
        }
        else {
            d = true;
            this.c9.ac();
        }
        if (d) {
            for (var e = 0; e < a.count; e++) {
                var f = this.bb._inner[e];
                var g = this.ba._inner[e];
                var h = a._inner[e];
                var i = this.di(g.c, h.width, h.height);
                var j = i.x - this.bk(f) / 2;
                var k = i.y - this.bj(f) / 2;
                h.x = j;
                h.y = k;
                a._inner[e] = h;
            }
        }
        return a;
    };
    AngleAxisLabelPanel.prototype.dk = function () {
        this.bh = this.df / 2;
        this.bh = this.bh + this.dg();
    };
    AngleAxisLabelPanel.prototype.dj = function () {
        this.bh = 5;
        this.bh = this.bh + this.dh();
    };
    AngleAxisLabelPanel.prototype.dh = function () {
        var a;
        var b;
        b = this.ad;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.bi);
        }
        if (a == null || b == null) {
            return 0;
        }
        var c = new List$1(Axis.$, 0);
        for (var d = 0; d < a.axes.count; d++) {
            var e = a.axes._inner[d];
            if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.np == b.aj.np)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        if (f > 0) {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var h = c._inner[f - 1];
                if (h.mi == 2) {
                    g += h.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.mi == 2) {
                    g += i.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.dg = function () {
        var a;
        var b;
        b = this.ad;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.bi);
        }
        if (a == null || b == null) {
            return 0;
        }
        var c = new List$1(Axis.$, 0);
        for (var d = 0; d < a.axes.count; d++) {
            var e = a.axes._inner[d];
            if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.np == b.aj.np)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        var h = 5;
        if (f == 0) {
            g += h;
        }
        else {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.mi == 2) {
                    g += i.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var j = c._inner[f - 1];
                if (j.ni == 2) {
                    g += j.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
            g += c._inner[f].aw.bh * 2 + h;
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.ai = function () {
        return 4;
    };
    AngleAxisLabelPanel.prototype.ay = function (a) {
        return a == 4 || a == 5;
    };
    AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
    return AngleAxisLabelPanel;
}(AxisLabelPanelBase));
export { AngleAxisLabelPanel };
/**
 * @hidden
 */
var CategoryAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAngleAxis, _super);
    function CategoryAngleAxis() {
        var _this = _super.call(this) || this;
        _this.mq = null;
        _this.mn = null;
        _this.mr = false;
        _this.my = NaN;
        _this.mo = null;
        _this.mz = 0;
        _this.mw = 0;
        _this.mx = 0;
        _this.nc = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.mn = _this.mm();
        _this.mq = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.a4 = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.ht = function (a) {
        _super.prototype.ht.call(this, a);
        this.ml = a;
    };
    CategoryAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.di = function (b, c, d) {
            var e = _this.bi != null ? _this.bi.vl : Rect.empty;
            var f = !e.isEmpty ? _this.ke : Rect.empty;
            var g = _this.j9();
            switch (_this.mi) {
                case 2: return _this.ns(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
                case 0:
                case 1:
                default: return _this.nt(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
            }
        };
        return a;
    };
    CategoryAngleAxis.prototype.mu = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.ng = function () {
        return null;
    };
    CategoryAngleAxis.prototype.na = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.mm = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.dd;
            $ret.e = _this.dc;
            $ret.b = _this.aw;
            return $ret;
        })());
        if (this.az != null) {
            this.az.registerAxis(this);
        }
        var b = new CategoryAxisRenderer(a);
        b.u = function () {
            var c = _this.a5.a4();
            var d = _this.a5.a7();
            var e = _this.a5.a5();
            var f = _this.a5.a6();
            _this.im();
            _this.hj(c);
            _this.hj(d);
            _this.hj(e);
            _this.hj(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.mp != null; };
        b.d = function (c, d, e, f) { return _this.mk(c, d, e, f); };
        b.v = function () {
            if (!_this.mr) {
                _this.mr = true;
                _this.mp.c1();
                _this.mr = false;
            }
        };
        b.g = function (c, d) {
            var e = typeGetValue(c);
            if (e == _this.lg - 1) {
                if (_this.cl) {
                    if (_this.mu(e)) {
                        return _this.ng();
                    }
                }
            }
            if (e > _this.lg - 1) {
                e -= _this.lg;
            }
            if (_this.mv(e)) {
                return null;
            }
            var f = _this.ks.item(e);
            return _this.f0(f);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.mp != null && _this.my != c) {
                var d = typeCast(XamDataChart.$, _this.bi);
                if (d == null) {
                    return;
                }
                _this.my = c;
                _this.aw.bg = c;
                d.nr();
                try {
                    for (var _b = __values(fromEnum(d.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var e = _c.value;
                        if (e != _this && typeCast(AngleAxisLabelPanel.$, e.aw) !== null) {
                            e.a5.ai();
                        }
                    }
                }
                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;
                    }
                }
            }
        };
        b.k = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            _this.mq.o(d, e, c.z, c.y, c.aa, f.minLength, f.maxLength, f.center);
        };
        b.l = function (c, d, e, f) {
            var g = typeCast(RadialAxisRenderingParameters.$, c);
            _this.mq.p(d, e, f, g.z, g.y, c.aa, g.minLength, g.maxLength, g.center);
        };
        b.m = function (c, d) { return _this.getScaledAngle(d); };
        b.q = function (c, d) {
            if (_this.na(d - _this.mz) < 0) {
                return false;
            }
            if (_this.na(d - _this.mz - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        b.j = function (c) {
            var d = typeCast(RadialAxisRenderingParameters.$, c);
            if (d.e == d.k._inner[0]) {
                _this.mq.k(c.t, c.n, c.z, c.y, c.aa, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.m2();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.nt(d, f.center, c.aa, c.z, c.y, 0);
            if (g.x < c.z.right && g.x >= c.z.left && g.y < c.z.bottom && g.y >= c.z.top) {
                return true;
            }
            return false;
        };
        b.a = function (c, d, e, f) {
            var g = c.y;
            var h = new ScalerParams(0, c.aa, c.z, _this.ch, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.lg);
                var k = _this.ek(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.m7);
        return b;
    };
    CategoryAngleAxis.prototype.mv = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.nt = function (a, b, c, d, e, f) {
        var g = this.m2();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    CategoryAngleAxis.prototype.ns = function (a, b, c, d, e, f, g, h) {
        if (!isNaN_(b) && !isNaN_(c)) {
            var i = this.m2();
            var j = b / f.width;
            var k = c / f.width;
            var l = ViewportUtils.a(h, e, f, g);
            var m = GeometryUtil.k(i, a, j, k);
            var n = d.x + (m + l) * Math.cos(a);
            var o = d.y + (m + l) * Math.sin(a);
            n = ViewportUtils.e(n, e, f, g);
            o = ViewportUtils.i(o, e, f, g);
            return { $type: Point_$type, x: n, y: o };
        }
        else {
            return this.nt(a, d, e, f, g, h);
        }
    };
    CategoryAngleAxis.prototype.m2 = function () {
        if (this.mp == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.mp.nu();
        }
        else {
            return this.mp.nv((this.fw));
        }
    };
    CategoryAngleAxis.prototype.mk = function (a, b, c, d) {
        if (this.ks == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.lh - 1;
        var g = this.a5.a4();
        var h = this.a5.a7();
        var i = this.a5.a5();
        var j = this.a5.a6();
        e.t = g;
        e.w = h;
        e.u = i;
        e.v = j;
        e.l = f;
        e.m = 0;
        e.h = false;
        e.z = a;
        e.y = c;
        e.x = d;
        e.aa = b;
        e.g = this.mt();
        e.p = this.m8;
        e.o = this.ez();
        e.q = this.m9;
        e.s = this.f1;
        var k = this.mq.h(b, a, c);
        var l = this.mq.i(b, a, c);
        var m = 0.5 * this.mp.np;
        var n = 0.5 * this.mp.no;
        var o = k;
        var p = l;
        var q = this.mp.nu();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.mq.m(b, a, c, e, 0, this.lh, this.ch, runOn(this, this.getUnscaledAngle), r);
        var s = { $type: Point_$type, x: 0.5, y: 0.5 };
        e.center = s;
        e.maxLength = p;
        e.minLength = o;
        e.effectiveMaximum = q;
        e.ae = this.lh;
        e.ab = this.categoryMode;
        e.ad = true;
        e.ac = this.ch;
        e.af = this.li;
        e.f = new CategoryTickmarkValues();
        e.j = this.cy;
        return e;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
        var f = this.mq.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    CategoryAngleAxis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.h9(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "mp", {
        get: function () {
            if (this.mo != null) {
                return this.mo;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericRadiusAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.mo;
        },
        set: function (a) {
            this.mo = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ak = function () {
        return this.mp;
    };
    CategoryAngleAxis.prototype.mj = function () {
        if (this.mi == 0) {
            return 1;
        }
        else {
            return this.mi;
        }
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.lg;
    };
    CategoryAngleAxis.prototype.get_ms = function () {
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "ms", {
        get: function () {
            return this.get_ms();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.m4 = function (a, b, c, d) {
        return this.k5(b, c, d);
    };
    CategoryAngleAxis.prototype.k5 = function (a, b, c) {
        var d = this.lc(a, b, c);
        var e = 0;
        if (!isNaN_(this.lb)) {
            e = Math.min(this.lb, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.li - (this.li - 1) * e);
    };
    CategoryAngleAxis.prototype.m3 = function (a, b, c, d, e) {
        return this.getGroupCenter(b, c, d, e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.li > 1) {
            var f = this.lc(b, c, d);
            var g = 0;
            if (!isNaN_(this.lb)) {
                g = Math.min(this.lb, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.li - (this.li - 1) * g);
            var j = (h - i) / (this.li - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.m7 = function (a) {
        var b = 0.5;
        if (this.li > 1) {
            var c = this.lc(Rect.empty, Rect.empty, Rect.empty);
            var d = 0;
            if (!isNaN_(this.lb)) {
                d = Math.min(this.lb, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.li - (this.li - 1) * d);
            var g = (e - f) / (this.li - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.ia = function (a) {
        _super.prototype.ia.call(this, a);
        var b = this.bi != null ? this.bi.vl : Rect.empty;
        var c = !b.isEmpty ? this.ke : Rect.empty;
        var d = this.j9();
        var e = this.j8();
        var f = this.mn.c(a, c, b, d, e);
        if (f != null) {
            this.m0 = f.f.m;
            this.m1 = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.m6 = function (a, b, c) {
        var d;
        var e;
        var f = this.mq.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (d == 0) {
            if (this.ch) {
                return this.lg;
            }
            else {
                return 0;
            }
        }
        var g = this.getUnscaledAngle(d);
        if (g < 0 || g > this.lg) {
            g = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.m5 = function (a, b, c) {
        var d;
        var e;
        var f = this.mq.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (e > Math.PI * 2) {
            e = e - Math.PI * 2;
        }
        if (e == Math.PI * 2) {
            if (this.ch) {
                return 0;
            }
            else {
                return this.lg;
            }
        }
        var g = this.getUnscaledAngle(e);
        if (g < 0 || g > this.lg) {
            g = this.getUnscaledAngle(e + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.lg;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.ci) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.mz;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.mz) {
            a += 2 * Math.PI;
        }
        var b = (a - this.mz) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        return b * (this.lg);
    };
    CategoryAngleAxis.prototype.ek = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.en = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.d4 = function (a) {
        var b = { $type: Point_$type, x: 0.5, y: 0.5 };
        var c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
        var d = Math.acos((a.x - b.x) / c);
        if ((a.y - b.y) < 0) {
            d = (2 * Math.PI) - d;
        }
        return d;
    };
    CategoryAngleAxis.prototype.hx = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.hx.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nn(f);
                if (f != null) {
                    f.n4(this);
                }
                this.cq = true;
                this.h9(false);
                break;
            case CategoryAngleAxis.$$p[1]:
                this.mz = this.nb;
                while (this.mz < 0) {
                    this.mz += 360;
                }
                while (this.mz >= 360) {
                    this.mz -= 360;
                }
                this.mz = (this.mz * Math.PI) / 180;
                this.cq = true;
                this.h9(false);
                try {
                    for (var _d = __values(fromEnum(this.de)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.rn(false);
                        g.qh();
                    }
                }
                catch (e_2_1) {
                    e_2 = { error: e_2_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                }
                break;
            case "Label":
            case CategoryAngleAxis.$$p[0]:
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.cq = true;
                            h.h8();
                        }
                    }
                    catch (e_3_1) {
                        e_3 = { error: e_3_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_3)
                                throw e_3.error;
                        }
                    }
                }
                break;
            case "CrossingValue":
                if (e != null) {
                    try {
                        for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                            var i = _j.value;
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.cq = true;
                                i.h8();
                            }
                        }
                    }
                    catch (e_4_1) {
                        e_4 = { error: e_4_1 };
                    }
                    finally {
                        try {
                            if (_j && !_j.done && (_c = _h.return))
                                _c.call(_h);
                        }
                        finally {
                            if (e_4)
                                throw e_4.error;
                        }
                    }
                }
                break;
            case "LabelSettings":
                this.mn = this.mm();
                this.nl();
                this.cq = true;
                this.h9(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.nl = function () {
        this.my = NaN;
    };
    CategoryAngleAxis.prototype.nn = function (a) {
        this.mp = a;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "m8", {
        get: function () {
            return this.c(CategoryAngleAxis.no);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.no, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "m0", {
        get: function () {
            return this.mw;
        },
        set: function (a) {
            if (this.m0 != a) {
                var b = this.mw;
                this.mw = a;
                this.h3("ActualInterval", b, this.m0);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ew = function () {
        return this.m0;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "m9", {
        get: function () {
            return this.c(CategoryAngleAxis.nq);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.nq, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "m1", {
        get: function () {
            return this.mx;
        },
        set: function (a) {
            if (this.m1 != a) {
                var b = this.mx;
                this.mx = a;
                this.h3("ActualMinorInterval", b, this.m1);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.mt = function () {
        return !isNaN_(this.m8);
    };
    CategoryAngleAxis.prototype.get_a2 = function () {
        return 2;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.c3 = function () {
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        if (this.ks == null) {
            return false;
        }
        var a = this.ks.count;
        if (a != this.nd) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.nd, a);
            this.nd = a;
            this.h4(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "nd", {
        get: function () {
            return this.nc;
        },
        set: function (a) {
            this.nc = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j6 = function (a, b, c, d, e) {
        var f = typeCast(RadialAxisRenderingParameters.$, this.mn.d(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "isVertical", {
        get: function () {
            return this.cp;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$d = function (a, b) {
        return this.en.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.ek.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) {
        this.hn.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.ho.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$g = function (a, b, c, d) {
        this.hp.apply(this, arguments);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "j$b", {
        get: function () {
            return this.ch;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.no = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.h3("Interval", b.oldValue, b.newValue);
        a.h9(false);
    }));
    CategoryAngleAxis.nq = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).h3("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).h9(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h3', ['LabelMode:mi:np', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:nb:nr', [1, 0]]);
    return CategoryAngleAxis;
}(CategoryAxisBase));
export { CategoryAngleAxis };
/**
 * @hidden
 */
var NumericAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAngleAxis, _super);
    function NumericAngleAxis() {
        var _this = _super.call(this) || this;
        _this.nn = null;
        _this.no = false;
        _this.np = NaN;
        _this.nq = 0;
        _this.nl = null;
        _this.ab = NumericAngleAxis.$;
        _this.nn = new PolarAxisRenderingManager();
        _this.k1 = _this.kz();
        return _this;
    }
    NumericAngleAxis.prototype.a4 = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.ht = function (a) {
        _super.prototype.ht.call(this, a);
        this.nk = a;
    };
    NumericAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    NumericAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.di = function (b, c, d) {
            var e = _this.bi != null ? _this.bi.vl : Rect.empty;
            var f = !e.isEmpty ? _this.ke : Rect.empty;
            var g = _this.j9();
            return _this.n2(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
        };
        return a;
    };
    NumericAngleAxis.prototype.nr = function () {
        if (this.nm == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.nm.nu();
        }
        else {
            return this.nm.nv((this.fw));
        }
    };
    NumericAngleAxis.prototype.nt = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.kz = function () {
        var _this = this;
        var a = _super.prototype.kz.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.nm != null && _this.np != b) {
                var c = typeCast(XamDataChart.$, _this.bi);
                if (c == null) {
                    return;
                }
                _this.np = b;
                _this.aw.bg = b;
                c.nr();
                try {
                    for (var _b = __values(fromEnum(c.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        if (d != _this && typeCast(AngleAxisLabelPanel.$, d.aw) !== null) {
                            d.a5.ai();
                        }
                    }
                }
                catch (e_5_1) {
                    e_5 = { error: e_5_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_5)
                            throw e_5.error;
                    }
                }
            }
        };
        a.e = function (b) {
            b.n = _this.nr();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.nn.k(b.t, b.n, b.z, b.y, b.aa, c.center, c.minAngle, c.maxAngle);
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nn.o(c, d, b.z, b.y, b.aa, e.minLength, e.maxLength, e.center);
        };
        a.l = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nn.p(c, d, e, f.z, f.y, b.aa, f.minLength, f.maxLength, f.center);
        };
        a.d = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, _this.k2(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.no) {
                _this.no = true;
                _this.nm.c1();
                _this.no = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.nm != null; };
        a.q = function (b, c) {
            if (_this.nt(c - _this.nq) < 0) {
                return false;
            }
            if (_this.nt(c - _this.nq - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.n2(_this.getScaledAngle(e.l), e.center, b.aa, b.z, b.y, 0);
            var g = _this.n2(c, e.center, b.aa, b.z, b.y, 0);
            if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                return false;
            }
            if (g.x < b.z.right && g.x >= b.z.left && g.y < b.z.bottom && g.y >= b.z.top) {
                return true;
            }
            return false;
        };
        a.r = function (b, c, d, e) {
            if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) {
                return b.m;
            }
            else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericAngleAxis.prototype.n2 = function (a, b, c, d, e, f) {
        var g = this.nr();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    NumericAngleAxis.prototype.ek = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.l4) / (this.l3 - this.l4);
        }
        else {
            d = (a - this.ly) / (this.lx - this.ly);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.nq;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.lk, this.ci);
    };
    NumericAngleAxis.prototype.en = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.nq) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lk) {
            return Math.exp(b * (this.l3 - this.l4) + this.l4);
        }
        else {
            return this.ly + b * (this.lx - this.ly);
        }
    };
    NumericAngleAxis.prototype.nj = function () {
        if (this.ni == 0) {
            return 1;
        }
        else {
            return this.ni;
        }
    };
    NumericAngleAxis.prototype.hx = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.hx.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nz(f);
                if (f != null) {
                    f.n4(this);
                }
                this.h9(false);
                break;
            case NumericAngleAxis.$$p[1]:
                this.nq = this.nu;
                while (this.nq < 0) {
                    this.nq += 360;
                }
                while (this.nq >= 360) {
                    this.nq -= 360;
                }
                this.nq = (this.nu * Math.PI) / 180;
                this.h9(false);
                try {
                    for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.rn(false);
                        g.qh();
                    }
                }
                catch (e_6_1) {
                    e_6 = { error: e_6_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_6)
                            throw e_6.error;
                    }
                }
                break;
            case "Label":
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.h8();
                        }
                    }
                    catch (e_7_1) {
                        e_7 = { error: e_7_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_7)
                                throw e_7.error;
                        }
                    }
                }
                break;
            case "CrossingValue":
                if (e != null) {
                    try {
                        for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                            var i = _j.value;
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.h8();
                            }
                        }
                    }
                    catch (e_8_1) {
                        e_8 = { error: e_8_1 };
                    }
                    finally {
                        try {
                            if (_j && !_j.done && (_c = _h.return))
                                _c.call(_h);
                        }
                        finally {
                            if (e_8)
                                throw e_8.error;
                        }
                    }
                }
                break;
            case "LabelSettings":
                this.k1 = this.kz();
                this.nx();
                this.cq = true;
                this.h9(false);
                break;
        }
    };
    NumericAngleAxis.prototype.nx = function () {
        this.np = NaN;
    };
    NumericAngleAxis.prototype.k3 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.k2 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k2.call(this, a, b, c, d));
        var f = this.nn.h(b, a, c);
        var g = this.nn.i(b, a, c);
        var h = 0.5 * this.nm.np;
        var i = 0.5 * this.nm.no;
        var j = f;
        var k = g;
        var l = this.nm.nu();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.nn.m(b, a, c, e, this.ly, this.lx, this.ch, runOn(this, this.getUnscaledAngle), m);
        var n = { $type: Point_$type, x: 0.5, y: 0.5 };
        e.center = n;
        e.maxLength = k;
        e.minLength = j;
        e.effectiveMaximum = l;
        return e;
    };
    NumericAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
        var f = this.nn.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    NumericAngleAxis.prototype.ia = function (a) {
        _super.prototype.ia.call(this, a);
        var b = this.bi != null ? this.bi.vl : Rect.empty;
        var c = !b.isEmpty ? this.ke : Rect.empty;
        var d = this.j9();
        var e = this.j8();
        var f = this.k1.c(a, c, b, d, e);
        if (f != null) {
            this.lw = f.f.m;
            this.lz = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "nm", {
        get: function () {
            if (this.nl != null) {
                return this.nl;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].cm) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.nl;
        },
        set: function (a) {
            this.nl = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.ak = function () {
        return this.nm;
    };
    NumericAngleAxis.prototype.nz = function (a) {
        this.nm = a;
    };
    NumericAngleAxis.prototype.iq = function (a, b) {
        _super.prototype.iq.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c1();
        }
    };
    NumericAngleAxis.prototype.get_a2 = function () {
        return 2;
    };
    Object.defineProperty(NumericAngleAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.j6 = function (a, b, c, d, e) {
        if (this.nm == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.k2(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
    NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'h3', ['LabelMode:ni:n0', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:nu:n1', [1, 0]]);
    return NumericAngleAxis;
}(NumericAxisBase));
export { NumericAngleAxis };
/**
 * @hidden
 */
var NumericRadiusAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericRadiusAxis, _super);
    function NumericRadiusAxis() {
        var _this = _super.call(this) || this;
        _this.nl = null;
        _this.nm = false;
        _this.nn = NaN;
        _this.np = 0;
        _this.no = 0;
        _this.nr = 0;
        _this.ni = null;
        _this.ab = NumericRadiusAxis.$;
        _this.np = _this.nz;
        _this.no = _this.ny;
        _this.nl = new PolarAxisRenderingManager();
        _this.k1 = _this.kz();
        return _this;
    }
    NumericRadiusAxis.prototype.a4 = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.ht = function (a) {
        _super.prototype.ht.call(this, a);
        this.nk = a;
    };
    NumericRadiusAxis.prototype.get_cm = function () {
        return true;
    };
    NumericRadiusAxis.prototype.ej = function () {
        var a = this.np;
        var b = this.no;
        var c = Math.min(this.nt(), this.ns()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.nt = function () {
        return this.ke.width;
    };
    NumericRadiusAxis.prototype.ns = function () {
        return this.ke.height;
    };
    NumericRadiusAxis.prototype.av = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.nq = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.kz = function () {
        var _this = this;
        var a = _super.prototype.kz.call(this);
        a.b.c = function (b) {
            if ((_this.az == null || _this.az.visibility == 0) && _this.nj != null) {
                if ((_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) && _this.nn != b) {
                    _this.nn = b;
                    _this.aw.bg = b;
                    _this.bi.nr();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nl.k(c, d, e.z, e.y, e.aa, e.center, e.minAngle, e.maxAngle);
        };
        a.l = function (b, c, d, e) {
            if (d == e) {
                return;
            }
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nl.l(c, d, e, f.z, f.y, f.aa, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.nv(c); };
        a.q = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return c <= d.effectiveMaximum;
        };
        a.n = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return c <= d.effectiveMaximum;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nl.o(b.t, c.crossingAngleRadians, b.z, b.y, b.aa, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.az == null || (_this.az.c == 4 || _this.az.c == 0) ? b.z.top : b.z.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.nq(_this.fw) * Math.PI) / 180;
            if (_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) {
                c.n = ViewportUtils.i(0.5, c.aa, c.z, c.y) - b.z.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.aw);
                if (d != null) {
                    var e = 0;
                    if (_this.az != null && _this.az.c == 4) {
                        e = 1;
                    }
                    d.dy = { $type: Point_$type, x: ViewportUtils.e(0.5, c.aa, c.z, c.y), y: e };
                    d.dv = c.crossingAngleRadians;
                }
            }
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            if (_this.nj == null) {
                return false;
            }
            if (c > e.effectiveMaximum) {
                return false;
            }
            var f = false;
            f = _this.az == null || (_this.az.c == 4 || _this.az.c == 5);
            var g = 0;
            if (f) {
                g = _this.nr;
            }
            var h = e.center.x + c * Math.cos(g);
            var i = e.center.y + c * Math.sin(g);
            h = ViewportUtils.e(h, e.aa, e.z, e.y);
            i = ViewportUtils.i(i, e.aa, e.z, e.y);
            if (h <= b.z.right && h >= b.z.left && ((i <= b.z.bottom && i >= b.z.top) || !f)) {
                return true;
            }
            return false;
        };
        a.h = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return new LabelPosition(ViewportUtils.e(d.center.x + c, d.aa, d.z, d.y));
        };
        a.r = function (b, c, d, e) {
            if (c < b.m) {
                return b.m;
            }
            else if (c > b.l) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericRadiusAxis.prototype.ek = function (a, b) {
        return this.nv(a);
    };
    NumericRadiusAxis.prototype.nw = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.ly) - this.l4) / (this.l3 - this.l4);
            }
            else {
                f = (Math.log(a) - this.l4) / (this.l3 - this.l4);
            }
        }
        else {
            f = (a - this.ly) / (this.lx - this.ly);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.nv = function (a) {
        return this.nw(a, this.lk, this.ci, this.np, this.no);
    };
    NumericRadiusAxis.prototype.nx = function (a) {
        var b = a * 2;
        b = (b - this.no) / (this.np - this.no);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lk) {
            return Math.exp(b * (this.l3 - this.l4) + this.l4);
        }
        else {
            return this.ly + b * (this.lx - this.ly);
        }
    };
    NumericRadiusAxis.prototype.en = function (a, b) {
        return this.nx(a);
    };
    NumericRadiusAxis.prototype.hx = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.nr = this.nq(this.fw) * Math.PI / 180;
                break;
        }
        _super.prototype.hx.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.np = this.nz;
                if (this.np < 0) {
                    this.np = 0.1;
                }
                if (this.np > 1) {
                    this.np = 1;
                }
                if (this.no >= this.np) {
                    this.no = this.np - 0.01;
                    if (this.no < 0) {
                        this.no = 0;
                        this.np = 0.01;
                    }
                }
                this.cq = true;
                this.h9(false);
                if (this.nj != null) {
                    this.nj.h8();
                }
                try {
                    for (var _c = __values(fromEnum(this.db())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.rn(false);
                    }
                }
                catch (e_9_1) {
                    e_9 = { error: e_9_1 };
                }
                finally {
                    try {
                        if (_d && !_d.done && (_a = _c.return))
                            _a.call(_c);
                    }
                    finally {
                        if (e_9)
                            throw e_9.error;
                    }
                }
                break;
            case NumericRadiusAxis.$$p[0]:
                this.no = this.ny;
                if (this.no < 0) {
                    this.no = 0.1;
                }
                if (this.no > 1) {
                    this.no = 1;
                }
                if (this.no >= this.np) {
                    this.no = this.np - 0.01;
                    if (this.no < 0) {
                        this.no = 0;
                        this.np = 0.01;
                    }
                }
                this.cq = true;
                this.h9(false);
                if (this.nj != null) {
                    this.nj.h8();
                }
                try {
                    for (var _e = __values(fromEnum(this.db())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.gy = true;
                        f.rn(false);
                    }
                }
                catch (e_10_1) {
                    e_10 = { error: e_10_1 };
                }
                finally {
                    try {
                        if (_f && !_f.done && (_b = _e.return))
                            _b.call(_e);
                    }
                    finally {
                        if (e_10)
                            throw e_10.error;
                    }
                }
                if (this.bi != null) {
                    this.bi.n5();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.n4(null);
                }
                if (g != null) {
                    this.n4(g);
                    g.nz(this);
                }
                if (h != null) {
                    this.n4(h);
                    h.nn(this);
                }
                this.cq = true;
                this.h9(false);
                break;
            case "IsInverted":
                if (this.nj != null) {
                    this.nj.cq = true;
                    this.nj.h9(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.n4 = function (a) {
        this.nj = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "nj", {
        get: function () {
            if (this.ni != null) {
                return this.ni;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericAngleAxis.$, a.axes._inner[b]) !== null || typeCast(CategoryAngleAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.ni;
        },
        set: function (a) {
            this.ni = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.ak = function () {
        return this.nj;
    };
    NumericRadiusAxis.prototype.k3 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.k2 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k2.call(this, a, b, c, d));
        var f = this.nl.h(b, a, c);
        var g = this.nl.i(b, a, c);
        var h = 0.5 * this.np;
        var i = 0.5 * this.no;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.vx)) {
            k = this.lx;
            j = this.ly;
        }
        else {
            k = Math.min(g, h);
            j = this.nx(f);
            k = this.nx(k);
            var l = this.n5(a, c, b, j, k);
            j = l.p3;
            k = l.p4;
        }
        var m = { $type: Point_$type, x: 0.5, y: 0.5 };
        var n = f;
        var o = g;
        var p = Math.min(d.width, d.height) * (this.np - this.no) / 2;
        if (this.nr == 0) {
            p = d.width * (this.np - this.no) / 2;
        }
        e.center = m;
        var q = Math.max(o, n);
        var r = Math.min(n, o);
        e.maxLength = q;
        e.minLength = r;
        var s = Math.min(j, k);
        var t = Math.max(j, k);
        if (s < this.ly) {
            s = this.ly;
        }
        if (t > this.lx) {
            t = this.lx;
        }
        this.l1 = s;
        this.l0 = t;
        e.k.add(((function () {
            var $ret = new RangeInfo();
            $ret.d = s;
            $ret.c = t;
            $ret.b = p;
            return $ret;
        })()));
        var u = typeCast(IAngleScaler_$type, this.nj);
        if (u != null) {
            var v = void 0;
            var w = void 0;
            var x = u.getMinMaxAngle(b, a, c, v, w);
            v = x.p3;
            w = x.p4;
            e.minAngle = Math.min(v, w);
            e.maxAngle = Math.max(v, w);
        }
        var y = this.nu();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.k6;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.n0(m, e.minLength, e.maxLength, b, a, c);
        }
        return e;
    };
    NumericRadiusAxis.prototype.n5 = function (a, b, c, d, e) {
        var f = { $type: Point_$type, x: 0.5, y: 0.5 };
        var g = 0;
        if (this.ch) {
            g = this.nv(this.ly);
        }
        else {
            g = this.nv(this.lx);
        }
        var h = 0;
        if (this.fw != null) {
            h = this.nr;
        }
        var i = f.x + g * Math.cos(h);
        var j = f.y + g * Math.sin(h);
        f.x = ViewportUtils.e(f.x, c, a, b);
        f.y = ViewportUtils.i(f.y, c, a, b);
        i = ViewportUtils.e(i, c, a, b);
        j = ViewportUtils.i(j, c, a, b);
        if (i >= a.left && i <= a.right && j >= a.top && j <= a.bottom) {
            if (this.ch) {
                e = this.ly;
            }
            else {
                e = this.lx;
            }
        }
        if (f.x >= a.left && f.x <= a.right && f.y >= a.top && f.y <= a.bottom) {
            if (this.ch) {
                d = this.lx;
            }
            else {
                d = this.ly;
            }
        }
        return {
            p3: d,
            p4: e
        };
    };
    NumericRadiusAxis.prototype.n0 = function (a, b, c, d, e, f) {
        var g = ViewportUtils.d(c - b, d, e, f);
        var h = g / Math.min(e.width, e.height);
        if (h > 0.7) {
            return 10;
        }
        return 5;
    };
    NumericRadiusAxis.prototype.nu = function () {
        var a = 0;
        if (!this.ch) {
            a = this.nv(this.lx);
        }
        else {
            a = this.nv(this.ly);
        }
        return a;
    };
    NumericRadiusAxis.prototype.m3 = function (a) {
        if (this.nj != null) {
            this.nj.h8();
        }
    };
    NumericRadiusAxis.prototype.ia = function (a) {
        _super.prototype.ia.call(this, a);
        var b = this.bi != null ? this.bi.vl : Rect.empty;
        var c = !b.isEmpty ? this.ke : Rect.empty;
        var d = this.j9();
        var e = this.j8();
        var f = this.k1.c(a, c, b, d, e);
        if (f != null) {
            this.lw = f.f.m;
            this.lz = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.iq = function (a, b) {
        _super.prototype.iq.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c1();
        }
    };
    NumericRadiusAxis.prototype.n3 = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.k2(b, c, d, e));
        if (f == null) {
            return;
        }
        this.nl.l(a.d, f.minLength, f.maxLength, b, d, c, f.center, f.minAngle, f.maxAngle);
    };
    NumericRadiusAxis.prototype.get_a2 = function () {
        return 3;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.j6 = function (a, b, c, d, e) {
        var f = typeCast(PolarAxisRenderingParameters.$, this.k2(c, b, d, e));
        var g = a;
        var h = new PathGeometry();
        var i = ViewportUtils.d(g, b, c, d);
        var j = ViewportUtils.h(g, b, c, d);
        if (i <= 0 || j <= 0) {
            return null;
        }
        var k = ViewportUtils.e(f.center.x, b, c, d);
        var l = ViewportUtils.i(f.center.y, b, c, d);
        if (f.maxAngle - f.minAngle < Math.PI && f.maxAngle - f.minAngle > 0) {
            var m = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.minAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.minAngle), b, c, d) };
            var n_1 = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.maxAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.maxAngle), b, c, d) };
            var o = new PathFigure();
            o._startPoint = m;
            o._isClosed = false;
            o._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = n_1;
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(o);
        }
        else {
            var p = new PathFigure();
            p._startPoint = { $type: Point_$type, x: k, y: l - j };
            p._isClosed = true;
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l + j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l - j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(p);
        }
        return h;
    };
    NumericRadiusAxis.$t = markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$);
    NumericRadiusAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericRadiusAxis, 'h3', ['InnerRadiusExtentScale:ny:n6', [1, 0], 'RadiusExtentScale:nz:n7', [1, 0.75]]);
    return NumericRadiusAxis;
}(NumericAxisBase));
export { NumericRadiusAxis };
/**
 * @hidden
 */
var AngleAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AngleAxisLabelPanelView, _super);
    function AngleAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    AngleAxisLabelPanelView.prototype.an = function () {
        _super.prototype.an.call(this);
        this.az.da = true;
    };
    AngleAxisLabelPanelView.prototype.a1 = function (a, b) {
        this.az.df = -1.7976931348623157E+308;
        this.az.dc = -1.7976931348623157E+308;
        this.az.de = -1.7976931348623157E+308;
        this.az.dd = -1.7976931348623157E+308;
        for (var c = 0; c < this.a.bb.count; c++) {
            var d = this.a.bb._inner[c];
            var e = this.a.ba._inner[c];
            var f = e.a;
            var g = this.az.di(e.c, NaN, NaN);
            var h = this.m(d);
            var i = this.l(d);
            var j = h + this.p() + this.q();
            var k = i + this.r() + this.o();
            var l = g.x - j / 2;
            var m = g.y - k / 2;
            this.az.de = Math.max(h, this.az.de);
            this.az.dd = Math.max(i, this.az.dd);
            this.az.df = Math.max(j, this.az.df);
            this.az.dc = Math.max(k, this.az.dc);
            var n = new Rect(0, l, m, j, k);
            a.add(n);
            b.add(f);
        }
    };
    AngleAxisLabelPanelView.prototype.a0 = function (a, b) {
        this.az.db = -1.7976931348623157E+308;
        var c = 0;
        if (typeCast(CategoryAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.m2() * this.az.ad.ke.width;
        }
        else if (typeCast(NumericAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.nr() * this.az.ad.ke.width;
        }
        var d = { $type: Point_$type, x: this.az.ad.ke.width * 0.5, y: this.az.ad.ke.width * 0.5 };
        for (var e = 0; e < this.a.bb.count; e++) {
            var f = this.a.bb._inner[e];
            var g = this.a.ba._inner[e];
            var h = g.a;
            var i = this.m(f);
            var j = this.l(f);
            var k = i + this.p() + this.q();
            var l = j + this.r() + this.o();
            var m = this.az.di(g.c, k, l);
            var n = m.x - k / 2;
            var o = m.y - l / 2;
            var p = new Rect(0, n, o, i, j);
            if (!h) {
                var q = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.top - d.y) * (p.top - d.y));
                var r = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.top - d.y) * (p.top - d.y));
                var s = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                var t = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                this.az.db = Math.max(q - c, this.az.db);
                this.az.db = Math.max(r - c, this.az.db);
                this.az.db = Math.max(s - c, this.az.db);
                this.az.db = Math.max(t - c, this.az.db);
            }
            a.add(p);
            b.add(h);
        }
    };
    AngleAxisLabelPanelView.prototype.o = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.p = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.q = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.r = function () {
        return 0;
    };
    AngleAxisLabelPanelView.$t = markType(AngleAxisLabelPanelView, 'AngleAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return AngleAxisLabelPanelView;
}(AxisLabelPanelBaseView));
export { AngleAxisLabelPanelView };
/**
 * @hidden
 */
var CategoryAngleAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAngleAxisView, _super);
    function CategoryAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    CategoryAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jx = AxisDefaults.h;
        this.a.j0 = AxisDefaults.g;
    };
    CategoryAngleAxisView.$t = markType(CategoryAngleAxisView, 'CategoryAngleAxisView', CategoryAxisBaseView.$);
    return CategoryAngleAxisView;
}(CategoryAxisBaseView));
export { CategoryAngleAxisView };
/**
 * @hidden
 */
var NumericAngleAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAngleAxisView, _super);
    function NumericAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jx = AxisDefaults.h;
        this.a.j0 = AxisDefaults.g;
    };
    NumericAngleAxisView.$t = markType(NumericAngleAxisView, 'NumericAngleAxisView', NumericAxisBaseView.$);
    return NumericAngleAxisView;
}(NumericAxisBaseView));
export { NumericAngleAxisView };
/**
 * @hidden
 */
var NumericRadiusAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericRadiusAxisView, _super);
    function NumericRadiusAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericRadiusAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jx = AxisDefaults.h;
        this.a.j0 = AxisDefaults.g;
    };
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
