/*
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-angular-core/ES2015/type";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { List$1 } from "igniteui-angular-core/ES2015/List$1";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-angular-core/ES2015/number";
/**
 * @hidden
 */
export class StrategyBasedIndicator extends FinancialIndicator {
    constructor() {
        super();
        this.qp();
    }
    qp() {
        this.qa = this.qb;
        this.ab = this.qo;
    }
    qh() {
        return -2147483648;
    }
    qq(a) {
    }
    qj() {
        return -2147483648;
    }
    qg() {
        return -2147483648;
    }
    static qu(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.qe.add(c);
        return d;
    }
    static qt(a, b) {
        return StrategyBasedIndicator.qu(a, b, "Period");
    }
    static qr(a, b) {
        return StrategyBasedIndicator.qu(a, b, "LongPeriod");
    }
    static qv(a, b) {
        return StrategyBasedIndicator.qu(a, b, "ShortPeriod");
    }
    pn(a, b) {
        let c = this.mj(a, b);
        let d = this.mk(c);
        return this.qa.b(c, d);
    }
    pk(a, b) {
        let c = this.mj(a, b);
        if (b == 0) {
            return false;
        }
        if (!this.ng(this.pn(a, b))) {
            return false;
        }
        let d = this.mk(c);
        if (this.ph != null) {
            c.minimumValue = this.ph.c;
            c.maximumValue = this.ph.b;
        }
        let e = this.qa.a(c, d);
        for (let f = 0; f < this.pp && f < c.indicatorColumn.count; f++) {
            c.indicatorColumn.item(f, NaN);
        }
        if (this.ms != null && this.qd(c)) {
            this.ms.ck();
        }
        return e;
    }
    qd(a) {
        if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
            let b = this.ph;
            this.ph = new AxisRange(a.minimumValue, a.maximumValue);
            return this.qc(b, this.ph);
        }
        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.ph;
        this.ph = new AxisRange(c, d);
        return this.qc(f, this.ph);
    }
    qc(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;
    }
    qi(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;
    }
    mj(a, b) {
        let c = super.mj(a, b);
        c.indicatorColumn = this.indicatorColumn;
        c.period = this.qi(this.qh());
        c.shortPeriod = this.qi(this.qj());
        c.longPeriod = this.qi(this.qg());
        c.multiplier = this.qf();
        return c;
    }
    qf() {
        return 1;
    }
    static qs(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.qe.add("Multiplier");
        return c;
    }
    iy(a, b, c, d) {
        super.iy(a, b, c, d);
        if (StrategyBasedIndicator.qe.contains(b)) {
            if (this.ms != null && !this.ms.ck()) {
                this.mn.bu.e(this.eu);
                this.pk(0, this.indicatorColumn.count);
                if (this.pi.b4) {
                    this.pi.b2.g$i();
                }
                this.jc(false);
            }
        }
    }
}
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
StrategyBasedIndicator.qe = new List$1(String_$type, 0);
//# sourceMappingURL=StrategyBasedIndicator.js.map