/*
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 { EventArgs, Base, Type, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, Delegate_$type } from "igniteui-angular-core/ES2015/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core/ES2015/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-angular-core/ES2015/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core/ES2015/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core/ES2015/Brush";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
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/ES2015/FastReflectionHelper";
import { List$1 } from "igniteui-angular-core/ES2015/List$1";
import { Dictionary$2 } from "igniteui-angular-core/ES2015/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-core/ES2015/IFastItemsSource";
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/ES2015/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { stringIsNullOrEmpty } from "igniteui-angular-core/ES2015/string";
import { dateToStringFormat } from "igniteui-angular-core/ES2015/dateExtended";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core/ES2015/SRProvider";
import { Color } from "igniteui-angular-core/ES2015/Color";
/**
 * @hidden
 */
export class FinancialEventArgs extends EventArgs {
    constructor(a, b, c, d, e) {
        super();
        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;
        }
    }
    get position() {
        return this._position;
    }
    set position(a) {
        this._position = a;
    }
    get count() {
        return this._count;
    }
    set count(a) {
        this._count = a;
    }
    get dataSource() {
        return this._dataSource;
    }
    set dataSource(a) {
        this._dataSource = a;
    }
    get supportingCalculations() {
        return this._supportingCalculations;
    }
    set supportingCalculations(a) {
        this._supportingCalculations = a;
    }
    get basedOn() {
        return this._basedOn;
    }
    set basedOn(a) {
        this._basedOn = a;
    }
}
FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
/**
 * @hidden
 */
export class FinancialBucketCalculator extends Base {
    constructor(a) {
        super();
        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;
    }
    getBucket(a) {
        return null;
    }
    getBucketWithoutUnknowns(a) {
        return this.getBucket(a);
    }
    getErrorBucket(a, b) {
        return NaN;
    }
    getBucketInfo(a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.bw.eu;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    }
    e(a) {
        let b = this.a.bs;
        let c = this.a.br;
        let d = this.a.br;
        if (this.a.bw != null) {
            d = this.a.bw.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bw.l7 == null) {
            this.b = 0;
            return;
        }
        let e = (this.a.bw.l7 != null) ? this.a.bw.l7.b8 : false;
        let f = new ScalerParams(0, b, c, e, d);
        let g = this.a.bw.lp(this.a);
        let h = typeCast(ISortingAxis_$type, this.a.bw.l7);
        if (h == null || h.i$b == null) {
            let i = Math.floor(this.a.bw.l7.dy(g.left, f));
            let j = Math.ceil(this.a.bw.l7.dy(g.right, f));
            if (this.a.bw.l7.b8) {
                j = Math.ceil(this.a.bw.l7.dy(g.left, f));
                i = Math.floor(this.a.bw.l7.dy(g.right, f));
            }
            let 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;
        }
    }
    cacheValues() {
    }
    unCacheValues() {
    }
}
FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
/**
 * @hidden
 */
export class FinancialSeries extends Series {
    constructor() {
        super();
        this.m0 = null;
        this.mw = null;
        this.my = null;
        this.mu = null;
        this.m3 = null;
        this.m7 = false;
        this.assigningCategoryStyle = null;
        this.mf = null;
        this.ni = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        this.nj = new Dictionary$2(String_$type, String_$type, 0);
        this.m6 = false;
        this.mq = null;
        this.ma = null;
        this.mc = null;
        this.l9 = null;
        this.mi = null;
        this.typical = null;
        this.typicalBasedOn = null;
        this.m5 = false;
        this.nv = null;
        this.nt = null;
        this.nu = null;
        this.ns = null;
        this.nw = null;
        this.mb = null;
        this.l8 = null;
        this.md = 0;
        this.mr = null;
        this.mt = null;
        this.mf = new CategorySeriesRenderManager();
        this.m7 = false;
        this.mi = new CategoryTransitionSourceFramePreparer();
        this.mb = new CategoryFrame(3);
        this.ab = FinancialSeries.$;
        this.me = 0;
    }
    it(a) {
        super.it(a);
        this.mn = a;
    }
    get_cr() {
        return true;
    }
    ag() {
        return [this.l7, this.ms];
    }
    fs(a, b) {
        let c = this.gu(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.ft(a, b, this.on);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.ft(a, b, this.oe);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.ft(a, b, this.oj);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.ft(a, b, this.ob);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.ft(a, b, this.or);
        }
        return super.fs(a, b);
    }
    n7() {
        return 2;
    }
    n5() {
        return 4;
    }
    ah(a) {
        let b = this.aj(this.l7, this.l9.f, this.n4(this.bi), this.n6(this.bi), this.ln(a), true);
        if (b == null) {
            return null;
        }
        let c = b[0];
        let d = b[1];
        let e = new Array(1);
        let f = new Array(2);
        let g = this.n7();
        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;
    }
    ai(a) {
        let b = this.aj(this.l7, this.l9.f, this.n4(this.bi), this.n6(this.bi), this.ln(a), true);
        if (b == null) {
            return null;
        }
        let c = b[0];
        let d = b[1];
        let e = new Array(1);
        let 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;
    }
    k8() {
        return this.pd;
    }
    ht() {
        super.ht();
        this.l7 = null;
        this.ms = null;
    }
    get m1() {
        return this.m0;
    }
    set m1(a) {
        if (this.m0 != a) {
            let b = this.m0;
            this.m0 = a;
            this.raisePropertyChanged("OpenColumn", b, this.m0);
        }
    }
    get mx() {
        return this.mw;
    }
    set mx(a) {
        if (this.mw != a) {
            let b = this.mw;
            this.mw = a;
            this.raisePropertyChanged("HighColumn", b, this.mw);
        }
    }
    get mz() {
        return this.my;
    }
    set mz(a) {
        if (this.my != a) {
            let b = this.my;
            this.my = a;
            this.raisePropertyChanged("LowColumn", b, this.my);
        }
    }
    get mv() {
        return this.mu;
    }
    set mv(a) {
        if (this.mu != a) {
            let b = this.mu;
            this.mu = a;
            this.raisePropertyChanged("CloseColumn", b, this.mu);
        }
    }
    get m4() {
        return this.m3;
    }
    set m4(a) {
        if (this.m3 != a) {
            let b = this.m3;
            this.m3 = a;
            this.raisePropertyChanged("VolumeColumn", b, this.m3);
        }
    }
    nf() {
        return (this.assigningCategoryStyle != null && this.m7) || this.cu;
    }
    oz(a) {
        if (this.assigningCategoryStyle != null && this.m7) {
            this.assigningCategoryStyle(this, a);
        }
    }
    ox(a, b, c, d, e, f) {
        let g = this.b9;
        this.mf.ac(a, b, c, d, e, f, g);
        let h = this.mf.c;
        let i = null;
        let j = this.bz;
        if (g && this.bs != null) {
            i = this.bs.az.getHighlightingInfo(this, j, d, h.m, h.l, false);
            h.b = i;
        }
        h.f = f;
        this.oz(h);
        this.mf.aa(i, f, g);
    }
    nx(a) {
        return this.ed(a, this.l7);
    }
    fe(a, b) {
        return this.ff(a, b, this.l7, runOn(this, this.nx), new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4));
    }
    fc(a, b) {
        return this.fd(a, b, this.l7, runOn(this, this.nx), new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4));
    }
    d9(a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        let f = this.l7.jx;
        return this.ea(a, b, this.l7, d, e, f, runOn(this, this.nx));
    }
    getOffsetValue() {
        return this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.l7.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    lk(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, null, null, null);
    }
    en(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4), a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    ej(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mx, a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    el(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mz, a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    nz(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mv, a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    n0(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.m1, a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    n1(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ny(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.m4, a, this.l7, f, e, runOn(this, this.nx), b, c);
    }
    lg(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.ej), (d, e) => this.ff(d, e, this.l7, runOn(this, this.nx), this.mx), (d, e) => this.fd(d, e, this.l7, runOn(this, this.nx), this.mx));
    }
    li(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.el), (d, e) => this.ff(d, e, this.l7, runOn(this, this.nx), this.mz), (d, e) => this.fd(d, e, this.l7, runOn(this, this.nx), this.mz));
    }
    pf(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.n0), (d, e) => this.ff(d, e, this.l7, runOn(this, this.nx), this.m1), (d, e) => this.fd(d, e, this.l7, runOn(this, this.nx), this.m1));
    }
    pe(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.nz), (d, e) => this.ff(d, e, this.l7, runOn(this, this.nx), this.mv), (d, e) => this.fd(d, e, this.l7, runOn(this, this.nx), this.mv));
    }
    pg(a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.n1), (d, e) => this.ff(d, e, this.l7, runOn(this, this.nx), this.m4), (d, e) => this.fd(d, e, this.l7, runOn(this, this.nx), this.m4));
    }
    ia() {
        super.ia();
        if (this.l7 != null) {
            this.l7.g5(false);
        }
        if (this.ms != null) {
            this.ms.g5(false);
        }
    }
    js(a, b) {
        this.mn.bu.e(this.eu);
        this.jc(false);
    }
    jr(a, b) {
        if (this.dm && this.ez < 0.05) {
            this.dn = true;
        }
        this.mn.bu.e(this.eu);
        this.jc(false);
    }
    m2(a, b, c) {
        let d = this.bw(b);
        this.ni.addItem(d, b);
        this.nj.addItem(b, c);
        return d;
    }
    ow(a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        let c = this.ni.item(b);
        this.nj.removeItem(c);
        this.ni.removeItem(b);
    }
    iy(a, b, c, d) {
        super.iy(a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.l7 != null) {
                        this.l7.bv(this);
                    }
                    if (this.ms != null) {
                        this.ms.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.l7 != null) {
                        this.l7.ch(this);
                    }
                    if (this.ms != null) {
                        this.ms.ch(this);
                    }
                }
                this.mn.bu.e(this.eu);
                this.jc(false);
                break;
            case "FastItemsSource":
                this.m6 = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.ow(typeCast(IFastItemsSource_$type, c), this.m1);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mx);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mz);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mv);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.m4);
                    this.m1 = null;
                    this.mx = null;
                    this.mz = null;
                    this.mv = null;
                    this.m4 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.on) == false) {
                        this.m1 = this.m2(typeCast(IFastItemsSource_$type, d), this.on, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.oe) == false) {
                        this.mx = this.m2(typeCast(IFastItemsSource_$type, d), this.oe, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.oj) == false) {
                        this.mz = this.m2(typeCast(IFastItemsSource_$type, d), this.oj, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.ob) == false) {
                        this.mv = this.m2(typeCast(IFastItemsSource_$type, d), this.ob, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.or) == false) {
                        this.m4 = this.m2(typeCast(IFastItemsSource_$type, d), this.or, "VolumeColumn");
                    }
                }
                this.m6 = false;
                if (this.ms != null && !this.ms.ck()) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.ow(this.bz, this.m1);
                    this.m1 = this.m2(this.bz, this.on, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mx);
                    this.mx = this.m2(this.bz, this.oe, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mz);
                    this.mz = this.m2(this.bz, this.oj, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mv);
                    this.mv = this.m2(this.bz, this.ob, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                this.o1();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.ow(this.bz, this.m4);
                    this.m4 = this.m2(this.bz, this.or, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mn.bu.e(this.eu);
                this.jc(false);
                this.ij();
                this.mr = typeCast(ITimeRangeSelectorAxis_$type, this.l7);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mn.bu.e(this.eu);
                if (this.ms != null) {
                    this.ms.ck();
                }
                {
                    this.jc(false);
                }
                this.ij();
                break;
            case "TransitionProgress":
                this.mc.c(this.ez, this.ma, this.l9);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ez == 1) {
                    this.l9.v();
                    this.o0(this.l9, this.mn);
                    if (this.dm) {
                        this.dm = false;
                        this.hw();
                        this.bt.r = truncate(this.eq());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.o0(this.mc, this.mn);
                }
                if (this.bs != null) {
                    this.bs.jj(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.jc(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.m7 = this.na();
                this.jc(false);
                break;
            case "CategoryMode":
                if (this.l7 != null) {
                    this.l7.km(true);
                }
                break;
        }
    }
    m9(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    m8(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    l0(a, b, c) {
        if (b < a || a < 0 || a > this.bz.count || b < 0 || b > this.bz.count || c == null) {
            return null;
        }
        let d = new Array((b - a) + 1);
        let e = c.cc;
        let f = null;
        if (e) {
            f = c.i$b;
        }
        for (let g = a; g <= b; g++) {
            let h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.bz.item(g);
        }
        return d;
    }
    n4(a) {
        return a.bu.b;
    }
    n6(a) {
        return a.bu.c;
    }
    lz(a, b) {
        return this.l0(a, b, this.ms);
    }
    get_nb() {
        return false;
    }
    get nb() {
        return this.get_nb();
    }
    get_cv() {
        return true;
    }
    at(a, b) {
        if (this.nb) {
            let c = this.mp(a, b, this.mq);
            this.mq = c;
            return c;
        }
        else {
            let d = this.mo(a, b, this.mq);
            this.mq = d;
            return d;
        }
    }
    n8(a) {
        let b = this.l9;
        if (this.ca()) {
            b = this.mc;
        }
        let c = this.bi.br;
        let d = this.bi.bs;
        let e = this.l7;
        let f = 0;
        if (e.ce) {
            let g = (a.y - d.top) / d.height;
            f = g * c.height + c.top;
        }
        else {
            let h = (a.x - d.left) / d.width;
            f = h * c.width + c.left;
        }
        let i = b.f.count;
        let j = 0;
        for (j = 0; j < i; j++) {
            let k = b.f._inner[j];
            let 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;
    }
    mp(a, b, c) {
        let d = this.bz.count;
        let e = this.mn.bu.c;
        let f = this.mn.bu.d;
        let g = this.mn.bu.b;
        let h = this.l7;
        let i = -1;
        let j = -1;
        if (h.cc) {
            let k = this.l9;
            if (this.ca()) {
                k = this.mc;
            }
            let l = this.n8(b);
            i = l;
            j = l;
        }
        else {
            let m = this.e8(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.f == i && c.e == j) {
            return c;
        }
        let n = new HighlightingInfo();
        n.b = this;
        n.f = i;
        n.e = j;
        return n;
    }
    mo(a, b, c) {
        let d = new HighlightingInfo();
        d.b = this;
        d.f = 0;
        d.e = this.bz.count - 1;
        if (c != null && c.f == d.f && c.e == d.e) {
            return c;
        }
        return d;
    }
    na() {
        return this.nd;
    }
    eb(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = -1;
        if (!b.isEmpty && !c.isEmpty && this.l7 != null) {
            let e = this.getEffectiveViewport1(this.bi);
            let f = new ScalerParams(0, b, c, this.l7.b8, e);
            let g = this.lp(this.bi);
            let h = this.l7.dy(g.left, f);
            let i = this.l7.dy(g.right, f);
            let j = (a.x - b.left) / b.width;
            let k = h + (j * (i - h));
            if (this.l7.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    }
    e8(a) {
        return truncate(Math.round(this.eb(a)));
    }
    get_c1() {
        return typeCast(ISortingAxis_$type, this.l7) !== null;
    }
    ap() {
        return this.l7;
    }
    fa(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = this.getEffectiveViewport1(this.bi);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        let e = new Rect(0, 0, 0, 1, 1);
        let f = new ScalerParams(0, b, c, this.l7.b8, d);
        let g = typeCast(ISortingAxis_$type, this.l7);
        let h = this.lp(this.bi);
        let i = h.left;
        let j = h.right;
        let k = this.lf(a).x;
        let l = this.l7.dy(k, f);
        let m = this.l7.dy(i, f);
        let n = this.l7.dy(j, f);
        l = Math.max(m, Math.min(n, l));
        let o = g.i$f(l);
        return o;
    }
    fp(a) {
        let b = 0;
        if (typeCast(ISortingAxis_$type, this.l7) !== null) {
            b = this.fa(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e8(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    ny(a, b, c) {
        if (this.l7 == null) {
            return 0;
        }
        return this.l7.jr(a, b, c, this.fh);
    }
    dc() {
        return this.ne;
    }
    mg() {
        return 11;
    }
    bo() {
        return 3;
    }
    o0(a, b) {
        this.lo = a.aa;
        b.ar();
    }
    oy(a, b) {
        a.u();
    }
    dw(a, b, c) {
        let d = super.dw(a, b, c);
        let e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.l7 == null || this.ms == null || e.bu.b < 1 || this.l7.bf == null || this.ms.bf == null || this.ms.j3 == this.ms.j2 || this.l7.itemsSource == null || this.l7.jx < 1) {
            e.bu.b = 0;
            d = false;
        }
        return d;
    }
    getViewInfo(a, b) {
        b = this.bi.bs;
        a = this.bi.br;
        return {
            p0: a,
            p1: b
        };
    }
    n2(a) {
        let b = 0;
        let c = a.bs;
        let d = a.br;
        let e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.ms != null) {
            let f = new ScalerParams(0, c, d, this.ms.b8, e);
            f.b = this.eh();
            b = this.ms.dv(this.ms.kd, f);
        }
        return b;
    }
    hw() {
        super.hw();
        this.ma.v();
        this.l9.v();
        this.mc.v();
    }
    jd(a) {
        super.jd(a);
        this.mn.bu.e(this.eu);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.de) {
            if (this.ca()) {
                this.o0(this.mc, this.mn);
            }
            else {
                this.o0(this.l9, this.mn);
            }
            return;
        }
        if (this.da(a)) {
            let b = this.ma;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.ma = this.mc;
                this.mc = b;
            }
            else {
                this.ma = this.l9;
                this.l9 = b;
            }
            this.oy(this.l9, this.mn);
            if (this.dp) {
                this.bt.w();
                this.bt.r = truncate(this.er());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.mi.p(this.ma, this.l9, this.isVertical, this.l7, this.ms, this.mh, this.mg(), this.bp, this.bo(), () => this.n2(this.mn), this.mn.br);
            }
            this.hs();
            this.jk();
            if (this.dp) {
                this.dn = false;
                this.dm = true;
            }
        }
        else {
            this.oy(this.l9, this.mn);
            this.o0(this.l9, this.mn);
        }
    }
    ng(a) {
        for (let b of fromEnum(a)) {
            switch (b) {
                case "HighColumn":
                    if (this.mx == null) {
                        return false;
                    }
                    break;
                case "LowColumn":
                    if (this.mz == null) {
                        return false;
                    }
                    break;
                case "OpenColumn":
                    if (this.m1 == null) {
                        return false;
                    }
                    break;
                case "CloseColumn":
                    if (this.mv == null) {
                        return false;
                    }
                    break;
                case "VolumeColumn":
                    if (this.m4 == null) {
                        return false;
                    }
                    break;
            }
        }
        return true;
    }
    get nh() {
        return this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null;
    }
    nc() {
        return this.typical != null;
    }
    ov(a) {
        this.typical(this, a);
    }
    get np() {
        return this.nm();
    }
    *_nm() {
        let a = false;
        if (this.nc()) {
            let b = this.mj(0, this.bz.count);
            this.ov(new FinancialEventArgs(0, this.bz.count, b, this.mk(b), this));
            if (b.typicalColumn != null) {
                a = true;
                for (let c of fromEnum(b.typicalColumn)) {
                    yield c;
                }
            }
        }
        if (!a) {
            if (this.nh && this.l7.i$b != null) {
                let d = this.bz.count;
                let e = this.l7.i$b;
                for (let f = 0; f < d; ++f) {
                    yield (this.mx.item(e.item(f)) + this.mz.item(e.item(f)) + this.mv.item(e.item(f))) / 3;
                }
            }
            else {
                let g = this.bz.count;
                for (let h = 0; h < g; ++h) {
                    yield (this.mx.item(h) + this.mz.item(h) + this.mv.item(h)) / 3;
                }
            }
        }
    }
    nm() {
        return toEnum(() => this._nm());
    }
    get no() {
        return this.nl();
    }
    *_nl() {
        if (this.nh && this.l7.i$b != null) {
            let a = this.mx.count;
            let b = this.l7.i$b;
            if (a > 0) {
                yield this.n3(this.mx.item(b.item(0)) - this.mz.item(b.item(0)));
            }
            for (let c = 1; c < a; ++c) {
                yield Math.max(this.n3(this.mx.item(b.item(c)) - this.mz.item(b.item(c))), Math.max(this.n3(Math.abs(this.mx.item(b.item(c)) - this.mv.item(b.item(c - 1)))), this.n3(Math.abs(this.mz.item(b.item(c)) - this.mv.item(b.item(c - 1))))));
            }
        }
        else {
            let d = this.mx.count;
            if (d > 0) {
                yield this.n3(this.mx.item(0) - this.mz.item(0));
            }
            for (let e = 1; e < d; ++e) {
                yield Math.max(this.n3(this.mx.item(e) - this.mz.item(e)), Math.max(this.n3(Math.abs(this.mx.item(e) - this.mv.item(e - 1))), this.n3(Math.abs(this.mz.item(e) - this.mv.item(e - 1)))));
            }
        }
    }
    nl() {
        return toEnum(() => this._nl());
    }
    get nn() {
        return this.nk();
    }
    *_nk() {
        if (this.nh && this.l7.i$b != null) {
            let a = this.mz.count;
            let b = this.l7.i$b;
            if (a > 0) {
                yield this.n3(this.mz.item(b.item(0)));
            }
            for (let c = 1; c < a; c++) {
                yield Math.min(this.n3(this.mz.item(b.item(c))), this.n3(this.mv.item(b.item(c - 1))));
            }
        }
        else {
            let d = this.mz.count;
            if (d > 0) {
                yield this.n3(this.mz.item(0));
            }
            for (let e = 1; e < d; e++) {
                yield Math.min(this.n3(this.mz.item(e)), this.n3(this.mv.item(e - 1)));
            }
        }
    }
    nk() {
        return toEnum(() => this._nk());
    }
    nr(a) {
        if (a == null) {
            return null;
        }
        if (this.nh && this.l7.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.l7.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    }
    nq() {
        let a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.bz != null && !this.m5) {
            this.m5 = true;
            let b = this.mj(0, this.bz.count);
            this.m5 = false;
            let c = new FinancialEventArgs(0, this.bz.count, b, this.mk(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    }
    getOpenColumnAsArray() {
        if (this.m1 == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nv != null) {
                return this.nv.asArray();
            }
            let a = new List$1(Number_$type, 2, this.m1.count);
            let b = this.l7.i$b;
            let c = this.m1.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nv = a;
            return this.nv.asArray();
        }
        else {
            return this.m1.asArray();
        }
    }
    getHighColumnAsArray() {
        if (this.mx == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nt != null) {
                return this.nt.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mx.count);
            let b = this.l7.i$b;
            let c = this.mx.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nt = a;
            return this.nt.asArray();
        }
        else {
            return this.mx.asArray();
        }
    }
    getLowColumnAsArray() {
        if (this.mz == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nu != null) {
                return this.nu.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mz.count);
            let b = this.l7.i$b;
            let c = this.mz.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nu = a;
            return this.nu.asArray();
        }
        else {
            return this.mz.asArray();
        }
    }
    getCloseColumnAsArray() {
        if (this.mv == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.ns != null) {
                return this.ns.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mv.count);
            let b = this.l7.i$b;
            let c = this.mv.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ns = a;
            return this.ns.asArray();
        }
        else {
            return this.mv.asArray();
        }
    }
    getVolumeColumnAsArray() {
        if (this.m4 == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nw != null) {
                return this.nw.asArray();
            }
            let a = new List$1(Number_$type, 2, this.m4.count);
            let b = this.l7.i$b;
            let c = this.m4.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nw = a;
            return this.nw.asArray();
        }
        else {
            return this.m4.asArray();
        }
    }
    hy(a, b, c, d) {
        super.hy(a, b, c, d);
        if (this.l7 == null || !(typeCast(ISortingAxis_$type, this.l7) !== null)) {
            return;
        }
        let e = this.l7.i$b;
        switch (a) {
            case 1:
                for (let f = b; f < c; f++) {
                    let g = e._inner[f];
                    if (this.nv != null) {
                        this.nv.insert(f, this.m1.item(g));
                    }
                    if (this.nt != null) {
                        this.nt.insert(f, this.mx.item(g));
                    }
                    if (this.nu != null) {
                        this.nu.insert(f, this.mz.item(g));
                    }
                    if (this.ns != null) {
                        this.ns.insert(f, this.mv.item(g));
                    }
                    if (this.nw != null) {
                        this.nw.insert(f, this.m4.item(g));
                    }
                }
                break;
            case 0:
                if (this.nv != null) {
                    this.nv.v(b, c);
                }
                if (this.nt != null) {
                    this.nt.v(b, c);
                }
                if (this.nu != null) {
                    this.nu.v(b, c);
                }
                if (this.ns != null) {
                    this.ns.v(b, c);
                }
                if (this.nw != null) {
                    this.nw.v(b, c);
                }
                break;
            case 4:
                if (this.nv != null) {
                    this.nv = new List$1(Number_$type, 0);
                }
                if (this.nt != null) {
                    this.nt = new List$1(Number_$type, 0);
                }
                if (this.nu != null) {
                    this.nu = new List$1(Number_$type, 0);
                }
                if (this.ns != null) {
                    this.ns = new List$1(Number_$type, 0);
                }
                if (this.nw != null) {
                    this.nw = new List$1(Number_$type, 0);
                }
                break;
            case 3:
            case 2:
                for (let h = b; h < c; h++) {
                    let i = e._inner[h];
                    if (this.nv != null) {
                        this.nv._inner[h] = this.m1.item(i);
                    }
                    if (this.nt != null) {
                        this.nt._inner[h] = this.mx.item(i);
                    }
                    if (this.nu != null) {
                        this.nu._inner[h] = this.mz.item(i);
                    }
                    if (this.ns != null) {
                        this.ns._inner[h] = this.mv.item(i);
                    }
                    if (this.nw != null) {
                        this.nw._inner[h] = this.m4.item(i);
                    }
                }
                break;
        }
        this.o1();
        this.jp();
    }
    mj(a, b) {
        let c = this.nr(this.m1);
        let d = this.nr(this.mv);
        let e = this.nr(this.mx);
        let f = this.nr(this.mz);
        let g = this.nr(this.m4);
        let h = ((() => {
            let $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.np), this.nq());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.no), ((() => {
                let $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.nn), ((() => {
                let $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.bz != null ? this.bz.count : 0;
            return $ret;
        })());
        return h;
    }
    n3(a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    }
    mk(a) {
        return ((() => {
            let $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, (b) => TrendCalculators.b(b.volumeColumn, b.shortPeriod), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.f = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.longPeriod), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.g = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.shortPeriod), a.typicalColumn.basedOn);
            $ret.e = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.longPeriod), a.typicalColumn.basedOn);
            $ret.k = Series.d1;
            $ret.j = Series.d0;
            $ret.i = runOn(this, this.n3);
            return $ret;
        })());
    }
    get categoryAxis() {
        return this.l7;
    }
    je(a, b) {
        super.je(a, b);
        if (!this.dl) {
            this.bi.az(b);
            return;
        }
        let c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.eu);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.df) {
            this.oy(this.mb, c);
        }
        this.df = false;
        this.o0(this.mb, c);
        this.dl = false;
    }
    jb(a, b, c, d, e) {
        super.jb(a, b, c, d, e);
        let f = this.a0.a$h.item(d);
        let g = f;
        g.bu.e(this.eu);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.l8 == null) {
            this.l8 = new CategoryFrame(3);
        }
        this.l8.u();
        this.oy(this.l8, g);
        this.o0(this.l8, g);
    }
    am(a) {
        if (this.l7 == a) {
            return this.ms;
        }
        if (this.ms == a) {
            return this.l7;
        }
        return null;
    }
    preferredCategoryMode(a) {
        let b = typeCast(IDateTimeAxis_$type, this.l7);
        return b != null ? b.preferredCategoryMode(this) : this.me;
    }
    get me() {
        return this.md;
    }
    set me(a) {
        let b = this.me;
        if (a != b) {
            this.md = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.me));
        }
    }
    get_cz() {
        return true;
    }
    jh(a, b) {
        super.jh(a, b);
        this.pd = a;
    }
    o1() {
        this.d8 = this.mv == null || this.mv.count == 0 ? NaN : this.mv.item(this.mv.count - 1);
    }
    fr(a) {
        if (this.mr != null && a != null) {
            if (this.mt == null || this.mt.propertyName != this.mr.dateTimeMemberPath) {
                this.mt = new FastReflectionHelper(false, this.mr.dateTimeMemberPath);
            }
            let b = this.mt.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.mr.itemLabelFormat());
            }
        }
        return super.fr(a);
    }
}
FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:ob:o2', [2, null], 'HighMemberPath:oe:o3', [2, null], 'IsCustomCategoryStyleAllowed:nd:o4', [0, false], 'IsTransitionInEnabled:ne:o5', [0, false], 'LowMemberPath:oj:o6', [2, null], 'NegativeBrush:pd:o7', [Brush.$, null], 'OpenMemberPath:on:o8', [2, null], 'TransitionInMode:mh:o9', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:or:pa', [2, null], 'XAxis:l7:pb', [CategoryAxisBase.$, null], 'YAxis:ms:pc', [NumericYAxis.$, null]]);
/**
 * @hidden
 */
export class FinancialCalculationSupportingCalculations extends Base {
    constructor() {
        super(...arguments);
        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;
    }
}
FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
/**
 * @hidden
 */
export class DataSourceSupportingCalculation extends SupportingCalculation$1 {
    constructor(a, ..._rest) {
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    let c = _rest[0];
                    super(Delegate_$type, 0, c);
                }
                break;
            case 1:
                {
                    let c = _rest[0];
                    let d = _rest[1];
                    super(Delegate_$type, 1, c, d);
                }
                break;
        }
    }
}
DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
/**
 * @hidden
 */
export class FinancialCalculationDataSource extends Base {
    constructor() {
        super(...arguments);
        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;
    }
    get openColumn() {
        return this._openColumn;
    }
    set openColumn(a) {
        this._openColumn = a;
    }
    get closeColumn() {
        return this._closeColumn;
    }
    set closeColumn(a) {
        this._closeColumn = a;
    }
    get highColumn() {
        return this._highColumn;
    }
    set highColumn(a) {
        this._highColumn = a;
    }
    get lowColumn() {
        return this._lowColumn;
    }
    set lowColumn(a) {
        this._lowColumn = a;
    }
    get volumeColumn() {
        return this._volumeColumn;
    }
    set volumeColumn(a) {
        this._volumeColumn = a;
    }
    get indicatorColumn() {
        return this._indicatorColumn;
    }
    set indicatorColumn(a) {
        this._indicatorColumn = a;
    }
    get typicalColumn() {
        return this._typicalColumn;
    }
    set typicalColumn(a) {
        this._typicalColumn = a;
    }
    get trueRange() {
        return this._trueRange;
    }
    set trueRange(a) {
        this._trueRange = a;
    }
    get trueLow() {
        return this._trueLow;
    }
    set trueLow(a) {
        this._trueLow = a;
    }
    get period() {
        return this._period;
    }
    set period(a) {
        this._period = a;
    }
    get shortPeriod() {
        return this._shortPeriod;
    }
    set shortPeriod(a) {
        this._shortPeriod = a;
    }
    get longPeriod() {
        return this._longPeriod;
    }
    set longPeriod(a) {
        this._longPeriod = a;
    }
    get count() {
        return this._count;
    }
    set count(a) {
        this._count = a;
    }
    get calculateFrom() {
        return this._calculateFrom;
    }
    set calculateFrom(a) {
        this._calculateFrom = a;
    }
    get calculateCount() {
        return this._calculateCount;
    }
    set calculateCount(a) {
        this._calculateCount = a;
    }
    get multiplier() {
        return this._multiplier;
    }
    set multiplier(a) {
        this._multiplier = a;
    }
    get minimumValue() {
        return this._minimumValue;
    }
    set minimumValue(a) {
        this._minimumValue = a;
    }
    get maximumValue() {
        return this._maximumValue;
    }
    set maximumValue(a) {
        this._maximumValue = a;
    }
    get specifiesRange() {
        return this._specifiesRange;
    }
    set specifiesRange(a) {
        this._specifiesRange = a;
    }
    get series() {
        return this._series;
    }
    set series(a) {
        this._series = a;
    }
}
FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
/**
 * @hidden
 */
export class FinancialSeriesView extends SeriesView {
    constructor(a) {
        super(a);
        this.bw = null;
        this.bu = null;
        this.by = 0;
        this.by = -1;
        this.bw = a;
        this.bu = this.bv();
    }
    bx(a) {
        if (this.by != a.t) {
            return true;
        }
        return false;
    }
    bz(a) {
        this.by = a.t;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 6;
        }
    }
    getDefaultTooltipTemplate() {
        let a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bw.l7.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.l7.e6 != null) {
            a += "<span>${item." + this.bw.l7.e6 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        let b = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        let c = new SRProvider(this.t);
        let d = c.al("financialSeries_Open");
        let e = c.al("financialSeries_High");
        let f = c.al("financialSeries_Low");
        let g = c.al("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.bw.fx + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.on + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.oe + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.oj + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.ob + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.or)) {
            let h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.or + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k9 = a;
        this.e.ev = 5;
        this.e.ew = 2;
        this.e.ex = 2;
    }
}
FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
//# sourceMappingURL=FinancialEventArgs_combined.js.map