/*
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 let StrategyBasedIndicator = /*@__PURE__*/ (() => {
    class StrategyBasedIndicator extends FinancialIndicator {
        constructor() {
            super();
            this.ab9();
        }
        ab9() {
            this.abu = this.abv;
            this.ab = this.ab8;
        }
        ab1() {
            return -2147483648;
        }
        aca(a) {
        }
        ab3() {
            return -2147483648;
        }
        ab0() {
            return -2147483648;
        }
        static ace(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.aby.add(c);
            return d;
        }
        static acd(a, b) {
            return StrategyBasedIndicator.ace(a, b, "Period");
        }
        static acb(a, b) {
            return StrategyBasedIndicator.ace(a, b, "LongPeriod");
        }
        static acf(a, b) {
            return StrategyBasedIndicator.ace(a, b, "ShortPeriod");
        }
        aa7(a, b) {
            let c = this.xj(a, b);
            let d = this.xk(c);
            return this.abu.b(c, d);
        }
        aa4(a, b) {
            let c = this.xj(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.yf(this.aa7(a, b))) {
                return false;
            }
            let d = this.xk(c);
            if (this.aa0 != null) {
                c.minimumValue = this.aa0.c;
                c.maximumValue = this.aa0.b;
            }
            let e = this.abu.a(c, d);
            for (let f = 0; f < this.aa9 && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.xp != null && this.abx(c)) {
                this.xp.c1();
            }
            return e;
        }
        abx(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.aa0;
                this.aa0 = new AxisRange(a.minimumValue, a.maximumValue);
                return this.abw(b, this.aa0);
            }
            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.aa0;
            this.aa0 = new AxisRange(c, d);
            return this.abw(f, this.aa0);
        }
        abw(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;
        }
        ab2(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;
        }
        xj(a, b) {
            let c = super.xj(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.ab2(this.ab1());
            c.shortPeriod = this.ab2(this.ab3());
            c.longPeriod = this.ab2(this.ab0());
            c.multiplier = this.abz();
            return c;
        }
        abz() {
            return 1;
        }
        static acc(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.aby.add("Multiplier");
            return c;
        }
        q9(a, b, c, d) {
            super.q9(a, b, c, d);
            if (StrategyBasedIndicator.aby.contains(b)) {
                if (this.xp != null && !this.xp.c1()) {
                    this.xn.b0.e(this.id);
                    this.aa4(0, this.indicatorColumn.count);
                    if (this.aa1.ca) {
                        this.aa1.b8.g$i();
                    }
                    this.rr(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.aby = new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
