/*
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 { FinancialIndicator } from "./FinancialIndicator";
import { String_$type, Number_$type, typeCast, fromEnum, markType } from "igniteui-react-core/ES2015/type";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
export class StrategyBasedIndicator extends FinancialIndicator {
    constructor() {
        super();
        this.qh();
    }
    qh() {
        this.p2 = this.p3;
        this.ab = this.qg;
    }
    p9() {
        return -2147483648;
    }
    qi(a) {
    }
    qb() {
        return -2147483648;
    }
    p8() {
        return -2147483648;
    }
    static qm(a, b, c) {
        let d = DependencyProperty.i(c, Number_$type, b, new PropertyMetadata(2, a, (e, f) => (typeCast(StrategyBasedIndicator.$, e)).raisePropertyChanged(c, f.oldValue, f.newValue)));
        StrategyBasedIndicator.p6.add(c);
        return d;
    }
    static ql(a, b) {
        return StrategyBasedIndicator.qm(a, b, "Period");
    }
    static qj(a, b) {
        return StrategyBasedIndicator.qm(a, b, "LongPeriod");
    }
    static qn(a, b) {
        return StrategyBasedIndicator.qm(a, b, "ShortPeriod");
    }
    pf(a, b) {
        let c = this.mb(a, b);
        let d = this.mc(c);
        return this.p2.b(c, d);
    }
    pc(a, b) {
        let c = this.mb(a, b);
        if (b == 0) {
            return false;
        }
        if (!this.m8(this.pf(a, b))) {
            return false;
        }
        let d = this.mc(c);
        if (this.o9 != null) {
            c.minimumValue = this.o9.c;
            c.maximumValue = this.o9.b;
        }
        let e = this.p2.a(c, d);
        for (let f = 0; f < this.ph && f < c.indicatorColumn.count; f++) {
            c.indicatorColumn.item(f, NaN);
        }
        if (this.mk != null && this.p5(c)) {
            this.mk.ck();
        }
        return e;
    }
    p5(a) {
        if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
            let b = this.o9;
            this.o9 = new AxisRange(a.minimumValue, a.maximumValue);
            return this.p4(b, this.o9);
        }
        let c = 1.7976931348623157E+308;
        let d = -1.7976931348623157E+308;
        for (let e of fromEnum(a.indicatorColumn)) {
            if (!isNaN_(e)) {
                c = Math.min(c, e);
                d = Math.max(d, e);
            }
        }
        let f = this.o9;
        this.o9 = new AxisRange(c, d);
        return this.p4(f, this.o9);
    }
    p4(a, b) {
        if (a == null || b == null) {
            return true;
        }
        if (a.c != b.c) {
            return true;
        }
        if (a.b != b.b) {
            return true;
        }
        return false;
    }
    qa(a) {
        if (a == -2147483648) {
            return 0;
        }
        if (a > this.indicatorColumn.count && this.indicatorColumn.count > 0) {
            a = this.indicatorColumn.count - 1;
        }
        if (a < 1) {
            return 1;
        }
        return a;
    }
    mb(a, b) {
        let c = super.mb(a, b);
        c.indicatorColumn = this.indicatorColumn;
        c.period = this.qa(this.p9());
        c.shortPeriod = this.qa(this.qb());
        c.longPeriod = this.qa(this.p8());
        c.multiplier = this.p7();
        return c;
    }
    p7() {
        return 1;
    }
    static qk(a, b) {
        let c = DependencyProperty.i("Multiplier", Number_$type, b, new PropertyMetadata(2, a, (d, e) => (typeCast(StrategyBasedIndicator.$, d)).raisePropertyChanged("Multiplier", e.oldValue, e.newValue)));
        StrategyBasedIndicator.p6.add("Multiplier");
        return c;
    }
    ir(a, b, c, d) {
        super.ir(a, b, c, d);
        if (StrategyBasedIndicator.p6.contains(b)) {
            if (this.mk != null && !this.mk.ck()) {
                this.mf.bu.e(this.eq);
                this.pc(0, this.indicatorColumn.count);
                if (this.pa.b4) {
                    this.pa.b2.g$i();
                }
                this.i4(false);
            }
        }
    }
}
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
StrategyBasedIndicator.p6 = new List$1(String_$type, 0);
