/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { DependencyProperty } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { Series } from "./Series";
import { Axis } from "./Axis";
import { enumGetBox, Delegate_$type, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, runOn } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { Visibility_$type } from "igniteui-angular-core";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { OverlayTextUtil } from "./OverlayTextUtil";
import { ValueLayerFrame } from "./ValueLayerFrame";
import { List$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { AxisAnnotationFrameManager } from "./AxisAnnotationFrameManager";
import { DoubleCollection } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { OverlayTextUpdatingEventArgs } from "./OverlayTextUpdatingEventArgs";
import { OverlayTextInfo } from "./OverlayTextInfo";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { TextBlock } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { TranslateTransform } from "igniteui-angular-core";
import { LineGeometry } from "igniteui-angular-core";
/**
 * @hidden
 */
var ValueLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ValueLayer, _super);
    function ValueLayer() {
        var _this = _super.call(this) || this;
        _this.aau = null;
        _this.aaf = [NaN, NaN];
        _this.aao = null;
        _this.aap = null;
        _this.afg = null;
        _this.stylingOverlayText = null;
        _this.aa5 = null;
        _this.aa4 = null;
        var a = new ValueLayerFrame();
        var b = new ValueLayerFrame();
        var c = new ValueLayerFrame();
        var d = _this.kh / 1000;
        _this.xm = a;
        _this.xl = b;
        _this.xn = c;
        _this.ab = ValueLayer.$;
        _this.aau = OverlayTextUtil.c();
        return _this;
    }
    ValueLayer.prototype.bk = function () {
        return new ValueLayer();
    };
    ValueLayer.prototype.get_ev = function () {
        return true;
    };
    ValueLayer.prototype.ct = function () {
        return new ValueLayerView(this);
    };
    ValueLayer.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.aat = a;
    };
    ValueLayer.prototype.gv = function (a) {
        if (this.aaq == null) {
            return true;
        }
        if (this.aaq == a) {
            return true;
        }
        return false;
    };
    Object.defineProperty(ValueLayer.prototype, "afi", {
        get: function () {
            return new Thickness(1, this.abi, this.abk, this.abj, this.abh);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueLayer.prototype, "afj", {
        get: function () {
            return new Thickness(1, this.abo, this.abq, this.abp, this.abn);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueLayer.prototype, "aav", {
        get: function () {
            return this.aau;
        },
        set: function (a) {
            var b = this.aau;
            if (OverlayTextUtil.q(a)) {
                a = OverlayTextUtil.c();
            }
            this.aau = a;
            if (b != this.aau) {
                this.raisePropertyChanged("OverlayTextStyle", b, this.aau);
            }
        },
        enumerable: false,
        configurable: true
    });
    ValueLayer.prototype.mh = function () {
        return "Value Layer";
    };
    ValueLayer.prototype.get_isSummarizationSupported = function () {
        return false;
    };
    ValueLayer.prototype.i8 = function (a, b, c) {
        if (isNaN_(this.aaf[0]) && isNaN_(this.aaf[1])) {
            return _super.prototype.i8.call(this, a, b, c);
        }
        if (!isNaN_(this.aaf[0])) {
            return this.aaf[0];
        }
        return this.aaf[1];
    };
    ValueLayer.prototype.getDataLegendSeriesContextAt = function (a, b) {
        if (isNaN_(this.aaf[0]) || isNaN_(this.aaf[1])) {
            return _super.prototype.getDataLegendSeriesContextAt.call(this, a, b);
        }
        if (this.aaq == null) {
            var c_1 = new DataLegendSeriesValueInfo();
            c_1.l = this.aaf[0];
            c_1.a = 0;
            c_1.q = "Value";
            c_1.r = "Value";
            c_1.s = "";
            var d_1 = new DataLegendSeriesValueInfo();
            d_1.l = this.aaf[1];
            d_1.a = 0;
            d_1.q = "Value";
            d_1.r = "Value";
            d_1.s = "";
            var e = new DataLegendSeriesContext();
            e.e = ((function () {
                var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(c_1);
                $ret.add(d_1);
                return $ret;
            })());
            e.h = this.mh();
            return e;
        }
        var f = this.aaq.getDataLegendSeriesContextAt(a, b);
        var g = typeCast(DataLegendSeriesContext.$, f);
        if (g == null || g.e == null) {
            return _super.prototype.getDataLegendSeriesContextAt.call(this, a, b);
        }
        if (g.e.count == 0) {
            g.e._inner[0].l = isNaN_(this.aaf[0]) ? this.aaf[1] : this.aaf[0];
        }
        else {
            g.e._inner[0].l = this.aaf[0];
            g.e._inner[1].l = this.aaf[1];
        }
        return g;
    };
    ValueLayer.prototype.y1 = function (a, b) {
        if (this.aaq == null || this.aaq == a) {
            if (!this.a1.c) {
                this.ry(b);
            }
        }
    };
    ValueLayer.prototype.y3 = function (a, b) {
        var e_1, _a, e_2, _b;
        _super.prototype.y3.call(this, a, b);
        var c = a;
        var d = this.aa3;
        var e = this.aa2;
        c.af.clear();
        c.ag.clear();
        c.ae.clear();
        c.ah.clear();
        AxisAnnotationFrameManager.b(c);
        this.aaf = [NaN, NaN];
        this.aao = null;
        this.aap = null;
        this.aat.cu();
        var f = this.aar();
        if (this.xs(this.aaq)) {
            var g = this.aaq.aq(f);
            this.aaf = g;
            this.adg(c, d, e, this.aaq);
        }
        else {
            if (f == 5 || f == 4 || f == 6) {
                var h = null;
                var i = null;
                var j = [NaN, NaN];
                var k = 0;
                try {
                    for (var _c = __values(fromEnum(this.dc.series)), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var l = _d.value;
                        if (!this.xs(l)) {
                            continue;
                        }
                        var m = l.ai();
                        for (var o = 0; o < m.length; o++) {
                            var n = m[o];
                            if (!this.aax(n)) {
                                continue;
                            }
                            var p = n.dq ? 1 : 0;
                            var q = j[p];
                            var r = null;
                            if (f == 5) {
                                var s = l.jb(2, n);
                                if (!isNaN_(s) && (s > q || isNaN_(q))) {
                                    r = l;
                                }
                                q = !isNaN_(q) ? Math.max(s, q) : s;
                            }
                            else if (f == 4) {
                                var t = l.jb(1, n);
                                if (!isNaN_(t) && (t < q || isNaN_(q))) {
                                    r = l;
                                }
                                q = !isNaN_(q) ? Math.min(t, q) : t;
                            }
                            else if (f == 6) {
                                var u = l.jb(3, n);
                                r = l;
                                q = !isNaN_(q) ? q + u : u;
                            }
                            if (n.dq) {
                                i = r != null ? r : i;
                            }
                            else {
                                h = r != null ? r : h;
                            }
                            j[p] = q;
                        }
                        k++;
                    }
                }
                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 (f == 6) {
                    j[0] = !isNaN_(j[0]) ? j[0] / k : NaN;
                    j[1] = !isNaN_(j[1]) ? j[1] / k : NaN;
                }
                if (h != null && !isNaN_(j[0])) {
                    var v = h.wq(j);
                    this.adj(h, { $type: Point_$type, x: v.x, y: NaN }, c, d, e);
                }
                if (i != null && !isNaN_(j[1])) {
                    var w = i.wq(j);
                    this.adj(i, { $type: Point_$type, x: NaN, y: w.y }, c, d, e);
                }
                this.aaf = j;
                this.aao = h;
                this.aap = i;
            }
            else {
                try {
                    for (var _e = __values(fromEnum(this.dc.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var x = _f.value;
                        this.adg(c, d, e, x);
                    }
                }
                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;
                    }
                }
            }
        }
    };
    ValueLayer.prototype.adg = function (a, b, c, d) {
        var _this = this;
        if (this.xs(d)) {
            this.adi(d, a, b, c);
        }
        if (d.isStacked) {
            d.p9(function (e) {
                if (_this.xs(e)) {
                    _this.adi(e, a, b, c);
                }
                if (e.ei) {
                    e.p7(function (f) {
                        if (_this.xs(f)) {
                            _this.adi(f, a, b, c);
                        }
                        return true;
                    });
                }
                return true;
            });
        }
        if (d.ei) {
            d.p7(function (e) {
                if (_this.xs(e)) {
                    _this.adi(e, a, b, c);
                }
                return true;
            });
        }
    };
    ValueLayer.prototype.xs = function (a) {
        if (!_super.prototype.xs.call(this, a)) {
            return false;
        }
        return true;
    };
    ValueLayer.prototype.aax = function (a) {
        if (!a.dh) {
            return false;
        }
        if (this.aaj != null && this.aaj != a) {
            return false;
        }
        return true;
    };
    ValueLayer.prototype.qv = function () {
        _super.prototype.qv.call(this);
        if (!this.a1.c && !this.d4()) {
            return;
        }
        if (this.d4()) {
            this.adk(this.xn, false);
        }
        else {
            this.adk(this.xl, false);
        }
    };
    ValueLayer.prototype.aar = function () {
        if (this.aas == 0) {
            return 2;
        }
        return this.aas;
    };
    ValueLayer.prototype.xc = function () {
        return 3;
    };
    ValueLayer.prototype.xz = function () {
        return 0.3;
    };
    ValueLayer.prototype.x2 = function () {
        return -0.4;
    };
    ValueLayer.prototype.x1 = function () {
        return 0.5;
    };
    ValueLayer.prototype.z4 = function () {
        return this.w9 == 3 ? this.afh() : null;
    };
    ValueLayer.prototype.z5 = function () {
        return this.xa == 3 ? this.afh() : null;
    };
    ValueLayer.prototype.afh = function () {
        if (this.afg == null) {
            this.afg = new DoubleCollection();
            this.afg.add(DeviceUtils.g(5));
            this.afg.add(DeviceUtils.g(5));
        }
        return this.afg;
    };
    ValueLayer.prototype.adh = function () {
        if (OverlayTextUtil.q(this.aau)) {
            this.aau = OverlayTextUtil.c();
        }
        else if (OverlayTextUtil.k(this.aau)) {
            this.aau = this.cw.l(this.aau.fontString);
        }
    };
    ValueLayer.prototype.adj = function (a, b, c, d, e) {
        var f = false;
        var g = this.ae4;
        if (g == null) {
            g = a.vj;
            f = true;
        }
        var h = false;
        var i = this.afa;
        if (i == null) {
            if (this.ae4 != null) {
                i = this.ae4;
            }
            else {
                i = a.vj;
                h = true;
            }
        }
        var j = false;
        var k = this.afd;
        if (k == null) {
            if (this.ae4 != null) {
                k = this.ae4;
            }
            else {
                k = a.vj;
                j = true;
            }
        }
        var l = g;
        var m = g;
        var n = i;
        var o = k;
        if (this.ae5 != null) {
            l = this.ae5;
        }
        else if (f) {
            switch (this.w9) {
                case 1:
                    l = this.aat.ck(l, this.xw);
                    break;
                case 2:
                    l = this.aat.cm(l, this.xw);
                    break;
                case 4:
                    l = this.aat.cl(l, this.xw);
                    break;
            }
        }
        if (this.ae9 != null) {
            m = this.ae9;
        }
        else if (f) {
            switch (this.xa) {
                case 1:
                    m = this.aat.ck(m, this.xy);
                    break;
                case 2:
                    m = this.aat.cm(m, this.xy);
                    break;
                case 4:
                    m = this.aat.cl(m, this.xy);
                    break;
            }
        }
        if (h) {
            switch (this.xa) {
                case 1:
                    n = this.aat.ck(n, this.xy);
                    break;
                case 2:
                    n = this.aat.cm(n, this.xy);
                    break;
            }
        }
        if (j) {
            switch (this.w9) {
                case 1:
                    o = this.aat.ck(o, this.xw);
                    break;
                case 2:
                    o = this.aat.cm(o, this.xw);
                    break;
            }
        }
        c.ae.add(l);
        c.ah.add(m);
        c.af.add(b.y);
        c.ag.add(b.x);
        var p = isNaN_(b.x);
        var q = p ? b.y : b.x;
        this.adh();
        var r = this.aav;
        var s = OverlayTextUtil.o(r, this.aa1);
        var t = this.aam;
        if (t == 18) {
            s = false;
        }
        if (s && !stringIsNullOrEmpty(this.aby)) {
            var u = this.ae8;
            if (u == null && this.aa0) {
                u = g;
            }
            var v = this.ae6;
            if (v == null && this.aay) {
                v = g;
            }
            var w = this.ae7;
            if (w == null && this.aaz) {
                w = g;
            }
            var x = new OverlayTextUpdatingEventArgs();
            x.textLocation = this.aam;
            x.textAngle = this.aa6;
            x.textVisible = this.aa1;
            x.textContent = this.aby;
            x.textColorMode = this.aai;
            x.textColorShift = this.abb;
            x.textColor = u;
            x.backgroundMode = this.aag;
            x.backgroundShift = this.aa7;
            x.background = v;
            x.borderMode = this.aah;
            x.borderShift = this.aa9;
            x.borderStroke = w;
            x.borderRadius = this.aa8;
            x.borderThickness = this.aba;
            x.shapeBrush = g;
            x.shapeOutline = g;
            x.f = p;
            x.horizontalMargin = this.abc;
            x.verticalPadding = this.abf;
            x.verticalMargin = this.abe;
            x.horizontalPadding = this.abd;
            if (this.stylingOverlayText != null) {
                this.stylingOverlayText(this, x);
            }
            OverlayTextUtil.ad(x);
            var y = OverlayTextInfo.d(x);
            if (y.textVisible && !y.h) {
                this.aat.cq.count += 1;
                this.aat.cp.count += 1;
                var z = this.aat.cq.count - 1;
                y.f = r;
                y.ad = this.cw.cc(y.textContent, y.f);
                y.u = this.aat.cq.item(z);
                y.ac = this.aat.cp.item(z);
                if (y.g) {
                    var aa = this.dc.xe({ $type: Point_$type, x: 0, y: NaN });
                    var ab = this.dc.xe({ $type: Point_$type, x: 1, y: NaN });
                    var ac = ab.x - aa.x;
                    y.ab = new Rect(0, aa.x, q, ac, 1);
                }
                else {
                    var ad = this.dc.xe({ $type: Point_$type, x: NaN, y: 0 });
                    var ae = this.dc.xe({ $type: Point_$type, x: NaN, y: 1 });
                    var af = ae.y - ad.y;
                    y.ab = new Rect(0, q, ad.y, 1, af);
                }
                OverlayTextUtil.ac(y);
                this.cw.av(y.u, y.f);
                this.cw.aw(y.u, y.f);
            }
        }
        if (this.aaw) {
            AxisAnnotationFrameManager.c(c, b, a, this.dc, this.getEffectiveViewport(), g, n, this.abg, this.afc, this.afb, this.afi, this.abl, o, this.abm, this.aff, this.afe, this.afj, this.abr, this.afl == 0, this.afk == 0);
        }
    };
    ValueLayer.prototype.adi = function (a, b, c, d) {
        var e = { $type: Point_$type, x: NaN, y: NaN };
        var f = this.aar();
        switch (f) {
            case 5:
                e = a.wp(2);
                break;
            case 4:
                e = a.wp(1);
                break;
            case 6:
                e = a.wp(3);
                break;
            default:
                e = a.wp(f);
                break;
        }
        var i = a.ai();
        for (var h = 0; h < i.length; h++) {
            var g = i[h];
            if (!this.aax(g)) {
                continue;
            }
            if (g.dq) {
                this.adj(a, { $type: Point_$type, x: NaN, y: e.y }, b, c, d);
            }
            else {
                this.adj(a, { $type: Point_$type, x: e.x, y: NaN }, b, c, d);
            }
        }
    };
    ValueLayer.prototype.adk = function (a, b) {
        var c = false;
        if (this.aa4 == null) {
            c = true;
            this.aa5 = new List$1(Axis.$, 0);
            this.aa4 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
        }
        AxisAnnotationFrameManager.d(this, a, c, this.aa4, this.aa5, b, this.abs, this.abt, this.aak, this.aal);
    };
    ValueLayer.prototype.adf = function (a, b, c, d, e) {
        var f = a.item(b);
        b++;
        if (e) {
            f._stroke = d.ah._inner[c];
            f._fill = d.ah._inner[c];
        }
        else {
            f._stroke = d.ae._inner[c];
            f._fill = d.ae._inner[c];
        }
        f.ad = this.ig;
        f.ai = e ? this.z2 : this.z1;
        f.am = this.wf;
        f.al = this.we;
        f.ak = this.we;
        f.aj = this.wd;
        f.ac = this.jk;
        return new Tuple$2(Path.$, Number_$type, f, b);
    };
    ValueLayer.prototype.y6 = function (a, b) {
        _super.prototype.y6.call(this, a, b);
        var c = this.aat.co;
        var d = a;
        var e = d.af.count;
        var f = 0;
        var g = b.b9.left;
        var h = b.b9.right;
        var i = b.b9.top;
        var j = b.b9.bottom;
        var k = this.afl == 0;
        var l = this.afk == 0;
        for (var m = 0; m < e; m++) {
            var n = Math.floor(d.af._inner[m]);
            var o = Math.floor(d.ag._inner[m]);
            var p = null;
            if (k) {
                if (!isNaN_(o)) {
                    var q = this.adf(c, f, m, d, true);
                    p = q.c;
                    f = q.d;
                    var r = new PathGeometry();
                    var s = new PathFigure();
                    s._startPoint = { $type: Point_$type, x: o, y: i };
                    var t = new LineSegment(1);
                    t.c = { $type: Point_$type, x: o, y: j };
                    s._segments.add(t);
                    r.c.add(s);
                    p.an = r;
                }
            }
            if (l) {
                if (!isNaN_(n)) {
                    var u = this.adf(c, f, m, d, false);
                    p = u.c;
                    f = u.d;
                    var v = new PathGeometry();
                    var w = new PathFigure();
                    w._startPoint = { $type: Point_$type, x: g, y: n };
                    var x = new LineSegment(1);
                    x.c = { $type: Point_$type, x: h, y: n };
                    w._segments.add(x);
                    v.c.add(w);
                    p.an = v;
                }
            }
        }
        c.count = f;
        if (this.d4()) {
            this.adk(this.xn, true);
        }
        else {
            this.adk(this.xl, false);
        }
    };
    ValueLayer.prototype.gb = function () {
        return true;
    };
    ValueLayer.prototype.rg = function (a, b, c, d) {
        _super.prototype.rg.call(this, a, b, c, d);
        switch (b) {
            case "SeriesViewer":
                if (d == null) {
                    if (this.aa4 != null && this.aa4.count > 0) {
                        var e = void 0;
                        if (this.d4()) {
                            e = this.xn;
                        }
                        else {
                            e = this.xl;
                        }
                        AxisAnnotationFrameManager.b(e);
                        AxisAnnotationFrameManager.d(this, e, true, this.aa4, this.aa5, true, this.abs, this.abt, this.aak, this.aal);
                    }
                }
                break;
            case ValueLayer.$$p[2]:
                this.ry(true);
                break;
            case ValueLayer.$$p[32]:
                this.ry(true);
                break;
            case ValueLayer.$$p[28]:
            case "Visibility":
                this.ry(true);
                break;
            case ValueLayer.$$p[3]:
            case ValueLayer.$$p[34]:
            case ValueLayer.$$p[33]:
            case ValueLayer.$$p[37]:
            case ValueLayer.$$p[39]:
            case ValueLayer.$$p[41]:
            case ValueLayer.$$p[40]:
            case ValueLayer.$$p[38]:
            case ValueLayer.$$p[42]:
            case ValueLayer.$$p[43]:
            case ValueLayer.$$p[45]:
            case ValueLayer.$$p[48]:
            case ValueLayer.$$p[50]:
            case ValueLayer.$$p[52]:
            case ValueLayer.$$p[51]:
            case ValueLayer.$$p[49]:
            case ValueLayer.$$p[53]:
            case ValueLayer.$$p[54]:
            case ValueLayer.$$p[1]:
            case ValueLayer.$$p[31]:
            case ValueLayer.$$p[29]:
                this.ry(true);
                break;
            case "Brush":
            case ValueLayer.$$p[30]:
                if (this.vp != null) {
                    this.ae4 = this.vp;
                }
                else {
                    switch (this.aas) {
                        case 6:
                            this.ae4 = BrushUtil.j(255, 248, 173, 118);
                            break;
                        case 4:
                            this.ae4 = BrushUtil.j(255, 246, 93, 80);
                            break;
                        case 5:
                            this.ae4 = BrushUtil.j(255, 99, 208, 0);
                            break;
                        default:
                            this.ae4 = this.aaq != null ? this.aaq.vj : null;
                            break;
                    }
                }
                this.ry(true);
                break;
            case ValueLayer.$$p[22]:
            case ValueLayer.$$p[25]:
            case ValueLayer.$$p[21]:
            case ValueLayer.$$p[4]:
            case ValueLayer.$$p[17]:
            case ValueLayer.$$p[15]:
            case ValueLayer.$$p[16]:
            case ValueLayer.$$p[18]:
            case ValueLayer.$$p[7]:
            case ValueLayer.$$p[5]:
            case ValueLayer.$$p[6]:
            case ValueLayer.$$p[8]:
            case ValueLayer.$$p[10]:
            case ValueLayer.$$p[11]:
            case ValueLayer.$$p[13]:
            case ValueLayer.$$p[9]:
            case ValueLayer.$$p[12]:
            case ValueLayer.$$p[14]:
            case ValueLayer.$$p[19]:
            case ValueLayer.$$p[20]:
            case ValueLayer.$$p[24]:
            case ValueLayer.$$p[23]:
                this.ry(true);
                break;
        }
    };
    ValueLayer.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        if (a) {
            AxisAnnotationFrameManager.b(this.xl);
            this.adk(this.xl, false);
        }
    };
    ValueLayer.$t = markType(ValueLayer, 'ValueLayer', AnnotationLayer.$);
    ValueLayer.$$p = markDep(DependencyProperty, PropertyMetadata, ValueLayer, 'raisePropertyChanged', ['ActualValueLayerBrush:ae4:adl', [Brush.$, null], 'HorizontalLineStroke:ae5:adm', [Brush.$, null], 'HorizontalLineVisibility:afk:adn', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'IsAxisAnnotationEnabled:aaw:ado', [0, false], 'OverlayTextAngle:aa6:adp', [1, NaN], 'OverlayTextBackgroundMatchLayer:aay:adq', [0, false], 'OverlayTextBackgroundMode:aag:adr', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:ae6:ads', [Brush.$, null], 'OverlayTextBackgroundShift:aa7:adt', [1, NaN], 'OverlayTextBorderColor:ae7:adu', [Brush.$, null], 'OverlayTextBorderMatchLayer:aaz:adv', [0, false], 'OverlayTextBorderMode:aah:adw', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:aa8:adx', [1, NaN], 'OverlayTextBorderShift:aa9:ady', [1, NaN], 'OverlayTextBorderThickness:aba:adz', [1, 1], 'OverlayTextColorMatchLayer:aa0:ad0', [0, true], 'OverlayTextColorMode:aai:ad1', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:ae8:ad2', [Brush.$, null], 'OverlayTextColorShift:abb:ad3', [1, NaN], 'OverlayTextHorizontalMargin:abc:ad4', [1, NaN], 'OverlayTextHorizontalPadding:abd:ad5', [1, NaN], 'OverlayTextLocation:aam:ad6', [OverlayTextLocation_$type, enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayText:aby:ad7', [2, null], 'OverlayTextVerticalMargin:abe:ad8', [1, NaN], 'OverlayTextVerticalPadding:abf:ad9', [1, NaN], 'OverlayTextVisible:aa1:aea', [0, true], 'SkipUnknownValues:aa2:aeb', [0, true], 'TargetAxis:aaj:aec', [Axis.$, null], 'TargetSeries:aaq:aed', [Series.$, null], 'UseInterpolation:aa3:aee', [0, true], 'ValueMode:aas:aef', [ValueLayerValueMode_$type, enumGetBox(ValueLayerValueMode_$type, 2)], 'VerticalLineStroke:ae9:aeg', [Brush.$, null], 'VerticalLineVisibility:afl:aeh', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'XAxisAnnotationBackgroundCornerRadius:abg:aei', [1, DeviceUtils.g(3)], 'XAxisAnnotationBackground:afa:aej', [Brush.$, null], 'XAxisAnnotationFormatLabel:aak:aek', [Delegate_$type], 'XAxisAnnotationInterpolatedValuePrecision:abs:ael', [1, -1], 'XAxisAnnotationOutline:afb:aem', [Brush.$, null], 'XAxisAnnotationPaddingBottom:abh:aen', [1, NaN], 'XAxisAnnotationPaddingLeft:abi:aeo', [1, NaN], 'XAxisAnnotationPaddingRight:abj:aep', [1, NaN], 'XAxisAnnotationPaddingTop:abk:aeq', [1, NaN], 'XAxisAnnotationStrokeThickness:abl:aer', [1, NaN], 'XAxisAnnotationTextColor:afc:aes', [Brush.$, null], 'YAxisAnnotationBackgroundCornerRadius:abm:aet', [1, DeviceUtils.g(3)], 'YAxisAnnotationBackground:afd:aeu', [Brush.$, null], 'YAxisAnnotationFormatLabel:aal:aev', [Delegate_$type], 'YAxisAnnotationInterpolatedValuePrecision:abt:aew', [1, -1], 'YAxisAnnotationOutline:afe:aex', [Brush.$, null], 'YAxisAnnotationPaddingBottom:abn:aey', [1, NaN], 'YAxisAnnotationPaddingLeft:abo:aez', [1, NaN], 'YAxisAnnotationPaddingRight:abp:ae0', [1, NaN], 'YAxisAnnotationPaddingTop:abq:ae1', [1, NaN], 'YAxisAnnotationStrokeThickness:abr:ae2', [1, NaN], 'YAxisAnnotationTextColor:aff:ae3', [Brush.$, null]]);
    return ValueLayer;
}(AnnotationLayer));
export { ValueLayer };
/**
 * @hidden
 */
var ValueLayerView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ValueLayerView, _super);
    function ValueLayerView(a) {
        var _this = _super.call(this, a) || this;
        _this.cn = null;
        _this.co = null;
        _this.ct = null;
        _this.cs = null;
        _this.cq = null;
        _this.cr = null;
        _this.cp = null;
        _this.cn = a;
        _this.ct = new List$1(Path.$, 0);
        return _this;
    }
    ValueLayerView.prototype.cu = function () {
        OverlayTextUtil.u(this.cq);
        OverlayTextUtil.v(this.cs);
        this.cp.clear();
        this.cr.clear();
        this.cq.count = 0;
        this.cp.count = 0;
    };
    ValueLayerView.prototype.a4 = function () {
        var _this = this;
        _super.prototype.a4.call(this);
        this.co = ((function () {
            var $ret = new Pool$1(Path.$);
            $ret.create = runOn(_this, _this.c6);
            $ret.activate = runOn(_this, _this.cv);
            $ret.disactivate = runOn(_this, _this.cx);
            $ret.destroy = runOn(_this, _this.cw);
            return $ret;
        })());
        this.cs = new List$1(TextBlock.$, 0);
        this.cq = ((function () {
            var $ret = new Pool$1(TextBlock.$);
            $ret.create = runOn(_this, _this.c5);
            $ret.activate = runOn(_this, _this.c1);
            $ret.disactivate = runOn(_this, _this.c3);
            $ret.destroy = runOn(_this, _this.c2);
            return $ret;
        })());
        this.cr = new List$1(Rectangle.$, 0);
        this.cp = ((function () {
            var $ret = new Pool$1(Rectangle.$);
            $ret.create = runOn(_this, _this.c7);
            $ret.activate = runOn(_this, _this.cy);
            $ret.disactivate = runOn(_this, _this.c0);
            $ret.destroy = runOn(_this, _this.cz);
            return $ret;
        })());
        this.cn.jt = Defaults.crosshairLineThickness;
    };
    ValueLayerView.prototype.c5 = function () {
        var a = new TextBlock();
        this.cs.add(a);
        return a;
    };
    ValueLayerView.prototype.c2 = function (a) {
        if (this.cs.contains(a)) {
            this.cs.remove(a);
        }
    };
    ValueLayerView.prototype.c1 = function (a) {
        a._visibility = 0;
        a.s = 0;
    };
    ValueLayerView.prototype.c3 = function (a) {
        a._visibility = 1;
    };
    ValueLayerView.prototype.c7 = function () {
        var a = new Rectangle();
        this.cr.add(a);
        return a;
    };
    ValueLayerView.prototype.cz = function (a) {
        a.dataContext = null;
        if (this.cr.contains(a)) {
            this.cr.remove(a);
        }
    };
    ValueLayerView.prototype.cy = function (a) {
        a._visibility = 0;
    };
    ValueLayerView.prototype.c0 = function (a) {
        a._visibility = 1;
    };
    ValueLayerView.prototype.c6 = function () {
        var a = new Path();
        a.j = new TranslateTransform();
        this.ct.add(a);
        return a;
    };
    ValueLayerView.prototype.cv = function (a) {
        a._visibility = 0;
    };
    ValueLayerView.prototype.cx = function (a) {
        a._visibility = 1;
    };
    ValueLayerView.prototype.cw = function (a) {
        this.ct.remove(a);
    };
    ValueLayerView.prototype.c4 = function (a, b, c, d) {
        if (a.an == null || a.an.c.x != d || a.an.d.x != c) {
            var e = ((function () {
                var $ret = new LineGeometry();
                $ret.d = { $type: Point_$type, x: c, y: b };
                $ret.c = { $type: Point_$type, x: d, y: b };
                return $ret;
            })());
            a.an = e;
        }
    };
    ValueLayerView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (a.d && !b) {
            for (var c = 0; c < this.ct.count; c++) {
                var d = this.ct._inner[c];
                if (d._visibility == 0) {
                    a.t(d);
                }
            }
            for (var e = 0; e < this.cp.count; e++) {
                var f = this.cp.item(e);
                if (f._visibility == 0) {
                    a.w(f);
                }
            }
            for (var g = 0; g < this.cq.count; g++) {
                var h = this.cq.item(g);
                a.ae(h.dataContext);
                a.x(h);
            }
        }
    };
    ValueLayerView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        for (var b = 0; b < this.ct.count; b++) {
            this.f.bc.exportPathData(a, this.ct._inner[b], "crosshairLine", ["Main", "Crosshair"]);
        }
    };
    ValueLayerView.$t = markType(ValueLayerView, 'ValueLayerView', AnnotationLayerView.$);
    return ValueLayerView;
}(AnnotationLayerView));
export { ValueLayerView };
