/*
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, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./HighlightingInfo";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-angular-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { dateToStringFormat } from "igniteui-angular-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let FinancialEventArgs = /*@__PURE__*/ (() => {
    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.$);
    return FinancialEventArgs;
})();
/**
 * @hidden
 */
export let FinancialBucketCalculator = /*@__PURE__*/ (() => {
    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.bz.fx;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.bv;
            let c = this.a.bu;
            let d = this.a.bu;
            if (this.a.bz != null) {
                d = this.a.bz.getEffectiveViewport1(this.a);
            }
            if (b.isEmpty || c.isEmpty || this.a.bz.qk == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.bz.qk != null) ? this.a.bz.qk.cg : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.bz.pz(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.bz.qk);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.bz.qk.el(g.left, f));
                let j = Math.ceil(this.a.bz.qk.el(g.right, f));
                if (this.a.bz.qk.cg) {
                    j = Math.ceil(this.a.bz.qk.el(g.left, f));
                    i = Math.floor(this.a.bz.qk.el(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]);
    return FinancialBucketCalculator;
})();
/**
 * @hidden
 */
export let FinancialSeries = /*@__PURE__*/ (() => {
    class FinancialSeries extends Series {
        constructor() {
            super();
            this.rb = null;
            this.q9 = null;
            this.ra = null;
            this.q8 = null;
            this.rc = null;
            this.rl = false;
            this.assigningCategoryStyle = null;
            this.qt = null;
            this.rv = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.rw = new Dictionary$2(String_$type, String_$type, 0);
            this.rk = false;
            this.q4 = null;
            this.qo = null;
            this.qq = null;
            this.qm = null;
            this.qw = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.rj = false;
            this.r8 = null;
            this.r6 = null;
            this.r7 = null;
            this.r5 = null;
            this.r9 = null;
            this.qp = null;
            this.ql = null;
            this.qr = 0;
            this.q5 = null;
            this.q7 = null;
            this.qt = new CategorySeriesRenderManager();
            this.rl = false;
            this.qw = new CategoryTransitionSourceFramePreparer();
            this.qp = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.qs = 0;
        }
        l4(a) {
            super.l4(a);
            this.q1 = a;
        }
        get_ds() {
            return true;
        }
        ag() {
            return [this.qk, this.q6];
        }
        h1(a, b) {
            let c = this.jv(b);
            if (c == FinancialSeries.$$p[6]) {
                return this.h2(a, b, this.s0);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.h2(a, b, this.sr);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.h2(a, b, this.sw);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.h2(a, b, this.so);
            }
            if (c == FinancialSeries.$$p[8]) {
                return this.h2(a, b, this.s4);
            }
            return super.h1(a, b);
        }
        sk() {
            return 2;
        }
        si() {
            return 4;
        }
        ah(a) {
            let b = this.aj(this.qk, this.qm.f, this.sh(this.b1), this.sj(this.b1), this.px(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.sk();
            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.qk, this.qm.f, this.sh(this.b1), this.sj(this.b1), this.px(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;
        }
        pf() {
            return this.tq;
        }
        pg() {
            return this.tq;
        }
        kz() {
            super.kz();
            this.qk = null;
            this.q6 = null;
        }
        get_c7() {
            return true;
        }
        get_em() {
            return this.q6 != null && this.q6.cg;
        }
        get rg() {
            return this.rb;
        }
        set rg(a) {
            if (this.rb != a) {
                let b = this.rb;
                this.rb = a;
                this.raisePropertyChanged("OpenColumn", b, this.rb);
            }
        }
        get re() {
            return this.q9;
        }
        set re(a) {
            if (this.q9 != a) {
                let b = this.q9;
                this.q9 = a;
                this.raisePropertyChanged("HighColumn", b, this.q9);
            }
        }
        get rf() {
            return this.ra;
        }
        set rf(a) {
            if (this.ra != a) {
                let b = this.ra;
                this.ra = a;
                this.raisePropertyChanged("LowColumn", b, this.ra);
            }
        }
        get rd() {
            return this.q8;
        }
        set rd(a) {
            if (this.q8 != a) {
                let b = this.q8;
                this.q8 = a;
                this.raisePropertyChanged("CloseColumn", b, this.q8);
            }
        }
        get ri() {
            return this.rc;
        }
        set ri(a) {
            if (this.rc != a) {
                let b = this.rc;
                this.rc = a;
                this.raisePropertyChanged("VolumeColumn", b, this.rc);
            }
        }
        rs() {
            return (this.assigningCategoryStyle != null && this.rl) || this.bl != 1;
        }
        tc(a) {
            if (this.assigningCategoryStyle != null && this.rl) {
                this.assigningCategoryStyle(this, a);
            }
        }
        ta(a, b, c, d, e, f) {
            let g = this.bl != 1;
            this.qt.a3(this.qt.b, d.cm, a, b, c, d, e, f, false);
            this.qt.ab(this.fv);
            let h = this.qt.ay;
            let i = null;
            let j = this.cl;
            if (g && this.ce != null) {
                i = this.ce.a7.getHighlightingInfo(this, j, h.o, h.n, false);
                h.b = i;
            }
            h.f = f;
            this.tc(h);
            this.qt.z(this, i, f, g, b < 0);
        }
        sa(a) {
            return this.gb(a, this.qk);
        }
        ho(a, b) {
            return this.hp(a, b, this.qk, runOn(this, this.sa), new FinancialValueList(this.rg, this.re, this.rf, this.rd, this.ri));
        }
        hm(a, b) {
            return this.hn(a, b, this.qk, runOn(this, this.sa), new FinancialValueList(this.rg, this.re, this.rf, this.rd, this.ri));
        }
        f7(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.qk.le;
            return this.f8(a, b, this.qk, d, e, f, runOn(this, this.sa));
        }
        getOffsetValue() {
            return this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1));
        }
        getCategoryWidth() {
            return this.qk.getCategorySize(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1));
        }
        ps(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, null, null, null);
        }
        gn(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(new FinancialValueList(this.rg, this.re, this.rf, this.rd, this.ri), a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        gj(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(this.re, a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        gl(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(this.rf, a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        sc(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(this.rd, a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        sd(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(this.rg, a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        se(a, b, c) {
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.sb(this.b1.bv, this.b1.bu, d);
            let f = new ScalerParams(0, this.b1.bv, this.b1.bu, this.qk.cg, d);
            return this.gp(this.ri, a, this.qk, f, e, runOn(this, this.sa), b, c);
        }
        po(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, runOn(this, this.gj), (d, e) => this.hp(d, e, this.qk, runOn(this, this.sa), this.re), (d, e) => this.hn(d, e, this.qk, runOn(this, this.sa), this.re));
        }
        pq(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, runOn(this, this.gl), (d, e) => this.hp(d, e, this.qk, runOn(this, this.sa), this.rf), (d, e) => this.hn(d, e, this.qk, runOn(this, this.sa), this.rf));
        }
        ts(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, runOn(this, this.sd), (d, e) => this.hp(d, e, this.qk, runOn(this, this.sa), this.rg), (d, e) => this.hn(d, e, this.qk, runOn(this, this.sa), this.rg));
        }
        tr(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, runOn(this, this.sc), (d, e) => this.hp(d, e, this.qk, runOn(this, this.sa), this.rd), (d, e) => this.hn(d, e, this.qk, runOn(this, this.sa), this.rd));
        }
        tt(a, b, c) {
            return this.pu(a, b, c, this.sb(this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.q6, this.qk, runOn(this, this.se), (d, e) => this.hp(d, e, this.qk, runOn(this, this.sa), this.ri), (d, e) => this.hn(d, e, this.qk, runOn(this, this.sa), this.ri));
        }
        lk() {
            super.lk();
            if (this.qk != null) {
                this.qk.h7(false);
            }
            if (this.q6 != null) {
                this.q6.h7(false);
            }
        }
        nb(a, b) {
            this.q1.bx.e(this.fx);
            this.mn(false);
        }
        na(a, b) {
            if (this.e4 && this.g5 < 0.05) {
                this.e5 = true;
            }
            this.q1.bx.e(this.fx);
            this.mn(false);
        }
        rh(a, b, c) {
            let d = this.ci(b);
            this.rv.addItem(d, b);
            this.rw.addItem(b, c);
            return d;
        }
        s9(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.rv.item(b);
            this.rw.removeItem(c);
            this.rv.removeItem(b);
        }
        l9(a, b, c, d) {
            super.l9(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.b9 != null && this.ce != null) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.qk != null) {
                            this.qk.bz(this);
                        }
                        if (this.q6 != null) {
                            this.q6.bz(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.qk != null) {
                            this.qk.cs(this);
                        }
                        if (this.q6 != null) {
                            this.q6.cs(this);
                        }
                    }
                    this.q1.bx.e(this.fx);
                    this.mn(false);
                    break;
                case "FastItemsSource":
                    this.rk = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.s9(typeCast(IFastItemsSource_$type, c), this.rg);
                        this.s9(typeCast(IFastItemsSource_$type, c), this.re);
                        this.s9(typeCast(IFastItemsSource_$type, c), this.rf);
                        this.s9(typeCast(IFastItemsSource_$type, c), this.rd);
                        this.s9(typeCast(IFastItemsSource_$type, c), this.ri);
                        this.rg = null;
                        this.re = null;
                        this.rf = null;
                        this.rd = null;
                        this.ri = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.s0) == false) {
                            this.rg = this.rh(typeCast(IFastItemsSource_$type, d), this.s0, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.sr) == false) {
                            this.re = this.rh(typeCast(IFastItemsSource_$type, d), this.sr, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.sw) == false) {
                            this.rf = this.rh(typeCast(IFastItemsSource_$type, d), this.sw, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.so) == false) {
                            this.rd = this.rh(typeCast(IFastItemsSource_$type, d), this.so, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.s4) == false) {
                            this.ri = this.rh(typeCast(IFastItemsSource_$type, d), this.s4, "VolumeColumn");
                        }
                    }
                    this.rk = false;
                    if (this.q6 != null && !this.q6.c0()) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case FinancialSeries.$$p[6]:
                    if (this.cl != null) {
                        this.s9(this.cl, this.rg);
                        this.rg = this.rh(this.cl, this.s0, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.q6 != null && !this.q6.c0() && !this.rk) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.cl != null) {
                        this.s9(this.cl, this.re);
                        this.re = this.rh(this.cl, this.sr, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.q6 != null && !this.q6.c0() && !this.rk) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case FinancialSeries.$$p[4]:
                    if (this.cl != null) {
                        this.s9(this.cl, this.rf);
                        this.rf = this.rh(this.cl, this.sw, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.q6 != null && !this.q6.c0() && !this.rk) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.cl != null) {
                        this.s9(this.cl, this.rd);
                        this.rd = this.rh(this.cl, this.so, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.q6 != null && !this.q6.c0() && !this.rk) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    this.te();
                    break;
                case FinancialSeries.$$p[8]:
                    if (this.cl != null) {
                        this.s9(this.cl, this.ri);
                        this.ri = this.rh(this.cl, this.s4, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.q6 != null && !this.q6.c0() && !this.rk) {
                        this.q1.bx.e(this.fx);
                        this.mn(false);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.q1.bx.e(this.fx);
                    this.mn(false);
                    this.lu();
                    this.q5 = typeCast(ITimeRangeSelectorAxis_$type, this.qk);
                    break;
                case FinancialSeries.$$p[10]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.q1.bx.e(this.fx);
                    if (this.q6 != null) {
                        this.q6.c0();
                    }
                    {
                        this.mn(false);
                    }
                    this.lu();
                    break;
                case "TransitionProgress":
                    this.qq.c(this.g5, this.qo, this.qm);
                    if (this.cy(this.b1)) {
                        return;
                    }
                    if (this.g5 == 1) {
                        this.qm.v();
                        this.td(this.qm, this.q1);
                        if (this.e4) {
                            this.e4 = false;
                            this.k3();
                            this.cf.r = truncate(this.gr());
                            this.cf.b = this.cg;
                        }
                    }
                    else {
                        this.td(this.qq, this.q1);
                    }
                    if (this.ce != null) {
                        this.ce.ob(this);
                    }
                    break;
                case FinancialSeries.$$p[5]:
                    this.mn(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.rl = this.ro();
                    this.mn(false);
                    break;
                case "CategoryMode":
                    if (this.qk != null) {
                        this.qk.l4(true);
                    }
                    break;
            }
        }
        rn(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        rm(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
                return true;
            }
            return false;
        }
        qd(a, b, c) {
            if (b < a || a < 0 || a > this.cl.count || b < 0 || b > this.cl.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cm;
            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.cl.item(g);
            }
            return d;
        }
        sh(a) {
            return a.bx.b;
        }
        sj(a) {
            return a.bx.c;
        }
        qc(a, b) {
            return this.qd(a, b, this.q6);
        }
        get_d0() {
            return true;
        }
        k0() {
            super.k0();
            this.q4 = null;
        }
        ax(a, b, c) {
            if (this.c3 && this.ei(this.bl) && !c) {
                let d = this.q3(a, b, this.q4);
                this.q4 = d;
                return d;
            }
            else {
                let e = this.q2(a, b, this.q4);
                this.q4 = e;
                return e;
            }
        }
        sl(a) {
            let b = this.qn();
            let c = this.b1.bu;
            let d = this.b1.bv;
            let e = this.qk;
            let f = 0;
            if (e.co) {
                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;
        }
        q3(a, b, c) {
            let d = this.cl.count;
            let e = this.q1.bx.c;
            let f = this.q1.bx.d;
            let g = this.q1.bx.b;
            let h = this.qk;
            let i = -1;
            let j = -1;
            if (h.cm) {
                let k = this.qn();
                let l = this.sl(b);
                i = l;
                j = l;
            }
            else {
                let m = this.hi(b);
                i = truncate(Math.floor((intDivide(m, g)))) * g;
                j = i + (g - 1);
            }
            if (c != null && c.h == i && c.g == j) {
                return c;
            }
            let n = new HighlightingInfo();
            n.b = this;
            n.h = i;
            n.g = j;
            return n;
        }
        q2(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.cl.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        ro() {
            return this.rq;
        }
        f9(a) {
            let b = this.b1.bv;
            let c = this.b1.bu;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.qk != null) {
                let e = this.getEffectiveViewport1(this.b1);
                let f = new ScalerParams(0, b, c, this.qk.cg, e);
                let g = this.pz(this.b1);
                let h = this.qk.el(g.left, f);
                let i = this.qk.el(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.qk.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        hi(a) {
            return truncate(Math.round(this.f9(a)));
        }
        get_ec() {
            return typeCast(ISortingAxis_$type, this.qk) !== null;
        }
        as() {
            return this.qk;
        }
        hk(a) {
            let b = this.b1.bv;
            let c = this.b1.bu;
            let d = this.getEffectiveViewport1(this.b1);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.qk.cg, d);
            let g = typeCast(ISortingAxis_$type, this.qk);
            let h = this.pz(this.b1);
            let i = h.left;
            let j = h.right;
            let k = this.pn(a).x;
            let l = this.qk.el(k, f);
            let m = this.qk.el(i, f);
            let n = this.qk.el(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        hy(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.qk) !== null) {
                b = this.hk(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.hi(a);
            }
            return b >= 0 && this.cl != null && b < this.cl.count ? this.cl.item(b) : null;
        }
        qn() {
            let a = this.qm;
            if (this.cw()) {
                if (this.cf.g) {
                    this.cf.t();
                }
                a = this.qq;
            }
            return a;
        }
        sb(a, b, c) {
            if (this.qk == null) {
                return 0;
            }
            return this.qk.k4(a, b, c, this.index);
        }
        eu() {
            return this.rr;
        }
        qu() {
            return 11;
        }
        ca() {
            return 3;
        }
        td(a, b) {
            this.py = a.aa;
            b.au();
        }
        tb(a, b) {
            a.u();
        }
        fd(a, b, c) {
            let d = super.fd(a, b, c);
            let e = c;
            if (this.cl == null || this.cl.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.qk == null || this.q6 == null || e.bx.b < 1 || this.qk.bh == null || this.q6.bh == null || this.q6.lw == this.q6.lv || this.qk.itemsSource == null || this.qk.le < 1) {
                e.bx.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.b1.bv;
            a = this.b1.bu;
            return {
                p0: a,
                p1: b
            };
        }
        sf(a) {
            let b = 0;
            let c = a.bv;
            let d = a.bu;
            let e = this.getEffectiveViewport1(this.b1);
            if (!c.isEmpty && !d.isEmpty && this.q6 != null) {
                let f = new ScalerParams(0, c, d, this.q6.cg, e);
                f.b = this.gg();
                b = this.q6.ei(this.q6.l6, f);
            }
            return b;
        }
        k3() {
            super.k3();
            this.qo.v();
            this.qm.v();
            this.qq.v();
        }
        mo(a) {
            super.mo(a);
            this.q1.bx.e(this.fx);
            if (this.cy(this.b1)) {
                return;
            }
            if (this.ew) {
                if (this.cw()) {
                    this.td(this.qq, this.q1);
                }
                else {
                    this.td(this.qm, this.q1);
                }
                return;
            }
            if (this.er(a)) {
                let b = this.qo;
                if (this.cw()) {
                    if (this.cf.g) {
                        this.cf.t();
                    }
                    this.qo = this.qq;
                    this.qq = b;
                }
                else {
                    this.qo = this.qm;
                    this.qm = b;
                }
                this.tb(this.qm, this.q1);
                if (this.e6) {
                    this.cf.w();
                    this.cf.r = truncate(this.gs());
                    this.cf.b = this.ch != null ? this.ch : this.cg;
                    this.qw.p(this.qo, this.qm, this.isVertical, this.qk, this.q6, this.qv, this.qu(), this.cb, this.ca(), () => this.sf(this.q1), this.q1.bu);
                }
                this.ky();
                this.mw();
                if (this.e6) {
                    this.e5 = false;
                    this.e4 = true;
                }
            }
            else {
                this.tb(this.qm, this.q1);
                this.td(this.qm, this.q1);
            }
        }
        rt(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.re == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.rf == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.rg == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.rd == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.ri == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get ru() {
            return this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null;
        }
        rp() {
            return this.typical != null;
        }
        s8(a) {
            this.typical(this, a);
        }
        get r2() {
            return this.rz();
        }
        *_rz() {
            let a = false;
            if (this.rp()) {
                let b = this.qx(0, this.cl.count);
                this.s8(new FinancialEventArgs(0, this.cl.count, b, this.qy(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.ru && this.qk.i$b != null) {
                    let d = this.cl.count;
                    let e = this.qk.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.re.item(e.item(f)) + this.rf.item(e.item(f)) + this.rd.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.cl.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.re.item(h) + this.rf.item(h) + this.rd.item(h)) / 3;
                    }
                }
            }
        }
        rz() {
            return toEnum(() => this._rz());
        }
        get r1() {
            return this.ry();
        }
        *_ry() {
            if (this.ru && this.qk.i$b != null) {
                let a = this.re.count;
                let b = this.qk.i$b;
                if (a > 0) {
                    yield this.sg(this.re.item(b.item(0)) - this.rf.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.sg(this.re.item(b.item(c)) - this.rf.item(b.item(c))), Math.max(this.sg(Math.abs(this.re.item(b.item(c)) - this.rd.item(b.item(c - 1)))), this.sg(Math.abs(this.rf.item(b.item(c)) - this.rd.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.re.count;
                if (d > 0) {
                    yield this.sg(this.re.item(0) - this.rf.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.sg(this.re.item(e) - this.rf.item(e)), Math.max(this.sg(Math.abs(this.re.item(e) - this.rd.item(e - 1))), this.sg(Math.abs(this.rf.item(e) - this.rd.item(e - 1)))));
                }
            }
        }
        ry() {
            return toEnum(() => this._ry());
        }
        get r0() {
            return this.rx();
        }
        *_rx() {
            if (this.ru && this.qk.i$b != null) {
                let a = this.rf.count;
                let b = this.qk.i$b;
                if (a > 0) {
                    yield this.sg(this.rf.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.sg(this.rf.item(b.item(c))), this.sg(this.rd.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.rf.count;
                if (d > 0) {
                    yield this.sg(this.rf.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.sg(this.rf.item(e)), this.sg(this.rd.item(e - 1)));
                }
            }
        }
        rx() {
            return toEnum(() => this._rx());
        }
        r4(a) {
            if (a == null) {
                return null;
            }
            if (this.ru && this.qk.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.qk.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        r3() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.cl != null && !this.rj) {
                this.rj = true;
                let b = this.qx(0, this.cl.count);
                this.rj = false;
                let c = new FinancialEventArgs(0, this.cl.count, b, this.qy(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.rg == null) {
                return null;
            }
            if (this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null) {
                if (this.r8 != null) {
                    return this.r8.asArray();
                }
                let a = new List$1(Number_$type, 2, this.rg.count);
                let b = this.qk.i$b;
                let c = this.rg.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r8 = a;
                return this.r8.asArray();
            }
            else {
                return this.rg.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.re == null) {
                return null;
            }
            if (this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null) {
                if (this.r6 != null) {
                    return this.r6.asArray();
                }
                let a = new List$1(Number_$type, 2, this.re.count);
                let b = this.qk.i$b;
                let c = this.re.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r6 = a;
                return this.r6.asArray();
            }
            else {
                return this.re.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.rf == null) {
                return null;
            }
            if (this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null) {
                if (this.r7 != null) {
                    return this.r7.asArray();
                }
                let a = new List$1(Number_$type, 2, this.rf.count);
                let b = this.qk.i$b;
                let c = this.rf.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r7 = a;
                return this.r7.asArray();
            }
            else {
                return this.rf.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.rd == null) {
                return null;
            }
            if (this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null) {
                if (this.r5 != null) {
                    return this.r5.asArray();
                }
                let a = new List$1(Number_$type, 2, this.rd.count);
                let b = this.qk.i$b;
                let c = this.rd.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r5 = a;
                return this.r5.asArray();
            }
            else {
                return this.rd.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.ri == null) {
                return null;
            }
            if (this.qk != null && typeCast(ISortingAxis_$type, this.qk) !== null) {
                if (this.r9 != null) {
                    return this.r9.asArray();
                }
                let a = new List$1(Number_$type, 2, this.ri.count);
                let b = this.qk.i$b;
                let c = this.ri.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r9 = a;
                return this.r9.asArray();
            }
            else {
                return this.ri.asArray();
            }
        }
        k5(a, b, c, d) {
            super.k5(a, b, c, d);
            if (this.qk == null || !(typeCast(ISortingAxis_$type, this.qk) !== null)) {
                return;
            }
            let e = this.qk.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.r8 != null) {
                            this.r8.insert(f, this.rg.item(g));
                        }
                        if (this.r6 != null) {
                            this.r6.insert(f, this.re.item(g));
                        }
                        if (this.r7 != null) {
                            this.r7.insert(f, this.rf.item(g));
                        }
                        if (this.r5 != null) {
                            this.r5.insert(f, this.rd.item(g));
                        }
                        if (this.r9 != null) {
                            this.r9.insert(f, this.ri.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.r8 != null) {
                        this.r8.v(b, c);
                    }
                    if (this.r6 != null) {
                        this.r6.v(b, c);
                    }
                    if (this.r7 != null) {
                        this.r7.v(b, c);
                    }
                    if (this.r5 != null) {
                        this.r5.v(b, c);
                    }
                    if (this.r9 != null) {
                        this.r9.v(b, c);
                    }
                    break;
                case 4:
                    if (this.r8 != null) {
                        this.r8 = new List$1(Number_$type, 0);
                    }
                    if (this.r6 != null) {
                        this.r6 = new List$1(Number_$type, 0);
                    }
                    if (this.r7 != null) {
                        this.r7 = new List$1(Number_$type, 0);
                    }
                    if (this.r5 != null) {
                        this.r5 = new List$1(Number_$type, 0);
                    }
                    if (this.r9 != null) {
                        this.r9 = 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.r8 != null) {
                            this.r8._inner[h] = this.rg.item(i);
                        }
                        if (this.r6 != null) {
                            this.r6._inner[h] = this.re.item(i);
                        }
                        if (this.r7 != null) {
                            this.r7._inner[h] = this.rf.item(i);
                        }
                        if (this.r5 != null) {
                            this.r5._inner[h] = this.rd.item(i);
                        }
                        if (this.r9 != null) {
                            this.r9._inner[h] = this.ri.item(i);
                        }
                    }
                    break;
            }
            this.te();
            this.m7();
        }
        qx(a, b) {
            let c = this.r4(this.rg);
            let d = this.r4(this.rd);
            let e = this.r4(this.re);
            let f = this.r4(this.rf);
            let g = this.r4(this.ri);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.r2), this.r3());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.r1), ((() => {
                    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.r0), ((() => {
                    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.cl != null ? this.cl.count : 0;
                return $ret;
            })());
            return h;
        }
        sg(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        qy(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.fi;
                $ret.j = Series.fh;
                $ret.i = runOn(this, this.sg);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.qk;
        }
        mp(a, b) {
            super.mp(a, b);
            if (!this.e3) {
                this.b1.a2(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.b0);
            this.b1.a2(b);
            c.bx.e(this.fx);
            if (this.cy(this.b0)) {
                return;
            }
            if (!this.ex) {
                this.tb(this.qp, c);
            }
            this.ex = false;
            this.td(this.qp, c);
            this.e3 = false;
        }
        mm(a, b, c, d, e) {
            super.mm(a, b, c, d, e);
            let f = this.a7.a$h.item(d);
            let g = f;
            g.bx.e(this.fx);
            f.a1(c);
            if (this.cy(g)) {
                return;
            }
            if (this.ql == null) {
                this.ql = new CategoryFrame(3);
            }
            this.ql.u();
            this.tb(this.ql, g);
            this.td(this.ql, g);
        }
        ao(a) {
            if (this.qk == a) {
                return this.q6;
            }
            if (this.q6 == a) {
                return this.qk;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.qk);
            return b != null ? b.preferredCategoryMode(this) : this.qs;
        }
        get qs() {
            return this.qr;
        }
        set qs(a) {
            let b = this.qs;
            if (a != b) {
                this.qr = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qs));
            }
        }
        get_d6() {
            return true;
        }
        ms(a, b) {
            super.ms(a, b);
            this.tq = a;
        }
        te() {
            this.f5 = this.rd == null || this.rd.count == 0 ? NaN : this.rd.item(this.rd.count - 1);
        }
        h0(a) {
            if (this.q5 != null && a != null) {
                if (this.q7 == null || this.q7.propertyName != this.q5.dateTimeMemberPath) {
                    this.q7 = new FastReflectionHelper(false, this.q5.dateTimeMemberPath);
                }
                let b = this.q7.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.q5.itemLabelFormat());
                }
            }
            return super.h0(a);
        }
    }
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:so:tf', [2, null], 'HighMemberPath:sr:tg', [2, null], 'IsCustomCategoryStyleAllowed:rq:th', [0, false], 'IsTransitionInEnabled:rr:ti', [0, false], 'LowMemberPath:sw:tj', [2, null], 'NegativeBrush:tq:tk', [Brush.$, null], 'OpenMemberPath:s0:tl', [2, null], 'TransitionInMode:qv:tm', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:s4:tn', [2, null], 'XAxis:qk:to', [CategoryAxisBase.$, null], 'YAxis:q6:tp', [NumericYAxis.$, null]]);
    return FinancialSeries;
})();
/**
 * @hidden
 */
export let FinancialCalculationSupportingCalculations = /*@__PURE__*/ (() => {
    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');
    return FinancialCalculationSupportingCalculations;
})();
/**
 * @hidden
 */
export let DataSourceSupportingCalculation = /*@__PURE__*/ (() => {
    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));
    return DataSourceSupportingCalculation;
})();
/**
 * @hidden
 */
export let FinancialCalculationDataSource = /*@__PURE__*/ (() => {
    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');
    return FinancialCalculationDataSource;
})();
/**
 * @hidden
 */
export let FinancialSeriesView = /*@__PURE__*/ (() => {
    class FinancialSeriesView extends SeriesView {
        constructor(a) {
            super(a);
            this.bz = null;
            this.bx = null;
            this.b1 = 0;
            this.b1 = -1;
            this.bz = a;
            this.bx = this.by();
        }
        b0(a) {
            if (this.b1 != a.t) {
                return true;
            }
            return false;
        }
        b2(a) {
            this.b1 = a.t;
        }
        as() {
            super.as();
            if (!this.q) {
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.bz.qk.cd) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.bz.qk.fz != null) {
                a += "<span>${item." + this.bz.qk.fz + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a7.a$r(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            let c = new SRProvider(this.w);
            let d = c.b1("financialSeries_Open");
            let e = c.b1("financialSeries_High");
            let f = c.b1("financialSeries_Low");
            let g = c.b1("financialSeries_Close");
            d = stringIsNullOrEmpty(d) ? "Open" : d;
            e = stringIsNullOrEmpty(e) ? "High" : e;
            f = stringIsNullOrEmpty(f) ? "Low" : f;
            g = stringIsNullOrEmpty(g) ? "Close" : g;
            a += ">" + this.bz.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.s0 + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.sr + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.sw + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.so + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.bz.s4)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.s4 + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.ph = a;
            this.e.g1 = 5;
            this.e.g2 = 2;
            this.e.g3 = 2;
        }
    }
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
