UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

2,991 lines 107 kB
/*
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 { Control } from "igniteui-angular-core";
import { INotifyPropertyChanged_$type, Base, PropertyChangedEventArgs, runOn, delegateCombine, Point_$type, Number_$type, enumGetBox, Delegate_$type, typeCast, String_$type, Array_$type, delegateRemove, fromEn, fromEnum, markType, markDep, TypeRegistrar } from "igniteui-angular-core";
import { DoubleAnimator } from "igniteui-angular-core";
import { BrushCollection } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { HighlightedValueDisplayMode_$type } from "igniteui-angular-core";
import { SweepDirection_$type } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { RadialGaugeNeedleShape_$type } from "./RadialGaugeNeedleShape";
import { RadialGaugePivotShape_$type } from "./RadialGaugePivotShape";
import { RadialGaugeScaleOversweepShape_$type } from "./RadialGaugeScaleOversweepShape";
import { RadialGaugeBackingShape_$type } from "./RadialGaugeBackingShape";
import { RadialGaugeRangeCollection } from "./RadialGaugeRangeCollection";
import { RadialGaugeDuplicateLabelOmissionStrategy_$type } from "./RadialGaugeDuplicateLabelOmissionStrategy";
import { BindingFormatter } from "igniteui-angular-core";
import { RadialGaugeScaler } from "./RadialGaugeScaler";
import { Rect } from "igniteui-angular-core";
import { RadialGaugeFrame } from "./RadialGaugeFrame";
import { StackPool$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { TextBlock } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
import { FontDefaults } from "igniteui-angular-core";
import { AlignRadialGaugeLabelEventArgs } from "./AlignRadialGaugeLabelEventArgs";
import { FormatRadialGaugeLabelEventArgs } from "./FormatRadialGaugeLabelEventArgs";
import { MathUtil } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { Stack$1 } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { DoubleValueChangedEventArgs } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { XamRadialGaugeRange } from "./XamRadialGaugeRange";
import { PathGeometry } from "igniteui-angular-core";
import { PolygonUtil } from "igniteui-angular-core";
import { TransformGroup } from "igniteui-angular-core";
import { RotateTransform } from "igniteui-angular-core";
import { RadialGaugeNeedleParameters } from "./RadialGaugeNeedleParameters";
import { RadialGaugeNeedlePreparer } from "./RadialGaugeNeedlePreparer";
import { BrushUtil } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { RadialGaugeRangeFrame } from "./RadialGaugeRangeFrame";
import { ArcSegment } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { GaugeVisualData } from "./GaugeVisualData";
import { RectData } from "igniteui-angular-core";
import { ScaleLabelVisualDataList } from "./ScaleLabelVisualDataList";
import { ScaleTickmarkVisualDataList } from "./ScaleTickmarkVisualDataList";
import { RangeVisualDataList } from "./RangeVisualDataList";
import { NeedleVisualData } from "./NeedleVisualData";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_, isInfinity, truncate } from "igniteui-angular-core";
import { EventProxy } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { CanvasScalingHelpers } from "igniteui-angular-core";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { ScaleLabelVisualData } from "./ScaleLabelVisualData";
import { ScaleTickmarkVisualData } from "./ScaleTickmarkVisualData";
import { RangeVisualData } from "./RangeVisualData";
import { PathVisualData } from "igniteui-angular-core";
import { PointData } from "igniteui-angular-core";
import { SizeData } from "igniteui-angular-core";
import { AppearanceHelper } from "igniteui-angular-core";
import { arrayCopy1 } from "igniteui-angular-core";
/**
 * @hidden
 */
var XamRadialGauge = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamRadialGauge, _super);
    function XamRadialGauge() {
        var _this = _super.call(this) || this;
        _this.propertyChanged = null;
        _this.alignTitle = null;
        _this.alignSubtitle = null;
        _this.alignHighlightLabel = null;
        _this.formatTitle = null;
        _this.formatSubtitle = null;
        _this.formatHighlightLabel = null;
        _this._view = null;
        _this.bc = null;
        _this.c4 = 0;
        _this.c3 = 100;
        _this.bw = 0;
        _this.c2 = 0.5;
        _this.bt = 1;
        _this.bx = 0;
        _this.formatLabel = null;
        _this.am = null;
        _this.alignLabel = null;
        _this.valueChanged = null;
        _this.highlightValueChanged = null;
        _this.cb = false;
        _this.a9 = null;
        _this.mn = new Size(1, NaN, NaN);
        _this.ml = null;
        _this.cw = null;
        _this.cx = null;
        _this.cu = null;
        _this.cv = null;
        _this.a4 = null;
        _this.a3 = null;
        _this.a2 = null;
        _this.cz = new Stack$1(TextBlock.$);
        _this.c0 = new Stack$1(TextBlock.$);
        _this.c1 = new Stack$1(TextBlock.$);
        _this.cy = new Stack$1(TextBlock.$);
        _this.ct = new List$1(Path.$, 0);
        _this.cs = new List$1(Path.$, 0);
        _this.cr = new List$1(Path.$, 0);
        _this.c7 = 0;
        _this.b3 = null;
        _this.b0 = null;
        _this.bz = null;
        _this.b2 = null;
        _this.b4 = null;
        _this.by = null;
        _this.b1 = null;
        _this.c6 = NaN;
        _this.c5 = 1;
        _this.em = 0;
        _this.ao = null;
        _this.ap = null;
        _this.an = null;
        _this.bj = XamRadialGauge.bm();
        _this.bk = XamRadialGauge.bn();
        _this.bl = XamRadialGauge.bo();
        _this.view = new XamRadialGaugeView(_this);
        _this.view.az();
        _this.ml = Rect.empty;
        _this.a4 = new RadialGaugeFrame();
        _this.a3 = new RadialGaugeFrame();
        _this.a2 = new RadialGaugeFrame();
        _this.ranges = new RadialGaugeRangeCollection();
        _this.cb = true;
        _this.bc = new DoubleAnimator(0, 1, _this.fg);
        var a = _this.bc;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(_this, _this.il));
        _this.ab = XamRadialGauge.$;
        _this.bz = ((function () {
            var $ret = new StackPool$1(TextBlock.$);
            $ret.b = runOn(_this.view, _this.view.ar);
            $ret.c = runOn(_this.view, _this.view.as);
            $ret.d = runOn(_this.view, _this.view.at);
            $ret.j = runOn(_this.view, _this.view.bm);
            return $ret;
        })());
        _this.b4 = ((function () {
            var $ret = new StackPool$1(TextBlock.$);
            $ret.b = runOn(_this.view, _this.view.ar);
            $ret.c = runOn(_this.view, _this.view.as);
            $ret.d = runOn(_this.view, _this.view.bh);
            $ret.j = runOn(_this.view, _this.view.bo);
            return $ret;
        })());
        _this.b2 = ((function () {
            var $ret = new StackPool$1(TextBlock.$);
            $ret.b = runOn(_this.view, _this.view.ar);
            $ret.c = runOn(_this.view, _this.view.as);
            $ret.d = runOn(_this.view, _this.view.bg);
            $ret.j = runOn(_this.view, _this.view.bn);
            return $ret;
        })());
        _this.by = ((function () {
            var $ret = new StackPool$1(TextBlock.$);
            $ret.b = runOn(_this.view, _this.view.ar);
            $ret.c = runOn(_this.view, _this.view.as);
            $ret.d = runOn(_this.view, _this.view.ap);
            $ret.j = runOn(_this.view, _this.view.bl);
            return $ret;
        })());
        _this.b3 = ((function () {
            var $ret = new StackPool$1(Path.$);
            $ret.b = runOn(_this.view, _this.view.a2);
            $ret.c = runOn(_this.view, _this.view.a3);
            $ret.d = runOn(_this.view, _this.view.a4);
            $ret.j = runOn(_this.view, _this.view.ce);
            return $ret;
        })());
        _this.b0 = ((function () {
            var $ret = new StackPool$1(Path.$);
            $ret.b = runOn(_this.view, _this.view.a2);
            $ret.c = runOn(_this.view, _this.view.a3);
            $ret.d = runOn(_this.view, _this.view.a4);
            $ret.j = runOn(_this.view, _this.view.ce);
            return $ret;
        })());
        _this.b1 = ((function () {
            var $ret = new StackPool$1(Path.$);
            $ret.b = runOn(_this.view, _this.view.a7);
            $ret.c = runOn(_this.view, _this.view.a8);
            $ret.d = runOn(_this.view, _this.view.a9);
            $ret.j = runOn(_this.view, _this.view.cf);
            return $ret;
        })());
        _this.a9 = new RadialGaugeScaler(_this.da, _this.c9, _this.ez, _this.eu, _this.mi);
        return _this;
    }
    XamRadialGauge.prototype.iz = function (a) {
        this.i5(a);
    };
    XamRadialGauge.prototype.i5 = function (a) {
        var b = this.propertyChanged;
        if (b != null) {
            b(this, new PropertyChangedEventArgs(a));
        }
    };
    XamRadialGauge.bn = function () {
        if (XamRadialGauge.bh != null) {
            return XamRadialGauge.bh;
        }
        XamRadialGauge.bh = ((function () {
            var $ret = new FontInfo();
            $ret.f = FontDefaults.gaugesSubtitleSize;
            $ret.t = FontDefaults.gaugesFontStyle;
            $ret.q = FontDefaults.gaugesFontFamily;
            $ret.v = FontDefaults.gaugesFontWeight;
            $ret.r = FontDefaults.gaugesFontStretch;
            $ret.u = FontDefaults.gaugesFontVariant;
            return $ret;
        })());
        return XamRadialGauge.bh;
    };
    XamRadialGauge.bo = function () {
        if (XamRadialGauge.bi != null) {
            return XamRadialGauge.bi;
        }
        XamRadialGauge.bi = ((function () {
            var $ret = new FontInfo();
            $ret.f = FontDefaults.gaugesTitleSize;
            $ret.t = FontDefaults.gaugesFontStyle;
            $ret.q = FontDefaults.gaugesFontFamily;
            $ret.v = FontDefaults.gaugesFontWeight;
            $ret.r = FontDefaults.gaugesFontStretch;
            $ret.u = FontDefaults.gaugesFontVariant;
            return $ret;
        })());
        return XamRadialGauge.bi;
    };
    XamRadialGauge.bm = function () {
        if (XamRadialGauge.bg != null) {
            return XamRadialGauge.bg;
        }
        XamRadialGauge.bg = ((function () {
            var $ret = new FontInfo();
            $ret.f = FontDefaults.gaugesTitleSize;
            $ret.t = FontDefaults.gaugesFontStyle;
            $ret.q = FontDefaults.gaugesFontFamily;
            $ret.v = FontDefaults.gaugesFontWeight;
            $ret.r = FontDefaults.gaugesFontStretch;
            $ret.u = FontDefaults.gaugesFontVariant;
            return $ret;
        })());
        return XamRadialGauge.bg;
    };
    XamRadialGauge.prototype.av = function (a, b, c, d, e, f) {
        var g = new FormatRadialGaugeLabelEventArgs();
        g.startAngle = this.a9.i;
        g.endAngle = this.a9.g;
        g.actualMinimumValue = this.da;
        g.actualMaximumValue = this.c9;
        g.angle = MathUtil.p(b);
        g.value = a;
        var h = a;
        if (!d) {
            g.label = c;
        }
        else {
            if (e == null) {
                h = Math.round(g.value * 100) / 100;
            }
            g.label = (h).toString();
            if (e != null) {
                g.label = e.i(h);
            }
        }
        if (f != null) {
            f(this, g);
        }
        return g;
    };
    XamRadialGauge.prototype.aq = function (a, b, c, d, e, f) {
        var g = c.h(this.em);
        var h = new AlignRadialGaugeLabelEventArgs();
        h.startAngle = this.a9.i;
        h.endAngle = this.a9.g;
        h.actualMinimumValue = this.da;
        h.actualMaximumValue = this.c9;
        h.angle = d.angle;
        h.value = d.value;
        h.label = d.label;
        h.extent = a;
        h.brush = b;
        h.font = g;
        var i = c.b(h.font);
        var j = f(((function () {
            var $ret = new TextBlock();
            $ret.al = h.label;
            return $ret;
        })()), i);
        h.width = j.width;
        h.height = j.height;
        h.offsetX = -1 * (j.width / 2);
        h.offsetY = -1 * (j.height / 2);
        var k = h.offsetX;
        var l = h.offsetY;
        if (e != null) {
            e(this, h);
            if (h.font != g) {
                h.font *= this.em;
                i = i.b(h.font);
                j = f(((function () {
                    var $ret = new TextBlock();
                    $ret.al = h.label;
                    return $ret;
                })()), i);
                h.width = j.width;
                h.height = j.height;
                h.offsetX = -1 * (j.width / 2) + (h.offsetX - k);
                h.offsetY = -1 * (j.height / 2) + (h.offsetY - l);
            }
        }
        return h;
    };
    XamRadialGauge.prototype.onDetachedFromUI = function () {
        this.view.ay();
    };
    XamRadialGauge.prototype.onAttachedToUI = function () {
        this.view.au();
    };
    XamRadialGauge.prototype.e2 = function (a) {
        return this.a9.h(a);
    };
    XamRadialGauge.prototype.fe = function (a) {
        return this.a9.j(a);
    };
    XamRadialGauge.prototype.dn = function (a) {
        var b = this.mm;
        var c = Math.min(b.width / 2, b.height / 2) * this.ep;
        var d = this.mj();
        var e = d.x;
        var f = d.y;
        var g = GeometryUtil.g({ $type: Point_$type, x: e, y: f }, a);
        if (this.a9 != null && g < this.a9.i) {
            g += Math.PI * 2;
        }
        if (this.a9 != null && g > this.a9.g) {
            g -= Math.PI * 2;
        }
        var h = this.fe(g);
        return h;
    };
    XamRadialGauge.prototype.mk = function (a, b) {
        var c = this.e2(a);
        var d = Math.min(this.mm.width / 2, this.mm.height / 2) * this.ep * b;
        var e = this.mj();
        var f = e.x + Math.cos(c) * d;
        var g = e.y + Math.sin(c) * d;
        return { $type: Point_$type, x: f, y: g };
    };
    XamRadialGauge.prototype.l7 = function (a, b) {
        if (b != null && b.count > 0) {
            return b.item(a % b.count);
        }
        else {
            return null;
        }
    };
    Object.defineProperty(XamRadialGauge.prototype, "view", {
        get: function () {
            return this._view;
        },
        set: function (a) {
            this._view = a;
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.il = function (a, b) {
        this.fd = this.bc.o;
    };
    Object.defineProperty(XamRadialGauge.prototype, "da", {
        get: function () {
            return this.c4;
        },
        set: function (a) {
            this.c4 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "c9", {
        get: function () {
            return this.c3;
        },
        set: function (a) {
            this.c3 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "c8", {
        get: function () {
            return this.c2;
        },
        set: function (a) {
            var b = this.c2;
            this.c2 = a;
            if (b != this.c2) {
                this.iy("ActualHighlightValueOpacity", b, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "ds", {
        get: function () {
            return this.c(XamRadialGauge.j3);
        },
        set: function (a) {
            this.h(XamRadialGauge.j3, a);
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.jg = function () {
        this.c8 = isNaN_(this.ds) ? 0.5 : Math.max(0, Math.min(this.ds, 1));
    };
    Object.defineProperty(XamRadialGauge.prototype, "bu", {
        get: function () {
            return this.bt;
        },
        set: function (a) {
            this.bt = a;
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.jf = function () {
        if (this.bv != 1) {
            if (isNaN_(this.dr) || isInfinity(this.dr)) {
                this.bu = 1;
            }
            else {
                this.bu = 2;
            }
        }
        else {
            this.bu = 1;
        }
    };
    XamRadialGauge.prototype.is = function () {
        this.bw = 0;
        this.view.b9().an = null;
    };
    Object.defineProperty(XamRadialGauge.prototype, "ej", {
        get: function () {
            return this.c(XamRadialGauge.k1);
        },
        set: function (a) {
            this.h(XamRadialGauge.k1, a);
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.refresh = function () {
        this.cb = true;
        this.view.bb();
    };
    XamRadialGauge.prototype.iy = function (a, b, c) {
        switch (a) {
            case XamRadialGauge.$$p[41]:
            case XamRadialGauge.$$p[44]:
            case XamRadialGauge.$$p[45]:
            case XamRadialGauge.$$p[47]:
            case XamRadialGauge.$$p[0]:
            case XamRadialGauge.$$p[4]:
            case XamRadialGauge.$$p[62]:
            case XamRadialGauge.$$p[78]:
            case XamRadialGauge.$$p[34]:
            case XamRadialGauge.$$p[83]:
            case XamRadialGauge.$$p[71]:
                this.view.av(a, b, c);
                break;
            case XamRadialGauge.$$p[59]:
                this.view.a0(b, c);
                break;
            case XamRadialGauge.$$p[60]:
                this.view.a1(b, c);
                break;
            case "PixelScalingRatio":
                if (isNaN_(DeviceUtils.a(this.eo))) {
                    this.db = 1;
                }
                else {
                    this.db = DeviceUtils.a(this.eo);
                }
                break;
            case "ActualPixelScalingRatio":
                this.view.a5();
                break;
        }
        switch (a) {
            case XamRadialGauge.$$p[29]:
            case XamRadialGauge.$$p[30]:
                if (this.gi != null) {
                    this.am = new BindingFormatter();
                    this.am.j = this.gi;
                    this.am.d = this.ah;
                }
                else {
                    this.am = null;
                }
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[74]:
            case XamRadialGauge.$$p[75]:
                if (this.hu != null) {
                    this.ao = new BindingFormatter();
                    this.ao.j = this.hu;
                    this.ao.d = this.ai;
                }
                else {
                    this.ao = null;
                }
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[86]:
            case XamRadialGauge.$$p[87]:
                if (this.h9 != null) {
                    this.ap = new BindingFormatter();
                    this.ap.j = this.h9;
                    this.ap.d = this.aj;
                }
                else {
                    this.ap = null;
                }
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[17]:
            case XamRadialGauge.$$p[18]:
                if (this.f2 != null) {
                    this.an = new BindingFormatter();
                    this.an.j = this.f2;
                    this.an.d = this.ag;
                }
                else {
                    this.an = null;
                }
                this.cb = true;
                this.view.bb();
                break;
            case "SubtitleTextStyle":
                this.cb = true;
                this.view.bb();
                break;
            case "TitleTextStyle":
                this.cb = true;
                this.view.bb();
                break;
            case "HighlightLabelTextStyle":
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[92]:
                if (this.valueChanged != null) {
                    this.valueChanged(this, new DoubleValueChangedEventArgs(b, c));
                }
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[22]:
                {
                    if (this.highlightValueChanged != null) {
                        this.highlightValueChanged(this, new DoubleValueChangedEventArgs(b, c));
                    }
                    var d = this.bu == 2;
                    this.jf();
                    var e = this.bu == 2;
                    this.cb = true;
                    if (!d && e) {
                        this.bw = 1;
                    }
                    else if (d && !e) {
                        this.bw = 4;
                    }
                    this.view.bb();
                    break;
                }
            case XamRadialGauge.$$p[21]:
                {
                    var f = this.bu == 2;
                    this.jf();
                    var g = this.bu == 2;
                    this.cb = true;
                    if (!f && g) {
                        this.bw = 1;
                    }
                    else if (f && !g) {
                        this.bw = 4;
                    }
                    this.view.bb();
                    break;
                }
            case "HighlighValueOpacity":
                this.jg();
                break;
            case "ActualHighlightValueOpacity":
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[0]:
            case XamRadialGauge.$$p[4]:
            case XamRadialGauge.$$p[7]:
            case XamRadialGauge.$$p[6]:
            case XamRadialGauge.$$p[2]:
            case XamRadialGauge.$$p[3]:
            case XamRadialGauge.$$p[5]:
            case XamRadialGauge.$$p[1]:
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[69]:
            case XamRadialGauge.$$p[67]:
            case XamRadialGauge.$$p[63]:
            case XamRadialGauge.$$p[65]:
            case XamRadialGauge.$$p[66]:
                this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[33]:
            case XamRadialGauge.$$p[32]:
                var h = this.dz;
                var i = this.dx;
                if (isInfinity(h) || isNaN_(h)) {
                    h = 0;
                }
                if (isInfinity(i) || isNaN_(i)) {
                    i = 100;
                }
                this.da = Math.min(h, i);
                this.c9 = Math.max(h, i);
                this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[23]:
            case XamRadialGauge.$$p[68]:
            case XamRadialGauge.$$p[64]:
            case XamRadialGauge.$$p[28]:
            case XamRadialGauge.$$p[80]:
            case XamRadialGauge.$$p[79]:
            case XamRadialGauge.$$p[78]:
            case XamRadialGauge.$$p[62]:
            case XamRadialGauge.$$p[31]:
            case XamRadialGauge.$$p[35]:
            case XamRadialGauge.$$p[81]:
            case XamRadialGauge.$$p[38]:
            case XamRadialGauge.$$p[34]:
            case XamRadialGauge.$$p[37]:
            case XamRadialGauge.$$p[36]:
            case XamRadialGauge.$$p[8]:
            case XamRadialGauge.$$p[9]:
            case XamRadialGauge.$$p[58]:
            case XamRadialGauge.$$p[10]:
                this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[82]:
            case XamRadialGauge.$$p[70]:
            case XamRadialGauge.$$p[13]:
            case XamRadialGauge.$$p[85]:
            case XamRadialGauge.$$p[73]:
            case XamRadialGauge.$$p[16]:
            case XamRadialGauge.$$p[83]:
            case XamRadialGauge.$$p[71]:
            case XamRadialGauge.$$p[14]:
            case XamRadialGauge.$$p[84]:
            case XamRadialGauge.$$p[72]:
            case XamRadialGauge.$$p[15]:
            case XamRadialGauge.$$p[88]:
            case XamRadialGauge.$$p[76]:
            case XamRadialGauge.$$p[19]:
            case XamRadialGauge.$$p[57]:
            case XamRadialGauge.$$p[56]:
            case XamRadialGauge.$$p[54]:
            case XamRadialGauge.$$p[42]:
            case XamRadialGauge.$$p[41]:
            case XamRadialGauge.$$p[44]:
            case "NeedleStartWidth":
            case XamRadialGauge.$$p[43]:
            case XamRadialGauge.$$p[45]:
            case XamRadialGauge.$$p[47]:
            case XamRadialGauge.$$p[55]:
            case XamRadialGauge.$$p[49]:
            case XamRadialGauge.$$p[39]:
            case XamRadialGauge.$$p[40]:
            case XamRadialGauge.$$p[51]:
            case XamRadialGauge.$$p[52]:
            case XamRadialGauge.$$p[50]:
            case XamRadialGauge.$$p[46]:
            case XamRadialGauge.$$p[48]:
            case XamRadialGauge.$$p[53]:
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[90]:
                this.bc.r = this.fg;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[91]:
                this.bc.b = this.bf;
                break;
            case "TransitionProgress":
                if (this.fd >= 1) {
                    this.bc.w();
                    var j = this.a3;
                    this.a3 = this.a4;
                    this.a4 = j;
                    this.i1();
                    this.i2();
                    this.i4();
                    this.ja(this.a3);
                    this.jb(this.a3, this.a3.b, true);
                    this.jb(this.a3, this.a3.c, false);
                    this.jc(this.a3);
                    if (this.bw == 5) {
                        this.is();
                    }
                    else if (this.bw == 2) {
                        this.bw = 3;
                    }
                    this.view.ah();
                    return;
                }
                this.a2.f(this.fd, this.a4, this.a3);
                this.ja(this.a2);
                this.jb(this.a2, this.a2.b, true);
                this.jb(this.a2, this.a2.c, false);
                this.jc(this.a2);
                this.view.ah();
                break;
            case XamRadialGauge.$$p[61]:
                var k = b;
                var l = c;
                if (k != null) {
                    var m = k;
                    m.collectionChanged = delegateRemove(m.collectionChanged, runOn(this, this.i8));
                }
                if (l != null) {
                    var n = l;
                    n.collectionChanged = delegateCombine(n.collectionChanged, runOn(this, this.i8));
                }
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[60]:
            case XamRadialGauge.$$p[59]:
                this.cb = true;
                this.view.bb();
                break;
            case XamRadialGauge.$$p[11]:
            case XamRadialGauge.$$p[12]:
                this.cb = true;
                this.view.bk();
                this.view.bb();
                break;
        }
        this.iz(a);
    };
    XamRadialGauge.prototype.je = function () {
        this.view.bf();
    };
    XamRadialGauge.prototype.i8 = function (a, b) {
        var e_1, _a, e_2, _b;
        if (b.oldItems != null) {
            try {
                for (var _c = __values(fromEn(b.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var c = _d.value;
                    c.propertyChanged = delegateRemove(c.propertyChanged, runOn(this, this.i7));
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
        if (b.newItems != null) {
            try {
                for (var _e = __values(fromEn(b.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var d = _f.value;
                    d.propertyChanged = delegateCombine(d.propertyChanged, runOn(this, this.i7));
                }
            }
            catch (e_2_1) {
                e_2 = { error: e_2_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_2)
                        throw e_2.error;
                }
            }
        }
        this.cb = true;
        this.view.bb();
    };
    XamRadialGauge.prototype.i7 = function (a, b) {
        this.cb = true;
        this.view.bb();
    };
    Object.defineProperty(XamRadialGauge.prototype, "mm", {
        get: function () {
            return this.ml;
        },
        set: function (a) {
            var b = this.ml;
            this.ml = a;
            if (!b.equals1(this.ml)) {
                this.i0(b, this.ml);
            }
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.i0 = function (a, b) {
        this.cb = true;
        this.view.bb();
    };
    XamRadialGauge.prototype.cg = function () {
        return !isNaN_(this.da) && !isNaN_(this.c9) && !isNaN_(this.ff) && !this.mm.isEmpty && this.view.n();
    };
    XamRadialGauge.prototype.im = function () {
        if (!this.cg()) {
            return;
        }
        if (this.cb) {
            if (this.b5) {
                if (this.bc.g) {
                    this.bc.t();
                }
                var a = this.a4;
                this.a4 = this.a2;
                this.a2 = a;
            }
            else {
                var b = this.a4;
                this.a4 = this.a3;
                this.a3 = b;
            }
        }
        else if (this.b5) {
            this.a2.f(this.fd, this.a4, this.a3);
            this.ja(this.a2);
            this.jb(this.a2, this.a2.b, true);
            this.jb(this.a2, this.a2.c, false);
            this.jc(this.a2);
        }
        if (this.cb) {
            if (this.bw == 1) {
                this.bw = 2;
                var c = this.et(this.ff, 0);
                this.i3(c, this.a4.b, false);
            }
            else if (this.bw == 4) {
                if (this.fg > 0) {
                    this.bw = 5;
                    var d = this.et(this.ff, 0);
                    this.i3(d, this.a3.b, false);
                }
                else {
                    this.is();
                }
            }
            this.i2();
            this.i4();
            this.i1();
        }
        if (this.cb && this.cl) {
            this.jd();
            this.a2.f(this.fd, this.a4, this.a3);
            this.ja(this.a2);
            this.jb(this.a2, this.a2.b, true);
            this.jb(this.a2, this.a2.c, false);
            this.jc(this.a2);
        }
        else {
            if (this.cb) {
                this.ja(this.a3);
                this.jb(this.a3, this.a3.b, true);
                this.jb(this.a3, this.a3.c, false);
                this.jc(this.a3);
            }
        }
        this.cb = false;
        this.view.ah();
    };
    XamRadialGauge.prototype.jd = function () {
        this.c7 = 0;
        this.bc.w();
        this.bc.v();
    };
    Object.defineProperty(XamRadialGauge.prototype, "cl", {
        get: function () {
            return this.fg > 0;
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.ja = function (a) {
        var b = this.mm;
        var c = this.view.b8();
        var d = a.a;
        var e = Math.min(b.width / 2, b.height / 2) * a.e;
        var f = this.mj();
        var g = f.x;
        var h = f.y;
        var i = d.n(e, g, h);
        c.an = i;
        c._fill = d.l;
        c._stroke = d.m;
        c.ad = d.h;
    };
    XamRadialGauge.prototype.ch = function (a) {
        return this.cj(a, false, false);
    };
    XamRadialGauge.prototype.needleContainsPoint = function (a, b) {
        return this.cj(a, b, false);
    };
    XamRadialGauge.prototype.b9 = function (a) {
        return this.cj(a, false, true);
    };
    XamRadialGauge.prototype.highlightNeedleContainsPoint = function (a, b) {
        return this.cj(a, b, true);
    };
    XamRadialGauge.prototype.cj = function (a, b, c) {
        var d;
        var e;
        if (c) {
            d = this.cu;
            e = this.cv;
        }
        else {
            d = this.cw;
            e = this.cx;
        }
        if (d == null) {
            return false;
        }
        return b ? PolygonUtil.b(e, a) : PolygonUtil.b(d, a);
    };
    XamRadialGauge.prototype.jb = function (a, b, c) {
        if (c) {
            if (this.bw == 0) {
                return;
            }
            this.cu = new List$1(Point_$type, 0);
            this.cv = new List$1(Point_$type, 0);
        }
        else {
            this.cw = new List$1(Point_$type, 0);
            this.cx = new List$1(Point_$type, 0);
        }
        var d = c ? this.cu : this.cw;
        var e = c ? this.cv : this.cx;
        var f = this.mm;
        var g = b.ab;
        var h = b.aj;
        var i = b.ak;
        var j = b.ae;
        var k = b.ah;
        var l = b.ai;
        var m = b.aa;
        var n = c ? this.view.b9() : this.view.ca();
        var o = this.view.cd();
        var p = this.view.cb();
        var q = Math.min(f.width / 2, f.height / 2) * a.e;
        var r = this.mj();
        var s = r.x;
        var t = r.y;
        var u = b.am(q, s, t);
        var v = g * 180 / Math.PI;
        n.an = u;
        var w = new TransformGroup();
        w.j.add(((function () {
            var $ret = new RotateTransform();
            $ret.k = s;
            $ret.l = t;
            $ret.j = v;
            return $ret;
        })()));
        n.j = w;
        n._fill = h;
        n._stroke = i;
        n.ad = j;
        o.an = b.an(q, s, t);
        p.an = b.al(q, s, t);
        o._fill = k;
        o._stroke = l;
        o.ad = m;
        p._fill = k;
        p._stroke = l;
        p.ad = m;
        var x = Math.cos(g);
        var y = Math.sin(g);
        var z = b.af / 2;
        var aa = { $type: Point_$type, x: b.ad * q, y: z * q };
        var ab = { $type: Point_$type, x: b.ac * q, y: z * q };
        var ac = { $type: Point_$type, x: b.ac * q, y: -z * q };
        var ad = { $type: Point_$type, x: b.ad * q, y: -z * q };
        aa = { $type: Point_$type, x: aa.x * x - aa.y * y + s, y: aa.y * x + aa.x * y + t };
        ab = { $type: Point_$type, x: ab.x * x - ab.y * y + s, y: ab.y * x + ab.x * y + t };
        ac = { $type: Point_$type, x: ac.x * x - ac.y * y + s, y: ac.y * x + ac.x * y + t };
        ad = { $type: Point_$type, x: ad.x * x - ad.y * y + s, y: ad.y * x + ad.x * y + t };
        d.add(aa);
        d.add(ab);
        d.add(ac);
        d.add(ad);
        z = (b.af / 2) * q;
        var ae = { $type: Point_$type, x: b.ad * q, y: z };
        var af = { $type: Point_$type, x: b.ac * q, y: z };
        var ag = { $type: Point_$type, x: b.ac * q, y: -z };
        var ah = { $type: Point_$type, x: b.ad * q, y: -z };
        ae = { $type: Point_$type, x: ae.x * x - ae.y * y + s, y: ae.y * x + ae.x * y + t };
        af = { $type: Point_$type, x: af.x * x - af.y * y + s, y: af.y * x + af.x * y + t };
        ag = { $type: Point_$type, x: ag.x * x - ag.y * y + s, y: ag.y * x + ag.x * y + t };
        ah = { $type: Point_$type, x: ah.x * x - ah.y * y + s, y: ah.y * x + ah.x * y + t };
        e.add(ae);
        e.add(af);
        e.add(ag);
        e.add(ah);
    };
    XamRadialGauge.prototype.mj = function () {
        var a = this.mm;
        var b = isNaN_(this.dl) ? 0.5 : this.dl;
        var c = isNaN_(this.dm) ? 0.5 : this.dm;
        var d = a.left + b * a.width;
        var e = a.top + c * a.height;
        return { $type: Point_$type, x: d, y: e };
    };
    XamRadialGauge.prototype.er = function (a) {
        if (isInfinity(a)) {
            return NaN;
        }
        return a;
    };
    XamRadialGauge.prototype.i2 = function () {
        var a = this.a3;
        a.e = this.ep;
        var b = this.mm;
        var c = !(this.bw == 0 || this.bw == 5);
        var d = this.et(this.ff, 0);
        this.i3(d, a.c, c);
        if (c) {
            var e = this.er(this.dr);
            this.i3(e, a.b, false);
        }
    };
    XamRadialGauge.prototype.i3 = function (a, b, c) {
        var d = this.a9;
        var e = d.h(a);
        var f = new RadialGaugeNeedlePreparer();
        var g = new RadialGaugeNeedleParameters();
        g.b = this.a5;
        g.o = this.er(this.ek);
        var h = this.ma;
        var i = this.mb;
        if (c) {
            h = BrushUtil.s(h, this.c8);
            i = BrushUtil.s(i, this.c8);
        }
        g.t = h;
        g.u = i;
        g.m = this.er(this.ei);
        g.k = this.er(this.ea);
        g.d = this.er(this.d8);
        g.e = this.er(this.d9);
        g.p = this.er(this.eg);
        g.q = this.er(this.eh);
        g.i = this.er(this.ef);
        g.f = this.er(this.ec);
        g.r = this.mc;
        g.s = this.md;
        g.c = this.a6;
        g.h = this.er(this.ed);
        g.n = this.er(this.ej);
        g.l = this.er(this.eb);
        if (isNaN_(g.o)) {
            g.o = XamRadialGauge.el;
        }
        if (isNaN_(g.h)) {
            g.h = XamRadialGauge.ee;
        }
        f.b = g;
        f.e(b);
        b.ab = e;
    };
    XamRadialGauge.prototype.jc = function (a) {
        var e_3, _a, e_4, _b, e_5, _c, e_6, _d;
        var b = this.mm;
        var c = a.d;
        var d = c.g;
        var e = c.c;
        var f = c.i;
        var g = c.j;
        var h = c.h;
        var i = c.f;
        var j = c.t;
        var k = c.e;
        var l = c.d;
        var m = c.ab;
        var n = c.y;
        var o = c.l;
        var p = c.k;
        var q = c.ad;
        var r = c.ac;
        var s = c.aa;
        var t = c.x;
        var u = c.aj;
        var v = c.ak;
        var w = c.ae;
        var x = c.ai;
        var y = c.v;
        var z = c.u;
        var aa = c.w;
        var ab = this.view.cc();
        var ac = c.z;
        m = Math.max(0, m);
        n = Math.max(0, n);
        var ad = true;
        if (this.a8 == 1 || (this.a8 == 0 && this.a0 == 0)) {
            ad = false;
        }
        var ae = Math.min(b.width / 2, b.height / 2) * a.e;
        var af = this.mj();
        var ag = af.x;
        var ah = af.y;
        var ai = s;
        var aj = t;
        s -= ac;
        t += ac;
        var ak = false;
        if ((t - s) >= 2 * Math.PI) {
            ak = true;
            s = 0;
            t = Math.PI;
        }
        var al = new PathGeometry();
        var am = new PathFigure();
        var an = Math.cos(s);
        var ao = Math.sin(s);
        var ap = Math.cos(t);
        var aq = Math.sin(t);
        var ar = ag + (ae * m) * an;
        var as = ah + (ae * m) * ao;
        var at = ag + (ae * n) * an;
        var au = ah + (ae * n) * ao;
        var av = ag + (ae * m) * ap;
        var aw = ah + (ae * m) * aq;
        var ax = ag + (ae * n) * ap;
        var ay = ah + (ae * n) * aq;
        var az = ak;
        if (ac != 0 && !ak && ad) {
            var a0 = Math.cos(ai);
            var a1 = Math.sin(ai);
            var a2 = Math.cos(aj);
            var a3 = Math.sin(aj);
            var a4 = ag + (ae * m) * a0;
            var a5 = ah + (ae * m) * a1;
            var a6 = ag + (ae * n) * a0;
            var a7 = ah + (ae * n) * a1;
            var a8 = ag + (ae * m) * a2;
            var a9 = ah + (ae * m) * a3;
            var ba = ag + (ae * n) * a2;
            var bb = ah + (ae * n) * a3;
            var bc = as;
            var bd = at;
            if (a6 - a4 != 0) {
                bd = ag;
                var be = (a7 - a5) / (a6 - a4);
                bc = be * (ag - at) + au;
            }
            var bf = { $type: Point_$type, x: bd, y: bc };
            var bg = GeometryUtil.o(bf, { $type: Point_$type, x: at, y: au }, { $type: Point_$type, x: ag, y: ah }, ae * m);
            var bh = aw;
            var bi = ax;
            if (ba - a8 != 0) {
                bi = ag;
                var bj = (bb - a9) / (ba - a8);
                bh = bj * (ag - ax) + ay;
            }
            var bk = { $type: Point_$type, x: bi, y: bh };
            var bl = GeometryUtil.o(bk, { $type: Point_$type, x: ax, y: ay }, { $type: Point_$type, x: ag, y: ah }, ae * m);
            if (isNaN_(bg.c.x) || isNaN_(bg.c.y) || isNaN_(bg.d.x) || isNaN_(bg.d.y) || isNaN_(bl.c.x) || isNaN_(bl.c.y) || isNaN_(bl.d.x) || isNaN_(bl.d.y)) {
                ak = true;
                s = 0;
                t = Math.PI;
            }
            else {
                var bm = void 0;
                var bn = void 0;
                if ((Math.pow(bg.c.x - at, 2) + Math.pow(bg.c.y - au, 2)) < (Math.pow(bg.d.x - at, 2) + Math.pow(bg.d.y - au, 2))) {
                    bm = bg.c;
                }
                else {
                    bm = bg.d;
                }
                if ((Math.pow(bl.c.x - ax, 2) + Math.pow(bl.c.y - ay, 2)) < (Math.pow(bl.d.x - ax, 2) + Math.pow(bl.d.y - ay, 2))) {
                    bn = bl.c;
                }
                else {
                    bn = bl.d;
                }
                if ((Math.pow(bn.x - at, 2) + Math.pow(bn.y - au, 2)) <= (Math.pow(bm.x - at, 2) + Math.pow(bm.y - au, 2))) {
                    ak = true;
                    s = 0;
                    t = Math.PI;
                }
                else {
                    var bo = GeometryUtil.g({ $type: Point_$type, x: ag, y: ah }, bm);
                    var bp = GeometryUtil.g({ $type: Point_$type, x: ag, y: ah }, bn);
                    var bq = s;
                    var br = t;
                    while (bq > Math.PI * 2) {
                        bq -= Math.PI * 2;
                    }
                    while (br > Math.PI * 2) {
                        br -= Math.PI * 2;
                    }
                    var bs = Math.min(Math.abs(bo - bq), Math.abs((Math.PI * 2 - bo) - bq));
                    var bt = Math.min(Math.abs(bp - br), Math.abs((Math.PI * 2 - bp) - br));
                    if ((t - s) + bs + bt >= 2 * Math.PI) {
                        ak = true;
                        s = 0;
                        t = Math.PI;
                    }
                    else {
                        ar = bm.x;
                        as = bm.y;
                        av = bn.x;
                        aw = bn.y;
                    }
                }
            }
        }
        if (ak && !az) {
            an = Math.cos(s);
            ao = Math.sin(s);
            ap = Math.cos(t);
            aq = Math.sin(t);
            ar = ag + (ae * m) * an;
            as = ah + (ae * m) * ao;
            at = ag + (ae * n) * an;
            au = ah + (ae * n) * ao;
            av = ag + (ae * m) * ap;
            aw = ah + (ae * m) * aq;
            ax = ag + (ae * n) * ap;
            ay = ah + (ae * n) * aq;
        }
        if (ak) {
            am._startPoint = { $type: Point_$type, x: at, y: au };
            am._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: ax, y: ay };
                $ret.b = false;
                $ret.d = 1;
                $ret.f = new Size(1, ae * n, ae * n);
                return $ret;
            })()));
            am._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: at, y: au };
                $ret.b = false;
                $ret.d = 1;
                $ret.f = new Size(1, ae * n, ae * n);
                return $ret;
            })()));
            var bu = new PathFigure();
            bu._startPoint = { $type: Point_$type, x: ar, y: as };
            bu._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: av, y: aw };
                $ret.b = false;
                $ret.d = 0;
                $ret.f = new Size(1, ae * m, ae * m);
                return $ret;
            })()));
            bu._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: ar, y: as };
                $ret.b = false;
                $ret.d = 0;
                $ret.f = new Size(1, ae * m, ae * m);
                return $ret;
            })()));
            al.c.add(am);
            al.c.add(bu);
        }
        else {
            am._startPoint = { $type: Point_$type, x: ar, y: as };
            am._segments.add(((function () {
                var $ret = new LineSegment(1);
                $ret.c = { $type: Point_$type, x: at, y: au };
                return $ret;
            })()));
            am._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: ax, y: ay };
                $ret.b = (t - s) > Math.PI;
                $ret.d = 1;
                $ret.f = new Size(1, ae * n, ae * n);
                return $ret;
            })()));
            am._segments.add(((function () {
                var $ret = new LineSegment(1);
                $ret.c = { $type: Point_$type, x: av, y: aw };
                return $ret;
            })()));
            am._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.e = { $type: Point_$type, x: ar, y: as };
                $ret.b = (t - s) > Math.PI;
                $ret.d = 0;
                $ret.f = new Size(1, ae * m, ae * m);
                return $ret;
            })()));
            al.c.add(am);
        }
        ab.an = al;
        ab._fill = u;
        var bv = this.bz;
        bv.f = true;
        try {
            for (var _e = __values(fromEnum(this.cz)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var bw = _f.value;
                bv.n(bw);
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return))
                    _a.call(_e);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
        this.cz.g();
        var bx = this.b2;
        bx.f = true;
        try {
            for (var _g = __values(fromEnum(this.c0)), _h = _g.next(); !_h.done; _h = _g.next()) {
                var by = _h.value;
                bx.n(by);
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_h && !_h.done && (_b = _g.return))
                    _b.call(_g);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        this.c0.g();
        var bz = this.b4;
        bz.f = true;
        try {
            for (var _j = __values(fromEnum(this.c1)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var b0 = _k.value;
                bz.n(b0);
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return))
                    _c.call(_j);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
        this.c1.g();
        var b1 = this.by;
        b1.f = true;
        try {
            for (var _l = __values(fromEnum(this.cy)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var b2 = _m.value;
                b1.n(b2);
            }
        }
        catch (e_6_1) {
            e_6 = { error: e_6_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return))
                    _d.call(_l);
            }
            finally {
                if (e_6)
                    throw e_6.error;
            }
        }
        this.cy.g();
        var b3 = ae * j;
        for (var b4 = 0; b4 < e.length; b4++) {
            var b5 = ag + b3 * Math.cos(e[b4]);
            var b6 = ah + b3 * Math.sin(e[b4]);
            var b7 = bv.a();
            if (b7.al != d[b4]) {
                b7.al = d[b4];
            }
            this.view.bd(b7, l[b4]);
            this.view.be(b7, k[b4]);
            var b8 = h[b4];
            var b9 = i[b4];
            var ca = f[b4];
            var cb = g[b4];
            this.view.a6(b7, b5 + ca, b6 + cb);
            this.cz.h(b7);
        }
        bv.f = false;
        if (!isNaN_(c.p.c) && !isNaN_(c.p.b)) {
            var cc = ag + (ae * c.p.c) * Math.cos(c.p.b);
            var cd = ah + (ae * c.p.c) * Math.sin(c.p.b);
            var ce = bz.a();
            if (ce.al != c.p.h) {
                ce.al = c.p.h;
            }
            this.view.bd(ce, c.p.i);
            this.view.be(ce, c.p.a);
            this.view.a6(ce, cc + c.p.f, cd + c.p.g);
            this.c1.h(ce);
        }
        bz.f = false;
        if (!isNaN_(c.o.c) && !isNaN_(c.o.b)) {
            var cf = ag + (ae * c.o.c) * Math.cos(c.o.b);
            var cg = ah + (ae * c.o.c) * Math.sin(c.o.b);
            var ch = bx.a();
            if (ch.al != c.o.h) {
                ch.al = c.o.h;
            }
            this.view.bd(ch, c.o.i);
            this.view.be(ch, c.o.a);
            this.view.a6(ch, cf + c.o.f, cg + c.o.g);
            this.c0.h(ch);
        }
        bx.f = false;
        if (this.bw != 0) {
            if (!isNaN_(c.m.c) && !isNaN_(c.m.b)) {
                var ci = ag + (ae * c.m.c) * Math.cos(c.m.b);
                var cj = ah + (ae * c.m.c) * Math.sin(c.m.b);
                var ck = b1.a();
                if (ck.al != c.m.h) {
                    ck.al = c.m.h;
                }
                this.view.bd(ck, c.m.i);
                this.view.be(ck, c.m.a);
                this.view.a6(ck, ci + c.m.f, cj + c.m.g);
                this.cy.h(ck);
            }
            b1.f = false;
        }
        var cl = this.b3;
        cl.f = true;
        for (var cm = 0; cm < this.ct.count; cm++) {
            cl.n(this.ct._inner[cm]);
        }
        this.ct.clear();
        var _loop_1 = function (cn) {
            var co = ag + (ae * q) * Math.cos(o[cn]);
            var cp = ah + (ae * q) * Math.sin(o[cn]);
            var cq = ag + (ae * r) * Math.cos(o[cn]);
            var cr = ah + (ae * r) * Math.sin(o[cn]);
            var cs = cl.a();
            var ct = new PathGeometry();
            var cu = new PathFigure();
            cu._startPoint = { $type: Point_$type, x: co, y: cp };
            cu._segments.add(((function () {
                var $ret = new LineSegment(1);
                $ret.c = { $type: Point_$type, x: cq, y: cr };
                return $ret;
            })()));
            ct.c.add(cu);
            cs.an = ct;
            cs._stroke = v;
            cs.ad = w;
            this_1.ct.add(cs);
        };
        var this_1 = this;
        for (var cn = 0; cn < o.length; cn++) {
            _loop_1(cn);
        }
        cl.f = false;
        var cv = this.b0;
        cv.f = true;
        for (var cw = 0; cw < this.cr.count; cw++) {
            cv.n(this.cr._inner[cw]);
        }
        this.cr.clear();
        var _loop_2 = function (cx) {
            var cy = ag + (ae * y) * Math.cos(p[cx]);
            var cz = ah + (ae * y) * Math.sin(p[cx]);
            var c0 = ag + (ae * z) * Math.cos(p[cx]);
            var c1 = ah + (ae * z) * Math.sin(p[cx]);
            var c2 = cv.a();
            var c3 = new PathGeometry();
            var c4 = new PathFigure();
            c4._startPoint = { $type: Point_$type, x: cy, y: cz };
            c4._segments.add(((function () {
                var $ret = new LineSegment(1);
                $ret.c = { $type: Point_$type, x: c0, y: c1 };
                return $ret;
            })()));
            c3.c.add(c4);
            c2.an = c3;
            c2._stroke = x;
            c2.ad = aa;
            this_2.cr.add(c2);
        };
        var this_2 = this;
        for (var cx = 0; cx < p.length; cx++) {
            _loop_2(cx);
        }
        cv.f = false;
        var c5 = this.b1;
        c5.f = true;
        for (var c6 = this.cs.count - 1; c6 >= 0; c6--) {
            c5.n(this.cs._inner[c6]);
        }
        this.cs.clear();
        for (var c7 = 0; c7 < c.r.count; c7++) {
            var c8 = c.r._inner[c7];
            var c9 = c5.a();
            c9.an = c8.m(ae, ag, ah);
            c9._fill = c8.k;
            c9._stroke = c8.l;
            c9.ad = c8.h;
            this.cs.add(c9);
        }
        this.view.bc(this.cs);
        c5.f = false;
    };
    XamRadialGauge.prototype.cq = function (a, b, c) {
        var d = c / 10000;
        if (isNaN_(d)) {
            d = 1E-05;
        }
        var e = Math.abs(a - b);
        if (e < d) {
            return true;
        }
        return false;
    };
    XamRadialGauge.prototype.es = function (a) {
        if (isInfinity(a)) {
            return NaN;
        }
        return a;
    };
    XamRadialGauge.prototype.eq = function (a, b) {
        if (isInfinity(a)) {
            return b;
        }
        return a;
    };
    XamRadialGauge.prototype.et = function (a, b) {
        if (isInfinity(a) || isNaN_(a)) {
            return b;
        }
        return a;
    };
    XamRadialGauge.prototype.i4 = function () {
        var a = this.a3;
        a.e = this.es(this.ep);
        if (isNaN_(a.e)) {
            a.e = 1;
        }
        if (this.ck && !isNaN_(this.en) && this.en > 0) {
            var b = Math.min(this.mm.width, this.mm.height);
            this.em = b / this.en;
        }
        else {
            this.em = 1;
        }
        var c = this.mm;
        var d = this.a9;
        var e = this.es(this.dt);
        var f = this.es(this.dw);
        var g = this.es(this.d1);
        if (isNaN_(e)) {
            e = (this.c9 - this.da) / 10;
        }
        if (isNaN_(f)) {
            f = e;
        }
        if (isNaN_(g)) {
            g = 3;
        }
        var h = new List$1(Tuple$2.$.specialize(Number_$type, Number_$type), 0);
        var i = d.i;
        var j = d.g;
        while (i >= Math.PI * 2) {
            i -= Math.PI * 2;
        }
        while (j >= Math.PI * 2) {
            j -= Math.PI * 2;
        }
        var k = Math.abs(j - i) < 0.0001;
        var l = this.a1 == 1 || this.a1 == 3;
        var m = this.a1 == 0 || this.a1 == 3;
        for (var n = this.da; n <= this.c9 || this.cq(n, this.c9, f); n += f) {
            if (k && this.cq(n, this.da, f) && l) {
                continue;
            }
            if (k && this.cq(n, this.c9, f) && m) {
                continue;
            }
            h.add(new Tuple$2(Number_$type, Number_$type, n, MathUtil.g(d.h(n))));
            if (f == 0) {
                break;
            }
        }
        var o = new List$1(Number_$type, 0);
        var p = new List$1(Number_$type, 0);
        for (var q = this.da; q <= this.c9 || this.cq(q, this.c9, e); q += e) {
            o.add(d.h(q));
            for (var r = 0; r < g; r++) {
                var s = (e / (g + 1)) * (r + 1);
                if (s + q > this.c9) {
                    continue;
                }
                p.add(d.h(s + q));
            }
            if (e == 0) {
                break;
            }
        }
        if (a.d.c.length != h.count) {
            a.d.g = new Array(h.count);
            a.d.c = new Array(h.count);
            a.d.h = new Array(h.count);
            a.d.f = new Array(h.count);
            a.d.i = new Array(h.count);
            a.d.j = new Array(h.count);
            a.d.e = new Array(h.count);
            a.d.d = new Array(h.count);
        }
        if (a.d.l.length != o.count || a.d.k.length != p.count) {
            a.d.l = new Array(o.count);
            a.d.k = new Array(p.count);
        }
        var t = this.bp();
        for (var u = 0; u < h.count; u++) {
            var v = h._inner[u].c;
            var w = h._inner[u].d;
            var x = this.av(v, w, "Label", true, this.am, this.formatLabel);
            var y = this.aq(this.du, this.l6, t, x, this.alignLabel, runOn(this.view, this.view.ch));
            a.d.c[u] = y.angle;
            a.d.h[u] = y.width;
            a.d.f[u] = y.height;
            a.d.i[u] = y.offsetX;
            a.d.j[u] = y.offsetY;
            a.d.g[u] = y.label;
            a.d.e[u] = t.b(y.font);
            a.d.d[u] = y.brush;
        }
        var z = this.fb;
        if (this.cp) {
            z = (MathUtil.g(this.a9.h(this.ff)) + 180) % 360;
        }
        var aa = this.av(this.ff, z, this.id, this.co, this.ap, this.formatTitle);
        var ab = this.bs.a();
        var ac = this.aq(this.fc, this.mh, ab, aa, this.alignTitle, runOn(this.view, this.view.cj));
        a.d.p.b = ac.angle;
        a.d.p.e = ac.width;
        a.d.p.d = ac.height;
        a.d.p.f = ac.offsetX;
        a.d.p.g = ac.offsetY;
        a.d.p.c = ac.extent;
        a.d.p.i = ac.brush;
        a.d.p.h = ac.label;
        a.d.p.a = ab.b(ac.font);
        var ad = this.e3;
        if (this.cn) {
            ad = (MathUtil.g(this.a9.h(this.ff)) + 180) % 360;
        }
        var ae = this.av(this.ff, ad, this.hy, this.cm, this.ao, this.formatSubtitle);
        var af = this.br.a();
        var ag = this.aq(this.e4, this.mf, af, ae, this.alignSubtitle, runOn(this.view, this.view.ci));
        a.d.o.b = ag.angle;
        a.d.o.e = ag.width;
        a.d.o.d = ag.height;
        a.d.o.f = ag.offsetX;
        a.d.o.g = ag.offsetY;
        a.d.o.c = ag.extent;
        a.d.o.i = ag.brush;
        a.d.o.h = ag.label;
        a.d.o.a = af.b(ag.font);
        var ah = this.dp;
        if (this.b8) {
            ah = (MathUtil.g(this.a9.h(this.dr)) + 180) % 360;
        }
        var ai = this.av(this.dr, ah, this.f6, this.b7, this.an, this.formatHighlightLabel);
        var aj = this.bq.a();
        var ak = this.aq(this.dq, this.l8, aj, ai, this.alignHighlightLabel, runOn(this.view, this.view.cg));
        a.d.m.b = ak.angle;
        a.d.m.e = ak.width;
        a.d.m.d = ak.height;
        a.d.m.f = ak.offsetX;
        a.d.m.g = ak.offsetY;
        a.d.m.c = ak.extent;
        a.d.m.i = ak.brush;
        var al = !(this.bw == 0 || this.bw == 5);
        a.d.m.h = al ? ak.label : null;
        a.d.m.a = aj.b(ak.font);
        for (var am = 0; am < o.count; am++) {
            a.d.l[am] = o._inner[am];
        }
        for (var an = 0; an < p.count; an++) {
            a.d.k[an] = p._inner[an];
        }
        a.d.ab = this.et(this.e0, 0.5);
        a.d.y = this.et(this.ev, 0.57);
        a.d.t = this.et(this.du, 0.65);
        a.d.ad = this.et(this.e7, 0.5);
        a.d.ac = this.et(this.e5, 0.57);
        a.d.v = this.et(this.d4, 0.54);
        a.d.u = this.et(this.d2, 0.57);
        a.d.aa = d.i;
        a.d.x = d.g;
        var ao = this.ex;
        if (isNaN_((ao))) {
            ao = 2.8;
        }
        var ap = ao * Math.PI / 180;
        if (ap < 0) {
            ap = 0;
        }
        a.d.z = ap;
        a.d.ak = this.mg;
        a.d.ai = this.l9;
        a.d.aj = this.me;
        a.d.ae = this.es(this.e9);
        a.d.w = this.es(this.d6);
        if (isNaN_(a.d.ae)) {
            a.d.ae = XamRadialGauge.fa;
        }
        if (isNaN_(a.d.w)) {
            a.d.w = XamRadialGauge.d7;
        }
        a.d.r.clear();
        for (var aq = 0; aq < this.ranges.count; aq++) {
            var ar = this.ranges._inner[aq];
            var as = this.es(Math.min(ar.o, ar.j));
            var at = this.es(Math.max(ar.o, ar.j));
            if (isNaN_(as) || isNaN_(at)) {
                continue;
            }
            var au = d.h(as);
            var av = d.h(at);
            var aw = RadialGaugeScaler.k(au, av, this.mi);
            au = aw.c;
            av = aw.d;
            var ax = new RadialGaugeRangeFrame();
            ax.e = au;
            ax.b = av;
            ax.k = ar.ao != null ? ar.ao : this.l7(aq, this.ak);
            ax.l = ar.ap != null ? ar.ap : this.l7(aq, this.al);
            ax.h = this.et(ar.p, XamRadialGaugeRange.q);
            ax.f = this.es(ar.l);
            if (isNaN_(ax.f)) {
                ax.f = Math.max(0, this.e0);
            }
            ax.c = this.es(ar.k);
            if (isNaN_(ax.c)) {
                ax.c = Math.max(0, this.e0);
            }
            ax.g = this.es(ar.n);
            if (isNaN_(ax.g)) {
                ax.g = Math.max(0, this.ev);
            }
            ax.d = this.es(ar.m);
            if (isNaN_(ax.d)) {
                ax.d = Math.max(0, this.ev);
            }
            if (this.mi == 0) {
                var ay = ax.f;
                ax.f = ax.c;
                ax.c = ay;
                ay = ax.g;
                ax.g = ax.d;
                ax.d = ay;
            }
            a.d.r.add(ax);
        }
    };
    XamRadialGauge.prototype.i1 = function () {
        var a = this.a3;
        a.e = this.ep;
        var b = a.a;
        var c = this.l4;
        var d = this.l5;
        var e = this.eq(this.dj, XamRadialGauge.dk);
        var f = this.a0;
        var g = this.dg;
        var h = this.de;
        if (isInfinity(h) || isNaN_(h)) {
            h = 0.12;
        }
        if (isInfinity(g) || isNaN_(g)) {
            g = 0.82;
        }
        var i = this.dc;
        if (isInfinity(i) || isNaN_(i)) {
            i = 4;
        }
        if (h > g) {
            var j = g;
            g = h;
            h = j;
        }
        var k = this.a9;
        var l = k.i;
        var m = k.g;
        b.l = c;
        b.m = d;
        b.h = e;
        if (f == 0) {
            b.b = 0;
            b.g = 0;
            b.c = 0;
            b.d = 0;
            b.e = this.dg;
        }
        else {
            b.b = i;
            var n = this.di * Math.PI / 180;
            if (n < 0) {
                n = 0;
            }
            if ((Math.PI * 2) - (m - l) < n) {
                b.f = 0;
                b.b = 0;
                b.g = 0;
                b.c = 0;
                b.d = 0;
                b.e = g;
            }
            else {
                b.f = n;
                b.g = l;
                b.c = m;
                b.b = i;
                b.d = h;
                b.e = g;
            }
        }
    };
    Object.defineProperty(XamRadialGauge.prototype, "b5", {
        get: function () {
            return this.bc.f();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "fd", {
        get: function () {
            return this.c7;
        },
        set: function (a) {
            var b = this.c7;
            this.c7 = a;
            this.iy("TransitionProgress", b, this.c7);
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.iq = function (a, b) {
        var c = this.dn(a);
        var d = this.bx == 2;
        var e = d ? this.cc : this.ce;
        if (e) {
            var f = this.fe(this.a9.g - Math.PI * 2);
            switch (this.mi) {
                case 1:
                    if (c < this.da) {
                        c = c < f * 0.5 ? this.c9 : this.da;
                    }
                    break;
                case 0:
                    if (c > this.c9) {
                        c = c < (f + this.c9) * 0.5 ? this.c9 : this.da;
                    }
                    break;
            }
        }
        if (d) {
            if (c != this.dr) {
                this.dr = c;
            }
        }
        else {
            if (c != this.ff) {
                this.ff = c;
            }
        }
    };
    XamRadialGauge.prototype.destroy = function () {
        this.provideContainer(null);
    };
    XamRadialGauge.prototype.provideContainer = function (a) {
        this.view.aw(a);
    };
    XamRadialGauge.prototype.onMouseMove = function (a, b) {
        if (this.bx != 0) {
            this.iq(a, b);
        }
    };
    XamRadialGauge.prototype.onMouseDown = function (a, b) {
        if (b === void 0) {
            b = false;
        }
        if (this.cf && this.needleContainsPoint(a, b) && this.bx == 0) {
            this.bx = 1;
        }
        if (this.cd && this.highlightNeedleContainsPoint(a, b) && this.bx == 0) {
            this.bx = 2;
        }
    };
    XamRadialGauge.prototype.onMouseUp = function (a) {
        if (this.bx != 0) {
            this.bx = 0;
        }
    };
    XamRadialGauge.prototype.containerResized = function () {
        this.view.ax();
    };
    XamRadialGauge.prototype.ir = function () {
        this.view.flush();
    };
    XamRadialGauge.prototype.ba = function () {
        var a = new GaugeVisualData();
        a.viewport = new RectData(this.mm.left, this.mm.top, this.mm.width, this.mm.height);
        a.scaleLabels = new ScaleLabelVisualDataList();
        a.scaleTickmarks = new ScaleTickmarkVisualDataList();
        a.ranges = new RangeVisualDataList();
        a.needle = new NeedleVisualData();
        a.highlightNeedle = new NeedleVisualData();
        a.titleLabels = new ScaleLabelVisualDataList();
        a.subtitleLabels = new ScaleLabelVisualDataList();
        a.highlightLabels = new ScaleLabelVisualDataList();
        this.view.am(a);
        return a;
    };
    XamRadialGauge.prototype.fu = function () {
        var a = this.ba();
        a.scaleByViewport();
        return a.serialize();
    };
    XamRadialGauge.prototype.bp = function () {
        if (this.fv == null) {
            return FontUtil.getFont(this.view.ac);
        }
        else {
            return FontUtil.toFontInfo(this.view.ac, this.fv);
        }
    };
    Object.defineProperty(XamRadialGauge.prototype, "eo", {
        get: function () {
            return this.c6;
        },
        set: function (a) {
            var b = this.c6;
            this.c6 = a;
            this.iy("PixelScalingRatio", b, this.c6);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "db", {
        get: function () {
            return this.c5;
        },
        set: function (a) {
            var b = this.c5;
            this.c5 = a;
            this.iy("ActualPixelScalingRatio", b, this.c5);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "bq", {
        get: function () {
            return this.bj;
        },
        set: function (a) {
            var b = this.bj;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bm();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bj = a;
            if (b != this.bj) {
                this.iy("HighlightLabelTextStyle", b, this.bj);
            }
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.prototype.b6 = function (a) {
        if (a == null) {
            return false;
        }
        return a.fontString != null && a.fontString != "NaNpx/normal";
    };
    Object.defineProperty(XamRadialGauge.prototype, "br", {
        get: function () {
            return this.bk;
        },
        set: function (a) {
            var b = this.bk;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bn();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bk = a;
            if (b != this.bk) {
                this.iy("SubtitleTextStyle", b, this.bk);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamRadialGauge.prototype, "bs", {
        get: function () {
            return this.bl;
        },
        set: function (a) {
            var b = this.bl;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bo();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bl = a;
            if (b != this.bl) {
                this.iy("TitleTextStyle", b, this.bl);
            }
        },
        enumerable: false,
        configurable: true
    });
    XamRadialGauge.$t = markType(XamRadialGauge, 'XamRadialGauge', Control.$, [INotifyPropertyChanged_$type]);
    XamRadialGauge.bh = null;
    XamRadialGauge.bi = null;
    XamRadialGauge.bg = null;
    XamRadialGauge.j3 = DependencyProperty.i("HighlighValueOpacity", Number_$type, XamRadialGauge.$, new PropertyMetadata(2, 0.5, function (a, b) { return a.iy("HighlighValueOpacity", b.oldValue, b.newValue); }));
    XamRadialGauge.k1 = DependencyProperty.i("NeedleStartWidth", Number_$type, XamRadialGauge.$, new PropertyMetadata(2, NaN, function (a, b) { return a.iy("NeedleStartWidth", b.oldValue, b.newValue); }));
    XamRadialGauge.el = DeviceUtils.g(1);
    XamRadialGauge.ee = DeviceUtils.g(1);
    XamRadialGauge.fa = DeviceUtils.g(3);
    XamRadialGauge.d7 = DeviceUtils.g(2);
    XamRadialGauge.dk = DeviceUtils.g(12);
    XamRadialGauge.$$p = markDep(DependencyProperty, PropertyMetadata, XamRadialGauge, 'iy', ['BackingBrush:l4:jh', [Brush.$, null], 'BackingCornerRadius:dc:ji', [1, 4], 'BackingInnerExtent:de:jj', [1, 0.12], 'BackingOuterExtent:dg:jk', [1, 0.82], 'BackingOutline:l5:jl', [Brush.$, null], 'BackingOversweep:di:jm', [1, 3], 'BackingShape:a0:jn', [RadialGaugeBackingShape_$type, enumGetBox(RadialGaugeBackingShape_$type, 0)], 'BackingStrokeThickness:dj:jo', [1, XamRadialGauge.dk], 'CenterX:dl:jp', [1, 0.5], 'CenterY:dm:jq', [1, 0.5], 'DuplicateLabelOmissionStrategy:a1:jr', [RadialGaugeDuplicateLabelOmissionStrategy_$type, enumGetBox(RadialGaugeDuplicateLabelOmissionStrategy_$type, 0)], 'FontBrush:l6:js', [Brush.$, null], 'Font:fv:jt', [2, null], 'HighlightLabelAngle:dp:ju', [1, 90], 'HighlightLabelBrush:l8:jv', [Brush.$, null], 'HighlightLabelDisplaysValue:b7:jw', [0, false], 'HighlightLabelExtent:dq:jx', [1, 0.2], 'HighlightLabelFormat:f2:jy', [2, null], 'HighlightLabelFormatSpecifiers:ag:jz', [Array_$type, null], 'HighlightLabelSnapsToNeedlePivot:b8:j0', [0, false], 'HighlightLabelText:f6:j1', [2, null], 'HighlightValueDisplayMode:bv:j2', [HighlightedValueDisplayMode_$type, enumGetBox(HighlightedValueDisplayMode_$type, 0)], 'HighlightValue:dr:j4', [1, NaN], 'Interval:dt:j5', [1, NaN], 'IsHighlightNeedleDraggingConstrained:cc:j6', [0, true], 'IsHighlightNeedleDraggingEnabled:cd:j7', [0, false], 'IsNeedleDraggingConstrained:ce:j8', [0, true], 'IsNeedleDraggingEnabled:cf:j9', [0, false], 'LabelExtent:du:ka', [1, 0.65], 'LabelFormat:gi:kb', [2, null], 'LabelFormatSpecifiers:ah:kc', [Array_$type, null], 'LabelInterval:dw:kd', [1, NaN], 'MaximumValue:dx:ke', [1, 100], 'MinimumValue:dz:kf', [1, 0], 'MinorTickBrush:l9:kg', [Brush.$, null], 'MinorTickCount:d1:kh', [1, 3], 'MinorTickEndExtent:d2:ki', [1, 0.57], 'MinorTickStartExtent:d4:kj', [1, 0.54], 'MinorTickStrokeThickness:d6:kk', [1, XamRadialGauge.d7], 'NeedleBaseFeatureExtent:d8:kl', [1, NaN], 'NeedleBaseFeatureWidthRatio:d9:km', [1, NaN], 'NeedleBrush:ma:kn', [Brush.$, null], 'NeedleEndExtent:ea:ko', [1, NaN], 'NeedleEndWidthRatio:eb:kp', [1, NaN], 'NeedleOutline:mb:kq', [Brush.$, null], 'NeedlePivotBrush:mc:kr', [Brush.$, null], 'NeedlePivotInnerWidthRatio:ec:ks', [1, NaN], 'NeedlePivotOutline:md:kt', [Brush.$, null], 'NeedlePivotShape:a6:ku', [RadialGaugePivotShape_$type, enumGetBox(RadialGaugePivotShape_$type, 3)], 'NeedlePivotStrokeThickness:ed:kv', [1, XamRadialGauge.ee], 'NeedlePivotWidthRatio:ef:kw', [1, NaN], 'NeedlePointFeatureExtent:eg:kx', [1, NaN], 'NeedlePointFeatureWidthRatio:eh:ky', [1, NaN], 'NeedleShape:a5:kz', [RadialGaugeNeedleShape_$type, enumGetBox(RadialGaugeNeedleShape_$type, 4)], 'NeedleStartExtent:ei:k0', [1, NaN], 'NeedleStrokeThickness:ek:k2', [1, XamRadialGauge.el], 'OpticalScalingEnabled:ck:k3', [0, false], 'OpticalScalingSize:en:k4', [1, 500], 'RadiusMultiplier:ep:k5', [1, 1], 'RangeBrushes:ak:k6', [BrushCollection.$, null], 'RangeOutlines:al:k7', [BrushCollection.$, null], 'Ranges::k8', [RadialGaugeRangeCollection.$, null], 'ScaleBrush:me:k9', [Brush.$, null], 'ScaleEndAngle:eu:la', [1, 45], 'ScaleEndExtent:ev:lb', [1, 0.57], 'ScaleOversweep:ex:lc', [1, 2.8], 'ScaleOversweepShape:a8:ld', [RadialGaugeScaleOversweepShape_$type, enumGetBox(RadialGaugeScaleOversweepShape_$type, 0)], 'ScaleStartAngle:ez:le', [1, 135], 'ScaleStartExtent:e0:lf', [1, 0.5], 'ScaleSweepDirection:mi:lg', [SweepDirection_$type, enumGetBox(SweepDirection_$type, 1)], 'SubtitleAngle:e3:lh', [1, 90], 'SubtitleBrush:mf:li', [Brush.$, null], 'SubtitleDisplaysValue:cm:lj', [0, false], 'SubtitleExtent:e4:lk', [1, 0.5], 'SubtitleFormat:hu:ll', [2, null], 'SubtitleFormatSpecifiers:ai:lm', [Array_$type, null], 'SubtitleSnapsToNeedlePivot:cn:ln', [0, false], 'SubtitleText:hy:lo', [2, null], 'TickBrush:mg:lp', [Brush.$, null], 'TickEndExtent:e5:lq', [1, 0.57], 'TickStartExtent:e7:lr', [1, 0.5], 'TickStrokeThickness:e9:ls', [1, XamRadialGauge.fa], 'TitleAngle:fb:lt', [1, 90], 'TitleBrush:mh:lu', [Brush.$, null], 'TitleDisplaysValue:co:lv', [0, false], 'TitleExtent:fc:lw', [1, 0.38], 'TitleFormat:h9:lx', [2, null], 'TitleFormatSpecifiers:aj:ly', [Array_$type, null], 'TitleSnapsToNeedlePivot:cp:lz', [0, false], 'TitleText:id:l0', [2, null], 'TransitionDuration:fg:l1', [1, 0], 'TransitionEasingFunction:bf:l2', [Delegate_$type, null], 'Value:ff:l3', [1, 0]]);
    return XamRadialGauge;
}(Control));
export { XamRadialGauge };
/**
 * @hidden
 */
var XamRadialGaugeView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamRadialGaugeView, _super);
    function XamRadialGaugeView(a) {
        var _this = _super.call(this) || this;
        _this.h = null;
        _this.s = null;
        _this.r = null;
        _this.q = null;
        _this.v = null;
        _this.u = null;
        _this.t = null;
        _this.b4 = new Path();
        _this.b3 = new Path();
        _this.b6 = new Path();
        _this.b2 = new Path();
        _this.b5 = new Path();
        _this.b7 = new Path();
        _this.o = null;
        _this.a = ["needle", "needlePivot", "backing", "scale", "tick", "minorTick", "label"];
        _this.c = null;
        _this.d = null;
        _this.l = false;
        _this.m = false;
        _this.g = null;
        _this.ad = null;
        _this.k = null;
        _this.ac = null;
        _this.i = null;
        _this.bp = new Brush();
        _this.bq = ((function () {
            var $ret = new Brush();
            $ret.fill = "black";
            return $ret;
        })());
        _this.w = NaN;
        _this.p = null;
        _this.af = -1;
        _this.ae = -1;
        _this.bu = null;
        _this.bv = null;
        _this.bw = null;
        _this.bx = null;
        _this.br = null;
        _this.bs = null;
        _this.by = null;
        _this.b0 = null;
        _this.bt = null;
        _this.bz = null;
        _this.b1 = null;
        _this.e = null;
        _this.f = null;
        _this.x = 0;
        _this.h = a;
        _this.o = new Dictionary$2(String_$type, Dictionary$2.$.specialize(String_$type, String_$type), 0);
        _this.q = new List$1(TextBlock.$, 0);
        _this.r = new List$1(Path.$, 0);
        _this.s = new List$1(Path.$, 0);
        _this.v = new List$1(TextBlock.$, 0);
        _this.u = new List$1(TextBlock.$, 0);
        _this.t = new List$1(TextBlock.$, 0);
        return _this;
    }
    XamRadialGaugeView.prototype.ar = function (a) {
        a._visibility = 0;
    };
    XamRadialGaugeView.prototype.as = function (a) {
        a._visibility = 1;
    };
    XamRadialGaugeView.prototype.at = function (a) {
        this.q.remove(a);
    };
    XamRadialGaugeView.prototype.bm = function () {
        var a = new TextBlock();
        this.q.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.bh = function (a) {
        this.v.remove(a);
    };
    XamRadialGaugeView.prototype.bo = function () {
        var a = new TextBlock();
        this.v.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.bg = function (a) {
        this.u.remove(a);
    };
    XamRadialGaugeView.prototype.bn = function () {
        var a = new TextBlock();
        this.u.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.ap = function (a) {
        this.t.remove(a);
    };
    XamRadialGaugeView.prototype.bl = function () {
        var a = new TextBlock();
        this.t.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.a2 = function (a) {
        a._visibility = 0;
    };
    XamRadialGaugeView.prototype.a3 = function (a) {
        a._visibility = 1;
    };
    XamRadialGaugeView.prototype.a4 = function (a) {
        this.r.remove(a);
    };
    XamRadialGaugeView.prototype.ce = function () {
        var a = new Path();
        this.r.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.a7 = function (a) {
        a._visibility = 0;
    };
    XamRadialGaugeView.prototype.a8 = function (a) {
        a._visibility = 1;
    };
    XamRadialGaugeView.prototype.a9 = function (a) {
        this.s.remove(a);
    };
    XamRadialGaugeView.prototype.cf = function () {
        var a = new Path();
        this.s.add(a);
        return a;
    };
    XamRadialGaugeView.prototype.n = function () {
        return true;
    };
    XamRadialGaugeView.prototype.ca = function () {
        return this.b4;
    };
    XamRadialGaugeView.prototype.b9 = function () {
        return this.b3;
    };
    XamRadialGaugeView.prototype.cc = function () {
        return this.b6;
    };
    XamRadialGaugeView.prototype.z = function (a, b) {
        var c = typeCast(TextBlock.$, a);
        if (c != null && c.al != null) {
            this.k.af(b);
            return this.k.f(c) + 0;
        }
        return 0;
    };
    XamRadialGaugeView.prototype.ch = function (a, b) {
        if (b == null) {
            b = this.h.bp();
        }
        var c = this.z(a, b);
        var d = this.y(b);
        return new Size(1, c, d);
    };
    XamRadialGaugeView.prototype.cj = function (a, b) {
        var c = this.z(a, b);
        var d = this.y(b);
        return new Size(1, c, d);
    };
    XamRadialGaugeView.prototype.ci = function (a, b) {
        var c = this.z(a, b);
        var d = this.y(b);
        return new Size(1, c, d);
    };
    XamRadialGaugeView.prototype.cg = function (a, b) {
        var c = this.z(a, b);
        var d = this.y(b);
        return new Size(1, c, d);
    };
    XamRadialGaugeView.prototype.ao = function () {
        this.l = true;
        var a = ["#CED3D8", "#CED3D8", "#EBEDEF", "#FFC73C", "#617583", "rgba(100,107,114,.74)", "rgba(100,107,114,.74)"];
        var b = ["#B2B9C0", "#B2B9C0", "#B2B9C0", null, null, null, null];
        var c = ["background-color", "border-top-color"];
        var d = ((function () {
            var $ret = new List$1(Array_$type, 0);
            $ret.add(a);
            $ret.add(b);
            return $ret;
        })());
        this.o.clear();
        var e = this.a.length;
        for (var f = 0; f < e; f++) {
            var g = new Dictionary$2(String_$type, String_$type, 0);
            var h = this.a[f];
            var i = new Array(c.length);
            arrayCopy1(c, 0, i, 0, c.length);
            this.b("ui-radialgauge-" + h, i);
            for (var j = 0; j < i.length; j++) {
                g.item(c[j], (i[j] == null) ? d._inner[j][f] : i[j]);
            }
            this.o.item(h, g);
        }
        this.bj();
        var k;
        var l;
        var m = BrushUtil.h("radialgauge-range", this.ac, k, l);
        k = m.p2;
        l = m.p3;
        this.c = k;
        this.d = l;
        if (this.e == null) {
            this.h.ak = this.c;
        }
        if (this.f == null) {
            this.h.al = this.d;
        }
        this.l = false;
    };
    XamRadialGaugeView.prototype.au = function () {
        this.aq();
        if (this.g != null) {
            this.g.au(this.ac.rootWrapper, "");
        }
    };
    XamRadialGaugeView.prototype.ay = function () {
        if (this.g != null && this.ac != null) {
            this.g.bi(this.ac.rootWrapper, "");
        }
    };
    XamRadialGaugeView.prototype.bj = function () {
        this.l = true;
        var a = this.a.length;
        for (var b = 0; b < a; b++) {
            var c = this.a[b];
            this.bi(c, this.o.item(c));
        }
        this.l = false;
    };
    XamRadialGaugeView.prototype.bi = function (a, b) {
        var e_7, _a;
        var c = null;
        var d = null;
        var e = b.count;
        try {
            for (var _b = __values(fromEnum(b.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                switch (f) {
                    case "background-color":
                        c = new Brush();
                        if (b.item(f) != null) {
                            c._fill = b.item(f);
                        }
                        break;
                    case "border-top-color":
                        d = new Brush();
                        if (b.item(f) != null) {
                            d._fill = b.item(f);
                        }
                        break;
                }
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
        switch (a) {
            case "needle":
                if (this.bu == null) {
                    this.h.ma = c;
                }
                if (this.bv == null) {
                    this.h.mb = d;
                }
                break;
            case "needlePivot":
                if (this.bw == null) {
                    this.h.mc = c;
                }
                if (this.bx == null) {
                    this.h.md = d;
                }
                break;
            case "backing":
                if (this.br == null) {
                    this.h.l4 = c;
                }
                if (this.bs == null) {
                    this.h.l5 = d;
                }
                break;
            case "scale":
                if (this.by == null) {
                    this.h.me = c;
                }
                break;
            case "tick":
                if (this.b0 == null) {
                    this.h.mg = c;
                }
                break;
            case "minorTick":
                if (this.bt == null) {
                    this.h.l9 = c;
                }
                break;
            case "label":
                this.bq = c;
                break;
        }
    };
    XamRadialGaugeView.prototype.b = function (a, b) {
        this.ac.startCSSQuery();
        for (var c = 0; c < b.length; c++) {
            b[c] = this.ac.getCssDefaultPropertyValue(a, b[c]);
        }
        this.ac.endCSSQuery();
        return b;
    };
    XamRadialGaugeView.ab = function (a, b) {
        var c = a == null ? 0 : a.length;
        if (c < 1) {
            return b;
        }
        var d = a.split('.');
        var e = (d[0].length > 0) ? parseInt(d[0]) : 0;
        if (d.length != 2) {
            return e;
        }
        c = d[1].length;
        var f = parseInt(d[1]);
        while (c-- > 0) {
            f /= 10;
        }
        return f + e;
    };
    XamRadialGaugeView.prototype.az = function () {
        this.l = true;
        this.h.ma = ((function () {
            var $ret = new Brush();
            $ret.fill = "#CED3D8";
            return $ret;
        })());
        this.h.mb = ((function () {
            var $ret = new Brush();
            $ret.fill = "#B2B9C0";
            return $ret;
        })());
        this.h.mg = ((function () {
            var $ret = new Brush();
            $ret.fill = "#617583";
            return $ret;
        })());
        this.h.me = ((function () {
            var $ret = new Brush();
            $ret.fill = "#FFC73C";
            return $ret;
        })());
        this.h.l4 = ((function () {
            var $ret = new Brush();
            $ret.fill = "#EBEDEF";
            return $ret;
        })());
        this.h.l5 = ((function () {
            var $ret = new Brush();
            $ret.fill = "#B2B9C0";
            return $ret;
        })());
        this.h.mc = ((function () {
            var $ret = new Brush();
            $ret.fill = "#CED3D8";
            return $ret;
        })());
        this.h.md = ((function () {
            var $ret = new Brush();
            $ret.fill = "#B2B9C0";
            return $ret;
        })());
        this.h.l9 = ((function () {
            var $ret = new Brush();
            $ret.fill = "rgba(100,107,114,.74)";
            return $ret;
        })());
        this.l = false;
        this.aq();
    };
    XamRadialGaugeView.prototype.aq = function () {
        var a = CanvasScalingHelpers.b(this.ac);
        this.h.db = CanvasScalingHelpers.a(this.h.eo, this.h.db, a);
        if (this.g != null) {
            CanvasScalingHelpers.h(this.g, a);
        }
    };
    XamRadialGaugeView.prototype.bb = function () {
        if (!this.m) {
            this.m = true;
            if (this.ac != null) {
                this.ac.setTimeout(runOn(this, this.ag), 0);
            }
            else {
                window.setTimeout(runOn(this, this.ag), 0);
            }
        }
    };
    XamRadialGaugeView.prototype.ag = function () {
        if (this.m) {
            this.m = false;
            this.h.im();
        }
    };
    XamRadialGaugeView.prototype.flush = function () {
        if (this.m) {
            this.ag();
        }
    };
    XamRadialGaugeView.prototype.a6 = function (a, b, c) {
        a.n = b;
        a.o = c;
    };
    XamRadialGaugeView.prototype.aw = function (a) {
        var _this = this;
        if (a == null) {
            this.ad = null;
            this.ac = null;
            this.k = null;
            if (this.h.b5) {
                this.h.bc.w();
            }
            this.ai();
            return;
        }
        this.x = (isNaN_(this.h.eo) ? this.h.db : this.h.eo);
        var b = a;
        this.ac = b;
        this.h.bc.u(this.ac);
        this.ac.rootWrapper.addClass("ui-radialgauge-container");
        var c = this.x;
        var d = Math.round(b.rootWrapper.width());
        var e = Math.round(b.rootWrapper.height());
        var f = d * c;
        var g = e * c;
        this.ac.rootWrapper.setStyleProperty("position", "relative");
        var h = this.ac.createElement("canvas");
        h.setStyleProperty("position", "absolute");
        this.ac.append(h);
        this.af = truncate(Math.round(f));
        this.ae = truncate(Math.round(g));
        h.setAttribute("width", f.toString());
        h.setAttribute("height", g.toString());
        h.setStyleProperty("width", d.toString() + "px");
        h.setStyleProperty("height", e.toString() + "px");
        h.setStyleProperty("left", "0px");
        h.setStyleProperty("top", "0px");
        this.h.mm = new Rect(0, 0, 0, d, e);
        this.ad = h;
        var i = this.ac.get2DCanvasContext(this.ad);
        this.k = new RenderingContext(new CanvasViewRenderer(), i);
        this.ao();
        this.bk();
        this.k.af(this.i);
        this.ai();
        if (TypeRegistrar.isRegistered("CanvasGestureDOMEventProxy")) {
            this.g = typeCast(EventProxy.$, TypeRegistrar.create("CanvasGestureDOMEventProxy", this.ac.rootWrapper, this.ac, false));
        }
        if (this.g != null) {
            var j = this.g;
            j.onContactStarted = delegateCombine(j.onContactStarted, runOn(this, this.al));
            var k = this.g;
            k.onContactMoved = delegateCombine(k.onContactMoved, runOn(this, this.ak));
            var l = this.g;
            l.onContactCompleted = delegateCombine(l.onContactCompleted, runOn(this, this.aj));
            this.g.ap = function (m) { return (_this.h.cf && (_this.h.bx == 1 || _this.h.ch(m))) || (_this.h.cd && (_this.h.bx == 2 || _this.h.b9(m))); };
        }
        this.ba();
    };
    XamRadialGaugeView.prototype.aj = function (a, b) {
        if (this.h != null) {
            this.h.onMouseUp(a);
        }
    };
    XamRadialGaugeView.prototype.ak = function (a, b) {
        if (this.h != null) {
            this.h.onMouseMove(a, b);
        }
    };
    XamRadialGaugeView.prototype.al = function (a, b) {
        if (this.h != null) {
            this.h.onMouseDown(a);
        }
    };
    XamRadialGaugeView.prototype.ai = function () {
        if (this.g != null) {
            var a = this.g;
            a.onContactStarted = delegateRemove(a.onContactStarted, runOn(this, this.al));
            var b = this.g;
            b.onContactMoved = delegateRemove(b.onContactMoved, runOn(this, this.ak));
            var c = this.g;
            c.onContactCompleted = delegateRemove(c.onContactCompleted, runOn(this, this.aj));
            this.g.ap = null;
            this.g.aw();
        }
    };
    XamRadialGaugeView.prototype.bd = function (a, b) {
        if (b != null) {
            a.ao = b;
        }
        else {
            a.ao = this.bq;
        }
    };
    XamRadialGaugeView.prototype.be = function (a, b) {
        if (a == null) {
            return;
        }
        if (b == null) {
            return;
        }
        a.dataContext = b;
    };
    XamRadialGaugeView.prototype.bf = function () {
        this.ao();
        this.bk();
        this.bb();
    };
    XamRadialGaugeView.prototype.bk = function () {
        this.i = FontUtil.getFont(this.ac);
        if (this.h.fv != null) {
            this.i = this.h.bp();
        }
        this.w = this.y(this.i);
        this.bp = new Brush();
        this.bp._fill = this.ac.rootWrapper.getStyleProperty("color");
        if (this.k != null) {
            this.k.af(this.i);
        }
    };
    XamRadialGaugeView.prototype.ah = function () {
        this.ba();
    };
    XamRadialGaugeView.prototype.ba = function () {
        var a = this.h.mm.width;
        var b = this.h.mm.height;
        var c = Math.round(a * this.x);
        var d = Math.round(b * this.x);
        if (this.af != c || this.ae != d) {
            this.ad.setAttribute("width", c.toString());
            this.ad.setAttribute("height", d.toString());
            this.ad.setStyleProperty("width", a.toString() + "px");
            this.ad.setStyleProperty("height", b.toString() + "px");
            this.af = truncate(Math.round(c));
            this.ae = truncate(Math.round(d));
        }
        if (this.k.d && this.x != 1) {
            this.k.aa();
            this.k.ab(this.x, this.x);
        }
        this.k.l(this.h.mm.left, this.h.mm.top, this.h.mm.width, this.h.mm.height);
        this.k.t(this.b2);
        this.k.t(this.b6);
        if (this.p != null) {
            for (var e = 0; e < this.p.count; e++) {
                this.k.t(this.p._inner[e]);
            }
        }
        for (var f = 0; f < this.q.count; f++) {
            var g = this.q._inner[f];
            this.k.af(g.dataContext);
            this.k.x(g);
        }
        for (var h = 0; h < this.v.count; h++) {
            var i = this.v._inner[h];
            this.k.af(i.dataContext);
            this.k.x(i);
        }
        for (var j = 0; j < this.u.count; j++) {
            var k = this.u._inner[j];
            this.k.af(k.dataContext);
            this.k.x(k);
        }
        for (var l = 0; l < this.t.count; l++) {
            var m = this.t._inner[l];
            this.k.af(m.dataContext);
            this.k.x(m);
        }
        for (var n = 0; n < this.r.count; n++) {
            this.k.t(this.r._inner[n]);
        }
        this.k.t(this.b7);
        if (this.b4.j != null) {
            this.k.aa();
            this.k.k(this.b4.j);
        }
        this.k.t(this.b4);
        if (this.b4.j != null) {
            this.k.z();
        }
        if (this.b3.j != null) {
            this.k.aa();
            this.k.k(this.b3.j);
        }
        this.k.t(this.b3);
        if (this.b3.j != null) {
            this.k.z();
        }
        this.k.t(this.b5);
        if (this.k.d && this.x != 1) {
            this.k.z();
        }
    };
    XamRadialGaugeView.prototype.y = function (a) {
        return FontUtil.getCurrentFontHeight(this.ac, a);
    };
    XamRadialGaugeView.prototype.bc = function (a) {
        this.p = a;
    };
    XamRadialGaugeView.prototype.b8 = function () {
        return this.b2;
    };
    XamRadialGaugeView.prototype.cd = function () {
        return this.b7;
    };
    XamRadialGaugeView.prototype.cb = function () {
        return this.b5;
    };
    XamRadialGaugeView.prototype.ax = function () {
        this.aq();
        var a = Math.round(this.ac.rootWrapper.width());
        var b = Math.round(this.ac.rootWrapper.height());
        this.h.mm = new Rect(0, 0, 0, a, b);
        if (this.g != null) {
            this.g.bm = this.h.mm;
        }
    };
    XamRadialGaugeView.prototype.j = function (a, b) {
        return FontUtil.getFontInfo(this.ac, a, b);
    };
    XamRadialGaugeView.prototype.am = function (a) {
        var e_8, _a, e_9, _b, e_10, _c, e_11, _d, e_12, _e, e_13, _f;
        a.scalePath = new PathVisualData(1, "Scale", this.b6);
        a.needlePath = new PathVisualData(1, "Needle", this.b4);
        a.highlightNeedlePath = new PathVisualData(1, "HighlightNeedle", this.b3);
        var b = this.b4.j.j._inner[0].j;
        a.needle.angle = b;
        if (this.b3 != null && typeCast(TransformGroup.$, this.b3.j) !== null) {
            var c = this.b3.j.j._inner[0].j;
            a.highlightNeedle.angle = c;
        }
        else {
            a.highlightNeedle.angle = NaN;
        }
        a.backingPath = new PathVisualData(1, "Backing", this.b2);
        a.overlayPath = new PathVisualData(1, "Overlay", this.b5);
        a.underlayPath = new PathVisualData(1, "Underlay", this.b7);
        var d = this.i;
        try {
            for (var _g = __values(fromEnum(this.q)), _h = _g.next(); !_h.done; _h = _g.next()) {
                var e = _h.value;
                if (e._visibility == 0) {
                    var f = e.dataContext;
                    var g = new ScaleLabelVisualData();
                    g.labelValue = e.al;
                    g.labelPosition = PointData.b({ $type: Point_$type, x: e.n, y: e.o });
                    g.labelSize = SizeData.b(this.ch(e, f));
                    g.appearance = AppearanceHelper.c(e, f);
                    a.scaleLabels.add(g);
                }
            }
        }
        catch (e_8_1) {
            e_8 = { error: e_8_1 };
        }
        finally {
            try {
                if (_h && !_h.done && (_a = _g.return))
                    _a.call(_g);
            }
            finally {
                if (e_8)
                    throw e_8.error;
            }
        }
        try {
            for (var _j = __values(fromEnum(this.v)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var h = _k.value;
                if (h._visibility == 0) {
                    var i = h.dataContext;
                    var j = new ScaleLabelVisualData();
                    j.labelValue = h.al;
                    j.labelPosition = PointData.b({ $type: Point_$type, x: h.n, y: h.o });
                    j.labelSize = SizeData.b(this.ch(h, i));
                    j.appearance = AppearanceHelper.c(h, i);
                    a.titleLabels.add(j);
                }
            }
        }
        catch (e_9_1) {
            e_9 = { error: e_9_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_b = _j.return))
                    _b.call(_j);
            }
            finally {
                if (e_9)
                    throw e_9.error;
            }
        }
        try {
            for (var _l = __values(fromEnum(this.u)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var k = _m.value;
                if (k._visibility == 0) {
                    var l = k.dataContext;
                    var m = new ScaleLabelVisualData();
                    m.labelValue = k.al;
                    m.labelPosition = PointData.b({ $type: Point_$type, x: k.n, y: k.o });
                    m.labelSize = SizeData.b(this.ch(k, l));
                    m.appearance = AppearanceHelper.c(k, l);
                    a.subtitleLabels.add(m);
                }
            }
        }
        catch (e_10_1) {
            e_10 = { error: e_10_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_c = _l.return))
                    _c.call(_l);
            }
            finally {
                if (e_10)
                    throw e_10.error;
            }
        }
        try {
            for (var _o = __values(fromEnum(this.t)), _p = _o.next(); !_p.done; _p = _o.next()) {
                var n = _p.value;
                if (n._visibility == 0) {
                    var o = n.dataContext;
                    var p = new ScaleLabelVisualData();
                    p.labelValue = n.al;
                    p.labelPosition = PointData.b({ $type: Point_$type, x: n.n, y: n.o });
                    p.labelSize = SizeData.b(this.ch(n, o));
                    p.appearance = AppearanceHelper.c(n, o);
                    a.highlightLabels.add(p);
                }
            }
        }
        catch (e_11_1) {
            e_11 = { error: e_11_1 };
        }
        finally {
            try {
                if (_p && !_p.done && (_d = _o.return))
                    _d.call(_o);
            }
            finally {
                if (e_11)
                    throw e_11.error;
            }
        }
        try {
            for (var _q = __values(fromEnum(this.r)), _r = _q.next(); !_r.done; _r = _q.next()) {
                var q = _r.value;
                if (q._visibility == 0) {
                    var r = new ScaleTickmarkVisualData();
                    r.tickPath = new PathVisualData(1, "tickmarks", q);
                    a.scaleTickmarks.add(r);
                }
            }
        }
        catch (e_12_1) {
            e_12 = { error: e_12_1 };
        }
        finally {
            try {
                if (_r && !_r.done && (_e = _q.return))
                    _e.call(_q);
            }
            finally {
                if (e_12)
                    throw e_12.error;
            }
        }
        try {
            for (var _s = __values(fromEnum(this.s)), _t = _s.next(); !_t.done; _t = _s.next()) {
                var s = _t.value;
                if (s._visibility == 0) {
                    var t = new RangeVisualData();
                    var u = new PathVisualData(1, "range", s);
                    t.rangePath = u;
                    a.ranges.add(t);
                }
            }
        }
        catch (e_13_1) {
            e_13 = { error: e_13_1 };
        }
        finally {
            try {
                if (_t && !_t.done && (_f = _s.return))
                    _f.call(_s);
            }
            finally {
                if (e_13)
                    throw e_13.error;
            }
        }
    };
    XamRadialGaugeView.prototype.av = function (a, b, c) {
        var d = b;
        var e = c;
        if (!this.l) {
            switch (a) {
                case XamRadialGauge.$$p[41]:
                    this.bu = e;
                    break;
                case XamRadialGauge.$$p[44]:
                    this.bv = e;
                    break;
                case XamRadialGauge.$$p[45]:
                    this.bw = e;
                    break;
                case XamRadialGauge.$$p[47]:
                    this.bx = e;
                    break;
                case XamRadialGauge.$$p[0]:
                    this.br = e;
                    break;
                case XamRadialGauge.$$p[4]:
                    this.bs = e;
                    break;
                case XamRadialGauge.$$p[62]:
                    this.by = e;
                    break;
                case XamRadialGauge.$$p[78]:
                    this.b0 = e;
                    break;
                case XamRadialGauge.$$p[34]:
                    this.bt = e;
                    break;
            }
            if (e == null) {
                this.bj();
            }
        }
    };
    XamRadialGaugeView.prototype.a0 = function (a, b) {
        if (!this.l) {
            this.e = b;
            if (this.e == null) {
                this.h.ak = this.c;
            }
        }
    };
    XamRadialGaugeView.prototype.a1 = function (a, b) {
        if (!this.l) {
            this.f = b;
            if (this.f == null) {
                this.h.al = this.d;
            }
        }
    };
    XamRadialGaugeView.prototype.a5 = function () {
        this.x = this.h.db;
    };
    XamRadialGaugeView.$t = markType(XamRadialGaugeView, 'XamRadialGaugeView');
    return XamRadialGaugeView;
}(Base));
export { XamRadialGaugeView };