/*
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, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./HighlightingInfo";
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-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-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-angular-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { dateToStringFormat } from "igniteui-angular-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core";
import { Color } from "igniteui-angular-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.bz.fv;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.bv;
        var c = this.a.bu;
        var d = this.a.bu;
        if (this.a.bz != null) {
            d = this.a.bz.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bz.qg == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bz.qg != null) ? this.a.bz.qg.cg : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bz.pv(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bz.qg);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bz.qg.el(g.left, f));
            var j = Math.ceil(this.a.bz.qg.el(g.right, f));
            if (this.a.bz.qg.cg) {
                j = Math.ceil(this.a.bz.qg.el(g.left, f));
                i = Math.floor(this.a.bz.qg.el(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.q7 = null;
        _this.q5 = null;
        _this.q6 = null;
        _this.q4 = null;
        _this.q8 = null;
        _this.rh = false;
        _this.assigningCategoryStyle = null;
        _this.qp = null;
        _this.rr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.rs = new Dictionary$2(String_$type, String_$type, 0);
        _this.rg = false;
        _this.q0 = null;
        _this.qk = null;
        _this.qm = null;
        _this.qi = null;
        _this.qs = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.rf = false;
        _this.r4 = null;
        _this.r2 = null;
        _this.r3 = null;
        _this.r1 = null;
        _this.r5 = null;
        _this.ql = null;
        _this.qh = null;
        _this.qn = 0;
        _this.q1 = null;
        _this.q3 = null;
        _this.qp = new CategorySeriesRenderManager();
        _this.rh = false;
        _this.qs = new CategoryTransitionSourceFramePreparer();
        _this.ql = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.qo = 0;
        return _this;
    }
    FinancialSeries.prototype.l2 = function (a) {
        _super.prototype.l2.call(this, a);
        this.qx = a;
    };
    FinancialSeries.prototype.get_dq = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.qg, this.q2];
    };
    FinancialSeries.prototype.hy = function (a, b) {
        var c = this.js(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.hz(a, b, this.sw);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.hz(a, b, this.sn);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.hz(a, b, this.ss);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.hz(a, b, this.sk);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.hz(a, b, this.s0);
        }
        return _super.prototype.hy.call(this, a, b);
    };
    FinancialSeries.prototype.sg = function () {
        return 2;
    };
    FinancialSeries.prototype.se = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.qg, this.qi.f, this.sd(this.b0), this.sf(this.b0), this.pt(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.sg();
        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.qg, this.qi.f, this.sd(this.b0), this.sf(this.b0), this.pt(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.pd = function () {
        return this.tm;
    };
    FinancialSeries.prototype.pe = function () {
        return this.tm;
    };
    FinancialSeries.prototype.kx = function () {
        _super.prototype.kx.call(this);
        this.qg = null;
        this.q2 = null;
    };
    FinancialSeries.prototype.get_c6 = function () {
        return true;
    };
    FinancialSeries.prototype.get_ek = function () {
        return this.q2 != null && this.q2.cg;
    };
    Object.defineProperty(FinancialSeries.prototype, "rc", {
        get: function () {
            return this.q7;
        },
        set: function (a) {
            if (this.q7 != a) {
                var b = this.q7;
                this.q7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.q7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "ra", {
        get: function () {
            return this.q5;
        },
        set: function (a) {
            if (this.q5 != a) {
                var b = this.q5;
                this.q5 = a;
                this.raisePropertyChanged("HighColumn", b, this.q5);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "rb", {
        get: function () {
            return this.q6;
        },
        set: function (a) {
            if (this.q6 != a) {
                var b = this.q6;
                this.q6 = a;
                this.raisePropertyChanged("LowColumn", b, this.q6);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "q9", {
        get: function () {
            return this.q4;
        },
        set: function (a) {
            if (this.q4 != a) {
                var b = this.q4;
                this.q4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.q4);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "re", {
        get: function () {
            return this.q8;
        },
        set: function (a) {
            if (this.q8 != a) {
                var b = this.q8;
                this.q8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.q8);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.ro = function () {
        return (this.assigningCategoryStyle != null && this.rh) || this.bk != 1;
    };
    FinancialSeries.prototype.s8 = function (a) {
        if (this.assigningCategoryStyle != null && this.rh) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.s6 = function (a, b, c, d, e, f) {
        var g = this.bk != 1;
        this.qp.a1(this.qp.b, d.cm, a, b, c, d, e, f, false);
        this.qp.ab(this.ft);
        var h = this.qp.aw;
        var i = null;
        var j = this.ck;
        if (g && this.cd != null) {
            i = this.cd.a7.getHighlightingInfo(this, j, h.o, h.n, false);
            h.b = i;
        }
        h.f = f;
        this.s8(h);
        this.qp.z(this, i, f, g, b < 0);
    };
    FinancialSeries.prototype.r6 = function (a) {
        return this.f9(a, this.qg);
    };
    FinancialSeries.prototype.hl = function (a, b) {
        return this.hm(a, b, this.qg, runOn(this, this.r6), new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re));
    };
    FinancialSeries.prototype.hj = function (a, b) {
        return this.hk(a, b, this.qg, runOn(this, this.r6), new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re));
    };
    FinancialSeries.prototype.f5 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.qg.le;
        return this.f6(a, b, this.qg, d, e, f, runOn(this, this.r6));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.qg.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    FinancialSeries.prototype.pq = function (a, b, c) {
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, null, null, null);
    };
    FinancialSeries.prototype.gl = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re), a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.gh = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(this.ra, a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.gj = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(this.rb, a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.r8 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(this.q9, a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.r9 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(this.rc, a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.sa = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r7(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
        return this.gn(this.re, a, this.qg, f, e, runOn(this, this.r6), b, c);
    };
    FinancialSeries.prototype.pm = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.gh), function (d, e) { return _this.hm(d, e, _this.qg, runOn(_this, _this.r6), _this.ra); }, function (d, e) { return _this.hk(d, e, _this.qg, runOn(_this, _this.r6), _this.ra); });
    };
    FinancialSeries.prototype.po = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.gj), function (d, e) { return _this.hm(d, e, _this.qg, runOn(_this, _this.r6), _this.rb); }, function (d, e) { return _this.hk(d, e, _this.qg, runOn(_this, _this.r6), _this.rb); });
    };
    FinancialSeries.prototype.to = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.r9), function (d, e) { return _this.hm(d, e, _this.qg, runOn(_this, _this.r6), _this.rc); }, function (d, e) { return _this.hk(d, e, _this.qg, runOn(_this, _this.r6), _this.rc); });
    };
    FinancialSeries.prototype.tn = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.r8), function (d, e) { return _this.hm(d, e, _this.qg, runOn(_this, _this.r6), _this.q9); }, function (d, e) { return _this.hk(d, e, _this.qg, runOn(_this, _this.r6), _this.q9); });
    };
    FinancialSeries.prototype.tp = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.sa), function (d, e) { return _this.hm(d, e, _this.qg, runOn(_this, _this.r6), _this.re); }, function (d, e) { return _this.hk(d, e, _this.qg, runOn(_this, _this.r6), _this.re); });
    };
    FinancialSeries.prototype.li = function () {
        _super.prototype.li.call(this);
        if (this.qg != null) {
            this.qg.h7(false);
        }
        if (this.q2 != null) {
            this.q2.h7(false);
        }
    };
    FinancialSeries.prototype.m9 = function (a, b) {
        this.qx.bx.e(this.fv);
        this.ml(false);
    };
    FinancialSeries.prototype.m8 = function (a, b) {
        if (this.e2 && this.g2 < 0.05) {
            this.e3 = true;
        }
        this.qx.bx.e(this.fv);
        this.ml(false);
    };
    FinancialSeries.prototype.rd = function (a, b, c) {
        var d = this.ch(b);
        this.rr.addItem(d, b);
        this.rs.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.s5 = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.rr.item(b);
        this.rs.removeItem(c);
        this.rr.removeItem(b);
    };
    FinancialSeries.prototype.l7 = function (a, b, c, d) {
        _super.prototype.l7.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.b8 != null && this.cd != null) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.qg != null) {
                        this.qg.bz(this);
                    }
                    if (this.q2 != null) {
                        this.q2.bz(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.qg != null) {
                        this.qg.cs(this);
                    }
                    if (this.q2 != null) {
                        this.q2.cs(this);
                    }
                }
                this.qx.bx.e(this.fv);
                this.ml(false);
                break;
            case "FastItemsSource":
                this.rg = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.s5(typeCast(IFastItemsSource_$type, c), this.rc);
                    this.s5(typeCast(IFastItemsSource_$type, c), this.ra);
                    this.s5(typeCast(IFastItemsSource_$type, c), this.rb);
                    this.s5(typeCast(IFastItemsSource_$type, c), this.q9);
                    this.s5(typeCast(IFastItemsSource_$type, c), this.re);
                    this.rc = null;
                    this.ra = null;
                    this.rb = null;
                    this.q9 = null;
                    this.re = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.sw) == false) {
                        this.rc = this.rd(typeCast(IFastItemsSource_$type, d), this.sw, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.sn) == false) {
                        this.ra = this.rd(typeCast(IFastItemsSource_$type, d), this.sn, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.ss) == false) {
                        this.rb = this.rd(typeCast(IFastItemsSource_$type, d), this.ss, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.sk) == false) {
                        this.q9 = this.rd(typeCast(IFastItemsSource_$type, d), this.sk, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.s0) == false) {
                        this.re = this.rd(typeCast(IFastItemsSource_$type, d), this.s0, "VolumeColumn");
                    }
                }
                this.rg = false;
                if (this.q2 != null && !this.q2.c0()) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.ck != null) {
                    this.s5(this.ck, this.rc);
                    this.rc = this.rd(this.ck, this.sw, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.q2 != null && !this.q2.c0() && !this.rg) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.ck != null) {
                    this.s5(this.ck, this.ra);
                    this.ra = this.rd(this.ck, this.sn, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.q2 != null && !this.q2.c0() && !this.rg) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.ck != null) {
                    this.s5(this.ck, this.rb);
                    this.rb = this.rd(this.ck, this.ss, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.q2 != null && !this.q2.c0() && !this.rg) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.ck != null) {
                    this.s5(this.ck, this.q9);
                    this.q9 = this.rd(this.ck, this.sk, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.q2 != null && !this.q2.c0() && !this.rg) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                this.ta();
                break;
            case FinancialSeries.$$p[8]:
                if (this.ck != null) {
                    this.s5(this.ck, this.re);
                    this.re = this.rd(this.ck, this.s0, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.q2 != null && !this.q2.c0() && !this.rg) {
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bz(this);
                }
                if (d != null) {
                    d.cs(this);
                }
                this.qx.bx.e(this.fv);
                this.ml(false);
                this.ls();
                this.q1 = typeCast(ITimeRangeSelectorAxis_$type, this.qg);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bz(this);
                }
                if (d != null) {
                    d.cs(this);
                }
                this.qx.bx.e(this.fv);
                if (this.q2 != null) {
                    this.q2.c0();
                }
                {
                    this.ml(false);
                }
                this.ls();
                break;
            case "TransitionProgress":
                this.qm.c(this.g2, this.qk, this.qi);
                if (this.cx(this.b0)) {
                    return;
                }
                if (this.g2 == 1) {
                    this.qi.v();
                    this.s9(this.qi, this.qx);
                    if (this.e2) {
                        this.e2 = false;
                        this.k1();
                        this.ce.r = truncate(this.go());
                        this.ce.b = this.cf;
                    }
                }
                else {
                    this.s9(this.qm, this.qx);
                }
                if (this.cd != null) {
                    this.cd.oa(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.ml(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.rh = this.rk();
                this.ml(false);
                break;
            case "CategoryMode":
                if (this.qg != null) {
                    this.qg.l4(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.rj = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.ri = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.p9 = function (a, b, c) {
        if (b < a || a < 0 || a > this.ck.count || b < 0 || b > this.ck.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cm;
        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.ck.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.sd = function (a) {
        return a.bx.b;
    };
    FinancialSeries.prototype.sf = function (a) {
        return a.bx.c;
    };
    FinancialSeries.prototype.p8 = function (a, b) {
        return this.p9(a, b, this.q2);
    };
    FinancialSeries.prototype.get_dy = function () {
        return true;
    };
    FinancialSeries.prototype.ky = function () {
        _super.prototype.ky.call(this);
        this.q0 = null;
    };
    FinancialSeries.prototype.aw = function (a, b, c) {
        if (this.c2 && this.eg(this.bk) && !c) {
            var d = this.qz(a, b, this.q0);
            this.q0 = d;
            return d;
        }
        else {
            var e = this.qy(a, b, this.q0);
            this.q0 = e;
            return e;
        }
    };
    FinancialSeries.prototype.sh = function (a) {
        var b = this.qj();
        var c = this.b0.bu;
        var d = this.b0.bv;
        var e = this.qg;
        var f = 0;
        if (e.co) {
            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.qz = function (a, b, c) {
        var d = this.ck.count;
        var e = this.qx.bx.c;
        var f = this.qx.bx.d;
        var g = this.qx.bx.b;
        var h = this.qg;
        var i = -1;
        var j = -1;
        if (h.cm) {
            var k = this.qj();
            var l = this.sh(b);
            i = l;
            j = l;
        }
        else {
            var m = this.hf(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.h == i && c.g == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.b = this;
        n.h = i;
        n.g = j;
        return n;
    };
    FinancialSeries.prototype.qy = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.h = 0;
        d.g = this.ck.count - 1;
        d.d = true;
        if (c != null && c.h == d.h && c.g == d.g) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.rk = function () {
        return this.rm;
    };
    FinancialSeries.prototype.f7 = function (a) {
        var b = this.b0.bv;
        var c = this.b0.bu;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.qg != null) {
            var e = this.getEffectiveViewport1(this.b0);
            var f = new ScalerParams(0, b, c, this.qg.cg, e);
            var g = this.pv(this.b0);
            var h = this.qg.el(g.left, f);
            var i = this.qg.el(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.qg.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.hf = function (a) {
        return truncate(Math.round(this.f7(a)));
    };
    FinancialSeries.prototype.get_ea = function () {
        return typeCast(ISortingAxis_$type, this.qg) !== null;
    };
    FinancialSeries.prototype.ar = function () {
        return this.qg;
    };
    FinancialSeries.prototype.hh = function (a) {
        var b = this.b0.bv;
        var c = this.b0.bu;
        var d = this.getEffectiveViewport1(this.b0);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.qg.cg, d);
        var g = typeCast(ISortingAxis_$type, this.qg);
        var h = this.pv(this.b0);
        var i = h.left;
        var j = h.right;
        var k = this.pl(a).x;
        var l = this.qg.el(k, f);
        var m = this.qg.el(i, f);
        var n = this.qg.el(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.hv = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.qg) !== null) {
            b = this.hh(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.hf(a);
        }
        return b >= 0 && this.ck != null && b < this.ck.count ? this.ck.item(b) : null;
    };
    FinancialSeries.prototype.qj = function () {
        var a = this.qi;
        if (this.cv()) {
            if (this.ce.g) {
                this.ce.t();
            }
            a = this.qm;
        }
        return a;
    };
    FinancialSeries.prototype.r7 = function (a, b, c) {
        if (this.qg == null) {
            return 0;
        }
        return this.qg.k4(a, b, c, this.index);
    };
    FinancialSeries.prototype.es = function () {
        return this.rn;
    };
    FinancialSeries.prototype.qq = function () {
        return 11;
    };
    FinancialSeries.prototype.b9 = function () {
        return 3;
    };
    FinancialSeries.prototype.s9 = function (a, b) {
        this.pu = a.aa;
        b.au();
    };
    FinancialSeries.prototype.s7 = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.fb = function (a, b, c) {
        var d = _super.prototype.fb.call(this, a, b, c);
        var e = c;
        if (this.ck == null || this.ck.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.qg == null || this.q2 == null || e.bx.b < 1 || this.qg.bh == null || this.q2.bh == null || this.q2.lv == this.q2.lu || this.qg.itemsSource == null || this.qg.le < 1) {
            e.bx.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.b0.bv;
        a = this.b0.bu;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.sb = function (a) {
        var b = 0;
        var c = a.bv;
        var d = a.bu;
        var e = this.getEffectiveViewport1(this.b0);
        if (!c.isEmpty && !d.isEmpty && this.q2 != null) {
            var f = new ScalerParams(0, c, d, this.q2.cg, e);
            f.b = this.ge();
            b = this.q2.ei(this.q2.l5, f);
        }
        return b;
    };
    FinancialSeries.prototype.k1 = function () {
        _super.prototype.k1.call(this);
        this.qk.v();
        this.qi.v();
        this.qm.v();
    };
    FinancialSeries.prototype.mm = function (a) {
        var _this = this;
        _super.prototype.mm.call(this, a);
        this.qx.bx.e(this.fv);
        if (this.cx(this.b0)) {
            return;
        }
        if (this.eu) {
            if (this.cv()) {
                this.s9(this.qm, this.qx);
            }
            else {
                this.s9(this.qi, this.qx);
            }
            return;
        }
        if (this.ep(a)) {
            var b = this.qk;
            if (this.cv()) {
                if (this.ce.g) {
                    this.ce.t();
                }
                this.qk = this.qm;
                this.qm = b;
            }
            else {
                this.qk = this.qi;
                this.qi = b;
            }
            this.s7(this.qi, this.qx);
            if (this.e4) {
                this.ce.w();
                this.ce.r = truncate(this.gp());
                this.ce.b = this.cg != null ? this.cg : this.cf;
                this.qs.p(this.qk, this.qi, this.isVertical, this.qg, this.q2, this.qr, this.qq(), this.ca, this.b9(), function () { return _this.sb(_this.qx); }, this.qx.bu);
            }
            this.kw();
            this.mu();
            if (this.e4) {
                this.e3 = false;
                this.e2 = true;
            }
        }
        else {
            this.s7(this.qi, this.qx);
            this.s9(this.qi, this.qx);
        }
    };
    FinancialSeries.prototype.rp = 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.ra == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.rb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.rc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.q9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.re == 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, "rq", {
        get: function () {
            return this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.rl = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.s4 = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "ry", {
        get: function () {
            return this.rv();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._rv = 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.rl())
                        return [3 /*break*/, 8];
                    b = this.qt(0, this.ck.count);
                    this.s4(new FinancialEventArgs(0, this.ck.count, b, this.qu(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.rq && this.qg.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.ck.count;
                    e = this.qg.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.ra.item(e.item(f)) + this.rb.item(e.item(f)) + this.q9.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.ck.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.ra.item(h) + this.rb.item(h) + this.q9.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.rv = function () {
        var _this = this;
        return toEnum(function () { return _this._rv(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "rx", {
        get: function () {
            return this.ru();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._ru = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.rq && this.qg.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.ra.count;
                    b = this.qg.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.sc(this.ra.item(b.item(0)) - this.rb.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.sc(this.ra.item(b.item(c)) - this.rb.item(b.item(c))), Math.max(this.sc(Math.abs(this.ra.item(b.item(c)) - this.q9.item(b.item(c - 1)))), this.sc(Math.abs(this.rb.item(b.item(c)) - this.q9.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.ra.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.sc(this.ra.item(0) - this.rb.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.sc(this.ra.item(e) - this.rb.item(e)), Math.max(this.sc(Math.abs(this.ra.item(e) - this.q9.item(e - 1))), this.sc(Math.abs(this.rb.item(e) - this.q9.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.ru = function () {
        var _this = this;
        return toEnum(function () { return _this._ru(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "rw", {
        get: function () {
            return this.rt();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._rt = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.rq && this.qg.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.rb.count;
                    b = this.qg.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.sc(this.rb.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.sc(this.rb.item(b.item(c))), this.sc(this.q9.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.rb.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.sc(this.rb.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.sc(this.rb.item(e)), this.sc(this.q9.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.rt = function () {
        var _this = this;
        return toEnum(function () { return _this._rt(); });
    };
    FinancialSeries.prototype.r0 = function (a) {
        if (a == null) {
            return null;
        }
        if (this.rq && this.qg.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.qg.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.rz = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.ck != null && !this.rf) {
            this.rf = true;
            var b = this.qt(0, this.ck.count);
            this.rf = false;
            var c = new FinancialEventArgs(0, this.ck.count, b, this.qu(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.rc == null) {
            return null;
        }
        if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
            if (this.r4 != null) {
                return this.r4.asArray();
            }
            var a = new List$1(Number_$type, 2, this.rc.count);
            var b = this.qg.i$b;
            var c = this.rc.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r4 = a;
            return this.r4.asArray();
        }
        else {
            return this.rc.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.ra == null) {
            return null;
        }
        if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
            if (this.r2 != null) {
                return this.r2.asArray();
            }
            var a = new List$1(Number_$type, 2, this.ra.count);
            var b = this.qg.i$b;
            var c = this.ra.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r2 = a;
            return this.r2.asArray();
        }
        else {
            return this.ra.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.rb == null) {
            return null;
        }
        if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
            if (this.r3 != null) {
                return this.r3.asArray();
            }
            var a = new List$1(Number_$type, 2, this.rb.count);
            var b = this.qg.i$b;
            var c = this.rb.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r3 = a;
            return this.r3.asArray();
        }
        else {
            return this.rb.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.q9 == null) {
            return null;
        }
        if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
            if (this.r1 != null) {
                return this.r1.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q9.count);
            var b = this.qg.i$b;
            var c = this.q9.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r1 = a;
            return this.r1.asArray();
        }
        else {
            return this.q9.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.re == null) {
            return null;
        }
        if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
            if (this.r5 != null) {
                return this.r5.asArray();
            }
            var a = new List$1(Number_$type, 2, this.re.count);
            var b = this.qg.i$b;
            var c = this.re.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r5 = a;
            return this.r5.asArray();
        }
        else {
            return this.re.asArray();
        }
    };
    FinancialSeries.prototype.k3 = function (a, b, c, d) {
        _super.prototype.k3.call(this, a, b, c, d);
        if (this.qg == null || !(typeCast(ISortingAxis_$type, this.qg) !== null)) {
            return;
        }
        var e = this.qg.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.r4 != null) {
                        this.r4.insert(f, this.rc.item(g));
                    }
                    if (this.r2 != null) {
                        this.r2.insert(f, this.ra.item(g));
                    }
                    if (this.r3 != null) {
                        this.r3.insert(f, this.rb.item(g));
                    }
                    if (this.r1 != null) {
                        this.r1.insert(f, this.q9.item(g));
                    }
                    if (this.r5 != null) {
                        this.r5.insert(f, this.re.item(g));
                    }
                }
                break;
            case 0:
                if (this.r4 != null) {
                    this.r4.v(b, c);
                }
                if (this.r2 != null) {
                    this.r2.v(b, c);
                }
                if (this.r3 != null) {
                    this.r3.v(b, c);
                }
                if (this.r1 != null) {
                    this.r1.v(b, c);
                }
                if (this.r5 != null) {
                    this.r5.v(b, c);
                }
                break;
            case 4:
                if (this.r4 != null) {
                    this.r4 = new List$1(Number_$type, 0);
                }
                if (this.r2 != null) {
                    this.r2 = new List$1(Number_$type, 0);
                }
                if (this.r3 != null) {
                    this.r3 = new List$1(Number_$type, 0);
                }
                if (this.r1 != null) {
                    this.r1 = new List$1(Number_$type, 0);
                }
                if (this.r5 != null) {
                    this.r5 = 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.r4 != null) {
                        this.r4._inner[h] = this.rc.item(i);
                    }
                    if (this.r2 != null) {
                        this.r2._inner[h] = this.ra.item(i);
                    }
                    if (this.r3 != null) {
                        this.r3._inner[h] = this.rb.item(i);
                    }
                    if (this.r1 != null) {
                        this.r1._inner[h] = this.q9.item(i);
                    }
                    if (this.r5 != null) {
                        this.r5._inner[h] = this.re.item(i);
                    }
                }
                break;
        }
        this.ta();
        this.m5();
    };
    FinancialSeries.prototype.qt = function (a, b) {
        var _this = this;
        var c = this.r0(this.rc);
        var d = this.r0(this.q9);
        var e = this.r0(this.ra);
        var f = this.r0(this.rb);
        var g = this.r0(this.re);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.ry), _this.rz());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.rx), ((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.rw), ((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.ck != null ? _this.ck.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.sc = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.qu = 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.fg;
            $ret.j = Series.ff;
            $ret.i = runOn(_this, _this.sc);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.qg;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.mn = function (a, b) {
        _super.prototype.mn.call(this, a, b);
        if (!this.e1) {
            this.b0.a2(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bz);
        this.b0.a2(b);
        c.bx.e(this.fv);
        if (this.cx(this.bz)) {
            return;
        }
        if (!this.ev) {
            this.s7(this.ql, c);
        }
        this.ev = false;
        this.s9(this.ql, c);
        this.e1 = false;
    };
    FinancialSeries.prototype.mk = function (a, b, c, d, e) {
        _super.prototype.mk.call(this, a, b, c, d, e);
        var f = this.a6.a$h.item(d);
        var g = f;
        g.bx.e(this.fv);
        f.a1(c);
        if (this.cx(g)) {
            return;
        }
        if (this.qh == null) {
            this.qh = new CategoryFrame(3);
        }
        this.qh.u();
        this.s7(this.qh, g);
        this.s9(this.qh, g);
    };
    FinancialSeries.prototype.an = function (a) {
        if (this.qg == a) {
            return this.q2;
        }
        if (this.q2 == a) {
            return this.qg;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.qg);
        return b != null ? b.preferredCategoryMode(this) : this.qo;
    };
    Object.defineProperty(FinancialSeries.prototype, "qo", {
        get: function () {
            return this.qn;
        },
        set: function (a) {
            var b = this.qo;
            if (a != b) {
                this.qn = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qo));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_d4 = function () {
        return true;
    };
    FinancialSeries.prototype.mq = function (a, b) {
        _super.prototype.mq.call(this, a, b);
        this.tm = a;
    };
    FinancialSeries.prototype.ta = function () {
        this.f3 = this.q9 == null || this.q9.count == 0 ? NaN : this.q9.item(this.q9.count - 1);
    };
    FinancialSeries.prototype.hx = function (a) {
        if (this.q1 != null && a != null) {
            if (this.q3 == null || this.q3.propertyName != this.q1.dateTimeMemberPath) {
                this.q3 = new FastReflectionHelper(false, this.q1.dateTimeMemberPath);
            }
            var b = this.q3.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.q1.itemLabelFormat());
            }
        }
        return _super.prototype.hx.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:sk:tb', [2, null], 'HighMemberPath:sn:tc', [2, null], 'IsCustomCategoryStyleAllowed:rm:td', [0, false], 'IsTransitionInEnabled:rn:te', [0, false], 'LowMemberPath:ss:tf', [2, null], 'NegativeBrush:tm:tg', [Brush.$, null], 'OpenMemberPath:sw:th', [2, null], 'TransitionInMode:qr:ti', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:s0:tj', [2, null], 'XAxis:qg:tk', [CategoryAxisBase.$, null], 'YAxis:q2:tl', [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.bz = null;
        _this.bx = null;
        _this.b1 = 0;
        _this.b1 = -1;
        _this.bz = a;
        _this.bx = _this.by();
        return _this;
    }
    FinancialSeriesView.prototype.b0 = function (a) {
        if (this.b1 != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.b2 = function (a) {
        this.b1 = a.t;
    };
    FinancialSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bz.qg.cd) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bz.qg.fz != null) {
            a += "<span>${item." + this.bz.qg.fz + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a6.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.bz.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.sw + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.sn + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.ss + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.sk + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bz.s0)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.s0 + "}</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.pf = a;
        this.e.gy = 5;
        this.e.gz = 2;
        this.e.g0 = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
