/*
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, __generator, __values } from "tslib";
import { EventArgs, Base, markType, typeCast, runOn, delegateCombine, enumGetBox, Point_$type, String_$type, Number_$type, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core";
import { IFastItemColumn$1_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "igniteui-react-core";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { Dictionary$2 } from "igniteui-react-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-react-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { dateToStringFormat } from "igniteui-react-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialEventArgs, _super);
    function FinancialEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this._position = 0;
        _this._count = 0;
        _this._dataSource = null;
        _this._supportingCalculations = null;
        _this._basedOn = null;
        _this.position = a;
        _this.count = b;
        _this.dataSource = c;
        _this.supportingCalculations = d;
        if (c != null) {
            c.series = e;
        }
        return _this;
    }
    Object.defineProperty(FinancialEventArgs.prototype, "position", {
        get: function () {
            return this._position;
        },
        set: function (a) {
            this._position = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialBucketCalculator, _super);
    function FinancialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.c = 0;
        _this.d = 0;
        _this.b = 0;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        _this.a = a;
        _this.c = -1;
        _this.d = _this.d;
        _this.b = 0;
        return _this;
    }
    FinancialBucketCalculator.prototype.getBucket = function (a) {
        return null;
    };
    FinancialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    FinancialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    FinancialBucketCalculator.prototype.getBucketInfo = function (a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.b2.hk;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.by;
        var c = this.a.bx;
        var d = this.a.bx;
        if (this.a.b2 != null) {
            d = this.a.b2.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.b2.ub == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.b2.ub != null) ? this.a.b2.ub.ch : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.b2.tq(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.b2.ub);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.b2.ub.em(g.left, f));
            var j = Math.ceil(this.a.b2.ub.em(g.right, f));
            if (this.a.b2.ub.ch) {
                j = Math.ceil(this.a.b2.ub.em(g.left, f));
                i = Math.floor(this.a.b2.ub.em(g.right, f));
            }
            var k = Math.floor((j - i + 1) * a / g.width);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.floor(i / this.b));
            this.d = truncate(Math.ceil(j / this.b));
        }
        else {
            this.c = h.i$e(b, c, d, g);
            this.d = h.i$g(b, c, d, g);
            this.b = 1;
        }
    };
    FinancialBucketCalculator.prototype.cacheValues = function () {
    };
    FinancialBucketCalculator.prototype.unCacheValues = function () {
    };
    FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
}(Base));
export { FinancialBucketCalculator };
/**
 * @hidden
 */
var FinancialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.u2 = null;
        _this.u0 = null;
        _this.u1 = null;
        _this.uz = null;
        _this.u3 = null;
        _this.vc = false;
        _this.assigningCategoryStyle = null;
        _this.uk = null;
        _this.vm = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.vn = new Dictionary$2(String_$type, String_$type, 0);
        _this.vb = false;
        _this.uy = null;
        _this.uf = null;
        _this.uh = null;
        _this.ud = null;
        _this.un = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.va = false;
        _this.vz = null;
        _this.vx = null;
        _this.vy = null;
        _this.vw = null;
        _this.v0 = null;
        _this.ug = null;
        _this.uc = null;
        _this.ui = 0;
        _this.ut = null;
        _this.uv = null;
        _this.uk = new CategorySeriesRenderManager();
        _this.vc = false;
        _this.un = new CategoryTransitionSourceFramePreparer();
        _this.ug = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.uj = 0;
        return _this;
    }
    FinancialSeries.prototype.g1 = function () {
        var a = _super.prototype.g1.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "OpenMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedOpenMemberPath";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.xe));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "HighMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedHighMemberPath";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.xc));
            a.add(c);
        }
        {
            var d = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "LowMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedLowMemberPath";
                $ret.q = true;
                return $ret;
            })());
            d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.xd));
            a.add(d);
        }
        {
            var e = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "CloseMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedCloseMemberPath";
                $ret.q = true;
                return $ret;
            })());
            e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.xb));
            a.add(e);
        }
        {
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "VolumeMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedVolumeMemberPath";
                $ret.q = true;
                return $ret;
            })());
            f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.xf));
            a.add(f);
        }
        {
            var g = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Brush";
                $ret.p = true;
                $ret.y = "ActualBrush";
                $ret.q = true;
                return $ret;
            })());
            g.valueResolving = delegateCombine(g.valueResolving, runOn(this, this.pz));
            a.add(g);
        }
        {
            var h = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Outline";
                $ret.p = true;
                $ret.y = "ActualOutline";
                $ret.q = true;
                return $ret;
            })());
            h.valueResolving = delegateCombine(h.valueResolving, runOn(this, this.pz));
            a.add(h);
        }
        {
            var i = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeBrush";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            i.valueResolving = delegateCombine(i.valueResolving, runOn(this, this.pz));
            a.add(i);
        }
        {
            var j = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeOutline";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            j.valueResolving = delegateCombine(j.valueResolving, runOn(this, this.pz));
            a.add(j);
        }
        var k = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "IsTransitionInEnabled";
            $ret.x = true;
            $ret.q = true;
            return $ret;
        })());
        a.add(k);
        var l = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "TransitionInMode";
            $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
            $ret.q = true;
            return $ret;
        })());
        a.add(l);
        return a;
    };
    FinancialSeries.prototype.xe = function (a, b) {
        if (this.wo != null) {
            b.value = this.wo;
            return;
        }
        b.value = this.w1;
    };
    FinancialSeries.prototype.xc = function (a, b) {
        if (this.wk != null) {
            b.value = this.wk;
            return;
        }
        b.value = this.ws;
    };
    FinancialSeries.prototype.xd = function (a, b) {
        if (this.wm != null) {
            b.value = this.wm;
            return;
        }
        b.value = this.wx;
    };
    FinancialSeries.prototype.xb = function (a, b) {
        if (this.wi != null) {
            b.value = this.wi;
            return;
        }
        b.value = this.wf;
    };
    FinancialSeries.prototype.xf = function (a, b) {
        if (this.wq != null) {
            b.value = this.wq;
            return;
        }
        b.value = this.w5;
    };
    FinancialSeries.prototype.jx = function () {
        if (this.dk()) {
            return this.bf.uh;
        }
        else {
            return this.bf.ud;
        }
    };
    FinancialSeries.prototype.o2 = function (a) {
        _super.prototype.o2.call(this, a);
        this.us = a;
    };
    FinancialSeries.prototype.get_el = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.ub, this.uu];
    };
    FinancialSeries.prototype.jv = function (a, b) {
        var c = this.lw(b);
        if (c == FinancialSeries.$$p[11]) {
            return this.jw(a, b, this.w1);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.jw(a, b, this.ws);
        }
        if (c == FinancialSeries.$$p[9]) {
            return this.jw(a, b, this.wx);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.jw(a, b, this.wf);
        }
        if (c == FinancialSeries.$$p[13]) {
            return this.jw(a, b, this.w5);
        }
        return _super.prototype.jv.call(this, a, b);
    };
    FinancialSeries.prototype.wb = function () {
        return 2;
    };
    FinancialSeries.prototype.v9 = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.ub, this.ud.f, this.v8(this.cg), this.wa(this.cg), this.to(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        var g = this.wb();
        f[0] = { $type: Point_$type, x: c[0], y: c[g] };
        f[1] = { $type: Point_$type, x: d[0], y: d[g] };
        e[0] = f;
        return e;
    };
    FinancialSeries.prototype.ai = function (a) {
        var b = this.aj(this.ub, this.ud.f, this.v8(this.cg), this.wa(this.cg), this.to(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[1] };
        f[1] = { $type: Point_$type, x: d[0], y: d[1] };
        e[0] = f;
        return e;
    };
    FinancialSeries.prototype.s5 = function () {
        return this.x1;
    };
    FinancialSeries.prototype.s6 = function () {
        return this.x1;
    };
    FinancialSeries.prototype.nh = function () {
        _super.prototype.nh.call(this);
        this.ub = null;
        this.uu = null;
    };
    FinancialSeries.prototype.get_d0 = function () {
        return true;
    };
    FinancialSeries.prototype.get_fj = function () {
        return this.uu != null && this.uu.ch;
    };
    Object.defineProperty(FinancialSeries.prototype, "u7", {
        get: function () {
            return this.u2;
        },
        set: function (a) {
            if (this.u2 != a) {
                var b = this.u2;
                this.u2 = a;
                this.raisePropertyChanged("OpenColumn", b, this.u2);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "u5", {
        get: function () {
            return this.u0;
        },
        set: function (a) {
            if (this.u0 != a) {
                var b = this.u0;
                this.u0 = a;
                this.raisePropertyChanged("HighColumn", b, this.u0);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "u6", {
        get: function () {
            return this.u1;
        },
        set: function (a) {
            if (this.u1 != a) {
                var b = this.u1;
                this.u1 = a;
                this.raisePropertyChanged("LowColumn", b, this.u1);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "u4", {
        get: function () {
            return this.uz;
        },
        set: function (a) {
            if (this.uz != a) {
                var b = this.uz;
                this.uz = a;
                this.raisePropertyChanged("CloseColumn", b, this.uz);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "u9", {
        get: function () {
            return this.u3;
        },
        set: function (a) {
            if (this.u3 != a) {
                var b = this.u3;
                this.u3 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.u3);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.fo = function () {
        return this.highlightedItemsSource != null || (this.wo != null && this.wk != null && this.wm != null && this.wi != null);
    };
    FinancialSeries.prototype.vj = function () {
        return (this.assigningCategoryStyle != null && this.vc) || this.bp != 1;
    };
    FinancialSeries.prototype.xi = function (a) {
        if (this.assigningCategoryStyle != null && this.vc) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.xg = function (a, b, c, d, e, f) {
        var g = this.bp != 1;
        this.uk.a3(this.uk.b, d.cn, a, b, c, d, e, f, false);
        this.uk.ab(this.hi);
        var h = this.uk.ay;
        var i = null;
        var j = this.c7;
        if (g && this.cv != null) {
            i = this.cv.c2.getHighlightingInfo(this, j, h.o, h.n, false);
            h.b = i;
        }
        h.f = f;
        this.xi(h);
        this.uk.z(this, i, f, g, b < 0);
    };
    FinancialSeries.prototype.v1 = function (a) {
        return this.hy(a, this.ub);
    };
    FinancialSeries.prototype.jg = function (a, b) {
        return this.jh(a, b, this.ub, runOn(this, this.v1), new FinancialValueList(this.u7, this.u5, this.u6, this.u4, this.u9));
    };
    FinancialSeries.prototype.je = function (a, b) {
        return this.jf(a, b, this.ub, runOn(this, this.v1), new FinancialValueList(this.u7, this.u5, this.u6, this.u4, this.u9));
    };
    FinancialSeries.prototype.hu = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.ub.lf;
        return this.hv(a, b, this.ub, d, e, f, runOn(this, this.v1));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.ub.getCategorySize(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg));
    };
    FinancialSeries.prototype.tj = function (a, b, c) {
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, null, null, null);
    };
    FinancialSeries.prototype.ia = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(new FinancialValueList(this.u7, this.u5, this.u6, this.u4, this.u9), a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.h6 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(this.u5, a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.h8 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(this.u6, a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.v3 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(this.u4, a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.v4 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(this.u7, a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.v5 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cg);
        var e = this.v2(this.cg.by, this.cg.bx, d);
        var f = new ScalerParams(0, this.cg.by, this.cg.bx, this.ub.ch, d);
        return this.ic(this.u9, a, this.ub, f, e, runOn(this, this.v1), b, c);
    };
    FinancialSeries.prototype.tf = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, runOn(this, this.h6), function (d, e) { return _this.jh(d, e, _this.ub, runOn(_this, _this.v1), _this.u5); }, function (d, e) { return _this.jf(d, e, _this.ub, runOn(_this, _this.v1), _this.u5); });
    };
    FinancialSeries.prototype.th = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, runOn(this, this.h8), function (d, e) { return _this.jh(d, e, _this.ub, runOn(_this, _this.v1), _this.u6); }, function (d, e) { return _this.jf(d, e, _this.ub, runOn(_this, _this.v1), _this.u6); });
    };
    FinancialSeries.prototype.x3 = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, runOn(this, this.v4), function (d, e) { return _this.jh(d, e, _this.ub, runOn(_this, _this.v1), _this.u7); }, function (d, e) { return _this.jf(d, e, _this.ub, runOn(_this, _this.v1), _this.u7); });
    };
    FinancialSeries.prototype.x2 = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, runOn(this, this.v3), function (d, e) { return _this.jh(d, e, _this.ub, runOn(_this, _this.v1), _this.u4); }, function (d, e) { return _this.jf(d, e, _this.ub, runOn(_this, _this.v1), _this.u4); });
    };
    FinancialSeries.prototype.x4 = function (a, b, c) {
        var _this = this;
        return this.tl(a, b, c, this.v2(this.cg.by, this.cg.bx, this.getEffectiveViewport1(this.cg)), this.uu, this.ub, runOn(this, this.v5), function (d, e) { return _this.jh(d, e, _this.ub, runOn(_this, _this.v1), _this.u9); }, function (d, e) { return _this.jf(d, e, _this.ub, runOn(_this, _this.v1), _this.u9); });
    };
    FinancialSeries.prototype.oc = function () {
        _super.prototype.oc.call(this);
        if (this.ub != null) {
            this.ub.h8(false);
        }
        if (this.uu != null) {
            this.uu.h8(false);
        }
    };
    FinancialSeries.prototype.qp = function (a, b) {
        this.us.b0.e(this.hk);
        this.pr(false);
    };
    FinancialSeries.prototype.qo = function (a, b) {
        if (this.ga && this.iw < 0.05) {
            this.gb = true;
            this.ge = false;
            this.fu = false;
        }
        this.us.b0.e(this.hk);
        this.pr(false);
    };
    FinancialSeries.prototype.u8 = function (a, b, c) {
        var d = this.c4(b);
        this.vm.addItem(d, b);
        this.vn.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.xa = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.vm.item(b);
        this.vn.removeItem(c);
        this.vm.removeItem(b);
    };
    FinancialSeries.prototype.pa = function (a, b, c, d) {
        _super.prototype.pa.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.co != null && this.cv != null) {
                    this.us.b0.e(this.hk);
                    this.pr(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.ub != null) {
                        this.ub.b0(this);
                    }
                    if (this.uu != null) {
                        this.uu.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.ub != null) {
                        this.ub.ct(this);
                    }
                    if (this.uu != null) {
                        this.uu.ct(this);
                    }
                }
                this.us.b0.e(this.hk);
                this.pr(false);
                break;
            case "FastItemsSource":
                this.vb = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.xa(typeCast(IFastItemsSource_$type, c), this.u7);
                    this.xa(typeCast(IFastItemsSource_$type, c), this.u5);
                    this.xa(typeCast(IFastItemsSource_$type, c), this.u6);
                    this.xa(typeCast(IFastItemsSource_$type, c), this.u4);
                    this.xa(typeCast(IFastItemsSource_$type, c), this.u9);
                    this.u7 = null;
                    this.u5 = null;
                    this.u6 = null;
                    this.u4 = null;
                    this.u9 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.w1) == false) {
                        this.u7 = this.u8(typeCast(IFastItemsSource_$type, d), this.w1, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.ws) == false) {
                        this.u5 = this.u8(typeCast(IFastItemsSource_$type, d), this.ws, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.wx) == false) {
                        this.u6 = this.u8(typeCast(IFastItemsSource_$type, d), this.wx, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.wf) == false) {
                        this.u4 = this.u8(typeCast(IFastItemsSource_$type, d), this.wf, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.w5) == false) {
                        this.u9 = this.u8(typeCast(IFastItemsSource_$type, d), this.w5, "VolumeColumn");
                    }
                }
                this.vb = false;
                if (this.uu != null && !this.uu.c1()) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && c != null);
                }
                break;
            case FinancialSeries.$$p[11]:
                if (this.c7 != null) {
                    this.xa(this.c7, this.u7);
                    this.u7 = this.u8(this.c7, this.w1, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.uu != null && !this.uu.c1() && !this.vb) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && this.dp);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.c7 != null) {
                    this.xa(this.c7, this.u5);
                    this.u5 = this.u8(this.c7, this.ws, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.uu != null && !this.uu.c1() && !this.vb) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && this.dp);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (this.c7 != null) {
                    this.xa(this.c7, this.u6);
                    this.u6 = this.u8(this.c7, this.wx, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.uu != null && !this.uu.c1() && !this.vb) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && this.dp);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.c7 != null) {
                    this.xa(this.c7, this.u4);
                    this.u4 = this.u8(this.c7, this.wf, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.uu != null && !this.uu.c1() && !this.vb) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && this.dp);
                }
                this.xk();
                break;
            case FinancialSeries.$$p[13]:
                if (this.c7 != null) {
                    this.xa(this.c7, this.u9);
                    this.u9 = this.u8(this.c7, this.w5, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.uu != null && !this.uu.c1() && !this.vb) {
                    this.us.b0.e(this.hk);
                    this.pr(this.fr && this.dp);
                }
                break;
            case FinancialSeries.$$p[14]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.us.b0.e(this.hk);
                this.pr(false);
                this.om();
                this.ut = typeCast(ITimeRangeSelectorAxis_$type, this.ub);
                break;
            case FinancialSeries.$$p[15]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.us.b0.e(this.hk);
                if (this.uu != null) {
                    this.uu.c1();
                }
                {
                    this.pr(false);
                }
                this.om();
                break;
            case "TransitionProgress":
                this.uh.c(this.iw, this.uf, this.ud);
                if (this.dm(this.cg)) {
                    return;
                }
                if (this.iw == 1) {
                    this.ud.v();
                    this.xj(this.ud, this.us);
                    if (this.ga) {
                        this.ga = false;
                        this.nl();
                        this.cw.r = truncate(this.ie());
                        this.cw.b = this.cx;
                    }
                    if (this.gd) {
                        this.gd = false;
                        this.nl();
                        this.cw.r = truncate(this.ie());
                        this.cw.b = this.cx;
                        this.o1();
                    }
                    this.op();
                }
                else {
                    this.xj(this.uh, this.us);
                }
                if (this.cv != null) {
                    this.cv.or(this);
                }
                break;
            case FinancialSeries.$$p[10]:
                this.pr(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.vc = this.vf();
                this.pr(false);
                break;
            case "CategoryMode":
                if (this.ub != null) {
                    this.ub.l5(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.ve = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.vd = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.t4 = function (a, b, c) {
        if (b < a || a < 0 || a > this.c7.count || b < 0 || b > this.c7.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cn;
        var f = null;
        if (e) {
            f = c.i$b;
        }
        for (var g = a; g <= b; g++) {
            var h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.c7.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.v8 = function (a) {
        return a.b0.b;
    };
    FinancialSeries.prototype.wa = function (a) {
        return a.b0.c;
    };
    FinancialSeries.prototype.t3 = function (a, b) {
        return this.t4(a, b, this.uu);
    };
    FinancialSeries.prototype.get_et = function () {
        return true;
    };
    FinancialSeries.prototype.ni = function () {
        _super.prototype.ni.call(this);
        this.uy = null;
    };
    FinancialSeries.prototype.c0 = function (a, b, c) {
        if (this.dv && this.fd(this.bp) && !c) {
            var d = this.ux(a, b, this.uy);
            this.uy = d;
            return d;
        }
        else {
            var e = this.uw(a, b, this.uy);
            this.uy = e;
            return e;
        }
    };
    FinancialSeries.prototype.wc = function (a) {
        var b = this.ue();
        var c = this.cg.bx;
        var d = this.cg.by;
        var e = this.ub;
        var f = 0;
        if (e.cp) {
            var g = (a.y - d.top) / d.height;
            f = g * c.height + c.top;
        }
        else {
            var h = (a.x - d.left) / d.width;
            f = h * c.width + c.left;
        }
        var i = b.f.count;
        var j = 0;
        for (j = 0; j < i; j++) {
            var k = b.f._inner[j];
            var l = null;
            if (j < i - 1) {
                l = b.f._inner[j + 1];
            }
            if (k[0] <= f && l == null || l[0] >= f) {
                if (l != null) {
                    if (Math.abs(k[0] - f) < Math.abs(l[0] - f)) {
                        return j;
                    }
                    else {
                        return j + 1;
                    }
                }
                else {
                    return j;
                }
            }
        }
        return j;
    };
    FinancialSeries.prototype.ux = function (a, b, c) {
        var d = this.c7.count;
        var e = this.us.b0.c;
        var f = this.us.b0.d;
        var g = this.us.b0.b;
        var h = this.ub;
        var i = -1;
        var j = -1;
        if (h.cn) {
            var k = this.ue();
            var l = this.wc(b);
            i = l;
            j = l;
        }
        else {
            var m = this.i9(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.g == i && c.f == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.i = this;
        n.g = i;
        n.f = j;
        return n;
    };
    FinancialSeries.prototype.uw = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.c7.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.vf = function () {
        return this.vh;
    };
    FinancialSeries.prototype.hw = function (a) {
        var b = this.cg.by;
        var c = this.cg.bx;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.ub != null) {
            var e = this.getEffectiveViewport1(this.cg);
            var f = new ScalerParams(0, b, c, this.ub.ch, e);
            var g = this.tq(this.cg);
            var h = this.ub.em(g.left, f);
            var i = this.ub.em(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.ub.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.i9 = function (a) {
        return truncate(Math.round(this.hw(a)));
    };
    FinancialSeries.prototype.get_e6 = function () {
        return typeCast(ISortingAxis_$type, this.ub) !== null;
    };
    FinancialSeries.prototype.as = function () {
        return this.ub;
    };
    FinancialSeries.prototype.jb = function (a) {
        var b = this.cg.by;
        var c = this.cg.bx;
        var d = this.getEffectiveViewport1(this.cg);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.ub.ch, d);
        var g = typeCast(ISortingAxis_$type, this.ub);
        var h = this.tq(this.cg);
        var i = h.left;
        var j = h.right;
        var k = this.te(a).x;
        var l = this.ub.em(k, f);
        var m = this.ub.em(i, f);
        var n = this.ub.em(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.js = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.ub) !== null) {
            b = this.jb(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.i9(a);
        }
        return b >= 0 && this.c7 != null && b < this.c7.count ? this.c7.item(b) : null;
    };
    FinancialSeries.prototype.ue = function () {
        var a = this.ud;
        if (this.dk()) {
            if (this.cw.g) {
                this.cw.t();
            }
            a = this.uh;
        }
        return a;
    };
    FinancialSeries.prototype.v2 = function (a, b, c) {
        if (this.ub == null) {
            return 0;
        }
        return this.ub.k5(a, b, c, this.index);
    };
    FinancialSeries.prototype.fx = function () {
        return this.vi;
    };
    FinancialSeries.prototype.ul = function () {
        return 11;
    };
    FinancialSeries.prototype.cp = function () {
        return 3;
    };
    FinancialSeries.prototype.cr = function () {
        return 3;
    };
    FinancialSeries.prototype.xj = function (a, b) {
        this.oy();
        this.tp = a.aa;
        b.aw();
    };
    FinancialSeries.prototype.xh = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.gm = function (a, b, c) {
        var d = _super.prototype.gm.call(this, a, b, c);
        var e = c;
        if (this.c7 == null || this.c7.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.ub == null || this.uu == null || e.b0.b < 1 || this.ub.bi == null || this.uu.bi == null || this.uu.lx == this.uu.lw || this.ub.itemsSource == null || this.ub.lf < 1) {
            e.b0.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.cg.by;
        a = this.cg.bx;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.v6 = function (a) {
        var b = 0;
        var c = a.by;
        var d = a.bx;
        var e = this.getEffectiveViewport1(this.cg);
        if (!c.isEmpty && !d.isEmpty && this.uu != null) {
            var f = new ScalerParams(0, c, d, this.uu.ch, e);
            f.b = this.h3();
            b = this.uu.ej(this.uu.l7, f);
        }
        return b;
    };
    FinancialSeries.prototype.nl = function () {
        _super.prototype.nl.call(this);
        this.uf.v();
        this.ud.v();
        this.uh.v();
    };
    FinancialSeries.prototype.ps = function (a) {
        var _this = this;
        _super.prototype.ps.call(this, a);
        this.us.b0.e(this.hk);
        if (this.dm(this.cg)) {
            return;
        }
        if (this.f1) {
            if (this.dk()) {
                this.xj(this.uh, this.us);
            }
            else {
                this.xj(this.ud, this.us);
            }
            return;
        }
        if (this.fq(a)) {
            var b = this.uf;
            if (this.dk()) {
                if (this.cw.g) {
                    this.cw.t();
                }
                this.uf = this.uh;
                this.uh = b;
            }
            else {
                this.uf = this.ud;
                this.ud = b;
            }
            this.xh(this.ud, this.us);
            var c = false;
            if (this.gc) {
                this.cw.w();
                this.cw.r = truncate(this.ig());
                this.cw.b = this.cy != null ? this.cy : this.cx;
                if (this.gd) {
                    var d = this.uh;
                    this.uh = this.uf;
                    this.uf = d;
                    c = true;
                }
                this.un.s(this, this.uf, this.ud, this.isVertical, this.ub, this.uu, this.um, this.ul(), this.cq, this.cp(), function () { return _this.v6(_this.us); }, this.us.bx);
                if (this.gd) {
                    var e = this.uh;
                    this.uh = this.uf;
                    this.uf = e;
                }
                this.gd = false;
            }
            if (this.gf) {
                this.cw.w();
                this.cw.r = truncate(this.ih());
                this.cw.b = this.cz != null ? this.cz : this.cx;
                if (this.ga) {
                    var f = this.uh;
                    this.uh = this.uf;
                    this.uf = f;
                    c = true;
                }
                this.un.s(this, this.uf, this.ud, this.isVertical, this.ub, this.uu, this.um, this.ul(), this.cq, this.cp(), function () { return _this.v6(_this.us); }, this.us.bx);
                var g = this.ud;
                this.ud = this.uf;
                this.uf = g;
                if (this.ga) {
                    var h = this.uh;
                    this.uh = this.uf;
                    this.uf = h;
                }
                this.ga = false;
            }
            this.dr = false;
            if (!c) {
                this.ng();
            }
            this.p5();
            if (this.gc) {
                this.gb = false;
                this.ge = false;
                this.fu = false;
                this.ga = true;
            }
            if (this.gf) {
                this.ge = false;
                this.gd = true;
            }
        }
        else {
            this.xh(this.ud, this.us);
            this.xj(this.ud, this.us);
        }
    };
    FinancialSeries.prototype.fy = function () {
        return true;
    };
    FinancialSeries.prototype.vk = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.u5 == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.u6 == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.u7 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.u4 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.u9 == null) {
                            return false;
                        }
                        break;
                }
            }
        }
        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;
            }
        }
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "vl", {
        get: function () {
            return this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.vg = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.w9 = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "vt", {
        get: function () {
            return this.vq();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._vq = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.vg())
                        return [3 /*break*/, 8];
                    b = this.uo(0, this.c7.count);
                    this.w9(new FinancialEventArgs(0, this.c7.count, b, this.up(b), this));
                    if (!(b.typicalColumn != null))
                        return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(b.typicalColumn)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    c = _b.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_2_1 = _d.sent();
                    e_2 = { error: e_2_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a)
                        return [3 /*break*/, 17];
                    if (!(this.vl && this.ub.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.c7.count;
                    e = this.ub.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.u5.item(e.item(f)) + this.u6.item(e.item(f)) + this.u4.item(e.item(f))) / 3];
                case 10:
                    _d.sent();
                    _d.label = 11;
                case 11:
                    ++f;
                    return [3 /*break*/, 9];
                case 12: return [3 /*break*/, 17];
                case 13:
                    g = this.c7.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.u5.item(h) + this.u6.item(h) + this.u4.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.vq = function () {
        var _this = this;
        return toEnum(function () { return _this._vq(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "vs", {
        get: function () {
            return this.vp();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._vp = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.vl && this.ub.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.u5.count;
                    b = this.ub.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.v7(this.u5.item(b.item(0)) - this.u6.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.max(this.v7(this.u5.item(b.item(c)) - this.u6.item(b.item(c))), Math.max(this.v7(Math.abs(this.u5.item(b.item(c)) - this.u4.item(b.item(c - 1)))), this.v7(Math.abs(this.u6.item(b.item(c)) - this.u4.item(b.item(c - 1))))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    ++c;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.u5.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.v7(this.u5.item(0) - this.u6.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.max(this.v7(this.u5.item(e) - this.u6.item(e)), Math.max(this.v7(Math.abs(this.u5.item(e) - this.u4.item(e - 1))), this.v7(Math.abs(this.u6.item(e) - this.u4.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.vp = function () {
        var _this = this;
        return toEnum(function () { return _this._vp(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "vr", {
        get: function () {
            return this.vo();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._vo = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.vl && this.ub.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.u6.count;
                    b = this.ub.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.v7(this.u6.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.min(this.v7(this.u6.item(b.item(c))), this.v7(this.u4.item(b.item(c - 1))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    c++;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.u6.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.v7(this.u6.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.min(this.v7(this.u6.item(e)), this.v7(this.u4.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.vo = function () {
        var _this = this;
        return toEnum(function () { return _this._vo(); });
    };
    FinancialSeries.prototype.vv = function (a) {
        if (a == null) {
            return null;
        }
        if (this.vl && this.ub.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.ub.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.vu = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.c7 != null && !this.va) {
            this.va = true;
            var b = this.uo(0, this.c7.count);
            this.va = false;
            var c = new FinancialEventArgs(0, this.c7.count, b, this.up(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    };
    FinancialSeries.prototype.getOpenColumnAsArray = function () {
        if (this.u7 == null) {
            return null;
        }
        if (this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null) {
            if (this.vz != null) {
                return this.vz.asArray();
            }
            var a = new List$1(Number_$type, 2, this.u7.count);
            var b = this.ub.i$b;
            var c = this.u7.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.vz = a;
            return this.vz.asArray();
        }
        else {
            return this.u7.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.u5 == null) {
            return null;
        }
        if (this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null) {
            if (this.vx != null) {
                return this.vx.asArray();
            }
            var a = new List$1(Number_$type, 2, this.u5.count);
            var b = this.ub.i$b;
            var c = this.u5.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.vx = a;
            return this.vx.asArray();
        }
        else {
            return this.u5.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.u6 == null) {
            return null;
        }
        if (this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null) {
            if (this.vy != null) {
                return this.vy.asArray();
            }
            var a = new List$1(Number_$type, 2, this.u6.count);
            var b = this.ub.i$b;
            var c = this.u6.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.vy = a;
            return this.vy.asArray();
        }
        else {
            return this.u6.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.u4 == null) {
            return null;
        }
        if (this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null) {
            if (this.vw != null) {
                return this.vw.asArray();
            }
            var a = new List$1(Number_$type, 2, this.u4.count);
            var b = this.ub.i$b;
            var c = this.u4.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.vw = a;
            return this.vw.asArray();
        }
        else {
            return this.u4.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.u9 == null) {
            return null;
        }
        if (this.ub != null && typeCast(ISortingAxis_$type, this.ub) !== null) {
            if (this.v0 != null) {
                return this.v0.asArray();
            }
            var a = new List$1(Number_$type, 2, this.u9.count);
            var b = this.ub.i$b;
            var c = this.u9.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.v0 = a;
            return this.v0.asArray();
        }
        else {
            return this.u9.asArray();
        }
    };
    FinancialSeries.prototype.np = function (a, b, c, d) {
        _super.prototype.np.call(this, a, b, c, d);
        if (this.ub == null || !(typeCast(ISortingAxis_$type, this.ub) !== null)) {
            return;
        }
        var e = this.ub.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.vz != null) {
                        this.vz.insert(f, this.u7.item(g));
                    }
                    if (this.vx != null) {
                        this.vx.insert(f, this.u5.item(g));
                    }
                    if (this.vy != null) {
                        this.vy.insert(f, this.u6.item(g));
                    }
                    if (this.vw != null) {
                        this.vw.insert(f, this.u4.item(g));
                    }
                    if (this.v0 != null) {
                        this.v0.insert(f, this.u9.item(g));
                    }
                }
                break;
            case 0:
                if (this.vz != null) {
                    this.vz.v(b, c);
                }
                if (this.vx != null) {
                    this.vx.v(b, c);
                }
                if (this.vy != null) {
                    this.vy.v(b, c);
                }
                if (this.vw != null) {
                    this.vw.v(b, c);
                }
                if (this.v0 != null) {
                    this.v0.v(b, c);
                }
                break;
            case 4:
                if (this.vz != null) {
                    this.vz = new List$1(Number_$type, 0);
                }
                if (this.vx != null) {
                    this.vx = new List$1(Number_$type, 0);
                }
                if (this.vy != null) {
                    this.vy = new List$1(Number_$type, 0);
                }
                if (this.vw != null) {
                    this.vw = new List$1(Number_$type, 0);
                }
                if (this.v0 != null) {
                    this.v0 = new List$1(Number_$type, 0);
                }
                break;
            case 3:
            case 2:
                for (var h = b; h < c; h++) {
                    var i = e._inner[h];
                    if (this.vz != null) {
                        this.vz._inner[h] = this.u7.item(i);
                    }
                    if (this.vx != null) {
                        this.vx._inner[h] = this.u5.item(i);
                    }
                    if (this.vy != null) {
                        this.vy._inner[h] = this.u6.item(i);
                    }
                    if (this.vw != null) {
                        this.vw._inner[h] = this.u4.item(i);
                    }
                    if (this.v0 != null) {
                        this.v0._inner[h] = this.u9.item(i);
                    }
                }
                break;
        }
        this.xk();
        this.ql();
    };
    FinancialSeries.prototype.uo = function (a, b) {
        var _this = this;
        var c = this.vv(this.u7);
        var d = this.vv(this.u4);
        var e = this.vv(this.u5);
        var f = this.vv(this.u6);
        var g = this.vv(this.u9);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.vt), _this.vu());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.vs), ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("HighColumn");
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.trueLow = new CalculatedColumn(1, new SafeEnumerable(_this.vr), ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.openColumn = c;
            $ret.closeColumn = d;
            $ret.highColumn = e;
            $ret.lowColumn = f;
            $ret.volumeColumn = g;
            $ret.calculateFrom = a;
            $ret.calculateCount = b;
            $ret.minimumValue = NaN;
            $ret.maximumValue = NaN;
            $ret.count = _this.c7 != null ? _this.c7.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.v7 = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.up = function (a) {
        var _this = this;
        return ((function () {
            var $ret = new FinancialCalculationSupportingCalculations();
            $ret.a = new ColumnSupportingCalculation(1, TrendCalculators.b, new List$1(String_$type, 0));
            $ret.c = new ColumnSupportingCalculation(1, TrendCalculators.e, new List$1(String_$type, 0));
            $ret.d = new ColumnSupportingCalculation(1, TrendCalculators.f, new List$1(String_$type, 0));
            $ret.b = new ColumnSupportingCalculation(1, TrendCalculators.d, new List$1(String_$type, 0));
            $ret.h = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.volumeColumn, b.shortPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.f = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.volumeColumn, b.longPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.g = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.shortPeriod); }, a.typicalColumn.basedOn);
            $ret.e = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.longPeriod); }, a.typicalColumn.basedOn);
            $ret.k = Series.gy;
            $ret.j = Series.gx;
            $ret.i = runOn(_this, _this.v7);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.ub;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.pt = function (a, b) {
        _super.prototype.pt.call(this, a, b);
        if (!this.f9) {
            this.cg.a4(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.cf);
        this.cg.a4(b);
        c.b0.e(this.hk);
        if (this.dm(this.cf)) {
            return;
        }
        if (!this.f2) {
            this.xh(this.ug, c);
        }
        this.f2 = false;
        this.xj(this.ug, c);
        this.f9 = false;
    };
    FinancialSeries.prototype.pq = function (a, b, c, d, e) {
        _super.prototype.pq.call(this, a, b, c, d, e);
        var f = this.a3.a$h.item(d);
        var g = f;
        g.b0.e(this.hk);
        f.a3(c);
        if (this.dm(g)) {
            return;
        }
        if (this.uc == null) {
            this.uc = new CategoryFrame(3);
        }
        this.uc.u();
        this.xh(this.uc, g);
        this.xj(this.uc, g);
    };
    FinancialSeries.prototype.ao = function (a) {
        if (this.ub == a) {
            return this.uu;
        }
        if (this.uu == a) {
            return this.ub;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.ub);
        return b != null ? b.preferredCategoryMode(this) : this.uj;
    };
    Object.defineProperty(FinancialSeries.prototype, "uj", {
        get: function () {
            return this.ui;
        },
        set: function (a) {
            var b = this.uj;
            if (a != b) {
                this.ui = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.uj));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_e0 = function () {
        return true;
    };
    FinancialSeries.prototype.p1 = function (a, b) {
        _super.prototype.p1.call(this, a, b);
        this.x1 = a;
    };
    FinancialSeries.prototype.xk = function () {
        this.hs = this.u4 == null || this.u4.count == 0 ? NaN : this.u4.item(this.u4.count - 1);
    };
    FinancialSeries.prototype.ju = function (a) {
        if (this.ut != null && a != null) {
            if (this.uv == null || this.uv.propertyName != this.ut.dateTimeMemberPath) {
                this.uv = new FastReflectionHelper(false, this.ut.dateTimeMemberPath);
            }
            var b = this.uv.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.ut.itemLabelFormat());
            }
        }
        return _super.prototype.ju.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:wf:xl', [2, null], 'HighMemberPath:ws:xr', [2, null], 'HighlightedCloseMemberPath:wi:xm', [2, null], 'HighlightedHighMemberPath:wk:xn', [2, null], 'HighlightedLowMemberPath:wm:xo', [2, null], 'HighlightedOpenMemberPath:wo:xp', [2, null], 'HighlightedVolumeMemberPath:wq:xq', [2, null], 'IsCustomCategoryStyleAllowed:vh:xs', [0, false], 'IsTransitionInEnabled:vi:xt', [0, false], 'LowMemberPath:wx:xu', [2, null], 'NegativeBrush:x1:xv', [Brush.$, null], 'OpenMemberPath:w1:xw', [2, null], 'TransitionInMode:um:xx', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:w5:xy', [2, null], 'XAxis:ub:xz', [CategoryAxisBase.$, null], 'YAxis:uu:x0', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationSupportingCalculations, _super);
    function FinancialCalculationSupportingCalculations() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        _this.c = null;
        _this.d = null;
        _this.b = null;
        _this.h = null;
        _this.f = null;
        _this.g = null;
        _this.e = null;
        _this.k = null;
        _this.j = null;
        _this.i = null;
        return _this;
    }
    FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
}(Base));
export { FinancialCalculationSupportingCalculations };
/**
 * @hidden
 */
var DataSourceSupportingCalculation = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataSourceSupportingCalculation, _super);
    function DataSourceSupportingCalculation(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = this;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this = _super.call(this, Delegate_$type, 0, c) || this;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this = _super.call(this, Delegate_$type, 1, c, d) || this;
                }
                break;
        }
        return _this;
    }
    DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
}(SupportingCalculation$1));
export { DataSourceSupportingCalculation };
/**
 * @hidden
 */
var FinancialCalculationDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationDataSource, _super);
    function FinancialCalculationDataSource() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._openColumn = null;
        _this._closeColumn = null;
        _this._highColumn = null;
        _this._lowColumn = null;
        _this._volumeColumn = null;
        _this._indicatorColumn = null;
        _this._typicalColumn = null;
        _this._trueRange = null;
        _this._trueLow = null;
        _this._period = 0;
        _this._shortPeriod = 0;
        _this._longPeriod = 0;
        _this._count = 0;
        _this._calculateFrom = 0;
        _this._calculateCount = 0;
        _this._multiplier = 0;
        _this._minimumValue = 0;
        _this._maximumValue = 0;
        _this._specifiesRange = false;
        _this._series = null;
        return _this;
    }
    Object.defineProperty(FinancialCalculationDataSource.prototype, "openColumn", {
        get: function () {
            return this._openColumn;
        },
        set: function (a) {
            this._openColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.b2 = null;
        _this.b0 = null;
        _this.b4 = 0;
        _this.b4 = -1;
        _this.b2 = a;
        _this.b0 = _this.b1();
        return _this;
    }
    FinancialSeriesView.prototype.b3 = function (a) {
        if (this.b4 != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.b5 = function (a) {
        this.b4 = a.t;
    };
    FinancialSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.b2.ub.ce) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.b2.ub.f0 != null) {
            a += "<span>${item." + this.b2.ub.f0 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a3.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.w);
        var d = c.b1("financialSeries_Open");
        var e = c.b1("financialSeries_High");
        var f = c.b1("financialSeries_Low");
        var g = c.b1("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.b2.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.b2.w1 + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.ws + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.wx + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.wf + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.b2.w5)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.w5 + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.s8 = a;
        this.e.is = 5;
        this.e.it = 2;
        this.e.iu = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
