/*
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";
import { DependencyProperty } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
export class StrategyBasedIndicator extends FinancialIndicator {
    constructor() {
        super();
        this.qq();
    }
    qq() {
        this.qb = this.qc;
        this.ab = this.qp;
    }
    qi() {
        return -2147483648;
    }
    qr(a) {
    }
    qk() {
        return -2147483648;
    }
    qh() {
        return -2147483648;
    }
    static qv(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.qf.add(c);
        return d;
    }
    static qu(a, b) {
        return StrategyBasedIndicator.qv(a, b, "Period");
    }
    static qs(a, b) {
        return StrategyBasedIndicator.qv(a, b, "LongPeriod");
    }
    static qw(a, b) {
        return StrategyBasedIndicator.qv(a, b, "ShortPeriod");
    }
    po(a, b) {
        let c = this.mk(a, b);
        let d = this.ml(c);
        return this.qb.b(c, d);
    }
    pl(a, b) {
        let c = this.mk(a, b);
        if (b == 0) {
            return false;
        }
        if (!this.nh(this.po(a, b))) {
            return false;
        }
        let d = this.ml(c);
        if (this.pi != null) {
            c.minimumValue = this.pi.c;
            c.maximumValue = this.pi.b;
        }
        let e = this.qb.a(c, d);
        for (let f = 0; f < this.pq && f < c.indicatorColumn.count; f++) {
            c.indicatorColumn.item(f, NaN);
        }
        if (this.mt != null && this.qe(c)) {
            this.mt.cl();
        }
        return e;
    }
    qe(a) {
        if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
            let b = this.pi;
            this.pi = new AxisRange(a.minimumValue, a.maximumValue);
            return this.qd(b, this.pi);
        }
        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.pi;
        this.pi = new AxisRange(c, d);
        return this.qd(f, this.pi);
    }
    qd(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;
    }
    qj(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;
    }
    mk(a, b) {
        let c = super.mk(a, b);
        c.indicatorColumn = this.indicatorColumn;
        c.period = this.qj(this.qi());
        c.shortPeriod = this.qj(this.qk());
        c.longPeriod = this.qj(this.qh());
        c.multiplier = this.qg();
        return c;
    }
    qg() {
        return 1;
    }
    static qt(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.qf.add("Multiplier");
        return c;
    }
    iz(a, b, c, d) {
        super.iz(a, b, c, d);
        if (StrategyBasedIndicator.qf.contains(b)) {
            if (this.mt != null && !this.mt.cl()) {
                this.mo.bu.e(this.eu);
                this.pl(0, this.indicatorColumn.count);
                if (this.pj.b4) {
                    this.pj.b2.g$i();
                }
                this.jd(false);
            }
        }
    }
}
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
StrategyBasedIndicator.qf = new List$1(String_$type, 0);
//# sourceMappingURL=StrategyBasedIndicator.js.map