/*
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, Delegate_$type } from "igniteui-react-core/ES2015/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core/ES2015/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-react-core/ES2015/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core/ES2015/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { DependencyProperty } from "igniteui-react-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 { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-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-react-core/ES2015/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core/ES2015/SRProvider";
import { Color } from "igniteui-react-core/ES2015/Color";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES2015/string";
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.$);
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.bu.eo;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    }
    e(a) {
        let b = this.a.bq;
        let c = this.a.bp;
        let d = this.a.bp;
        if (this.a.bu != null) {
            d = this.a.bu.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bu.lw == null) {
            this.b = 0;
            return;
        }
        let e = (this.a.bu.lw != null) ? this.a.bu.lw.b8 : false;
        let f = new ScalerParams(0, b, c, e, d);
        let g = this.a.bu.le(this.a);
        let h = typeCast(ISortingAxis_$type, this.a.bu.lw);
        if (h == null || h.i$b == null) {
            let i = Math.floor(this.a.bu.lw.dw(g.left, f));
            let j = Math.ceil(this.a.bu.lw.dw(g.right, f));
            if (this.a.bu.lw.b8) {
                j = Math.ceil(this.a.bu.lw.dw(g.left, f));
                i = Math.floor(this.a.bu.lw.dw(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]);
export class FinancialSeries extends Series {
    constructor() {
        super();
        this.mn = null;
        this.mj = null;
        this.ml = null;
        this.mh = null;
        this.mq = null;
        this.mu = false;
        this.assigningCategoryStyle = null;
        this.l4 = null;
        this.m5 = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        this.m6 = new Dictionary$2(String_$type, String_$type, 0);
        this.mt = false;
        this.mf = null;
        this.lz = null;
        this.l1 = null;
        this.ly = null;
        this.o4 = null;
        this.l7 = null;
        this.typical = null;
        this.typicalBasedOn = null;
        this.ms = false;
        this.ni = null;
        this.ng = null;
        this.nh = null;
        this.nf = null;
        this.nj = null;
        this.l0 = null;
        this.lx = null;
        this.l2 = 0;
        this.l4 = new CategorySeriesRenderManager();
        this.mu = false;
        this.l7 = new CategoryTransitionSourceFramePreparer();
        this.l0 = new CategoryFrame(3);
        this.ab = FinancialSeries.$;
        this.l3 = 0;
    }
    ii(a) {
        super.ii(a);
        this.mc = a;
    }
    get_cq() {
        return true;
    }
    get cq() {
        return this.get_cq();
    }
    ag() {
        return [this.lw, this.mg];
    }
    nu() {
        return 2;
    }
    ns() {
        return 4;
    }
    ah(a) {
        let b = this.aj(this.lw, this.ly.f, this.nr(this.bi), this.nt(this.bi), this.lc(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.nu();
        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.lw, this.ly.f, this.nr(this.bi), this.nt(this.bi), this.lc(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;
    }
    kx() {
        return this.o0;
    }
    hj() {
        super.hj();
        this.lw = null;
        this.mg = null;
    }
    get mo() {
        return this.mn;
    }
    set mo(a) {
        if (this.mn != a) {
            let b = this.mn;
            this.mn = a;
            this.raisePropertyChanged("OpenColumn", b, this.mn);
        }
    }
    get mk() {
        return this.mj;
    }
    set mk(a) {
        if (this.mj != a) {
            let b = this.mj;
            this.mj = a;
            this.raisePropertyChanged("HighColumn", b, this.mj);
        }
    }
    get mm() {
        return this.ml;
    }
    set mm(a) {
        if (this.ml != a) {
            let b = this.ml;
            this.ml = a;
            this.raisePropertyChanged("LowColumn", b, this.ml);
        }
    }
    get mi() {
        return this.mh;
    }
    set mi(a) {
        if (this.mh != a) {
            let b = this.mh;
            this.mh = a;
            this.raisePropertyChanged("CloseColumn", b, this.mh);
        }
    }
    get mr() {
        return this.mq;
    }
    set mr(a) {
        if (this.mq != a) {
            let b = this.mq;
            this.mq = a;
            this.raisePropertyChanged("VolumeColumn", b, this.mq);
        }
    }
    m2() {
        return (this.assigningCategoryStyle != null && this.mu) || this.ct;
    }
    om(a) {
        if (this.assigningCategoryStyle != null && this.mu) {
            this.assigningCategoryStyle(this, a);
        }
    }
    ok(a, b, c, d, e, f) {
        let g = this.b9;
        this.l4.ac(a, b, c, d, e, f, g);
        let h = this.l4.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.om(h);
        this.l4.aa(i, f, g);
    }
    nk(a) {
        return this.d8(a, this.lw);
    }
    e8(a, b) {
        return this.e9(a, b, this.lw, runOn(this, this.nk), new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr));
    }
    e6(a, b) {
        return this.e7(a, b, this.lw, runOn(this, this.nk), new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr));
    }
    d4(a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        let f = this.lw.jq;
        return this.d5(a, b, this.lw, d, e, f, runOn(this, this.nk));
    }
    getOffsetValue() {
        return this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.lw.getCategorySize(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi));
    }
    k9(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, null, null, null);
    }
    eh(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr), a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    ed(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mk, a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    ef(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mm, a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    nm(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mi, a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    nn(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mo, a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    no(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nl(this.bi.bq, this.bi.bp, d);
        let f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mr, a, this.lw, f, e, runOn(this, this.nk), b, c);
    }
    k5(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.ed), (d, e) => this.e9(d, e, this.lw, runOn(this, this.nk), this.mk), (d, e) => this.e7(d, e, this.lw, runOn(this, this.nk), this.mk));
    }
    k7(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.ef), (d, e) => this.e9(d, e, this.lw, runOn(this, this.nk), this.mm), (d, e) => this.e7(d, e, this.lw, runOn(this, this.nk), this.mm));
    }
    o2(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.nn), (d, e) => this.e9(d, e, this.lw, runOn(this, this.nk), this.mo), (d, e) => this.e7(d, e, this.lw, runOn(this, this.nk), this.mo));
    }
    o1(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.nm), (d, e) => this.e9(d, e, this.lw, runOn(this, this.nk), this.mi), (d, e) => this.e7(d, e, this.lw, runOn(this, this.nk), this.mi));
    }
    o3(a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.no), (d, e) => this.e9(d, e, this.lw, runOn(this, this.nk), this.mr), (d, e) => this.e7(d, e, this.lw, runOn(this, this.nk), this.mr));
    }
    h0() {
        super.h0();
        if (this.lw != null) {
            this.lw.gz(false);
        }
        if (this.mg != null) {
            this.mg.gz(false);
        }
    }
    jh(a, b) {
        this.mc.bs.e(this.eo);
        this.i1(false);
    }
    jg(a, b) {
        if (this.dj && this.et < 0.05) {
            this.dk = true;
        }
        this.mc.bs.e(this.eo);
        this.i1(false);
    }
    mp(a, b, c) {
        let d = this.bw(b);
        this.m5.addItem(d, b);
        this.m6.addItem(b, c);
        return d;
    }
    oj(a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        let c = this.m5.item(b);
        this.m6.removeItem(c);
        this.m5.removeItem(b);
    }
    io(a, b, c, d) {
        super.io(a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.lw != null) {
                        this.lw.bv(this);
                    }
                    if (this.mg != null) {
                        this.mg.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.lw != null) {
                        this.lw.ch(this);
                    }
                    if (this.mg != null) {
                        this.mg.ch(this);
                    }
                }
                this.mc.bs.e(this.eo);
                this.i1(false);
                break;
            case "FastItemsSource":
                this.mt = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mo);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mk);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mm);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mi);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mr);
                    this.mo = null;
                    this.mk = null;
                    this.mm = null;
                    this.mi = null;
                    this.mr = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (this.oa != null) {
                        this.mo = this.mp(typeCast(IFastItemsSource_$type, d), this.oa, "OpenColumn");
                    }
                    if (this.n1 != null) {
                        this.mk = this.mp(typeCast(IFastItemsSource_$type, d), this.n1, "HighColumn");
                    }
                    if (this.n6 != null) {
                        this.mm = this.mp(typeCast(IFastItemsSource_$type, d), this.n6, "LowColumn");
                    }
                    if (this.ny != null) {
                        this.mi = this.mp(typeCast(IFastItemsSource_$type, d), this.ny, "CloseColumn");
                    }
                    if (this.oe != null) {
                        this.mr = this.mp(typeCast(IFastItemsSource_$type, d), this.oe, "VolumeColumn");
                    }
                }
                this.mt = false;
                if (this.mg != null && !this.mg.ck()) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mo);
                    this.mo = this.mp(this.bz, this.oa, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mk);
                    this.mk = this.mp(this.bz, this.n1, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mm);
                    this.mm = this.mp(this.bz, this.n6, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mi);
                    this.mi = this.mp(this.bz, this.ny, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                this.oo();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mr);
                    this.mr = this.mp(this.bz, this.oe, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mc.bs.e(this.eo);
                this.i1(false);
                this.h8();
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mc.bs.e(this.eo);
                if (this.mg != null) {
                    this.mg.ck();
                }
                {
                    this.i1(false);
                }
                this.h8();
                break;
            case "TransitionProgress":
                this.l1.c(this.et, this.lz, this.ly);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.et == 1) {
                    this.ly.v();
                    this.on(this.ly, this.mc);
                    if (this.dj) {
                        this.dj = false;
                        this.hm();
                        this.bt.r = truncate(this.ek());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.on(this.l1, this.mc);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.i1(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.mu = this.mx();
                this.i1(false);
                break;
            case "CategoryMode":
                if (this.lw != null) {
                    this.lw.kf(true);
                }
                break;
        }
    }
    mw(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    mv(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    lp(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;
    }
    nr(a) {
        return a.bs.b;
    }
    nt(a) {
        return a.bs.c;
    }
    lo(a, b) {
        return this.lp(a, b, this.mg);
    }
    get_my() {
        return false;
    }
    get my() {
        return this.get_my();
    }
    get_cu() {
        return true;
    }
    get cu() {
        return this.get_cu();
    }
    at(a, b) {
        if (this.my) {
            let c = this.me(a, b, this.mf);
            this.mf = c;
            return c;
        }
        else {
            let d = this.md(a, b, this.mf);
            this.mf = d;
            return d;
        }
    }
    nv(a) {
        let b = this.ly;
        if (this.ca()) {
            b = this.l1;
        }
        let c = this.bi.bp;
        let d = this.bi.bq;
        let e = this.lw;
        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;
    }
    me(a, b, c) {
        let d = this.bz.count;
        let e = this.mc.bs.c;
        let f = this.mc.bs.d;
        let g = this.mc.bs.b;
        let h = this.lw;
        let i = -1;
        let j = -1;
        if (h.cc) {
            let k = this.ly;
            if (this.ca()) {
                k = this.l1;
            }
            let l = this.nv(b);
            i = l;
            j = l;
        }
        else {
            let m = this.e2(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;
    }
    md(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;
    }
    mx() {
        return this.m0;
    }
    d6(a) {
        let b = this.bi.bq;
        let c = this.bi.bp;
        let d = -1;
        if (!b.isEmpty && !c.isEmpty && this.lw != null) {
            let e = this.getEffectiveViewport1(this.bi);
            let f = new ScalerParams(0, b, c, this.lw.b8, e);
            let g = this.le(this.bi);
            let h = this.lw.dw(g.left, f);
            let i = this.lw.dw(g.right, f);
            let j = (a.x - b.left) / b.width;
            let k = h + (j * (i - h));
            if (this.lw.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    }
    e2(a) {
        return truncate(Math.round(this.d6(a)));
    }
    get_c0() {
        return typeCast(ISortingAxis_$type, this.lw) !== null;
    }
    get c0() {
        return this.get_c0();
    }
    ap() {
        return this.lw;
    }
    e4(a) {
        let b = this.bi.bq;
        let c = this.bi.bp;
        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.lw.b8, d);
        let g = typeCast(ISortingAxis_$type, this.lw);
        let h = this.le(this.bi);
        let i = h.left;
        let j = h.right;
        let k = this.k4(a).x;
        let l = this.lw.dw(k, f);
        let m = this.lw.dw(i, f);
        let n = this.lw.dw(j, f);
        l = Math.max(m, Math.min(n, l));
        let o = g.i$f(l);
        return o;
    }
    fj(a) {
        let b = 0;
        if (typeCast(ISortingAxis_$type, this.lw) !== null) {
            b = this.e4(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e2(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    nl(a, b, c) {
        if (this.lw == null) {
            return 0;
        }
        return this.lw.getOffset(a, b, c, this.fb);
    }
    c9() {
        return this.m1;
    }
    l5() {
        return 11;
    }
    bo() {
        return 3;
    }
    on(a, b) {
        this.ld = a.aa;
        b.ar();
    }
    get o5() {
        return this.o4;
    }
    ol(a, b) {
        a.u();
    }
    dt(a, b, c) {
        let d = super.dt(a, b, c);
        let e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.lw == null || this.mg == null || e.bs.b < 1 || this.lw.bf == null || this.mg.bf == null || this.mg.jw == this.mg.jv || this.lw.itemsSource == null || this.lw.jq < 1) {
            e.bs.b = 0;
            d = false;
        }
        return d;
    }
    getViewInfo(a, b) {
        b = this.bi.bq;
        a = this.bi.bp;
        return {
            p0: a,
            p1: b
        };
    }
    np(a) {
        let b = 0;
        let c = a.bq;
        let d = a.bp;
        let e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.mg != null) {
            let f = new ScalerParams(0, c, d, this.mg.b8, e);
            b = this.mg.dt(this.mg.j6, f);
        }
        return b;
    }
    hm() {
        super.hm();
        this.lz.v();
        this.ly.v();
        this.l1.v();
    }
    i2(a) {
        super.i2(a);
        this.mc.bs.e(this.eo);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.db) {
            if (this.ca()) {
                this.on(this.l1, this.mc);
            }
            else {
                this.on(this.ly, this.mc);
            }
            return;
        }
        if (this.c7(a)) {
            let b = this.lz;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.lz = this.l1;
                this.l1 = b;
            }
            else {
                this.lz = this.ly;
                this.ly = b;
            }
            this.ol(this.ly, this.mc);
            if (this.dl) {
                this.bt.w();
                this.bt.r = truncate(this.el());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.l7.p(this.lz, this.ly, this.isVertical, this.lw, this.mg, this.l6, this.l5(), this.bp, this.bo(), () => this.np(this.mc), this.mc.bp);
            }
            this.hi();
            this.i9();
            if (this.dl) {
                this.dk = false;
                this.dj = true;
            }
        }
        else {
            this.ol(this.ly, this.mc);
            this.on(this.ly, this.mc);
        }
    }
    m3(a) {
        for (let b of fromEnum(a)) {
            switch (b) {
                case "HighColumn":
                    if (this.mk == null) {
                        return false;
                    }
                    break;
                case "LowColumn":
                    if (this.mm == null) {
                        return false;
                    }
                    break;
                case "OpenColumn":
                    if (this.mo == null) {
                        return false;
                    }
                    break;
                case "CloseColumn":
                    if (this.mi == null) {
                        return false;
                    }
                    break;
                case "VolumeColumn":
                    if (this.mr == null) {
                        return false;
                    }
                    break;
            }
        }
        return true;
    }
    get m4() {
        return this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null;
    }
    mz() {
        return this.typical != null;
    }
    oi(a) {
        this.typical(this, a);
    }
    get nc() {
        return this.m9();
    }
    *_m9() {
        let a = false;
        if (this.mz()) {
            let b = this.l8(0, this.bz.count);
            this.oi(new FinancialEventArgs(0, this.bz.count, b, this.l9(b), this));
            if (b.typicalColumn != null) {
                a = true;
                for (let c of fromEnum(b.typicalColumn)) {
                    yield c;
                }
            }
        }
        if (!a) {
            if (this.m4 && this.lw.i$b != null) {
                let d = this.bz.count;
                let e = this.lw.i$b;
                for (let f = 0; f < d; ++f) {
                    yield (this.mk.item(e.item(f)) + this.mm.item(e.item(f)) + this.mi.item(e.item(f))) / 3;
                }
            }
            else {
                let g = this.bz.count;
                for (let h = 0; h < g; ++h) {
                    yield (this.mk.item(h) + this.mm.item(h) + this.mi.item(h)) / 3;
                }
            }
        }
    }
    m9() {
        return toEnum(() => this._m9());
    }
    get nb() {
        return this.m8();
    }
    *_m8() {
        if (this.m4 && this.lw.i$b != null) {
            let a = this.mk.count;
            let b = this.lw.i$b;
            if (a > 0) {
                yield this.nq(this.mk.item(b.item(0)) - this.mm.item(b.item(0)));
            }
            for (let c = 1; c < a; ++c) {
                yield Math.max(this.nq(this.mk.item(b.item(c)) - this.mm.item(b.item(c))), Math.max(this.nq(Math.abs(this.mk.item(b.item(c)) - this.mi.item(b.item(c - 1)))), this.nq(Math.abs(this.mm.item(b.item(c)) - this.mi.item(b.item(c - 1))))));
            }
        }
        else {
            let d = this.mk.count;
            if (d > 0) {
                yield this.nq(this.mk.item(0) - this.mm.item(0));
            }
            for (let e = 1; e < d; ++e) {
                yield Math.max(this.nq(this.mk.item(e) - this.mm.item(e)), Math.max(this.nq(Math.abs(this.mk.item(e) - this.mi.item(e - 1))), this.nq(Math.abs(this.mm.item(e) - this.mi.item(e - 1)))));
            }
        }
    }
    m8() {
        return toEnum(() => this._m8());
    }
    get na() {
        return this.m7();
    }
    *_m7() {
        if (this.m4 && this.lw.i$b != null) {
            let a = this.mm.count;
            let b = this.lw.i$b;
            if (a > 0) {
                yield this.nq(this.mm.item(b.item(0)));
            }
            for (let c = 1; c < a; c++) {
                yield Math.min(this.nq(this.mm.item(b.item(c))), this.nq(this.mi.item(b.item(c - 1))));
            }
        }
        else {
            let d = this.mm.count;
            if (d > 0) {
                yield this.nq(this.mm.item(0));
            }
            for (let e = 1; e < d; e++) {
                yield Math.min(this.nq(this.mm.item(e)), this.nq(this.mi.item(e - 1)));
            }
        }
    }
    m7() {
        return toEnum(() => this._m7());
    }
    ne(a) {
        if (a == null) {
            return null;
        }
        if (this.m4 && this.lw.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.lw.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    }
    nd() {
        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.ms) {
            this.ms = true;
            let b = this.l8(0, this.bz.count);
            this.ms = false;
            let c = new FinancialEventArgs(0, this.bz.count, b, this.l9(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    }
    getOpenColumnAsArray() {
        if (this.mo == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.ni != null) {
                return this.ni.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mo.count);
            let b = this.lw.i$b;
            let c = this.mo.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ni = a;
            return this.ni.asArray();
        }
        else {
            return this.mo.asArray();
        }
    }
    getHighColumnAsArray() {
        if (this.mk == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.ng != null) {
                return this.ng.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mk.count);
            let b = this.lw.i$b;
            let c = this.mk.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ng = a;
            return this.ng.asArray();
        }
        else {
            return this.mk.asArray();
        }
    }
    getLowColumnAsArray() {
        if (this.mm == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nh != null) {
                return this.nh.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mm.count);
            let b = this.lw.i$b;
            let c = this.mm.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nh = a;
            return this.nh.asArray();
        }
        else {
            return this.mm.asArray();
        }
    }
    getCloseColumnAsArray() {
        if (this.mi == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nf != null) {
                return this.nf.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mi.count);
            let b = this.lw.i$b;
            let c = this.mi.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nf = a;
            return this.nf.asArray();
        }
        else {
            return this.mi.asArray();
        }
    }
    getVolumeColumnAsArray() {
        if (this.mr == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nj != null) {
                return this.nj.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mr.count);
            let b = this.lw.i$b;
            let c = this.mr.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nj = a;
            return this.nj.asArray();
        }
        else {
            return this.mr.asArray();
        }
    }
    ho(a, b, c, d) {
        super.ho(a, b, c, d);
        if (this.lw == null || !(typeCast(ISortingAxis_$type, this.lw) !== null)) {
            return;
        }
        let e = this.lw.i$b;
        switch (a) {
            case 1:
                for (let f = b; f < c; f++) {
                    let g = e._inner[f];
                    if (this.ni != null) {
                        this.ni.insert(f, this.mo.item(g));
                    }
                    if (this.ng != null) {
                        this.ng.insert(f, this.mk.item(g));
                    }
                    if (this.nh != null) {
                        this.nh.insert(f, this.mm.item(g));
                    }
                    if (this.nf != null) {
                        this.nf.insert(f, this.mi.item(g));
                    }
                    if (this.nj != null) {
                        this.nj.insert(f, this.mr.item(g));
                    }
                }
                break;
            case 0:
                if (this.ni != null) {
                    this.ni.v(b, c);
                }
                if (this.ng != null) {
                    this.ng.v(b, c);
                }
                if (this.nh != null) {
                    this.nh.v(b, c);
                }
                if (this.nf != null) {
                    this.nf.v(b, c);
                }
                if (this.nj != null) {
                    this.nj.v(b, c);
                }
                break;
            case 4:
                if (this.ni != null) {
                    this.ni = new List$1(Number_$type, 0);
                }
                if (this.ng != null) {
                    this.ng = new List$1(Number_$type, 0);
                }
                if (this.nh != null) {
                    this.nh = new List$1(Number_$type, 0);
                }
                if (this.nf != null) {
                    this.nf = new List$1(Number_$type, 0);
                }
                if (this.nj != null) {
                    this.nj = 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.ni != null) {
                        this.ni._inner[h] = this.mo.item(i);
                    }
                    if (this.ng != null) {
                        this.ng._inner[h] = this.mk.item(i);
                    }
                    if (this.nh != null) {
                        this.nh._inner[h] = this.mm.item(i);
                    }
                    if (this.nf != null) {
                        this.nf._inner[h] = this.mi.item(i);
                    }
                    if (this.nj != null) {
                        this.nj._inner[h] = this.mr.item(i);
                    }
                }
                break;
        }
        this.oo();
    }
    l8(a, b) {
        let c = this.ne(this.mo);
        let d = this.ne(this.mi);
        let e = this.ne(this.mk);
        let f = this.ne(this.mm);
        let g = this.ne(this.mr);
        let h = ((() => {
            let $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.nc), this.nd());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.nb), ((() => {
                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.na), ((() => {
                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;
    }
    nq(a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    }
    l9(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.dw;
            $ret.j = Series.dv;
            $ret.i = runOn(this, this.nq);
            return $ret;
        })());
    }
    get categoryAxis() {
        return this.lw;
    }
    i3(a, b) {
        super.i3(a, b);
        if (!this.di) {
            this.bi.az(b);
            return;
        }
        let c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bs.e(this.eo);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.dc) {
            this.ol(this.l0, c);
        }
        this.dc = false;
        this.on(this.l0, c);
        this.di = false;
    }
    i0(a, b, c, d, e) {
        super.i0(a, b, c, d, e);
        let f = this.a0.a$h.item(d);
        let g = f;
        g.bs.e(this.eo);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.lx == null) {
            this.lx = new CategoryFrame(3);
        }
        this.lx.u();
        this.ol(this.lx, g);
        this.on(this.lx, g);
    }
    am(a) {
        if (this.lw == a) {
            return this.mg;
        }
        if (this.mg == a) {
            return this.lw;
        }
        return null;
    }
    preferredCategoryMode(a) {
        let b = typeCast(IDateTimeAxis_$type, this.lw);
        return b != null ? b.preferredCategoryMode(this) : this.l3;
    }
    get l3() {
        return this.l2;
    }
    set l3(a) {
        let b = this.l3;
        if (a != b) {
            this.l2 = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.l3));
        }
    }
    get_cy() {
        return true;
    }
    get cy() {
        return this.get_cy();
    }
    i6(a, b) {
        super.i6(a, b);
        this.o0 = a;
    }
    oo() {
        this.d3 = this.mi == null || this.mi.count == 0 ? NaN : this.mi.item(this.mi.count - 1);
    }
}
FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:ny:op', [2, null], 'HighMemberPath:n1:oq', [2, null], 'IsCustomCategoryStyleAllowed:m0:or', [0, false], 'IsTransitionInEnabled:m1:os', [0, false], 'LowMemberPath:n6:ot', [2, null], 'NegativeBrush:o0:ou', [Brush.$, null], 'OpenMemberPath:oa:ov', [2, null], 'TransitionInMode:l6:ow', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:oe:ox', [2, null], 'XAxis:lw:oy', [CategoryAxisBase.$, null], 'YAxis:mg:oz', [NumericYAxis.$, null]]);
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');
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));
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');
export class FinancialSeriesView extends SeriesView {
    constructor(a) {
        super(a);
        this.bu = null;
        this.bs = null;
        this.bw = 0;
        this.bw = -1;
        this.bu = a;
        this.bs = this.bt();
    }
    bv(a) {
        if (this.bw != a.t) {
            return true;
        }
        return false;
    }
    bx(a) {
        this.bw = a.t;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 6;
        }
    }
    getDefaultTooltipTemplate() {
        let a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bu.lw.b5) {
            let b = this.bu.lw;
            a += "<span>${item." + b.dateTimeMemberPath + "}</span><br/>";
        }
        else if (this.bu.lw.e1 != null) {
            a += "<span>${item." + this.bu.lw.e1 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        let c = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(c)) {
            a += " style='color:" + c + "'";
        }
        let d = new SRProvider(this.t);
        let e = d.al("financialSeries_Open");
        let f = d.al("financialSeries_High");
        let g = d.al("financialSeries_Low");
        let h = d.al("financialSeries_Close");
        e = stringIsNullOrEmpty(e) ? "Open" : e;
        f = stringIsNullOrEmpty(f) ? "High" : f;
        g = stringIsNullOrEmpty(g) ? "Low" : g;
        h = stringIsNullOrEmpty(h) ? "Close" : h;
        a += ">" + this.bu.fo + "</span><table><tr><td>" + e + ":</td><td>" + "${item." + this.bu.oa + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bu.n1 + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bu.n6 + "}</td></tr><tr><td>" + h + ":</td><td>" + "${item." + this.bu.ny + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bu.oe)) {
            let i = d.al("financialSeries_Volume");
            i = stringIsNullOrEmpty(i) ? "Volume" : i;
            a += "<tr><td>" + i + ":</td><td>" + "${item." + this.bu.oe + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.ky = a;
        this.e.ep = 5;
        this.e.eq = 2;
        this.e.er = 2;
    }
}
FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
/*<BeginStatics Name="Infragistics.Controls.Charts.FinancialSeries" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.FinancialSeries" />*/
