/*
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 * as tslib_1 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 { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-react-core";
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 { 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";
/**
 * @hidden
 */
var BubbleSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BubbleSeries, _super);
    function BubbleSeries() {
        var _this = _super.call(this) || this;
        _this.qq = null;
        _this.qp = null;
        _this.pp = null;
        _this.ph = null;
        _this.pg = null;
        _this.pf = null;
        _this.ab = BubbleSeries.$;
        _this.nm = new ScatterFrame();
        _this.no = new ScatterFrame();
        _this.nl = new ScatterFrame();
        return _this;
    }
    BubbleSeries.prototype.bf = function () {
        return new BubbleSeriesView(this);
    };
    BubbleSeries.prototype.i2 = function (a) {
        _super.prototype.i2.call(this, a);
        this.pd = a;
    };
    BubbleSeries.prototype.isAttachedTo = function (a) {
        return this.aw == a;
    };
    BubbleSeries.prototype.ci = function () {
        return true;
    };
    BubbleSeries.prototype.ie = function (a) {
        _super.prototype.ie.call(this, a);
        if (this.pk != null && this.pp != null && this.pp.count > 0) {
            for (var b = 0; b < this.pp.count; b++) {
                a(this.pp._inner[b]);
            }
        }
    };
    Object.defineProperty(BubbleSeries.prototype, "pj", {
        get: function () {
            return this.pl;
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.qo = function (a) {
        var b = typeCast(CustomPaletteBrushScale.$, this.pc);
        var c = typeCast(ValueBrushScale.$, this.pc);
        var d = this.pc;
        if (b != null && this.bz != null) {
            return b.getBrush1(a, this.bz.count);
        }
        else if (c != null) {
            return c.getBrushByIndex(a, this.pi);
        }
        else if (d != null) {
            return d.getBrush(a);
        }
        return null;
    };
    Object.defineProperty(BubbleSeries.prototype, "legendReady", {
        get: function () {
            return this.pl != null && this.pl.count != 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "minScaleText", {
        get: function () {
            var a = this.pb(this.pe).b;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "maxScaleText", {
        get: function () {
            var a = this.pb(this.pe).a;
            return (Math.round(a * 1000) / 1000).toString();
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.forScaleColors = function (a) {
        for (var b = 0; b < this.pl.count; b++) {
            if (this.pc == null || !this.pc.isReady) {
                return false;
            }
            var c = NaN;
            if (this.pi != null) {
                c = (this.pi.item(b) - this.pi.minimum) / (this.pi.maximum - this.pi.minimum);
            }
            var d = (this.pl.item(b) - this.pl.minimum) / (this.pl.maximum - this.pl.minimum);
            if (isNaN_(c)) {
                c = 0;
            }
            if (isNaN_(d)) {
                d = c;
            }
            var e = this.m8;
            var f = this.qo(b);
            var g = f != null ? f : e;
            a(g, d);
        }
        return true;
    };
    BubbleSeries.prototype.fs = function (a, b) {
        var c = this.g2(b);
        if (c == BubbleSeries.$$p[3]) {
            return this.ft(a, b, this.p0);
        }
        if (c == BubbleSeries.$$p[7]) {
            return this.ft(a, b, this.p6);
        }
        if (c == ScatterBase.$$p[4]) {
            return this.ft(a, b, this.n4);
        }
        if (c == ScatterBase.$$p[6]) {
            return this.ft(a, b, this.n8);
        }
        if (c == BubbleSeries.$$p[0]) {
            return this.ft(a, b, this.pv);
        }
        return _super.prototype.fs.call(this, a, b);
    };
    Object.defineProperty(BubbleSeries.prototype, "pl", {
        get: function () {
            return this.ph;
        },
        set: function (a) {
            if (this.ph != a) {
                var b = this.pl;
                this.ph = a;
                this.raisePropertyChanged("RadiusColumn", b, this.pl);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "pk", {
        get: function () {
            return this.pg;
        },
        set: function (a) {
            if (this.pg != a) {
                var b = this.pk;
                this.pg = a;
                this.raisePropertyChanged("LabelColumn", b, this.pk);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BubbleSeries.prototype, "pi", {
        get: function () {
            return this.pf;
        },
        set: function (a) {
            if (this.pf != a) {
                var b = this.pi;
                this.pf = a;
                this.raisePropertyChanged("FillColumn", b, this.pi);
            }
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.prototype.ob = function (a, b, c, d, e) {
        if (c <= this.nx) {
            b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
        }
        var f = this.nx;
        var g = this.bz;
        var h;
        var i;
        var j = this.getEffectiveViewport1(a);
        var k = new ScalerParams(0, d, e, this.nh.d, j);
        var l = new ScalerParams(0, d, e, this.nh.e, j);
        var m = false;
        var n = 0;
        if (this.bs != null) {
            if (this.bs.d1()) {
                var o = this.bs.h4(d, k);
                m = o.c;
                n = o.d;
            }
        }
        var _loop_1 = function (p) {
            h = this_1.nq.item(p);
            i = this_1.ns.item(p);
            var q = { $type: Point_$type, x: this_1.nh.a.dy(h, k), y: this_1.nh.b.dy(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.of = function (a, b) {
        var c = typeCast(BubbleSeriesView.$, b);
        var d = c.cr;
        d.m = this.pl;
        _super.prototype.of.call(this, a, b);
        var e = Math.min(this.nq != null ? this.nq.count : 0, this.ns != null ? this.ns.count : 0);
        if (e < 1) {
            return;
        }
        c.dc();
        c.dd();
    };
    BubbleSeries.prototype.qb = function () {
        if (this.bs == null) {
            return;
        }
        if (this.aw == null) {
            return;
        }
        if (this.aw.isItemwise) {
            var a = this.aw;
            this.aw.clearLegendItemsForSeries(this);
            this.qa();
            a.renderItemwiseContent(this);
        }
        if (this.aw.isScale) {
            var b = this.aw;
            b.restoreOriginalState();
            b.initializeLegend(this);
        }
    };
    BubbleSeries.pq = 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.pr = function (a, b, c, d, logBase_, e) {
        var f = logBase(e, logBase_);
        var g = logBase(a, logBase_);
        var h = logBase(b, logBase_);
        return BubbleSeries.pq(g, h, c, d, f);
    };
    BubbleSeries.prototype.dw = function (a, b, c) {
        var d = _super.prototype.dw.call(this, a, b, c);
        if (this.pl == null || this.bz == null || this.pl.count == 0 || this.bz.count != this.pl.count) {
            d = false;
        }
        return d;
    };
    BubbleSeries.prototype.nv = function (a, b) {
        if (b != 3) {
            return true;
        }
        if (a == null) {
            return true;
        }
        if (this.n4 == a || this.n8 == a || this.p6 == a) {
            return true;
        }
        return false;
    };
    BubbleSeries.prototype.qa = function () {
        var _this = this;
        var a = typeCast(IChartLegend_$type, this.aw);
        if (a == null || this.bz == null) {
            return;
        }
        this.pp = new List$1(UIElement.$, 0);
        var b = typeCast(CustomPaletteBrushScale.$, this.pc);
        var c = typeCast(ValueBrushScale.$, this.pc);
        var d = this.pc;
        var e = this.pa();
        var f = e.b;
        var g = e.a;
        var h = this.bz;
        var _loop_2 = function (i) {
            var j = null;
            if (c != null && this_2.pi != null) {
                var k = this_2.pi.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.pk != null && this_2.pk.item(i) != null ? this_2.pk.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.j6;
            if (n == null) {
                n = this_2.bi.bi(this_2.bk);
            }
            l.ah = n;
            this_2.pp.add(l);
        };
        var this_2 = this;
        for (var i = 0; i < h.count; i++) {
            _loop_2(i);
        }
    };
    BubbleSeries.prototype.h6 = function (a, b, c, d) {
        _super.prototype.h6.call(this, a, b, c, d);
        if (this.pe != null) {
            this.pe.aa();
        }
        if (this.pc != null) {
            this.pc.w();
        }
        this.qb();
    };
    BubbleSeries.prototype.im = function () {
        _super.prototype.im.call(this);
        this.qb();
    };
    BubbleSeries.prototype.is = function () {
        _super.prototype.is.call(this);
        this.qb();
    };
    BubbleSeries.prototype.i7 = function (a, b, c, d) {
        var e_1, _a;
        _super.prototype.i7.call(this, a, b, c, d);
        switch (b) {
            case "FastItemsSource":
                if (this.pe != null) {
                    this.pe.aa();
                }
                if (this.pc != null) {
                    this.pc.w();
                }
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.pl);
                    c.deregisterColumn(this.pi);
                    c.deregisterColumn(this.pk);
                    this.pl = null;
                    this.pi = null;
                    this.pk = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.pl = this.bw(this.p6);
                    if (!stringIsNullOrEmpty(this.pv)) {
                        this.pi = this.bw(this.pv);
                    }
                    this.pk = this.by(this.p0);
                }
                this.jl(false);
                this.qb();
                break;
            case BubbleSeries.$$p[7]:
                if (this.pe != null) {
                    this.pe.aa();
                }
                if (this.bz != null) {
                    this.bz.deregisterColumn(this.pl);
                    this.pl = this.bw(this.p6);
                    this.qb();
                }
                break;
            case "RadiusColumn":
                if (this.pe != null) {
                    this.pe.aa();
                }
                this.ni.ct.g$i();
                this.jl(false);
                this.iu();
                break;
            case BubbleSeries.$$p[8]:
                if (c != null) {
                    c.l.remove(this);
                    c.aa();
                }
                if (d != null) {
                    d.l.add(this);
                    d.aa();
                }
                this.jl(false);
                this.it();
                break;
            case BubbleSeries.$$p[9]:
                this.jl(false);
                this.it();
                break;
            case "DiscreteLegendItemTemplate":
                this.qb();
                break;
            case BubbleSeries.$$p[1]:
                if (c != null) {
                    c.o.remove(this);
                    c.w();
                }
                if (d != null) {
                    d.o.add(this);
                    d.w();
                }
                this.jl(false);
                this.qb();
                this.it();
                break;
            case BubbleSeries.$$p[2]:
            case BubbleSeries.$$p[6]:
            case BubbleSeries.$$p[5]:
            case BubbleSeries.$$p[4]:
                this.jl(false);
                this.qb();
                this.it();
                break;
            case "FillColumn":
                this.jl(false);
                this.it();
                break;
            case BubbleSeries.$$p[0]:
                if (this.pc != null) {
                    this.pc.w();
                }
                if (this.bz != null) {
                    this.bz.deregisterColumn(this.pi);
                    this.pi = this.bw(this.pv);
                    this.qb();
                }
                break;
            case BubbleSeries.$$p[3]:
                if (this.bz != null) {
                    this.bz.deregisterColumn(this.pk);
                    this.pk = this.by(this.p0);
                    this.qb();
                }
                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.bs != null) {
                        try {
                            for (var _b = tslib_1.__values(fromEnum(this.bs.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.qb();
                break;
            case "SeriesViewer":
                this.qb();
                break;
        }
    };
    BubbleSeries.prototype.updateSizeScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.pl != null) {
            a.b = this.pl.minimum;
            a.a = this.pl.maximum;
        }
        if (this.pe != null) {
            this.pe.ab(a.b, a.a);
        }
    };
    BubbleSeries.prototype.updateFillScaleGlobals = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.pi != null) {
            a.b = this.pi.minimum;
            a.a = this.pi.maximum;
        }
        if (this.pc != null) {
            this.pc.y(a.b, a.a);
        }
    };
    BubbleSeries.prototype.pb = function (a) {
        var b = new ActualRange();
        b.b = NaN;
        b.a = NaN;
        if (this.pl != null) {
            b.b = this.pl.minimum;
            b.a = this.pl.maximum;
        }
        if (a != null) {
            a.x();
            if (this.po) {
                b.b = a.globalMinimum;
                b.a = a.globalMaximum;
            }
        }
        return b;
    };
    BubbleSeries.prototype.pa = function () {
        var a = new ActualRange();
        a.b = NaN;
        a.a = NaN;
        if (this.pi != null) {
            a.b = this.pi.minimum;
            a.a = this.pi.maximum;
        }
        var b = typeCast(ValueBrushScale.$, this.pc);
        if (b != null) {
            b.s();
            if (this.pm && this.pc.o.count > 1) {
                a.b = b.q;
                a.a = b.p;
            }
        }
        return a;
    };
    BubbleSeries.prototype.qd = function (a, b, c, d) {
        var e = c.width;
        if (!this.bi.br.isEmpty) {
            e = this.bi.br.width;
        }
        else if (this.bs != null && !this.bs.oh.isEmpty) {
            e = this.bs.oh.width;
        }
        var f = DeviceUtils.c(e);
        var g = this.pe || ((function () {
            var $ret = new SizeScale();
            $ret.minimumValue = f / 10;
            $ret.maximumValue = f / 5;
            return $ret;
        })());
        if (g != null) {
            var h = g.minimumValue;
            var i = g.maximumValue;
            var j = g.logarithmBase;
            var k = this.pb(g);
            var l = k.b;
            var m = k.a;
            if (g.isLogarithmic) {
                for (var n = 0; n < b.count; n++) {
                    b._inner[n] = BubbleSeries.pr(l, m, h, i, j, b._inner[n]);
                }
            }
            else {
                for (var o = 0; o < b.count; o++) {
                    b._inner[o] = BubbleSeries.pq(l, m, h, i, b._inner[o]);
                }
            }
        }
        var p = 1;
        p = DeviceUtils.d();
        var q = this.pe == null;
        if (d) {
            var r = c.width / e;
            for (var s = 0; s < b.count; s++) {
                if (q) {
                    b._inner[s] = b._inner[s] / p;
                }
                b._inner[s] = b._inner[s] * r;
            }
        }
        for (var t = 0; t < a.count; t++) {
            var u = a._inner[t];
            if (q && !d) {
                u.width = Math.max(0, b._inner[t] / p);
                u.height = Math.max(0, b._inner[t] / p);
            }
            else {
                u.width = Math.max(0, b._inner[t]);
                u.height = Math.max(0, b._inner[t]);
            }
        }
    };
    BubbleSeries.prototype.qc = function (a) {
        var b = typeCast(BubbleSeriesView.$, this.bh);
        this.pd.b0 = false;
        if (b != null) {
            b.b0 = false;
        }
        var c = typeCast(CustomPaletteBrushScale.$, this.pc);
        var d = typeCast(ValueBrushScale.$, this.pc);
        var e = this.pc;
        var f = this.pa();
        var g = f.b;
        var h = f.a;
        var i = this.pc == null || !this.pc.isReady || (d != null && this.pv == null);
        if (i) {
            this.pd.db();
            if (b != null) {
                b.db();
            }
            return;
        }
        this.pd.b0 = true;
        if (b != null) {
            b.b0 = true;
        }
        var j = a.count;
        var k = this.bz;
        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.pi != null) {
                    var q = this.pi.item(p);
                    o = d.getBrushByRange(q, g, h);
                }
                else if (e != null) {
                    o = e.getBrush(p);
                }
                else {
                    if (this.na == null) {
                        o = this.m8;
                    }
                    else {
                        o = this.na;
                    }
                }
                var r = null;
                if (this.nb == null) {
                    r = this.m9;
                }
                else {
                    r = this.nb;
                }
                if (this.pn && o != null) {
                    r = o;
                }
                if (r != null && !isNaN_(this.pt)) {
                    r = BrushUtil.l(r, this.pt);
                }
                if (o != null && !isNaN_(this.ps)) {
                    o = BrushUtil.l(o, this.ps);
                }
                n.itemBrush = o;
                n.actualItemBrush = o;
                n.outline = r;
            }
        }
    };
    BubbleSeries.prototype.get_cy = function () {
        return false;
    };
    Object.defineProperty(BubbleSeries.prototype, "actualMarkerBrush", {
        get: function () {
            return this.m8;
        },
        enumerable: true,
        configurable: true
    });
    BubbleSeries.$t = markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberPath:pv:qe', [2], 'FillScale:pc:qf', [BrushScale.$], 'FillScaleUseGlobalValues:pm:qg', [0, false], 'LabelMemberPath:p0:qh', [2], 'MarkerBrushBrightness:ps:qi', [1, NaN], 'MarkerOutlineBrightness:pt:qj', [1, NaN], 'MarkerOutlineUsesFillScale:pn:qk', [0, false], 'RadiusMemberPath:p6:ql', [2, null], 'RadiusScale:pe:qm', [SizeScale.$], 'RadiusScaleUseGlobalValues:po:qn', [0, false]]);
    return BubbleSeries;
}(ScatterBase));
export { BubbleSeries };
/**
 * @hidden
 */
var CustomPaletteBrushScale = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__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.pq(0, b - 1, 0, this.brushes.count - 1, a);
        return this.aa(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, 'u', ['BrushSelectionMode', [BrushSelectionMode_$type, enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
}(BrushScale));
export { CustomPaletteBrushScale };
/**
 * @hidden
 */
var BubbleSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BubbleSeriesView, _super);
    function BubbleSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.da = null;
        _this.da = a;
        _this.ct = new ScatterTrendLineManager();
        return _this;
    }
    BubbleSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.by.mb = 2;
            this.e.bj = 4;
        }
    };
    BubbleSeriesView.prototype.cq = function () {
        var _this = this;
        return new BubbleMarkerManager(function (a) { return _this.cu.item(a); }, function (a) { return _this.cs.nh.c.item(a); }, runOn(this, this.c4), runOn(this, this.cn), runOn(this, this.cv));
    };
    BubbleSeriesView.prototype.dc = function () {
        var a = this.cr;
        this.da.qd(a.n, a.o, this.br, this == this.e.bh);
        this.an();
    };
    BubbleSeriesView.prototype.dd = function () {
        var a = this.cr;
        this.da.qc(a.n);
    };
    BubbleSeriesView.prototype.db = function () {
        var e_2, _a;
        var a = this.cr;
        try {
            for (var _b = tslib_1.__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.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.da.fx + "</span><br/><span>" + "(${item." + this.da.n4 + "}, ${item." + this.da.n8 + "})</span>";
        if (!stringIsNullOrEmpty(this.da.p6)) {
            a += "<span>, Radius: ${item." + this.da.p6 + "}</span>";
        }
        a += "</div>";
        return a;
    };
    BubbleSeriesView.$t = markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
}(ScatterBaseView));
export { BubbleSeriesView };
//# sourceMappingURL=BubbleSeries_combined.js.map
