/*
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 { ScatterBase } from "./ScatterBase";
import { IScaleLegendSeries_$type } from "igniteui-react-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { List$1 } from "igniteui-react-core";
import { UIElement } from "igniteui-react-core";
import { Base, typeCast, Point_$type, fromEnum, markType, markDep, enumGetBox, runOn } from "igniteui-react-core";
import { ActualRange } from "./ActualRange";
import { DependencyProperty } from "igniteui-react-core";
import { SizeScale } from "./SizeScale";
import { BrushScale } from "./BrushScale";
import { ScatterFrame } from "./ScatterFrame";
import { IChartLegend_$type } from "igniteui-react-core";
import { ValueBrushScale } from "./ValueBrushScale";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { ScatterBaseView } from "./ScatterBaseView";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { BubbleMarkerManager } from "./BubbleMarkerManager";
import { IChartItemLegend_$type } from "igniteui-react-core";
import { IChartScaleLegend_$type } from "igniteui-react-core";
import { ContentControl } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity, logBase } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { BrushSelectionMode_$type } from "./BrushSelectionMode";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
var BubbleSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(BubbleSeries, _super);
    function BubbleSeries() {
        var _this = _super.call(this) || this;
        _this.aa9 = null;
        _this.aa8 = null;
        _this.zw = null;
        _this.zo = null;
        _this.zn = null;
        _this.zm = null;
        _this.zk = null;
        _this.ab = BubbleSeries.$;
        _this.vx = new ScatterFrame();
        _this.vz = new ScatterFrame();
        _this.vv = new ScatterFrame();
        return _this;
    }
    BubbleSeries.prototype.bc = function () {
        return new BubbleSeries();
    };
    BubbleSeries.prototype.get_dy = function () {
        return true;
    };
    BubbleSeries.prototype.cd = function () {
        return new BubbleSeriesView(this);
    };
    BubbleSeries.prototype.o2 = function (a) {
        _super.prototype.o2.call(this, a);
        this.zj = a;
    };
    BubbleSeries.prototype.ir = function () {
        return 0.7;
    };
    BubbleSeries.prototype.t6 = function () {
        if (this.t5 == 0) {
            return 2;
        }
        return _super.prototype.t6.call(this);
    };
    BubbleSeries.prototype.isAttachedTo = function (a) {
        return this.ay == a;
    };
    BubbleSeries.prototype.dx = function () {
        return true;
    };
    BubbleSeries.prototype.n5 = function (a) {
        _super.prototype.n5.call(this, a);
        if (this.zr != null && this.zw != null && this.zw.count > 0) {
            for (var b = 0; b < this.zw.count; b++) {
                a(this.zw._inner[b]);
            }
        }
    };
    Object.defineProperty(BubbleSeries.prototype, "zq", {
        get: function () {
            return this.zs;
        },
        enumerable: false,
        configurable: true
    });
    BubbleSeries.prototype.aa7 = function (a) {
        var b = typeCast(CustomPaletteBrushScale.$, this.zi);
        var c = typeCast(ValueBrushScale.$, this.zi);
        var d = this.zi;
        if (b != null && this.c7 != null) {
            return b.getBrush1(a, this.c7.count);
        }
        else if (c != null) {
            return c.getBrushByIndex(a, this.zp);
        }
        else if (d != null) {
            return d.getBrush(a);
        }
        return null;
    };
    Object.defineProperty(BubbleSeries.prototype, "legendReady", {
        get: function () {
            return this.zs != null && this.zs.count != 0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "minScaleText", {
        get: function () {
            var a = this.zh(this.zl).b;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "maxScaleText", {
        get: function () {
            var a = this.zh(this.zl).a;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: false,
        configurable: true
    });
    BubbleSeries.prototype.forScaleColors = function (a) {
        for (var b = 0; b < this.zs.count; b++) {
            if (this.zi == null || !this.zi.isReady) {
                return false;
            }
            var c = NaN;
            if (this.zp != null) {
                c = (this.zp.item(b) - this.zp.minimum) / (this.zp.maximum - this.zp.minimum);
            }
            var d = (this.zs.item(b) - this.zs.minimum) / (this.zs.maximum - this.zs.minimum);
            if (isNaN_(c)) {
                c = 0;
            }
            if (isNaN_(d)) {
                d = c;
            }
            var e = this.vc;
            var f = this.aa7(b);
            var g = f != null ? f : e;
            a(g, d);
        }
        return true;
    };
    BubbleSeries.prototype.jv = function (a, b) {
        var c = this.lw(b);
        if (c == BubbleSeries.$$p[5]) {
            return this.jw(a, b, this.aab);
        }
        if (c == BubbleSeries.$$p[11]) {
            return this.jw(a, b, this.aal);
        }
        if (c == ScatterBase.$$p[12]) {
            return this.jw(a, b, this.xn);
        }
        if (c == ScatterBase.$$p[16]) {
            return this.jw(a, b, this.xv);
        }
        if (c == BubbleSeries.$$p[2]) {
            return this.jw(a, b, this.z6);
        }
        return _super.prototype.jv.call(this, a, b);
    };
    Object.defineProperty(BubbleSeries.prototype, "zs", {
        get: function () {
            return this.zo;
        },
        set: function (a) {
            if (this.zo != a) {
                var b = this.zs;
                this.zo = a;
                this.raisePropertyChanged("RadiusColumn", b, this.zs);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "zr", {
        get: function () {
            return this.zn;
        },
        set: function (a) {
            if (this.zn != a) {
                var b = this.zr;
                this.zn = a;
                this.raisePropertyChanged("LabelColumn", b, this.zr);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "zp", {
        get: function () {
            return this.zm;
        },
        set: function (a) {
            if (this.zm != a) {
                var b = this.zp;
                this.zm = a;
                this.raisePropertyChanged("FillColumn", b, this.zp);
            }
        },
        enumerable: false,
        configurable: true
    });
    BubbleSeries.prototype.xy = function (a, b, c, d, e) {
        if (c <= this.w3) {
            b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
        }
        var f = this.w3;
        var g = this.c7;
        var h;
        var i;
        var j = this.getEffectiveViewport1(a);
        var k = new ScalerParams(0, d, e, this.vr.d, j);
        var l = new ScalerParams(0, d, e, this.vr.e, j);
        var m = false;
        var n = 0;
        if (this.cv != null) {
            if (this.cv.fc()) {
                var o = this.cv.lp(d, k);
                m = o.c;
                n = o.d;
            }
        }
        var _loop_1 = function (p) {
            h = this_1.wc.item(p);
            i = this_1.wd.item(p);
            var q = { $type: Point_$type, x: this_1.vr.a.ej(h, k), y: this_1.vr.b.ej(i, l) };
            if (m) {
                if (q.x < e.left || q.x > e.right) {
                    if (q.x + n >= e.left && q.x + n <= e.right) {
                        q = { $type: Point_$type, x: q.x + n, y: i };
                    }
                }
            }
            if (!isInfinity(q.x) && !isInfinity(q.y)) {
                var r_1 = g.item(p);
                if (c <= f) {
                    if (!b.g.containsKey(r_1)) {
                        var s_1 = { $type: Point_$type, x: h, y: i };
                        b.g.addItem(r_1, ((function () {
                            var $ret = new OwnedPoint();
                            $ret.a = r_1;
                            $ret.b = s_1;
                            $ret.c = q;
                            return $ret;
                        })()));
                    }
                }
            }
        };
        var this_1 = this;
        for (var p = 0; p < c; p++) {
            _loop_1(p);
        }
    };
    BubbleSeries.prototype.x8 = function (a, b) {
        var c = typeCast(BubbleSeriesView.$, b);
        var d = c.cy;
        d.m = this.zs;
        _super.prototype.x8.call(this, a, b);
        var e = Math.min(this.wc != null ? this.wc.count : 0, this.wd != null ? this.wd.count : 0);
        if (e < 1) {
            return;
        }
        c.dk();
        c.dl();
    };
    BubbleSeries.prototype.aaq = function () {
        if (this.cv == null) {
            return;
        }
        if (this.ay == null) {
            return;
        }
        if (this.ay.isItemwise) {
            var a = this.ay;
            this.ay.clearLegendItemsForSeries(this);
            this.aap();
            a.renderItemwiseContent(this);
        }
        if (this.ay.isScale) {
            var b = this.ay;
            b.restoreOriginalState();
            b.initializeLegend(this);
        }
    };
    BubbleSeries.zx = function (a, b, c, d, e) {
        if (e <= a || isNaN_(e) || isInfinity(e)) {
            return c;
        }
        if (e >= b) {
            return d;
        }
        var f = c + ((d - c) / (b - a)) * (e - a);
        return f;
    };
    BubbleSeries.zy = function (a, b, c, d, logBase_, e) {
        var f = logBase(e, logBase_);
        var g = logBase(a, logBase_);
        var h = logBase(b, logBase_);
        return BubbleSeries.zx(g, h, c, d, f);
    };
    BubbleSeries.prototype.gm = function (a, b, c) {
        var d = _super.prototype.gm.call(this, a, b, c);
        if (this.zs == null || this.c7 == null || this.zs.count == 0 || this.c7.count != this.zs.count) {
            d = false;
        }
        return d;
    };
    BubbleSeries.prototype.wm = function (a, b) {
        if (b != 3) {
            return true;
        }
        if (a == null) {
            return true;
        }
        if (this.xn == a || this.xv == a || this.aal == a) {
            return true;
        }
        return false;
    };
    BubbleSeries.prototype.aap = function () {
        var _this = this;
        var a = typeCast(IChartLegend_$type, this.ay);
        if (a == null || this.c7 == null) {
            return;
        }
        this.zw = new List$1(UIElement.$, 0);
        var b = typeCast(CustomPaletteBrushScale.$, this.zi);
        var c = typeCast(ValueBrushScale.$, this.zi);
        var d = this.zi;
        var e = this.zg();
        var f = e.b;
        var g = e.a;
        var h = this.c7;
        var _loop_2 = function (i) {
            var j = null;
            if (c != null && this_2.zp != null) {
                var k = this_2.zp.item(i);
                j = c.getBrushByRange(k, f, g);
            }
            else if (b != null) {
                j = b.getBrush1(i, h.count);
            }
            else if (d != null) {
                j = d.getBrush(i);
            }
            var l = new ContentControl();
            var m = this_2.zr != null && this_2.zr.item(i) != null ? this_2.zr.item(i).toString() : "";
            l.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = h.item(i);
                $ret.itemBrush = j;
                $ret.itemLabel = m;
                return $ret;
            })());
            var n = this_2.qv;
            if (n == null) {
                n = this_2.cg.bn(this_2.cl);
            }
            l.ah = n;
            this_2.zw.add(l);
        };
        var this_2 = this;
        for (var i = 0; i < h.count; i++) {
            _loop_2(i);
        }
    };
    BubbleSeries.prototype.np = function (a, b, c, d) {
        _super.prototype.np.call(this, a, b, c, d);
        if (this.zl != null) {
            this.zl.aa();
        }
        if (this.zi != null) {
            this.zi.x();
        }
        this.aaq();
    };
    BubbleSeries.prototype.of = function () {
        _super.prototype.of.call(this);
        this.aaq();
    };
    BubbleSeries.prototype.ol = function () {
        _super.prototype.ol.call(this);
        this.aaq();
    };
    BubbleSeries.prototype.pa = function (a, b, c, d) {
        var e_1, _a;
        _super.prototype.pa.call(this, a, b, c, d);
        switch (b) {
            case "FastItemsSource":
                if (this.zl != null) {
                    this.zl.aa();
                }
                if (this.zi != null) {
                    this.zi.x();
                }
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.zs);
                    c.deregisterColumn(this.zp);
                    c.deregisterColumn(this.zr);
                    this.zs = null;
                    this.zp = null;
                    this.zr = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.zs = this.c4(this.aal);
                    if (!stringIsNullOrEmpty(this.z6)) {
                        this.zp = this.c4(this.z6);
                    }
                    this.zr = this.c6(this.aab);
                }
                this.pr(false);
                this.aaq();
                break;
            case BubbleSeries.$$p[11]:
                if (this.zl != null) {
                    this.zl.aa();
                }
                if (this.c7 != null) {
                    this.c7.deregisterColumn(this.zs);
                    this.zs = this.c4(this.aal);
                    this.aaq();
                }
                break;
            case "RadiusColumn":
                if (this.zl != null) {
                    this.zl.aa();
                }
                this.vs.c0.g$i();
                this.pr(this.fr && this.dp);
                this.on();
                break;
            case BubbleSeries.$$p[12]:
                if (c != null) {
                    c.l.remove(this);
                    c.aa();
                }
                if (d != null) {
                    d.l.add(this);
                    d.aa();
                }
                this.pr(false);
                this.om();
                break;
            case BubbleSeries.$$p[13]:
                this.pr(false);
                this.om();
                break;
            case "DiscreteLegendItemTemplate":
                this.aaq();
                break;
            case BubbleSeries.$$p[3]:
                if (c != null) {
                    c.o.remove(this);
                    c.x();
                }
                if (d != null) {
                    d.o.add(this);
                    d.x();
                }
                this.pr(false);
                this.aaq();
                this.om();
                break;
            case BubbleSeries.$$p[4]:
            case BubbleSeries.$$p[8]:
            case BubbleSeries.$$p[7]:
            case BubbleSeries.$$p[6]:
                this.pr(false);
                this.aaq();
                this.om();
                break;
            case "FillColumn":
                this.pr(this.fr && this.dp);
                this.om();
                break;
            case BubbleSeries.$$p[2]:
                if (this.zi != null) {
                    this.zi.x();
                }
                if (this.c7 != null) {
                    this.c7.deregisterColumn(this.zp);
                    this.zp = this.c4(this.z6);
                    this.aaq();
                }
                break;
            case BubbleSeries.$$p[5]:
                if (this.c7 != null) {
                    this.c7.deregisterColumn(this.zr);
                    this.zr = this.c6(this.aab);
                    this.aaq();
                }
                break;
            case "ActualLegend":
                var e = typeCast(IChartLegend_$type, c);
                if (e != null && e.isItemwise) {
                    var f = typeCast(IChartItemLegend_$type, e);
                    f.clearLegendItemsForSeries(this);
                }
                if (e != null && e.isScale) {
                    var g = typeCast(IChartScaleLegend_$type, e);
                    var h = true;
                    var i = null;
                    if (this.cv != null) {
                        try {
                            for (var _b = __values(fromEnum(this.cv.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                                var j = _c.value;
                                if (j.legend == g) {
                                    i = j;
                                    h = false;
                                }
                            }
                        }
                        catch (e_1_1) {
                            e_1 = { error: e_1_1 };
                        }
                        finally {
                            try {
                                if (_c && !_c.done && (_a = _b.return))
                                    _a.call(_b);
                            }
                            finally {
                                if (e_1)
                                    throw e_1.error;
                            }
                        }
                    }
                    if (h) {
                        g.restoreOriginalState();
                    }
                    else {
                        g.initializeLegend(typeCast(IScaleLegendSeries_$type, i));
                    }
                }
                this.aaq();
                break;
            case "SeriesViewer":
                this.aaq();
                break;
        }
    };
    BubbleSeries.prototype.updateSizeScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.zs != null) {
            a.b = this.zs.minimum;
            a.a = this.zs.maximum;
        }
        if (this.zl != null) {
            this.zl.ab(a.b, a.a);
        }
    };
    BubbleSeries.prototype.updateFillScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.zp != null) {
            a.b = this.zp.minimum;
            a.a = this.zp.maximum;
        }
        if (this.zi != null) {
            this.zi.z(a.b, a.a);
        }
    };
    BubbleSeries.prototype.zh = function (a) {
        var b = new ActualRange();
        b.b = NaN;
        b.a = NaN;
        if (this.zs != null) {
            b.b = this.zs.minimum;
            b.a = this.zs.maximum;
        }
        if (a != null) {
            a.x();
            if (this.zv) {
                b.b = a.globalMinimum;
                b.a = a.globalMaximum;
            }
        }
        return b;
    };
    BubbleSeries.prototype.zg = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.zp != null) {
            a.b = this.zp.minimum;
            a.a = this.zp.maximum;
        }
        var b = typeCast(ValueBrushScale.$, this.zi);
        if (b != null) {
            b.s();
            if (this.zt && this.zi.o.count > 1) {
                a.b = b.q;
                a.a = b.p;
            }
        }
        return a;
    };
    BubbleSeries.prototype.aas = function (a, b, c, d) {
        var e = c.width;
        if (!this.cg.bx.isEmpty) {
            e = this.cg.bx.width;
        }
        else if (this.cv != null && !this.cv.t6.isEmpty) {
            e = this.cv.t6.width;
        }
        var f = DeviceUtils.c(e);
        this.zk = this.zl || ((function () {
            var $ret = new SizeScale();
            $ret.minimumValue = f / 10;
            $ret.maximumValue = f / 5;
            return $ret;
        })());
        if (this.zk != null) {
            var g = this.zk.minimumValue;
            var h = this.zk.maximumValue;
            var i = this.zk.logarithmBase;
            var j = this.zh(this.zk);
            var k = j.b;
            var l = j.a;
            if (this.zk.isLogarithmic) {
                for (var m = 0; m < b.count; m++) {
                    b._inner[m] = BubbleSeries.zy(k, l, g, h, i, b._inner[m]);
                }
            }
            else {
                for (var n = 0; n < b.count; n++) {
                    b._inner[n] = BubbleSeries.zx(k, l, g, h, b._inner[n]);
                }
            }
        }
        var o = 1;
        o = DeviceUtils.d();
        var p = this.zl == null;
        if (d) {
            var q = c.width / e;
            for (var r = 0; r < b.count; r++) {
                if (p) {
                    b._inner[r] = b._inner[r] / o;
                }
                b._inner[r] = b._inner[r] * q;
            }
        }
        for (var s = 0; s < a.count; s++) {
            var t = a._inner[s];
            if (p && !d) {
                t.width = Math.max(0, b._inner[s] / o);
                t.height = Math.max(0, b._inner[s] / o);
            }
            else {
                t.width = Math.max(0, b._inner[s]);
                t.height = Math.max(0, b._inner[s]);
            }
        }
    };
    BubbleSeries.prototype.aar = function (a) {
        var b = typeCast(BubbleSeriesView.$, this.cf);
        this.zj.b6 = false;
        if (b != null) {
            b.b6 = false;
        }
        var c = typeCast(CustomPaletteBrushScale.$, this.zi);
        var d = typeCast(ValueBrushScale.$, this.zi);
        var e = this.zi;
        var f = this.zg();
        var g = f.b;
        var h = f.a;
        var i = this.zi == null || !this.zi.isReady || (d != null && this.z6 == null);
        if (i) {
            this.zj.dj();
            if (b != null) {
                b.dj();
            }
            return;
        }
        this.zj.b6 = true;
        if (b != null) {
            b.b6 = true;
        }
        var j = a.count;
        var k = this.c7;
        for (var l = 0; l < j; l++) {
            var m = a._inner[l];
            var n = typeCast(DataContext.$, m.content);
            if (n != null) {
                var o = null;
                var p = k.indexOf(n.item);
                if (c != null) {
                    o = c.getBrush1(p, k.count);
                }
                else if (d != null && this.zp != null) {
                    var q = this.zp.item(p);
                    o = d.getBrushByRange(q, g, h);
                }
                else if (e != null) {
                    o = e.getBrush(p);
                }
                else {
                    if (this.ve == null) {
                        o = this.vc;
                    }
                    else {
                        o = this.ve;
                    }
                }
                var r = null;
                if (this.vf == null) {
                    r = this.vd;
                }
                else {
                    r = this.vf;
                }
                if (this.zu && o != null) {
                    r = o;
                }
                if (r != null && !isNaN_(this.z0)) {
                    r = BrushUtil.m(r, this.z0);
                }
                if (o != null && !isNaN_(this.zz)) {
                    o = BrushUtil.m(o, this.zz);
                }
                n.itemBrush = o;
                n.actualItemBrush = o;
                n.outline = r;
            }
        }
    };
    BubbleSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = { $type: Point_$type, x: a, y: b };
        var d = this.js(c);
        var e = d == null ? NaN : this.h2(d, "XMemberPath");
        var f = d == null ? NaN : this.h2(d, "YMemberPath");
        var g = new DataLegendSeriesValueInfo();
        g.a = 13;
        g.l = e;
        g.p = "X";
        g.q = this.xn != null ? this.xn : "X";
        g.r = this.xj != null ? this.xj : "X:";
        g.s = this.xl != null ? this.xl : "";
        var h = new DataLegendSeriesValueInfo();
        h.l = f;
        h.a = 14;
        h.p = "Y";
        h.q = this.xv != null ? this.xv : "Y";
        h.r = this.xr != null ? this.xr : "Y:";
        h.s = this.xt != null ? this.xt : "";
        var i = new DataLegendSeriesContext();
        i.f = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(g);
            $ret.add(h);
            return $ret;
        })());
        i.b = this.aw();
        if (!stringIsNullOrEmpty(this.aal)) {
            var j = d == null ? NaN : this.h2(d, "RadiusMemberPath");
            var k = new DataLegendSeriesValueInfo();
            k.l = j;
            k.a = 11;
            k.p = "Radius";
            k.q = this.aal != null ? this.aal : "Radius";
            k.r = this.aah != null ? this.aah : "R:";
            k.s = this.aaj != null ? this.aaj : "";
            i.f.add(k);
        }
        else if (this.zk != null) {
            var l = new DataLegendSeriesValueInfo();
            l.l = this.zk.maximumValue;
            l.a = 11;
            l.p = "Radius";
            l.q = this.aal != null ? this.aal : "Radius";
            l.r = this.aah != null ? this.aah : "R:";
            l.s = this.aaj != null ? this.aaj : "";
            i.f.add(l);
        }
        if (!stringIsNullOrEmpty(this.z6)) {
            var m = d == null ? NaN : this.h2(d, "FillMemberPath");
            var n = new DataLegendSeriesValueInfo();
            n.l = m;
            n.a = 12;
            n.p = "Fill";
            n.q = this.z6 != null ? this.z6 : "Fill";
            n.r = this.z2 != null ? this.z2 : "F:";
            n.s = this.z4 != null ? this.z4 : "";
            i.f.add(n);
        }
        return i;
    };
    Object.defineProperty(BubbleSeries.prototype, "actualMarkerBrush", {
        get: function () {
            return this.vc;
        },
        enumerable: false,
        configurable: true
    });
    BubbleSeries.$t = markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberAsLegendLabel:z2:aat', [2, null], 'FillMemberAsLegendUnit:z4:aau', [2, null], 'FillMemberPath:z6:aav', [2], 'FillScale:zi:aaw', [BrushScale.$], 'FillScaleUseGlobalValues:zt:aax', [0, false], 'LabelMemberPath:aab:aay', [2], 'MarkerBrushBrightness:zz:aaz', [1, NaN], 'MarkerOutlineBrightness:z0:aa0', [1, NaN], 'MarkerOutlineUsesFillScale:zu:aa1', [0, false], 'RadiusMemberAsLegendLabel:aah:aa2', [2, null], 'RadiusMemberAsLegendUnit:aaj:aa3', [2, null], 'RadiusMemberPath:aal:aa4', [2, null], 'RadiusScale:zl:aa5', [SizeScale.$], 'RadiusScaleUseGlobalValues:zv:aa6', [0, false]]);
    return BubbleSeries;
}(ScatterBase));
export { BubbleSeries };
/**
 * @hidden
 */
var CustomPaletteBrushScale = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CustomPaletteBrushScale, _super);
    function CustomPaletteBrushScale() {
        return _super.call(this) || this;
    }
    CustomPaletteBrushScale.prototype.getBrush1 = function (a, b) {
        if (this.brushes == null || this.brushes.count == 0) {
            return null;
        }
        if (this.brushSelectionMode == 0) {
            return _super.prototype.getBrush.call(this, a % this.brushes.count);
        }
        var c = BubbleSeries.zx(0, b - 1, 0, this.brushes.count - 1, a);
        return this.ab(c);
    };
    CustomPaletteBrushScale.prototype.get_isReady = function () {
        return this.brushes != null && this.brushes.count > 0;
    };
    CustomPaletteBrushScale.$t = markType(CustomPaletteBrushScale, 'CustomPaletteBrushScale', BrushScale.$);
    CustomPaletteBrushScale.$$p = markDep(DependencyProperty, PropertyMetadata, CustomPaletteBrushScale, 'v', ['BrushSelectionMode', [BrushSelectionMode_$type, enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
}(BrushScale));
export { CustomPaletteBrushScale };
/**
 * @hidden
 */
var BubbleSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(BubbleSeriesView, _super);
    function BubbleSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.di = null;
        _this.di = a;
        _this.c0 = new ScatterTrendLineManager();
        return _this;
    }
    BubbleSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.b4.uc = Defaults.e;
        }
    };
    BubbleSeriesView.prototype.cx = function () {
        var _this = this;
        return new BubbleMarkerManager(function (a) { return _this.c1.item(a); }, function (a) { return _this.cz.vr.c.item(a); }, runOn(this, this.dc), runOn(this, this.cu), runOn(this, this.c2));
    };
    BubbleSeriesView.prototype.dk = function () {
        var a = this.cy;
        this.di.aas(a.n, a.o, this.bx, this == this.e.cf);
        this.as();
    };
    BubbleSeriesView.prototype.dl = function () {
        var a = this.cy;
        this.di.aar(a.n);
    };
    BubbleSeriesView.prototype.dj = function () {
        var e_2, _a;
        var a = this.cy;
        try {
            for (var _b = __values(fromEnum(a.n)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = typeCast(DataContext.$, b.content);
                if (c != null) {
                    c.itemBrush = null;
                    c.outline = null;
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    BubbleSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span";
        var b = this.e.a3.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.di.title + "</span><br/><span>" + "(${item." + this.di.xn + "}, ${item." + this.di.xv + "})</span>";
        if (!stringIsNullOrEmpty(this.di.aal)) {
            a += "<span>, Radius: ${item." + this.di.aal + "}</span>";
        }
        a += "</div>";
        return a;
    };
    BubbleSeriesView.$t = markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
}(ScatterBaseView));
export { BubbleSeriesView };
