/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-react-core";
import { Base, runOn, delegateCombine, String_$type, enumGetBox, EnumUtil, typeCast, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-react-core";
import { Series } from "./Series";
import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection";
import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode";
import { Brush } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { FontUtil } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { CalloutLayerFrame } from "./CalloutLayerFrame";
import { HashSet$1 } from "igniteui-react-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { List$1 } from "igniteui-react-core";
import { LinkedList$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { LinkedListNode$1 } from "igniteui-react-core";
import { LabelCollisionManager } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs";
import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs";
import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs";
import { DeviceUtils } from "igniteui-react-core";
import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs";
import { LabelCollisionInfo } from "igniteui-react-core";
import { QuadTreeBoundingBox } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { Size } from "igniteui-react-core";
import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs";
import { CalloutKey } from "./CalloutKey";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { FastItemObjectColumn } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-react-core";
import { TextBlock } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
import { Line } from "igniteui-react-core";
import { CalloutViewHelper } from "./CalloutViewHelper";
import { Rectangle } from "igniteui-react-core";
import { TranslateTransform } from "igniteui-react-core";
/**
 * @hidden
 */
export let CalloutLayer = /*@__PURE__*/ (() => {
    class CalloutLayer extends AnnotationLayer {
        bc() {
            return new CalloutLayer();
        }
        get_d3() {
            return true;
        }
        constructor() {
            super();
            this.calloutStyleUpdating = null;
            this.calloutRenderStyleUpdating = null;
            this.xm = null;
            this.xn = null;
            this.xo = null;
            this.xl = null;
            this.xk = null;
            this.ye = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            this.yh = new List$1(CalloutAnnotationWrapper.$, 0);
            this.yi = new List$1(CalloutAnnotationWrapper.$, 0);
            this.xc = null;
            this.w2 = null;
            this.xi = null;
            this.yf = new LinkedList$1(CalloutAnnotationWrapper.$);
            this.yc = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0);
            this.xu = null;
            this.abo = new Rect(0, 0, 0, 1, 1);
            this.x1 = false;
            this.yt = 0;
            this.abn = Rect.empty;
            this.xz = false;
            this.x0 = false;
            this.calloutContentUpdating = null;
            this.calloutLabelUpdating = null;
            this.calloutSeriesSelecting = null;
            this.yg = new List$1(SeriesPointOfInterest.$, 0);
            this.x3 = false;
            this.x4 = false;
            this.yk = 0;
            this.x2 = false;
            this.xy = true;
            this.w4 = 1;
            FastItemObjectColumn.m();
            this.w2 = null;
            this.xc = new CalloutPlacementPositionsCollection();
            let a = this.xc;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.z8));
            this.up = true;
            let b = new CalloutLayerFrame();
            let c = new CalloutLayerFrame();
            let d = new CalloutLayerFrame();
            let e = this.jj / 1000;
            this.uh = b;
            this.ug = c;
            this.ui = d;
            this.ab = CalloutLayer.$;
        }
        z8(a, b) {
            this.aah();
        }
        aah() {
            this.w2 = this.w3(this.xd);
            this.aae();
        }
        z9(a, b) {
            this.yi.clear();
            this.pr(false);
        }
        np(a, b, c, d) {
            super.np(a, b, c, d);
            let e = this.yd();
            switch (a) {
                case 3:
                    this.aam(b, e);
                    break;
                case 1:
                    for (let f = b; f < b + c; f++) {
                        let g = new CalloutAnnotation();
                        let h = new CalloutAnnotationWrapper();
                        h.b = g;
                        h.b.series = this.xh;
                        this.yi.insert(f, h);
                        this.aam(f, e);
                    }
                    break;
                case 0:
                    this.yi.v(b, c);
                    break;
                case 2:
                    for (let i = b; i < b + c; i++) {
                        this.aam(i, e);
                    }
                    break;
                case 4:
                    this.yi.clear();
                    for (let j = 0; j < this.c7.count; j++) {
                        let k = new CalloutAnnotation();
                        let l = new CalloutAnnotationWrapper();
                        l.b = k;
                        l.b.series = this.xh;
                        this.yi.add(l);
                        this.aam(j, e);
                    }
                    break;
            }
            this.pr(true);
        }
        fq(a) {
            return false;
        }
        yd() {
            let a = new Dictionary$2(String_$type, Series.$, 0);
            if (this.cv != null) {
                for (let b = 0; b < this.cv.series.count; b++) {
                    let c = this.cv.series._inner[b];
                    if (c.name != null && !a.containsKey(c.name)) {
                        a.addItem(c.name, c);
                    }
                }
            }
            return a;
        }
        aam(a, b) {
            if (this.xt == null || this.xr == null) {
                return;
            }
            let c = a;
            if (this.xs != null) {
                c = this.xs.item(a);
            }
            let d = this.xt.item(a);
            let e = this.xr.item(a);
            let f = this.yi._inner[a];
            if (this.xq != null) {
                if (f.b.ab != this.xq.item(a)) {
                    f.b.key = this.xq.item(a);
                }
            }
            if (this.yc.containsKey(f)) {
                f.b = this.yc.item(f).c.b;
            }
            f.b.xValue = c;
            f.b.yValue = d;
            if (this.calloutLabelUpdating != null) {
                let g = ((() => {
                    let $ret = new CalloutLabelUpdatingEventArgs();
                    $ret.d = c;
                    $ret.e = d;
                    $ret.item = this.c7.item(a);
                    return $ret;
                })());
                this.calloutLabelUpdating(this, g);
                if (g.c != null && !Base.equalsStatic(g.c, f.b.ao)) {
                    let h = g.c;
                    f.b.text = h != null ? h.toString() : "";
                }
            }
            else {
                f.b.text = e != null ? e.toString() : "";
            }
            if (this.xp != null) {
                f.b.content = this.xp.item(a);
            }
            else {
                f.b.content = this.c7.item(a);
            }
            if (this.calloutSeriesSelecting != null) {
                let i = ((() => {
                    let $ret = new CalloutSeriesSelectingEventArgs();
                    $ret.c = c;
                    $ret.d = d;
                    $ret.item = this.c7.item(a);
                    return $ret;
                })());
                this.calloutSeriesSelecting(this, i);
                if (i.a != null) {
                    f.b.series = i.a;
                }
                else if (i.e != null) {
                    if (b.containsKey(i.e)) {
                        f.b.series = b.item(i.e);
                    }
                }
            }
            this.aan(f);
        }
        aan(a) {
            let b = new Thickness(0, DeviceUtils.g(3));
            if (isNaN_(this.abq.left) || isNaN_(this.abq.top) || isNaN_(this.abq.right) || isNaN_(this.abq.bottom)) {
                b = new Thickness(0, DeviceUtils.g(3));
            }
            else {
                b = this.abq;
            }
            let c = DeviceUtils.g(3);
            if (isNaN_(this.yl)) {
                c = DeviceUtils.g(3);
            }
            else {
                c = this.yl;
            }
            let d = this.abj != null ? this.abj : this.xb.cl(a.b.l);
            let e = this.abm != null ? this.abm : this.xb.co();
            let f = this.abl != null ? this.abl : this.xb.cn(a.b.l);
            let g = this.abk != null ? this.abk : this.xb.cm(a.b.l);
            let h = isNaN_(this.yr) ? 0 : this.yr;
            if (this.x8 && this.calloutStyleUpdating != null) {
                let i = new CalloutStyleUpdatingEventArgs();
                i.item = a.b.aa;
                i.xValue = a.b.ac;
                i.yValue = a.b.ad;
                i.series = a.b.l;
                i.background = d;
                i.textColor = e;
                i.outline = f;
                i.leaderBrush = g;
                i.strokeThickness = h;
                this.calloutStyleUpdating(this, i);
                d = i.background;
                e = i.textColor;
                f = i.outline;
                g = i.leaderBrush;
                h = i.strokeThickness;
            }
            a.b.backgroundPadding = b;
            a.b.backgroundCornerRadius = c;
            a.b.background = d;
            a.b.textColor = e;
            a.b.outline = f;
            a.b.leaderBrush = g;
            a.b.strokeThickness = h;
        }
        jv(a, b) {
            let c = this.lw(b);
            if (c == CalloutLayer.$$p[21]) {
                return this.jw(a, b, this.zs);
            }
            if (c == CalloutLayer.$$p[28]) {
                return this.jw(a, b, this.z3);
            }
            if (c == CalloutLayer.$$p[29]) {
                return this.jw(a, b, this.z6);
            }
            if (c == CalloutLayer.$$p[20]) {
                return this.jw(a, b, this.zp);
            }
            if (c == CalloutLayer.$$p[15]) {
                return this.jw(a, b, this.zi);
            }
            return super.jv(a, b);
        }
        get xr() {
            return this.xm;
        }
        set xr(a) {
            if (this.xm != a) {
                let b = this.xm;
                this.xm = a;
                this.raisePropertyChanged("LabelColumn", b, this.xm);
            }
        }
        get xs() {
            return this.xn;
        }
        set xs(a) {
            if (this.xn != a) {
                let b = this.xn;
                this.xn = a;
                this.raisePropertyChanged("XColumn", b, this.xn);
            }
        }
        get xt() {
            return this.xo;
        }
        set xt(a) {
            if (this.xo != a) {
                let b = this.xo;
                this.xo = a;
                this.raisePropertyChanged("YColumn", b, this.xo);
            }
        }
        get xq() {
            return this.xl;
        }
        set xq(a) {
            if (this.xl != a) {
                let b = this.xl;
                this.xl = a;
                this.raisePropertyChanged("KeyColumn", b, this.xl);
            }
        }
        get xp() {
            return this.xk;
        }
        set xp(a) {
            if (this.xk != a) {
                let b = this.xk;
                this.xk = a;
                this.raisePropertyChanged("ContentColumn", b, this.xk);
            }
        }
        aab(a, b) {
            if (b.propertyName == CalloutAnnotation.$$p[14] || b.propertyName == CalloutAnnotation.$$p[15]) {
                let c = a.k;
                if (!this.ye.contains(c)) {
                    this.ye.add_1(c);
                    this.yh.add(c);
                    this.pr(false);
                }
            }
        }
        cd() {
            return new CalloutLayerView(this);
        }
        o2(a) {
            super.o2(a);
            this.xb = a;
        }
        get xd() {
            return this.xc;
        }
        set xd(a) {
            let b = this.xd;
            if (a != b) {
                this.xc = a;
                this.raisePropertyChanged("AllowedPositions", b, this.xd);
            }
        }
        get w6() {
            return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.aa2));
        }
        set w6(a) {
            this.h(CalloutLayer.aa2, enumGetBox(AutoCalloutVisibilityMode_$type, a));
        }
        get w5() {
            return this.w4;
        }
        set w5(a) {
            this.w4 = a;
        }
        get abq() {
            return new Thickness(1, this.yn, this.yp, this.yo, this.ym);
        }
        get xj() {
            if (this.xi == null) {
                this.xi = FontUtil.toFontInfo(this.i5, this.zx);
            }
            return this.xi;
        }
        vu(a, b) {
            if (this.xh == null || this.xh == a) {
                if (!this.at.c) {
                    this.pr(b);
                }
            }
        }
        vw(a, b) {
            super.vw(a, b);
            let c = a;
            c.q.clear();
            c.r.clear();
            c.n.clear();
            c.f.clear();
            c.i.clear();
            c.h.clear();
            c.k.clear();
            c.m.clear();
            c.l.clear();
            c.j.clear();
            c.g.clear();
            c.o.clear();
            c.p.clear();
            c.u.clear();
            c.v.clear();
            c.s.clear();
            c.t.clear();
            let d = this.yj();
            let e = new List$1(CalloutAnnotationWrapper.$, 0);
            let f = true;
            if (this.x5) {
                if (this.un(this.xh)) {
                    this.aaj(this.xh, c, e);
                }
                else {
                    for (let g of fromEnum(this.cv.series)) {
                        if (this.un(g)) {
                            if (!g.d7) {
                                if (!g.isVertical) {
                                    f = false;
                                }
                            }
                            this.aaj(g, c, e);
                        }
                    }
                }
            }
            if (this.x5 && this.w5 == 2) {
                let h = 0;
                let i = 0;
                let j = 1.7976931348623157E+308;
                let k = 1.7976931348623157E+308;
                let l = -1.7976931348623157E+308;
                let m = -1.7976931348623157E+308;
                if (e.count > 0) {
                    if (e._inner[0].c != null) {
                        h = e._inner[0].e;
                        i = e._inner[0].f;
                    }
                    for (let n = 0; n < e.count; n++) {
                        let o = e._inner[n];
                        if (o.c != null) {
                            let p = o.e;
                            let q = o.f;
                            if (p != h) {
                                j = Math.min(j, Math.abs(p - h));
                            }
                            if (q != i) {
                                k = Math.min(k, Math.abs(q - i));
                            }
                            l = Math.max(o.c.l + o.c.l, l);
                            m = Math.max(o.c.k + o.c.k, m);
                        }
                    }
                    if (f) {
                        if (m > k) {
                            e.clear();
                        }
                    }
                    else {
                        if (l > j) {
                            e.clear();
                        }
                    }
                }
            }
            this.aai(c, d, e);
        }
        qp(a, b) {
            super.qp(a, b);
            let c = b.width - this.abo.width;
            let d = b.height - this.abo.height;
            let e = 0;
            if (Math.abs(c) > Math.abs(d)) {
                e = c;
                this.yk = c * this.ty.width;
            }
            else {
                e = d;
                this.yk = d * this.ty.height;
            }
            if (e > 0 && this.yk > 5) {
                this.x4 = true;
            }
            if (e < 0 && this.yk > 5) {
                this.x3 = true;
            }
        }
        qo(a, b) {
            super.qo(a, b);
            if (!a.equals1(b)) {
                this.x2 = true;
            }
        }
        get abp() {
            return this.abn;
        }
        set abp(a) {
            this.abn = a;
        }
        aai(a, b, c) {
            if (this.cv != null) {
                this.abo = this.cv.tr;
            }
            if (this.ty.isEmpty) {
                return;
            }
            this.abp = new Rect(0, this.ty.left, this.ty.top, this.ty.width, this.ty.height);
            if (this.xu != null && this.zf != null && this.zf != this.xu.ap) {
                this.aad();
            }
            if (this.xu == null) {
                let d = this.xv();
                if (d != null) {
                    this.xu = d;
                    let e = this.xu;
                    e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.aaa));
                }
                else {
                    let f = this.tq(this.cg);
                    let g = new Array(2);
                    g[0] = 0;
                    g[1] = 3;
                    if (this.xh != null) {
                        if (this.xh.isVertical) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    else {
                        let h = false;
                        if (this.cv != null && this.cv.series.count > 0) {
                            h = true;
                            for (let i of fromEnum(this.cv.series)) {
                                if (!i.d7) {
                                    if (!i.isVertical) {
                                        h = false;
                                    }
                                }
                            }
                        }
                        if (h) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    this.xu = new LabelCollisionManager(this.ty.right, this.ty.bottom, this.ty, this.xb.j(), this.yq, this.xw(), g, this.yx(), this.yw(), this.x6, this.w2);
                    if (this.zf != null) {
                        this.xu.ap = this.zf;
                        this.xu.an = this;
                    }
                    let j = this.xu;
                    j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.aaa));
                }
            }
            if (this.x3) {
                this.x3 = false;
                if (this.xu.al > 2) {
                    this.x1 = true;
                }
            }
            if (this.x4) {
                this.x4 = false;
                if (this.yk > 5) {
                    this.x1 = true;
                }
            }
            if (this.x2) {
                this.x2 = false;
                this.xu.a3(this.ty.right, this.ty.bottom, this.ty);
                this.x1 = true;
            }
            let k = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let l = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let m = new List$1(CalloutAnnotationWrapper.$, 0);
            let n = new List$1(CalloutAnnotationWrapper.$, 0);
            let o = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (let p = 0; p < b.count; p++) {
                o.add_1(b._inner[p]);
            }
            for (let q = 0; q < c.count; q++) {
                o.add_1(c._inner[q]);
            }
            let r = this.yf.c;
            while (r != null) {
                let s = r.a;
                if (!o.contains(r.c)) {
                    n.add(r.c);
                    l.add_1(r.c);
                    let t = r.c.b;
                    t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.aab));
                    this.yf.h(r);
                    this.yc.removeItem(r.c);
                    this.xu.a2(r.c.c);
                }
                r = s;
            }
            for (let u = 0; u < b.count; u++) {
                if (!this.yc.containsKey(b._inner[u])) {
                    this.yf.f(b._inner[u]);
                    let v = b._inner[u].b;
                    v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.aab));
                    this.yc.addItem(b._inner[u], this.yf.d);
                    m.add(b._inner[u]);
                    k.add_1(b._inner[u]);
                    this.x1 = true;
                }
            }
            for (let w = 0; w < c.count; w++) {
                if (!this.yc.containsKey(c._inner[w])) {
                    this.yf.f(c._inner[w]);
                    this.yc.addItem(c._inner[w], this.yf.d);
                    let x = c._inner[w].b;
                    x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.aab));
                    m.add(c._inner[w]);
                    k.add_1(c._inner[w]);
                    this.x1 = true;
                }
            }
            if (this.xz == true) {
                this.xz = false;
                this.x1 = true;
            }
            if (this.yh.count > 0) {
                this.x1 = true;
                this.yh.clear();
                this.ye.clear();
            }
            r = this.yf.c;
            while (r != null) {
                let y = this.xx(r.c);
                if (y == null) {
                    return;
                }
                if (!Base.equalsStatic(y, r.c.c.c)) {
                    let z = false;
                    if (r.c.c.c == null) {
                        z = true;
                    }
                    let aa = r.c.c;
                    aa.o = y.b;
                    aa.p = y.c;
                    if (!isNaN_(aa.o) && !isNaN_(aa.p)) {
                        aa.n = y.e;
                        aa.m = y.d;
                        if (aa.b == null) {
                            this.xu.t(aa, false);
                        }
                        if (z) {
                            this.xu.aq(aa);
                        }
                        else {
                            this.xu.az(aa);
                        }
                    }
                }
                r = r.a;
            }
            let ab = this.xu.am();
            let ac = this.xu.u();
            if (ac) {
                if (this.xu.q()) {
                    this.x1 = true;
                }
            }
            if (this.x1 && (ab != 0 || ac)) {
                this.x1 = false;
                this.yt = 0x7FFFFFFF;
                if (this.zf != null) {
                    let ad = true;
                    for (let ae = 0; ae < this.cv.series.count; ae++) {
                        let af = this.cv.series._inner[ae];
                        if (af.d7 && typeCast(CalloutLayer.$, af) !== null) {
                            let ag = af;
                            if (ag.zf == this.zf) {
                                if (!ag.abp.equals1(this.xu.a5)) {
                                    ad = false;
                                    break;
                                }
                            }
                        }
                    }
                    if (ad) {
                        this.xu.a4();
                    }
                    else {
                        this.xu.ar();
                        this.xu.as();
                    }
                }
                else {
                    this.xu.a4();
                }
            }
            else {
                this.xu.as();
            }
            let ah = this.yf.c;
            let ai;
            let aj;
            let ak;
            let al;
            let am;
            let an;
            let ao;
            let ap;
            let aq;
            let ar;
            let as;
            let at;
            let au;
            let av;
            let aw;
            let ax;
            let ay = this.x7;
            while (ah != null) {
                let az = ah.c;
                let a0 = az.b;
                ai = a0.bk;
                aj = a0.bm;
                ak = a0.bl;
                al = a0.backgroundPadding.left;
                am = a0.backgroundPadding.top;
                an = a0.backgroundPadding.right;
                ao = a0.backgroundPadding.bottom;
                aq = a0.backgroundCornerRadius;
                ap = a0.y;
                ar = a0.bn;
                as = a0.ao;
                at = a0.aa;
                let a1 = az.c;
                au = a1.o - (a1.g - a1.l);
                av = a1.p - (a1.h - a1.k);
                aw = a1.g - a1.l;
                ax = a1.h - a1.k;
                if (ay) {
                    let a2 = new CalloutRenderStyleUpdatingEventArgs();
                    a2.background = ai;
                    a2.outline = aj;
                    a2.leaderBrush = ak;
                    a2.strokeThickness = ap;
                    a2.textColor = ar;
                    a2.item = at;
                    a2.series = a0.l;
                    a2.actualPosition = a1.a;
                    a2.xValue = a0.ac;
                    a2.yValue = a0.ad;
                    if (this.calloutRenderStyleUpdating != null) {
                        this.calloutRenderStyleUpdating(this, a2);
                        ai = a2.background;
                        aj = a2.outline;
                        ak = a2.leaderBrush;
                        ap = a2.strokeThickness;
                        ar = a2.textColor;
                    }
                }
                a.n.add1(az);
                a.f.add(ai);
                a.i.add(aj);
                a.h.add(ak);
                a.k.add(al);
                a.m.add(am);
                a.l.add(an);
                a.j.add(ao);
                a.g.add(aq);
                a.o.add(ap);
                a.p.add(ar);
                a.q.add1(as);
                a.r.add1(at);
                a.u.add(au);
                a.v.add(av);
                a.s.add(aw);
                a.t.add(ax);
                ah = ah.a;
            }
        }
        aad() {
            if (this.xu != null) {
                let a = this.yf.c;
                while (a != null) {
                    let b = a.c.c;
                    if (b != null) {
                        this.xu.a2(b);
                    }
                    a = a.a;
                }
                let c = this.xu;
                c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.aaa));
                this.xu = null;
            }
            this.aac();
        }
        xv() {
            if (this.cv == null) {
                return null;
            }
            for (let a = 0; a < this.cv.series.count; a++) {
                let b = this.cv.series._inner[a];
                if (b.d7 && typeCast(CalloutLayer.$, b) !== null) {
                    let c = b;
                    if (c != this) {
                        if (c.zf != null && c.zf == this.zf) {
                            if (c.xu != null) {
                                return c.xu;
                            }
                        }
                    }
                }
            }
            return null;
        }
        yw() {
            return 20000;
        }
        yx() {
            return 300;
        }
        xw() {
            switch (this.w8) {
                case 0: return 2;
                case 2: return 1;
                case 3: return 2;
                case 1: return 0;
            }
            return 2;
        }
        aaa(a) {
            let b = this.xu.am();
            if (b < this.yt) {
                this.yt = b;
                this.pr(false);
            }
        }
        xx(a) {
            let b = this.xh;
            if (a.b.l != null) {
                b = a.b.l;
            }
            if (b == null) {
                for (let c = 0; c < this.cv.series.count; c++) {
                    let d = this.cv.series._inner[c];
                    if (!d.d7) {
                        b = d;
                        break;
                    }
                }
            }
            if (b == null) {
                return null;
            }
            let e = b.ag();
            let f = b.h3();
            let g = null;
            let h = null;
            let i = false;
            for (let j = 0; j < e.length; j++) {
                if (e[j].b9) {
                    i = true;
                    g = e[j];
                }
                else if (e[j].cm) {
                    i = true;
                    h = e[j];
                }
                else if (e[j].cp) {
                    h = e[j];
                }
                else {
                    g = e[j];
                }
            }
            if (g == null || h == null) {
                return null;
            }
            if (!g.co() || !h.co()) {
                return null;
            }
            let k = 0;
            let l = 0;
            if (g.cb && g.categoryMode != 0) {
                if (b.el) {
                    k = b.getOffsetValue();
                }
                else if (b.ed) {
                    k = b.getOffsetValue();
                }
            }
            if (h.cb && h.categoryMode != 0) {
                if (b.ed) {
                    l = b.getOffsetValue();
                }
            }
            let m = new ScalerParams(0, this.cv.tr, g.kd, g.ch, g.j8());
            m.b = f;
            let n = new ScalerParams(0, this.cv.tr, h.kd, h.ch, h.j8());
            n.b = f;
            let o = 0;
            let p = 0;
            if (i) {
                o = g.ej(this.ys(a.b.ac), m) + k;
                p = h.ej(this.ys(a.b.ad), n) + l;
                let q = o;
                let r = p;
                let s = { $type: Point_$type, x: 0.5, y: 0.5 };
                let t = s.x + (r * Math.cos(q));
                o = ViewportUtils.c(t, m.e, m.d);
                let u = s.y + (r * Math.sin(q));
                p = ViewportUtils.f(u, n.e, n.d);
            }
            else {
                o = g.ej(this.ys(a.b.ac), m) + k;
                p = h.ej(this.ys(a.b.ad), n) + l;
            }
            let v = new QuadTreeBoundingBox();
            v.b = o;
            v.c = p;
            v.e = 3;
            v.d = 3;
            v.g = a.b;
            return v;
        }
        ys(a) {
            if (typeCast(Date_$type, a) !== null) {
                return a.getTime();
            }
            if (a == null) {
                return 0;
            }
            return a;
        }
        yj() {
            let a = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let b = 0; b < this.yi.count; b++) {
                if (stringIsNullOrEmpty(this.yi._inner[b].b.ao)) {
                    continue;
                }
                if (this.yi._inner[b].c == null) {
                    let c = new LabelCollisionInfo();
                    this.yi._inner[b].c = c;
                    let d = this.xb.cq(this.yy(this.yi._inner[b]), this.yi._inner[b].b.backgroundPadding);
                    c.k = d.height / 2;
                    c.l = d.width / 2;
                }
                let e = this.xx(this.yi._inner[b]);
                if (e == null || e.b < this.ty.left || e.b > this.ty.right || e.c < this.ty.top || e.c > this.ty.bottom) {
                    continue;
                }
                a.add(this.yi._inner[b]);
            }
            return a;
        }
        yy(a) {
            return a.b.ao;
        }
        un(a) {
            if (!super.un(a)) {
                return false;
            }
            if (this.zu != null) {
                if (a.eq) {
                    let b = a.lv();
                    if (!Base.equalsStatic(this.zu, b)) {
                        return false;
                    }
                }
                else {
                    if (!Base.equalsStatic(this.zu, a.name)) {
                        return false;
                    }
                }
            }
            return true;
        }
        oq() {
            super.oq();
            if (!this.at.c && !this.dk()) {
                return;
            }
            if (this.xy) {
                this.xy = false;
                this.aaf();
            }
            if (this.dk()) {
                this.aal(this.ui, false);
            }
            else {
                this.aal(this.ug, false);
            }
        }
        aag() {
            if (!this.x0) {
                this.x0 = true;
                this.pr(true);
            }
        }
        aaj(a, b, c) {
            let d = false;
            if (this.x0) {
                this.x0 = false;
                d = true;
            }
            if (!a.ft && a.dt(this.yg, this.yb, this.x9, this.yu)) {
                let e = this.yg;
                for (let f = 0; f < this.yg.count; f++) {
                    let g = e._inner[f];
                    let h = g.a != null ? g.a.item : null;
                    let i = g.a.item != null ? g.a.item : g.a;
                    let j = a;
                    let k = new CalloutKey(i, j);
                    let l = new CalloutAnnotationWrapper();
                    let m = new CalloutAnnotation();
                    l.b = m;
                    m.key = k;
                    let n = false;
                    if (this.yc.containsKey(l)) {
                        l = this.yc.item(l).c;
                        m = l.b;
                        n = d;
                    }
                    else {
                        n = true;
                    }
                    let o = m.ac;
                    let p = m.ad;
                    if (this.ys(o) != this.ys(g.b)) {
                        m.xValue = g.b;
                    }
                    if (this.ys(p) != this.ys(g.c)) {
                        m.yValue = g.c;
                    }
                    m.series = a;
                    let q = false;
                    if (g.d != m.ay) {
                        m.ay = g.d;
                        q = true;
                    }
                    if (n || q) {
                        if (this.calloutLabelUpdating != null) {
                            let r = ((() => {
                                let $ret = new CalloutLabelUpdatingEventArgs();
                                $ret.d = m.ac;
                                $ret.e = m.ad;
                                $ret.item = h;
                                $ret.a = a;
                                $ret.f = a.name;
                                return $ret;
                            })());
                            this.calloutLabelUpdating(this, r);
                            if (r.c != null && !Base.equalsStatic(r.c, l.b.ao)) {
                                let s = r.c;
                                l.b.text = s != null ? s.toString() : "";
                            }
                        }
                        else {
                            if (g.d != null) {
                                m.text = g.d;
                            }
                        }
                    }
                    if (m.ao == null) {
                        continue;
                    }
                    if (n || q) {
                        if (this.calloutContentUpdating != null) {
                            let t = ((() => {
                                let $ret = new CalloutContentUpdatingEventArgs();
                                $ret.c = m.ac;
                                $ret.d = m.ad;
                                $ret.item = h;
                                $ret.a = i;
                                return $ret;
                            })());
                            this.calloutContentUpdating(this, t);
                            if (t.a != null && t.a != l.b.aa) {
                                l.b.content = t.a;
                            }
                        }
                        else {
                            if (i != null && i != l.b.aa) {
                                l.b.content = i;
                            }
                        }
                    }
                    if (n) {
                        this.aan(l);
                    }
                    if (l.c == null) {
                        let u = new LabelCollisionInfo();
                        l.c = u;
                        let v = this.xb.cq(this.yy(l), l.b.backgroundPadding);
                        u.k = v.height / 2;
                        u.l = v.width / 2;
                    }
                    let w = this.xx(l);
                    if (w == null || w.b < this.ty.left || w.b > this.ty.right || w.c < this.ty.top || w.c > this.ty.bottom) {
                        continue;
                    }
                    l.e = w.b;
                    l.f = w.c;
                    c.add(l);
                }
            }
        }
        bu() {
            return 1;
        }
        au(a, b) {
            let c = this.xu.f(a, b);
            if (c == null) {
                return null;
            }
            return c.u;
        }
        f5(a, b) {
            if (this.xu == null) {
                return false;
            }
            return this.xu.f(a, b) != null;
        }
        aal(a, b) {
            let c = 0;
            let d = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (c = 0; c < a.q.count; c++) {
                let e = a.n._inner[c];
                if (isNaN_(a.u._inner[c]) || isNaN_(a.v._inner[c])) {
                    continue;
                }
                let f = this.xb.cb.item(e);
                d.add_1(e);
                if (f.h != a.q._inner[c]) {
                    f.h = a.q._inner[c];
                    let g = f.u();
                }
                f.e = a.o._inner[c];
                f.m = a.f._inner[c];
                f.p = a.p._inner[c];
                f.o = f.e > 0 ? a.i._inner[c] : this.cg.bt();
                f.n = a.h._inner[c];
                f.x = new Thickness(1, a.k._inner[c], a.m._inner[c], a.l._inner[c], a.j._inner[c]);
                f.d = a.g._inner[c];
                this.xb.cj(f, Math.min(a.s._inner[c], a.s._inner[c] + a.u._inner[c]), Math.min(a.t._inner[c], a.t._inner[c] + a.v._inner[c]));
                this.xb.ck(f, e, a.r._inner[c]);
                f.r = { $type: Point_$type, x: a.u._inner[c], y: a.v._inner[c] };
            }
            let h = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let i of fromEnum(this.xb.cb.c)) {
                if (!d.contains(i)) {
                    h.add(i);
                }
            }
            for (let j = 0; j < h.count; j++) {
                this.xb.cb.h(h._inner[j]);
            }
        }
        vz(a, b) {
            super.vz(a, b);
            if (this.dk()) {
                this.aal(this.ui, true);
            }
            else {
                this.aal(this.ug, false);
            }
        }
        fn() {
            return true;
        }
        pa(a, b, c, d) {
            super.pa(a, b, c, d);
            switch (b) {
                case CalloutLayer.$$p[24]:
                    this.xi = null;
                    this.xb.ci();
                    this.pr(true);
                    break;
                case CalloutLayer.$$p[22]:
                case CalloutLayer.$$p[23]:
                    this.pr(true);
                    break;
                case CalloutLayer.$$p[14]:
                    this.pr(true);
                    break;
                case "SeriesViewer":
                    if (c != null) {
                        let e = c;
                        e.seriesAnimating = delegateRemove(e.seriesAnimating, runOn(this, this.aak));
                    }
                    if (d != null) {
                        let f = d;
                        f.seriesAnimating = delegateCombine(f.seriesAnimating, runOn(this, this.aak));
                    }
                    if (d == null) {
                        this.aad();
                    }
                    break;
                case "AutoCalloutVisibilityMode":
                    this.w5 = this.w7();
                    this.aae();
                    break;
                case "AllowedPositions":
                    if (c != null) {
                        let g = c;
                        g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.z8));
                    }
                    if (d != null) {
                        let h = d;
                        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.z8));
                    }
                    this.w2 = this.w3(this.xd);
                    this.aae();
                    break;
                case CalloutLayer.$$p[16]:
                case CalloutLayer.$$p[17]:
                case CalloutLayer.$$p[1]:
                case CalloutLayer.$$p[6]:
                case CalloutLayer.$$p[5]:
                case CalloutLayer.$$p[25]:
                case CalloutLayer.$$p[26]:
                case CalloutLayer.$$p[19]:
                case CalloutLayer.$$p[18]:
                case CalloutLayer.$$p[8]:
                case CalloutLayer.$$p[10]:
                case CalloutLayer.$$p[9]:
                case CalloutLayer.$$p[7]:
                case CalloutLayer.$$p[12]:
                case CalloutLayer.$$p[13]:
                    this.aae();
                    break;
                case CalloutLayer.$$p[21]:
                    if (this.c7 != null) {
                        this.c7.deregisterColumn(this.xr);
                        this.xr = this.c6(this.zs);
                    }
                    break;
                case "LabelColumn":
                    this.aae();
                    break;
                case CalloutLayer.$$p[15]:
                    if (this.c7 != null) {
                        this.c7.deregisterColumn(this.xp);
                        this.xp = this.c6(this.zi);
                    }
                    break;
                case "ContentColumn":
                    this.aae();
                    break;
                case CalloutLayer.$$p[28]:
                    if (this.c7 != null) {
                        this.c7.deregisterColumn(this.xs);
                        this.xs = stringIsNullOrEmpty(this.z3) == false ? this.c6(this.z3) : null;
                    }
                    break;
                case "XColumn":
                    this.aae();
                    break;
                case CalloutLayer.$$p[29]:
                    if (this.c7 != null) {
                        this.c7.deregisterColumn(this.xt);
                        this.xt = this.c6(this.z6);
                    }
                    break;
                case "YColumn":
                    this.aae();
                    break;
                case CalloutLayer.$$p[20]:
                    if (this.c7 != null) {
                        this.c7.deregisterColumn(this.xq);
                        this.xq = this.c6(this.zp);
                    }
                    break;
                case "KeyColumn":
                    this.aae();
                    break;
                case "FastItemsSource":
                    this.xz = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.xr);
                        c.deregisterColumn(this.xp);
                        c.deregisterColumn(this.xs);
                        c.deregisterColumn(this.xt);
                        c.deregisterColumn(this.xq);
                        this.xr = null;
                        this.xp = null;
                        this.xs = null;
                        this.xt = null;
                        this.xq = null;
                        this.yi.clear();
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.xr = this.c6(this.zs);
                        this.xp = this.c6(this.zi);
                        if (stringIsNullOrEmpty(this.z3) == false) {
                            this.xs = this.c6(this.z3);
                        }
                        this.xt = this.c6(this.z6);
                        this.xq = this.c6(this.zp);
                    }
                    this.aae();
                    break;
            }
        }
        w7() {
            if (this.w6 == 0) {
                return 1;
            }
            return this.w6;
        }
        w3(a) {
            if (a == null || a.count == 0) {
                return null;
            }
            let b = new Array(a.count);
            for (let c = 0; c < a.count; c++) {
                b[c] = a._inner[c];
            }
            return b;
        }
        aak(a) {
            if (a.d7) {
                return;
            }
            if ((a == this.xh || this.xh == null) && this.x5) {
                this.pr(false);
            }
        }
        aae() {
            if (this.xy == false) {
                this.xy = true;
                this.pr(false);
            }
        }
        aac() {
            this.xb.cb.clear();
            this.yf.g();
            this.yc.clear();
        }
        aaf() {
            if (this.xt == null || this.xr == null) {
                let a = this.yf.c;
                while (a != null) {
                    this.aan(a.c);
                    a = a.a;
                }
                return;
            }
            let b = this.yd();
            for (let c = 0; c < this.xt.count; c++) {
                let d;
                if (this.yi.count <= c) {
                    let e = new CalloutAnnotation();
                    d = new CalloutAnnotationWrapper();
                    d.b = e;
                    d.b.series = this.xh;
                    this.yi.add(d);
                }
                else {
                    d = this.yi._inner[c];
                }
                this.aam(c, b);
            }
        }
    }
    CalloutLayer.$t = /*@__PURE__*/ markType(CalloutLayer, 'CalloutLayer', AnnotationLayer.$);
    CalloutLayer.aa2 = /*@__PURE__*/ DependencyProperty.i("AutoCalloutVisibilityMode", AutoCalloutVisibilityMode_$type, CalloutLayer.$, /*@__PURE__*/ new PropertyMetadata(2, /*@__PURE__*/ enumGetBox(AutoCalloutVisibilityMode_$type, 0), (a, b) => a.raisePropertyChanged("AutoCalloutVisibilityMode", b.oldValue, b.newValue)));
    CalloutLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CalloutLayer, 'raisePropertyChanged', ['AutoCalloutLabelPrecision:yu:aao', [1, 5], 'CalloutBackground:abj:aap', [Brush.$, null], 'CalloutCollisionMode:w8:aaq', [CalloutCollisionMode_$type, /*@__PURE__*/ enumGetBox(CalloutCollisionMode_$type, 3)], 'CalloutCornerRadius:yl:aar', [1, NaN], 'CalloutInterpolatedValuePrecision:yv:aas', [1, -1], 'CalloutLeaderBrush:abk:aat', [Brush.$, null], 'CalloutOutline:abl:aau', [Brush.$, null], 'CalloutPaddingBottom:ym:aav', [1, NaN], 'CalloutPaddingLeft:yn:aaw', [1, NaN], 'CalloutPaddingRight:yo:aax', [1, NaN], 'CalloutPaddingTop:yp:aay', [1, NaN], 'CalloutPositionPadding:yq:aaz', [1, 10], 'CalloutStrokeThickness:yr:aa0', [1, NaN], 'CalloutTextColor:abm:aa1', [Brush.$, null], 'CollisionChannel:zf:aa3', [2, null], 'ContentMemberPath:zi:aa4', [2, null], 'IsAutoCalloutBehaviorEnabled:x5:aa5', [0, false], 'IsCalloutOffsettingEnabled:x6:aa6', [0, true], 'IsCustomCalloutRenderStyleEnabled:x7:aa7', [0, false], 'IsCustomCalloutStyleEnabled:x8:aa8', [0, false], 'KeyMemberPath:zp:aa9', [2, null], 'LabelMemberPath:zs:aba', [2, null], 'TargetSeriesName:zu:abb', [2, null], 'TargetSeries:xh:abc', [Series.$, null], 'TextStyle:zx:abd', [2, null], 'UseInterpolatedValueForAutoCalloutLabels:x9:abe', [0, false], 'UseSeriesColorForOutline:ya:abf', [0, false], 'UseValueForAutoCalloutLabels:yb:abg', [0, true], 'XMemberPath:z3:abh', [2, null], 'YMemberPath:z6:abi', [2, null]]);
    return CalloutLayer;
})();
/**
 * @hidden
 */
export let CalloutLayerView = /*@__PURE__*/ (() => {
    class CalloutLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b7 = null;
            this.cc = null;
            this.cb = null;
            this.cd = NaN;
            this.b8 = null;
            this.b7 = a;
            this.cc = new List$1(CalloutView.$, 0);
        }
        au() {
            super.au();
            this.cb = ((() => {
                let $ret = new HashPool$2(CalloutAnnotationWrapper.$, CalloutView.$);
                $ret.create = runOn(this, this.b9);
                $ret.activate = runOn(this, this.cf);
                $ret.disactivate = runOn(this, this.ch);
                $ret.destroy = runOn(this, this.cg);
                return $ret;
            })());
        }
        b9() {
            let a = new CalloutView(this);
            this.cc.add(a);
            return a;
        }
        cf(a) {
            a.y = 0;
        }
        ch(a) {
            a.y = 1;
        }
        cg(a) {
            this.cc.remove(a);
        }
        cp(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.m(a, 0.1);
        }
        a8(a, b) {
            super.a8(a, b);
            a.ad(this.ca());
            if (a.d && !b) {
                for (let c = 0; c < this.cc.count; c++) {
                    let d = this.cc._inner[c];
                    if (d.y == 0) {
                        d.j(a);
                    }
                }
            }
        }
        ca() {
            if (this.b7.xj != null) {
                return this.b7.xj;
            }
            return this.e.cv.getFontInfo();
        }
        an(a) {
            super.an(a);
            for (let b = 0; b < this.cc.count; b++) {
                let c = this.cc._inner[b];
                if (c.y != 0) {
                    continue;
                }
                c.i(this.b7, this.ca(), a);
            }
        }
        cr(a) {
            this.k.ad(this.ca());
            this.cd = this.ce();
            let b = this.k.ah(a, this.cd, true);
            return new Size(1, b.c, b.b);
        }
        ce() {
            let a = this.ca();
            if (isNaN_(this.cd)) {
                let b = FontUtil.getCurrentFontHeight(this.e.cv.cu.j.ae, a);
                this.cd = b;
            }
            return this.cd;
        }
        cq(a, b) {
            if (this.b8 == null) {
                this.b8 = new CalloutView(this);
            }
            this.b8.h = a;
            this.b8.x = b;
            let c = this.b8.u();
            this.b8.h = null;
            return c;
        }
        cj(a, b, c) {
            a.f = b;
            a.g = c;
        }
        ck(a, b, c) {
            a.k(this.e, b, c);
        }
        cl(a) {
            if (a != null) {
                return this.cp(a.sz);
            }
            return this.e.sz;
        }
        co() {
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        cn(a) {
            if (this.b7.ya) {
                if (a != null) {
                    return this.cp(a.sz);
                }
            }
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        cm(a) {
            if (a != null) {
                return this.cp(a.su);
            }
            return this.e.su;
        }
        ci() {
            this.cd = NaN;
        }
    }
    CalloutLayerView.$t = /*@__PURE__*/ markType(CalloutLayerView, 'CalloutLayerView', AnnotationLayerView.$);
    return CalloutLayerView;
})();
/**
 * @hidden
 */
export let CalloutView = /*@__PURE__*/ (() => {
    class CalloutView extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.y = 0;
            this.l = null;
            this.t = null;
            this.q = { $type: Point_$type, x: 0, y: 0 };
            this.s = null;
            this.w = new Thickness(0, 0);
            this.v = null;
            this.c = 0;
            this.f = 0;
            this.g = 0;
            this.b = null;
            this.s = new Line();
            this.s.ab = false;
            this.s._stroke = ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 0, 0, 0);
                return $ret;
            })());
            this.s.ad = 2;
            this.l = new TextBlock();
            this.t = new Rectangle();
            this.t.ad = 0;
            this.a = a;
            this.y = 0;
        }
        j(a) {
            a.aa();
            a.ag(this.f, this.g);
            let b = new TranslateTransform();
            b.j = this.v.left;
            b.k = this.v.top;
            this.t.j = b;
            a.s(this.s);
            a.aa();
            this.t.width = this.l.m + this.w.left + this.w.right;
            this.t.height = this.l.l + this.w.top + this.w.bottom;
            this.t.ap = this.c;
            this.t.aq = this.c;
            a.k(this.t.j);
            a.w(this.t);
            this.l.ag = true;
            this.l.o = this.w.top;
            this.l.n = this.w.left;
            a.x(this.l);
            a.z();
            a.z();
        }
        get r() {
            return this.q;
        }
        set r(a) {
            if (this.q.x != a.x || this.q.y != a.y) {
                let b = this.u();
                let c = b.height;
                let d = b.width;
                this.q = a;
                let e = CalloutViewHelper.b(this.r, d, c, this.s);
                this.v = e;
            }
        }
        get p() {
            return this.l.ao;
        }
        set p(a) {
            this.l.ao = a;
        }
        get o() {
            return this.t._stroke;
        }
        set o(a) {
            this.t._stroke = a;
        }
        get n() {
            return this.s._stroke;
        }
        set n(a) {
            this.s._stroke = a;
        }
        get m() {
            return this.t._fill;
        }
        set m(a) {
            this.t._fill = a;
        }
        get e() {
            return this.t.ad;
        }
        set e(a) {
            this.t.ad = a;
        }
        get x() {
            return this.w;
        }
        set x(a) {
            this.w = a;
        }
        get d() {
            return this.c;
        }
        set d(a) {
            this.c = a;
        }
        get h() {
            return this.l.al;
        }
        set h(a) {
            if (a == null) {
                this.l.al = "";
            }
            else {
                this.l.al = a.toString();
            }
            let b = this.u();
            let c = b.height;
            let d = b.width;
            let e = CalloutViewHelper.b(this.r, d, c, this.s);
            this.v = e;
        }
        u() {
            let a = this.a.cr(this.l);
            this.l.m = a.width;
            this.l.l = a.height;
            return new Size(1, a.width + this.w.left + this.w.right, a.height + this.w.top + this.w.bottom);
        }
        k(a, b, c) {
            if (this.b == null) {
                this.b = new DataContext();
            }
            this.b.series = a;
            this.b.item = c;
            if (b.c != null) {
                b.c.u = this.b;
            }
        }
        i(a, b, c) {
            a.a5.exportCalloutData(this.f, this.g, this.v.left, this.v.top, c, this.t, this.l, b, this.s, "callout", ["Main", "Callout"]);
        }
    }
    CalloutView.$t = /*@__PURE__*/ markType(CalloutView, 'CalloutView');
    return CalloutView;
})();
