/*
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.ft;
            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.qb == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.bz.qb != null) ? this.a.bz.qb.cg : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.bz.pq(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.bz.qb);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.bz.qb.el(g.left, f));
                let j = Math.ceil(this.a.bz.qb.el(g.right, f));
                if (this.a.bz.qb.cg) {
                    j = Math.ceil(this.a.bz.qb.el(g.left, f));
                    i = Math.floor(this.a.bz.qb.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.q2 = null;
            this.q0 = null;
            this.q1 = null;
            this.qz = null;
            this.q3 = null;
            this.rc = false;
            this.assigningCategoryStyle = null;
            this.qk = null;
            this.rm = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.rn = new Dictionary$2(String_$type, String_$type, 0);
            this.rb = false;
            this.qv = null;
            this.qf = null;
            this.qh = null;
            this.qd = null;
            this.qn = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.ra = false;
            this.rz = null;
            this.rx = null;
            this.ry = null;
            this.rw = null;
            this.r0 = null;
            this.qg = null;
            this.qc = null;
            this.qi = 0;
            this.qw = null;
            this.qy = null;
            this.qk = new CategorySeriesRenderManager();
            this.rc = false;
            this.qn = new CategoryTransitionSourceFramePreparer();
            this.qg = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.qj = 0;
        }
        ly(a) {
            super.ly(a);
            this.qs = a;
        }
        get_dp() {
            return true;
        }
        ag() {
            return [this.qb, this.qx];
        }
        hw(a, b) {
            let c = this.jq(b);
            if (c == FinancialSeries.$$p[6]) {
                return this.hx(a, b, this.sr);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.hx(a, b, this.si);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.hx(a, b, this.sn);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.hx(a, b, this.sf);
            }
            if (c == FinancialSeries.$$p[8]) {
                return this.hx(a, b, this.sv);
            }
            return super.hw(a, b);
        }
        sb() {
            return 2;
        }
        r9() {
            return 4;
        }
        ah(a) {
            let b = this.aj(this.qb, this.qd.f, this.r8(this.b0), this.sa(this.b0), this.po(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.sb();
            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.qb, this.qd.f, this.r8(this.b0), this.sa(this.b0), this.po(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;
        }
        o8() {
            return this.th;
        }
        o9() {
            return this.th;
        }
        ku() {
            super.ku();
            this.qb = null;
            this.qx = null;
        }
        get_c6() {
            return true;
        }
        get_ej() {
            return this.qx != null && this.qx.cg;
        }
        get q7() {
            return this.q2;
        }
        set q7(a) {
            if (this.q2 != a) {
                let b = this.q2;
                this.q2 = a;
                this.raisePropertyChanged("OpenColumn", b, this.q2);
            }
        }
        get q5() {
            return this.q0;
        }
        set q5(a) {
            if (this.q0 != a) {
                let b = this.q0;
                this.q0 = a;
                this.raisePropertyChanged("HighColumn", b, this.q0);
            }
        }
        get q6() {
            return this.q1;
        }
        set q6(a) {
            if (this.q1 != a) {
                let b = this.q1;
                this.q1 = a;
                this.raisePropertyChanged("LowColumn", b, this.q1);
            }
        }
        get q4() {
            return this.qz;
        }
        set q4(a) {
            if (this.qz != a) {
                let b = this.qz;
                this.qz = a;
                this.raisePropertyChanged("CloseColumn", b, this.qz);
            }
        }
        get q9() {
            return this.q3;
        }
        set q9(a) {
            if (this.q3 != a) {
                let b = this.q3;
                this.q3 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.q3);
            }
        }
        rj() {
            return (this.assigningCategoryStyle != null && this.rc) || this.bk != 1;
        }
        s3(a) {
            if (this.assigningCategoryStyle != null && this.rc) {
                this.assigningCategoryStyle(this, a);
            }
        }
        s1(a, b, c, d, e, f) {
            let g = this.bk != 1;
            this.qk.a1(this.qk.b, d.cm, a, b, c, d, e, f, false);
            this.qk.ab(this.fr);
            let h = this.qk.aw;
            let i = null;
            let j = this.ck;
            if (g && this.cd != null) {
                i = this.cd.a3.getHighlightingInfo(this, j, h.o, h.n, false);
                h.b = i;
            }
            h.f = f;
            this.s3(h);
            this.qk.z(this, i, f, g, b < 0);
        }
        r1(a) {
            return this.f7(a, this.qb);
        }
        hj(a, b) {
            return this.hk(a, b, this.qb, runOn(this, this.r1), new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9));
        }
        hh(a, b) {
            return this.hi(a, b, this.qb, runOn(this, this.r1), new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9));
        }
        f3(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.qb.le;
            return this.f4(a, b, this.qb, d, e, f, runOn(this, this.r1));
        }
        getOffsetValue() {
            return this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        getCategoryWidth() {
            return this.qb.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        pl(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, null, null, null);
        }
        gj(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9), a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        gf(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(this.q5, a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        gh(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(this.q6, a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        r3(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(this.q4, a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        r4(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(this.q7, a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        r5(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r2(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
            return this.gl(this.q9, a, this.qb, f, e, runOn(this, this.r1), b, c);
        }
        ph(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.gf), (d, e) => this.hk(d, e, this.qb, runOn(this, this.r1), this.q5), (d, e) => this.hi(d, e, this.qb, runOn(this, this.r1), this.q5));
        }
        pj(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.gh), (d, e) => this.hk(d, e, this.qb, runOn(this, this.r1), this.q6), (d, e) => this.hi(d, e, this.qb, runOn(this, this.r1), this.q6));
        }
        tj(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r4), (d, e) => this.hk(d, e, this.qb, runOn(this, this.r1), this.q7), (d, e) => this.hi(d, e, this.qb, runOn(this, this.r1), this.q7));
        }
        ti(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r3), (d, e) => this.hk(d, e, this.qb, runOn(this, this.r1), this.q4), (d, e) => this.hi(d, e, this.qb, runOn(this, this.r1), this.q4));
        }
        tk(a, b, c) {
            return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r5), (d, e) => this.hk(d, e, this.qb, runOn(this, this.r1), this.q9), (d, e) => this.hi(d, e, this.qb, runOn(this, this.r1), this.q9));
        }
        le() {
            super.le();
            if (this.qb != null) {
                this.qb.h7(false);
            }
            if (this.qx != null) {
                this.qx.h7(false);
            }
        }
        m5(a, b) {
            this.qs.bx.e(this.ft);
            this.mh(false);
        }
        m4(a, b) {
            if (this.e0 && this.g0 < 0.05) {
                this.e1 = true;
            }
            this.qs.bx.e(this.ft);
            this.mh(false);
        }
        q8(a, b, c) {
            let d = this.ch(b);
            this.rm.addItem(d, b);
            this.rn.addItem(b, c);
            return d;
        }
        s0(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.rm.item(b);
            this.rn.removeItem(c);
            this.rm.removeItem(b);
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.b8 != null && this.cd != null) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.qb != null) {
                            this.qb.bz(this);
                        }
                        if (this.qx != null) {
                            this.qx.bz(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.qb != null) {
                            this.qb.cs(this);
                        }
                        if (this.qx != null) {
                            this.qx.cs(this);
                        }
                    }
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                    break;
                case "FastItemsSource":
                    this.rb = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.s0(typeCast(IFastItemsSource_$type, c), this.q7);
                        this.s0(typeCast(IFastItemsSource_$type, c), this.q5);
                        this.s0(typeCast(IFastItemsSource_$type, c), this.q6);
                        this.s0(typeCast(IFastItemsSource_$type, c), this.q4);
                        this.s0(typeCast(IFastItemsSource_$type, c), this.q9);
                        this.q7 = null;
                        this.q5 = null;
                        this.q6 = null;
                        this.q4 = null;
                        this.q9 = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.sr) == false) {
                            this.q7 = this.q8(typeCast(IFastItemsSource_$type, d), this.sr, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.si) == false) {
                            this.q5 = this.q8(typeCast(IFastItemsSource_$type, d), this.si, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.sn) == false) {
                            this.q6 = this.q8(typeCast(IFastItemsSource_$type, d), this.sn, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.sf) == false) {
                            this.q4 = this.q8(typeCast(IFastItemsSource_$type, d), this.sf, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.sv) == false) {
                            this.q9 = this.q8(typeCast(IFastItemsSource_$type, d), this.sv, "VolumeColumn");
                        }
                    }
                    this.rb = false;
                    if (this.qx != null && !this.qx.c0()) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case FinancialSeries.$$p[6]:
                    if (this.ck != null) {
                        this.s0(this.ck, this.q7);
                        this.q7 = this.q8(this.ck, this.sr, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.qx != null && !this.qx.c0() && !this.rb) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.ck != null) {
                        this.s0(this.ck, this.q5);
                        this.q5 = this.q8(this.ck, this.si, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.qx != null && !this.qx.c0() && !this.rb) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case FinancialSeries.$$p[4]:
                    if (this.ck != null) {
                        this.s0(this.ck, this.q6);
                        this.q6 = this.q8(this.ck, this.sn, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.qx != null && !this.qx.c0() && !this.rb) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.ck != null) {
                        this.s0(this.ck, this.q4);
                        this.q4 = this.q8(this.ck, this.sf, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.qx != null && !this.qx.c0() && !this.rb) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    this.s5();
                    break;
                case FinancialSeries.$$p[8]:
                    if (this.ck != null) {
                        this.s0(this.ck, this.q9);
                        this.q9 = this.q8(this.ck, this.sv, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.qx != null && !this.qx.c0() && !this.rb) {
                        this.qs.bx.e(this.ft);
                        this.mh(false);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                    this.lo();
                    this.qw = typeCast(ITimeRangeSelectorAxis_$type, this.qb);
                    break;
                case FinancialSeries.$$p[10]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.qs.bx.e(this.ft);
                    if (this.qx != null) {
                        this.qx.c0();
                    }
                    {
                        this.mh(false);
                    }
                    this.lo();
                    break;
                case "TransitionProgress":
                    this.qh.c(this.g0, this.qf, this.qd);
                    if (this.cx(this.b0)) {
                        return;
                    }
                    if (this.g0 == 1) {
                        this.qd.v();
                        this.s4(this.qd, this.qs);
                        if (this.e0) {
                            this.e0 = false;
                            this.ky();
                            this.ce.r = truncate(this.gm());
                            this.ce.b = this.cf;
                        }
                    }
                    else {
                        this.s4(this.qh, this.qs);
                    }
                    if (this.cd != null) {
                        this.cd.nn(this);
                    }
                    break;
                case FinancialSeries.$$p[5]:
                    this.mh(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.rc = this.rf();
                    this.mh(false);
                    break;
                case "CategoryMode":
                    if (this.qb != null) {
                        this.qb.l4(true);
                    }
                    break;
            }
        }
        re(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        rd(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
                return true;
            }
            return false;
        }
        p4(a, b, c) {
            if (b < a || a < 0 || a > this.ck.count || b < 0 || b > this.ck.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.ck.item(g);
            }
            return d;
        }
        r8(a) {
            return a.bx.b;
        }
        sa(a) {
            return a.bx.c;
        }
        p3(a, b) {
            return this.p4(a, b, this.qx);
        }
        get_dx() {
            return true;
        }
        kv() {
            super.kv();
            this.qv = null;
        }
        aw(a, b, c) {
            if (this.c2 && this.ef(this.bk) && !c) {
                let d = this.qu(a, b, this.qv);
                this.qv = d;
                return d;
            }
            else {
                let e = this.qt(a, b, this.qv);
                this.qv = e;
                return e;
            }
        }
        sc(a) {
            let b = this.qe();
            let c = this.b0.bu;
            let d = this.b0.bv;
            let e = this.qb;
            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;
        }
        qu(a, b, c) {
            let d = this.ck.count;
            let e = this.qs.bx.c;
            let f = this.qs.bx.d;
            let g = this.qs.bx.b;
            let h = this.qb;
            let i = -1;
            let j = -1;
            if (h.cm) {
                let k = this.qe();
                let l = this.sc(b);
                i = l;
                j = l;
            }
            else {
                let m = this.hd(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;
        }
        qt(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.ck.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        rf() {
            return this.rh;
        }
        f5(a) {
            let b = this.b0.bv;
            let c = this.b0.bu;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.qb != null) {
                let e = this.getEffectiveViewport1(this.b0);
                let f = new ScalerParams(0, b, c, this.qb.cg, e);
                let g = this.pq(this.b0);
                let h = this.qb.el(g.left, f);
                let i = this.qb.el(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.qb.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        hd(a) {
            return truncate(Math.round(this.f5(a)));
        }
        get_d9() {
            return typeCast(ISortingAxis_$type, this.qb) !== null;
        }
        ar() {
            return this.qb;
        }
        hf(a) {
            let b = this.b0.bv;
            let c = this.b0.bu;
            let d = this.getEffectiveViewport1(this.b0);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.qb.cg, d);
            let g = typeCast(ISortingAxis_$type, this.qb);
            let h = this.pq(this.b0);
            let i = h.left;
            let j = h.right;
            let k = this.pg(a).x;
            let l = this.qb.el(k, f);
            let m = this.qb.el(i, f);
            let n = this.qb.el(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        ht(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.qb) !== null) {
                b = this.hf(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.hd(a);
            }
            return b >= 0 && this.ck != null && b < this.ck.count ? this.ck.item(b) : null;
        }
        qe() {
            let a = this.qd;
            if (this.cv()) {
                if (this.ce.g) {
                    this.ce.t();
                }
                a = this.qh;
            }
            return a;
        }
        r2(a, b, c) {
            if (this.qb == null) {
                return 0;
            }
            return this.qb.k4(a, b, c, this.index);
        }
        eq() {
            return this.ri;
        }
        ql() {
            return 11;
        }
        b9() {
            return 3;
        }
        s4(a, b) {
            this.pp = a.aa;
            b.au();
        }
        s2(a, b) {
            a.u();
        }
        e9(a, b, c) {
            let d = super.e9(a, b, c);
            let e = c;
            if (this.ck == null || this.ck.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.qb == null || this.qx == null || e.bx.b < 1 || this.qb.bh == null || this.qx.bh == null || this.qx.lv == this.qx.lu || this.qb.itemsSource == null || this.qb.le < 1) {
                e.bx.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.b0.bv;
            a = this.b0.bu;
            return {
                p0: a,
                p1: b
            };
        }
        r6(a) {
            let b = 0;
            let c = a.bv;
            let d = a.bu;
            let e = this.getEffectiveViewport1(this.b0);
            if (!c.isEmpty && !d.isEmpty && this.qx != null) {
                let f = new ScalerParams(0, c, d, this.qx.cg, e);
                f.b = this.gc();
                b = this.qx.ei(this.qx.l5, f);
            }
            return b;
        }
        ky() {
            super.ky();
            this.qf.v();
            this.qd.v();
            this.qh.v();
        }
        mi(a) {
            super.mi(a);
            this.qs.bx.e(this.ft);
            if (this.cx(this.b0)) {
                return;
            }
            if (this.es) {
                if (this.cv()) {
                    this.s4(this.qh, this.qs);
                }
                else {
                    this.s4(this.qd, this.qs);
                }
                return;
            }
            if (this.eo(a)) {
                let b = this.qf;
                if (this.cv()) {
                    if (this.ce.g) {
                        this.ce.t();
                    }
                    this.qf = this.qh;
                    this.qh = b;
                }
                else {
                    this.qf = this.qd;
                    this.qd = b;
                }
                this.s2(this.qd, this.qs);
                if (this.e2) {
                    this.ce.w();
                    this.ce.r = truncate(this.gn());
                    this.ce.b = this.cg != null ? this.cg : this.cf;
                    this.qn.p(this.qf, this.qd, this.isVertical, this.qb, this.qx, this.qm, this.ql(), this.ca, this.b9(), () => this.r6(this.qs), this.qs.bu);
                }
                this.kt();
                this.mq();
                if (this.e2) {
                    this.e1 = false;
                    this.e0 = true;
                }
            }
            else {
                this.s2(this.qd, this.qs);
                this.s4(this.qd, this.qs);
            }
        }
        rk(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.q5 == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.q6 == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.q7 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.q4 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.q9 == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get rl() {
            return this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null;
        }
        rg() {
            return this.typical != null;
        }
        sz(a) {
            this.typical(this, a);
        }
        get rt() {
            return this.rq();
        }
        *_rq() {
            let a = false;
            if (this.rg()) {
                let b = this.qo(0, this.ck.count);
                this.sz(new FinancialEventArgs(0, this.ck.count, b, this.qp(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.rl && this.qb.i$b != null) {
                    let d = this.ck.count;
                    let e = this.qb.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.q5.item(e.item(f)) + this.q6.item(e.item(f)) + this.q4.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.ck.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.q5.item(h) + this.q6.item(h) + this.q4.item(h)) / 3;
                    }
                }
            }
        }
        rq() {
            return toEnum(() => this._rq());
        }
        get rs() {
            return this.rp();
        }
        *_rp() {
            if (this.rl && this.qb.i$b != null) {
                let a = this.q5.count;
                let b = this.qb.i$b;
                if (a > 0) {
                    yield this.r7(this.q5.item(b.item(0)) - this.q6.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.r7(this.q5.item(b.item(c)) - this.q6.item(b.item(c))), Math.max(this.r7(Math.abs(this.q5.item(b.item(c)) - this.q4.item(b.item(c - 1)))), this.r7(Math.abs(this.q6.item(b.item(c)) - this.q4.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.q5.count;
                if (d > 0) {
                    yield this.r7(this.q5.item(0) - this.q6.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.r7(this.q5.item(e) - this.q6.item(e)), Math.max(this.r7(Math.abs(this.q5.item(e) - this.q4.item(e - 1))), this.r7(Math.abs(this.q6.item(e) - this.q4.item(e - 1)))));
                }
            }
        }
        rp() {
            return toEnum(() => this._rp());
        }
        get rr() {
            return this.ro();
        }
        *_ro() {
            if (this.rl && this.qb.i$b != null) {
                let a = this.q6.count;
                let b = this.qb.i$b;
                if (a > 0) {
                    yield this.r7(this.q6.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.r7(this.q6.item(b.item(c))), this.r7(this.q4.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.q6.count;
                if (d > 0) {
                    yield this.r7(this.q6.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.r7(this.q6.item(e)), this.r7(this.q4.item(e - 1)));
                }
            }
        }
        ro() {
            return toEnum(() => this._ro());
        }
        rv(a) {
            if (a == null) {
                return null;
            }
            if (this.rl && this.qb.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.qb.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        ru() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.ck != null && !this.ra) {
                this.ra = true;
                let b = this.qo(0, this.ck.count);
                this.ra = false;
                let c = new FinancialEventArgs(0, this.ck.count, b, this.qp(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.q7 == null) {
                return null;
            }
            if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
                if (this.rz != null) {
                    return this.rz.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q7.count);
                let b = this.qb.i$b;
                let c = this.q7.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.rz = a;
                return this.rz.asArray();
            }
            else {
                return this.q7.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.q5 == null) {
                return null;
            }
            if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
                if (this.rx != null) {
                    return this.rx.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q5.count);
                let b = this.qb.i$b;
                let c = this.q5.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.rx = a;
                return this.rx.asArray();
            }
            else {
                return this.q5.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.q6 == null) {
                return null;
            }
            if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
                if (this.ry != null) {
                    return this.ry.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q6.count);
                let b = this.qb.i$b;
                let c = this.q6.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.ry = a;
                return this.ry.asArray();
            }
            else {
                return this.q6.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.q4 == null) {
                return null;
            }
            if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
                if (this.rw != null) {
                    return this.rw.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q4.count);
                let b = this.qb.i$b;
                let c = this.q4.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.rw = a;
                return this.rw.asArray();
            }
            else {
                return this.q4.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.q9 == null) {
                return null;
            }
            if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
                if (this.r0 != null) {
                    return this.r0.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q9.count);
                let b = this.qb.i$b;
                let c = this.q9.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r0 = a;
                return this.r0.asArray();
            }
            else {
                return this.q9.asArray();
            }
        }
        k0(a, b, c, d) {
            super.k0(a, b, c, d);
            if (this.qb == null || !(typeCast(ISortingAxis_$type, this.qb) !== null)) {
                return;
            }
            let e = this.qb.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.rz != null) {
                            this.rz.insert(f, this.q7.item(g));
                        }
                        if (this.rx != null) {
                            this.rx.insert(f, this.q5.item(g));
                        }
                        if (this.ry != null) {
                            this.ry.insert(f, this.q6.item(g));
                        }
                        if (this.rw != null) {
                            this.rw.insert(f, this.q4.item(g));
                        }
                        if (this.r0 != null) {
                            this.r0.insert(f, this.q9.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.rz != null) {
                        this.rz.v(b, c);
                    }
                    if (this.rx != null) {
                        this.rx.v(b, c);
                    }
                    if (this.ry != null) {
                        this.ry.v(b, c);
                    }
                    if (this.rw != null) {
                        this.rw.v(b, c);
                    }
                    if (this.r0 != null) {
                        this.r0.v(b, c);
                    }
                    break;
                case 4:
                    if (this.rz != null) {
                        this.rz = new List$1(Number_$type, 0);
                    }
                    if (this.rx != null) {
                        this.rx = new List$1(Number_$type, 0);
                    }
                    if (this.ry != null) {
                        this.ry = new List$1(Number_$type, 0);
                    }
                    if (this.rw != null) {
                        this.rw = new List$1(Number_$type, 0);
                    }
                    if (this.r0 != null) {
                        this.r0 = 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.rz != null) {
                            this.rz._inner[h] = this.q7.item(i);
                        }
                        if (this.rx != null) {
                            this.rx._inner[h] = this.q5.item(i);
                        }
                        if (this.ry != null) {
                            this.ry._inner[h] = this.q6.item(i);
                        }
                        if (this.rw != null) {
                            this.rw._inner[h] = this.q4.item(i);
                        }
                        if (this.r0 != null) {
                            this.r0._inner[h] = this.q9.item(i);
                        }
                    }
                    break;
            }
            this.s5();
            this.m1();
        }
        qo(a, b) {
            let c = this.rv(this.q7);
            let d = this.rv(this.q4);
            let e = this.rv(this.q5);
            let f = this.rv(this.q6);
            let g = this.rv(this.q9);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.rt), this.ru());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.rs), ((() => {
                    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.rr), ((() => {
                    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.ck != null ? this.ck.count : 0;
                return $ret;
            })());
            return h;
        }
        r7(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        qp(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.fe;
                $ret.j = Series.fd;
                $ret.i = runOn(this, this.r7);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.qb;
        }
        mj(a, b) {
            super.mj(a, b);
            if (!this.ez) {
                this.b0.a2(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.bz);
            this.b0.a2(b);
            c.bx.e(this.ft);
            if (this.cx(this.bz)) {
                return;
            }
            if (!this.et) {
                this.s2(this.qg, c);
            }
            this.et = false;
            this.s4(this.qg, c);
            this.ez = false;
        }
        mg(a, b, c, d, e) {
            super.mg(a, b, c, d, e);
            let f = this.a6.a$h.item(d);
            let g = f;
            g.bx.e(this.ft);
            f.a1(c);
            if (this.cx(g)) {
                return;
            }
            if (this.qc == null) {
                this.qc = new CategoryFrame(3);
            }
            this.qc.u();
            this.s2(this.qc, g);
            this.s4(this.qc, g);
        }
        an(a) {
            if (this.qb == a) {
                return this.qx;
            }
            if (this.qx == a) {
                return this.qb;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.qb);
            return b != null ? b.preferredCategoryMode(this) : this.qj;
        }
        get qj() {
            return this.qi;
        }
        set qj(a) {
            let b = this.qj;
            if (a != b) {
                this.qi = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qj));
            }
        }
        get_d3() {
            return true;
        }
        mm(a, b) {
            super.mm(a, b);
            this.th = a;
        }
        s5() {
            this.f1 = this.q4 == null || this.q4.count == 0 ? NaN : this.q4.item(this.q4.count - 1);
        }
        hv(a) {
            if (this.qw != null && a != null) {
                if (this.qy == null || this.qy.propertyName != this.qw.dateTimeMemberPath) {
                    this.qy = new FastReflectionHelper(false, this.qw.dateTimeMemberPath);
                }
                let b = this.qy.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.qw.itemLabelFormat());
                }
            }
            return super.hv(a);
        }
    }
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:sf:s6', [2, null], 'HighMemberPath:si:s7', [2, null], 'IsCustomCategoryStyleAllowed:rh:s8', [0, false], 'IsTransitionInEnabled:ri:s9', [0, false], 'LowMemberPath:sn:ta', [2, null], 'NegativeBrush:th:tb', [Brush.$, null], 'OpenMemberPath:sr:tc', [2, null], 'TransitionInMode:qm:td', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:sv:te', [2, null], 'XAxis:qb:tf', [CategoryAxisBase.$, null], 'YAxis:qx:tg', [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.qb.cd) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.bz.qb.fz != null) {
                a += "<span>${item." + this.bz.qb.fz + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a6.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.sr + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.si + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.sn + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.sf + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.bz.sv)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.sv + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.pa = a;
            this.e.gw = 5;
            this.e.gx = 2;
            this.e.gy = 2;
        }
    }
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
